summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGerhard Sittig <gerhard.sittig@gmx.net>2020-02-22 09:52:39 +0100
committerGerhard Sittig <gerhard.sittig@gmx.net>2020-07-18 15:32:52 +0200
commit650f19467d6e0f864df9960d8696148e90d85b79 (patch)
treef740177dc2646aba70d38cbc31e270942a15321b /configure.ac
parentab88bae1c7b966e686b313625dd799a522e2093e (diff)
downloadlibsigrokdecode-650f19467d6e0f864df9960d8696148e90d85b79.tar.gz
libsigrokdecode-650f19467d6e0f864df9960d8696148e90d85b79.zip
irmp: hook up IRMP to the build, create a separate shared object
Add the irmp/ subdirectory to the automake build instructions. Make the feature optional, provide an enable/disable switch (on by default). It's an essential implementation detail that the irmp.c file is required to build, but is not a compile unit of its own. It's yet to be seen how to most appropriately declare the dependencies of libirmp_la (can get refined in future commits). Create a separate shared object from the IRMP source, which shall result in a stable filename for the DLL/.so lookup. Decoder library code would not know the application's executable name, neither is anonymous symbol lookup "in the current process" portable across supported platforms. The configure.ac macros were modelled after the autobook DLL section. https://www.sourceware.org/autobook/autobook/autobook_137.html Symbol export is simple because the library gets implemented and built here, but is not used from C language code in this project. That's why we don't do the full dance of symbol import which would be needed on Windows.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3a8b163..f9958b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,11 @@ AC_C_CONST
# Required for per-target flags or subdir-objects with C sources.
AM_PROG_CC_C_O
+# Support building Windows DLLs.
+AC_LIBTOOL_WIN32_DLL
+AM_PROG_CC_STDC
+AM_PROG_LIBTOOL
+
# Set the standard the C library headers should conform to.
AH_VERBATIM([_POSIX_C_SOURCE], [/* The targeted POSIX standard. */
#ifndef _POSIX_C_SOURCE
@@ -134,6 +139,17 @@ AC_SYS_LARGEFILE
AC_C_BIGENDIAN
+#########################
+## Optional features. ##
+#########################
+
+# Enable IRMP support by default. Accept user overrides.
+AC_ARG_ENABLE([irmp],
+ [AS_HELP_STRING([--enable-irmp], [enable IRMP shared object [default=yes]])],
+ [], [enable_irmp_so=yes])
+AM_CONDITIONAL([WITH_IRMP], [test "x$enable_irmp_so" = "xyes"])
+test -n "$enable_irmp_so" || enable_irmp_so=no
+
##############################
## Finalize configuration ##
##############################
@@ -177,4 +193,6 @@ Detected libraries (required):
$srd_pkglibs_summary
Detected libraries (optional):
$srd_pkglibs_opt_summary
+Optional features:
+ - IRMP support library .......... $enable_irmp_so
_EOF