From 9d23ed25b44ae351eaf839805722d6796f9b018a Mon Sep 17 00:00:00 2001 From: Chris Dickens Date: Mon, 16 Nov 2020 13:03:52 -0800 Subject: build: Fix Android and Xcode compilation errors/warnings Commit f69548c3b3 ("examples: Enable all examples to build on all platforms") modified dpfp and sam3u_benchmark to be buildable on any platform, however there were some oversights and regressions introduced for Android and Xcode. Update the Android and Xcode build files to account for the removal of dpfp_threaded.c as well as the inclusion of config.h from examples and/or tests source. Additionally switch the threaded version of dpfp to use sem_open() instead of sem_init() as the latter is in fact deprecated on MacOS. Closes #808 Signed-off-by: Chris Dickens --- android/jni/examples.mk | 11 +++++++++-- android/jni/libusb.mk | 3 --- android/jni/tests.mk | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'android') diff --git a/android/jni/examples.mk b/android/jni/examples.mk index 74139ce..30b5c84 100644 --- a/android/jni/examples.mk +++ b/android/jni/examples.mk @@ -28,6 +28,7 @@ LOCAL_SRC_FILES := \ $(LIBUSB_ROOT_REL)/examples/dpfp.c LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/.. \ $(LIBUSB_ROOT_ABS) LOCAL_SHARED_LIBRARIES += libusb1.0 @@ -41,12 +42,13 @@ include $(BUILD_EXECUTABLE) include $(CLEAR_VARS) LOCAL_SRC_FILES := \ - $(LIBUSB_ROOT_REL)/examples/dpfp_threaded.c + $(LIBUSB_ROOT_REL)/examples/dpfp.c LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/.. \ $(LIBUSB_ROOT_ABS) -LOCAL_CFLAGS := -pthread +LOCAL_CFLAGS := -DDPFP_THREADED -pthread LOCAL_SHARED_LIBRARIES += libusb1.0 @@ -63,6 +65,7 @@ LOCAL_SRC_FILES := \ $(LIBUSB_ROOT_REL)/examples/fxload.c LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/.. \ $(LIBUSB_ROOT_ABS) LOCAL_SHARED_LIBRARIES += libusb1.0 @@ -79,6 +82,7 @@ LOCAL_SRC_FILES := \ $(LIBUSB_ROOT_REL)/examples/hotplugtest.c LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/.. \ $(LIBUSB_ROOT_ABS) LOCAL_SHARED_LIBRARIES += libusb1.0 @@ -95,6 +99,7 @@ LOCAL_SRC_FILES := \ $(LIBUSB_ROOT_REL)/examples/listdevs.c LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/.. \ $(LIBUSB_ROOT_ABS) LOCAL_SHARED_LIBRARIES += libusb1.0 @@ -111,6 +116,7 @@ LOCAL_SRC_FILES := \ $(LIBUSB_ROOT_REL)/examples/sam3u_benchmark.c LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/.. \ $(LIBUSB_ROOT_ABS) LOCAL_SHARED_LIBRARIES += libusb1.0 @@ -127,6 +133,7 @@ LOCAL_SRC_FILES := \ $(LIBUSB_ROOT_REL)/examples/xusb.c LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/.. \ $(LIBUSB_ROOT_ABS) LOCAL_SHARED_LIBRARIES += libusb1.0 diff --git a/android/jni/libusb.mk b/android/jni/libusb.mk index 656f903..dacf1ee 100644 --- a/android/jni/libusb.mk +++ b/android/jni/libusb.mk @@ -24,9 +24,6 @@ LIBUSB_ROOT_ABS := $(LOCAL_PATH)/../.. include $(CLEAR_VARS) -LIBUSB_ROOT_REL := ../.. -LIBUSB_ROOT_ABS := $(LOCAL_PATH)/../.. - LOCAL_SRC_FILES := \ $(LIBUSB_ROOT_REL)/libusb/core.c \ $(LIBUSB_ROOT_REL)/libusb/descriptor.c \ diff --git a/android/jni/tests.mk b/android/jni/tests.mk index 6136f58..b42bd1c 100644 --- a/android/jni/tests.mk +++ b/android/jni/tests.mk @@ -29,6 +29,7 @@ LOCAL_SRC_FILES := \ $(LIBUSB_ROOT_REL)/tests/testlib.c LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/.. \ $(LIBUSB_ROOT_ABS) LOCAL_SHARED_LIBRARIES += libusb1.0 -- cgit v1.2.1