aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-06-14 00:58:19 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-06-26 02:11:31 +0200
commit27cd6e6dbefa66a431c0c5300a176b15ab205ce7 (patch)
tree91cfa64c94d335dd4ff1742d60c8ddde701769c1
parent1593d9a10a0a91c2077a85da6e9a703ffafbd400 (diff)
downloadhardware_replicant_libsamsung-ipc-27cd6e6dbefa66a431c0c5300a176b15ab205ce7.tar.gz
hardware_replicant_libsamsung-ipc-27cd6e6dbefa66a431c0c5300a176b15ab205ce7.tar.bz2
hardware_replicant_libsamsung-ipc-27cd6e6dbefa66a431c0c5300a176b15ab205ce7.zip
Autotools: Add --enable-samsung-ipc-device=[DEVICE] option
In the Android.mk we have the following: ifneq ($(TARGET_DEVICE),) libsamsung_local_cflags += -DIPC_DEVICE_NAME=\"$(ipc_device_name)\" endif # ifneq ($(TARGET_DEVICE),) This makes libsamsung-ipc assume that it runs on a specific device. It can for instance be useful to test libsamsung-ipc on a device very similar to one that is already supported, or during development. The issue is that, with autotools and without this patch, this feature is not easy to use as to force the i9300 device we would have to run configure in this way: ./configure CFLAGS='-DIPC_DEVICE_NAME=\"i9300\"' And we had no feedback that could indicate if it worked or not. Note that even now, the only feedback we have is the output of ./configure because the autodetection of the device is done in ipc_device_detect. And ipc_device_detect is called by ipc_transport_client_create which setups the ipc_client struct. And without a valid ipc_client struct, we cannot use ipc_client_log, so we can't print in ipc_device_detect. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--configure.ac19
-rw-r--r--samsung-ipc/Makefile.am4
2 files changed, 23 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 1f83a58..b0a6d9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,10 @@ AC_SUBST(OPENSSL_LIBS)
AC_SUBST(VALGRIND)
#------------------------------------------------------------------------------
+# ipc device name
+AC_SUBST([IPC_DEVICE_NAME], [all])
+
+#------------------------------------------------------------------------------
# libcurl
PKG_CHECK_MODULES(LIBCURL, libcurl >= $LIBCURL_REQUIRED)
AC_SUBST(LIBCURL_CFLAGS)
@@ -59,6 +63,19 @@ AS_IF([test x"$valgrind_tests" = x"yes"],
[AC_MSG_ERROR(
[valgrind tests are enabled but valgrind was not found in PATH ($PATH)])])])
#------------------------------------------------------------------------------
+AC_ARG_ENABLE(samsung-ipc-device,
+ [ --enable-samsung-ipc-device=[DEVICE]
+ make libsamsung-ipc assumes that it runs on DEVICE
+ DEVICE={all,aries,crespo,galaxys2,herolte,i9300,maguro,n5100,n7100,piranha} (default=all)],
+ [AS_CASE([$enableval],
+ [aries|crespo|galaxys2|herolte|i9300|maguro|n5100|n7100|piranha],
+ [IPC_DEVICE_NAME=$enableval],
+ [AC_MSG_ERROR([Unnown device $enableval])])],
+ [IPC_DEVICE_NAME="all"])
+
+AM_CONDITIONAL( [WANT_IPC_DEVICE_NAME], [test x"$IPC_DEVICE_NAME" != x"all"])
+#------------------------------------------------------------------------------
+
AC_CONFIG_FILES([
Makefile
samsung-ipc.pc
@@ -101,6 +118,8 @@ echo "Configuration Options:"
echo
echo " debug build.............: $debug"
echo
+echo " device(s)...............: $IPC_DEVICE_NAME"
+echo
echo " prefix..................: $prefix"
echo
echo " valgrind tests..........: $valgrind_tests"
diff --git a/samsung-ipc/Makefile.am b/samsung-ipc/Makefile.am
index 9ffaa03..5eb3bbc 100644
--- a/samsung-ipc/Makefile.am
+++ b/samsung-ipc/Makefile.am
@@ -10,6 +10,10 @@ if WANT_DEBUG
AM_CFLAGS += -DDEBUG
endif
+if WANT_IPC_DEVICE_NAME
+AM_CFLAGS += -DIPC_DEVICE_NAME=\"$(IPC_DEVICE_NAME)\"
+endif
+
lib_LTLIBRARIES = \
libsamsung-ipc.la \
$(NULL)