aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2019-04-17 16:12:00 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2019-06-19 14:55:44 +0200
commit3a41803a9d7254105fc0cac2cffa7e3d1b897802 (patch)
tree1e99b4e4db014f85bb45232398f831226c56131a
parentda4f765056e90842c25ab5d267dd2b92a6caf900 (diff)
downloadhardware_replicant_libsamsung-ipc-3a41803a9d7254105fc0cac2cffa7e3d1b897802.tar.gz
hardware_replicant_libsamsung-ipc-3a41803a9d7254105fc0cac2cffa7e3d1b897802.tar.bz2
hardware_replicant_libsamsung-ipc-3a41803a9d7254105fc0cac2cffa7e3d1b897802.zip
Android: also build as a shared libarry
On Android, libsamsung-ipc is dynamically linked to libcrypto. However libsamsung-ril uses libsamsung-ipc as a static library. Without that fix, on Android 9, linking libsamsung-ril to libsamsung-ipc fails with the following errors: rfs.c:50: error: undefined reference to 'MD5_Init' rfs.c:51: error: undefined reference to 'MD5_Update' rfs.c:52: error: undefined reference to 'MD5_Update' rfs.c:53: error: undefined reference to 'MD5_Final' Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--Android.mk59
1 files changed, 47 insertions, 12 deletions
diff --git a/Android.mk b/Android.mk
index aaa3c02..cca4bb7 100644
--- a/Android.mk
+++ b/Android.mk
@@ -17,8 +17,6 @@
LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
ifneq (,$(filter crespo,$(TARGET_DEVICE)))
ipc_device_name := crespo
endif
@@ -51,7 +49,7 @@ ifneq (,$(filter n5100,$(TARGET_DEVICE)))
ipc_device_name := n5100
endif
-LOCAL_SRC_FILES := \
+libsamsung_ipc_local_src_files := \
samsung-ipc/ipc.c \
samsung-ipc/ipc_devices.c \
samsung-ipc/ipc_utils.c \
@@ -79,26 +77,63 @@ LOCAL_SRC_FILES := \
samsung-ipc/rfs.c \
samsung-ipc/gen.c
-LOCAL_C_INCLUDES := \
+libsamsung_ipc_local_c_includes := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/samsung-ipc \
$(LOCAL_PATH)/samsung-ipc/devices/xmm616/ \
$(LOCAL_PATH)/samsung-ipc/devices/xmm626/ \
external/openssl/include
-LOCAL_CFLAGS := \
+libsamsung_local_cflags := \
-DIPC_DEVICE_NAME=\"$(ipc_device_name)\" \
-DDEBUG
-LOCAL_SHARED_LIBRARIES := libutils libcrypto
+libsamsung_ipc_local_shared_libraries := \
+ libutils \
+ libcrypto
+
+############################################
+# Static library version of libsamsung-ipc #
+############################################
+include $(CLEAR_VARS)
LOCAL_MODULE := libsamsung-ipc
LOCAL_MODULE_TAGS := optional
+LOCAL_SRC_FILES := $(libsamsung_ipc_local_src_files)
+
+LOCAL_C_INCLUDES := $(libsamsung_ipc_local_c_includes)
+
+LOCAL_CFLAGS := $(libsamsung_local_cflags)
+LOCAL_SHARED_LIBRARIES := $(libsamsung_ipc_local_shared_libraries)
+
include $(BUILD_STATIC_LIBRARY)
+############################################
+# Shared library version of libsamsung-ipc #
+############################################
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libsamsung-ipc
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(libsamsung_ipc_local_src_files)
+
+LOCAL_C_INCLUDES := $(libsamsung_ipc_local_c_includes)
+
+LOCAL_CFLAGS := $(libsamsung_local_cflags)
+LOCAL_SHARED_LIBRARIES := $(libsamsung_ipc_local_shared_libraries)
+
+include $(BUILD_SHARED_LIBRARY)
+
+##################
+# ipc-modem tool #
+##################
include $(CLEAR_VARS)
+LOCAL_MODULE := ipc-modem
+LOCAL_MODULE_TAGS := optional
+
LOCAL_SRC_FILES := tools/ipc-modem.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
@@ -106,13 +141,16 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES := libsamsung-ipc
LOCAL_SHARED_LIBRARIES := libutils
-LOCAL_MODULE := ipc-modem
-LOCAL_MODULE_TAGS := optional
-
include $(BUILD_EXECUTABLE)
+#################
+# ipc-test tool #
+#################
include $(CLEAR_VARS)
+LOCAL_MODULE := ipc-test
+LOCAL_MODULE_TAGS := optional
+
LOCAL_SRC_FILES := tools/ipc-test.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
@@ -120,7 +158,4 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES := libsamsung-ipc
LOCAL_SHARED_LIBRARIES := libutils
-LOCAL_MODULE := ipc-test
-LOCAL_MODULE_TAGS := optional
-
include $(BUILD_EXECUTABLE)