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

Commit 20afb0f9 authored by Steve Kondik's avatar Steve Kondik Committed by Bruno Martins
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 9d88fd17
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
cc_binary {
cc_library_static {
    srcs: ["sdcard.cpp"],
    name: "sdcard",
    name: "libsdcard",
    cflags: [
        "-Wall",
        "-Wno-unused-parameter",
@@ -15,3 +15,20 @@ cc_binary {
        misc_undefined: ["integer"],
    },
}

cc_binary {
    srcs: ["main.c"],
    name: "sdcard",
    cflags: [
        "-Wall",
        "-Wno-unused-parameter",
        "-Werror",
    ],
    static_libs: ["libsdcard"],
    shared_libs: [
        "libbase",
        "libc",
        "libcutils",
        "libminijail",
    ],
}

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
@@ -213,7 +213,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;