Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 580215d8 authored by Steve Kondik's avatar Steve Kondik Committed by Michael Bestas
Browse files

sdcard: Allow building as a static library

 * Split main() out in order to allow linking with a multi-call
   executable such as recovery.

Change-Id: I3325135e47e4dd5af3912f5ce67ec64007d54a63
parent ba7e647b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -3,11 +3,19 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := sdcard.cpp fuse.cpp
LOCAL_MODULE := sdcard
LOCAL_MODULE := libsdcard
LOCAL_CFLAGS := -Wall -Wno-unused-parameter -Werror
LOCAL_SHARED_LIBRARIES := libbase libcutils libminijail libpackagelistparser

LOCAL_SANITIZE := integer
LOCAL_CLANG := true
LOCAL_MODULE_TAGS := optional
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_SRC_FILES := main.c
LOCAL_MODULE := sdcard
LOCAL_CFLAGS := -Wall -Wno-unused-parameter -Werror
LOCAL_STATIC_LIBRARIES := libsdcard
LOCAL_SHARED_LIBRARIES := libbase libc libcutils libminijail libpackagelistparser
include $(BUILD_EXECUTABLE)

sdcard/main.c

0 → 100644
+21 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

extern int sdcard_main(int argc, char **argv);

int main(int argc, char **argv) {
    return sdcard_main(argc, argv);
}
+1 −1
Original line number Diff line number Diff line
@@ -455,7 +455,7 @@ static int usage() {
    return 1;
}

int main(int argc, char **argv) {
extern "C" int sdcard_main(int argc, char **argv) {
    const char *source_path = NULL;
    const char *label = NULL;
    uid_t uid = 0;