diff options
author | Marc Schink <jaylink-dev@marcschink.de> | 2016-10-23 20:10:18 +0200 |
---|---|---|
committer | Marc Schink <jaylink-dev@marcschink.de> | 2016-11-05 13:34:50 +0100 |
commit | 8e5a880694034738ac56df54c560890393ba098c (patch) | |
tree | 882485c7142cae432b3573d70a49b031f8632e0d | |
parent | ffa64002fcadd32fe94b154456790cc02a90f313 (diff) |
configure.ac: Do not assign user variables
Do not assign user variables (e.g. CFLAGS) in configure.ac, otherwise
users are not able to modify them properly at 'make' and 'configure'
invocation time.
For more information, see:
https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
Thanks to Paul Fertser for spotting this.
Signed-off-by: Marc Schink <jaylink-dev@marcschink.de>
-rw-r--r-- | configure.ac | 15 | ||||
-rw-r--r-- | libjaylink/Makefile.am | 4 |
2 files changed, 11 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index 9ba68c2..9c815a4 100644 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,7 @@ AM_INIT_AUTOMAKE([foreign -Wall -Werror]) # Enable additional compiler warnings via -Wall and -Wextra. Use hidden # visibility for all non-static symbols by default with -fvisibility=hidden. -CFLAGS="$CFLAGS -Wall -Wextra -Werror -fvisibility=hidden" +JAYLINK_CFLAGS="-Wall -Wextra -Werror -fvisibility=hidden" # Checks for programs. AC_PROG_CC @@ -49,8 +49,7 @@ PKG_PROG_PKG_CONFIG # Checks for libraries. # Check for libusb-1.0 which is always needed. -PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.9], - [CFLAGS="$CFLAGS $libusb_CFLAGS"; LIBS="$LIBS $libusb_LIBS"]) +PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.9]) # Checks for header files. @@ -78,9 +77,7 @@ AM_CONDITIONAL([SUBPROJECT_BUILD], # Libtool interface version is not used for sub-project build as libjaylink is # built as libtool convenience library. AS_IF([test "x$enable_subproject_build" != "xyes"], - [JAYLINK_LIB_LDFLAGS="-version-info $JAYLINK_VERSION_LIBRARY"]) - -AC_SUBST([JAYLINK_LIB_LDFLAGS]) + [JAYLINK_LDFLAGS="-version-info $JAYLINK_VERSION_LIBRARY"]) # Use C99 compatible stdio functions on MinGW instead of the incompatible # functions provided by Microsoft. @@ -90,7 +87,11 @@ AS_CASE([$host_os], [mingw*], # Add the Winsock2 library on MinGW for socket and other network-related # functions. -AS_CASE([$host_os], [mingw*], [LIBS="$LIBS -lws2_32"]) +AS_CASE([$host_os], [mingw*], [JAYLINK_LIBS="$JAYLINK_LIBS -lws2_32"]) + +AC_SUBST([JAYLINK_CFLAGS]) +AC_SUBST([JAYLINK_LDFLAGS]) +AC_SUBST([JAYLINK_LIBS]) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([libjaylink/Makefile]) diff --git a/libjaylink/Makefile.am b/libjaylink/Makefile.am index 25ae2ae..b0a9f4d 100644 --- a/libjaylink/Makefile.am +++ b/libjaylink/Makefile.am @@ -47,6 +47,8 @@ libjaylink_la_SOURCES = \ util.c \ version.c -libjaylink_la_LDFLAGS = $(JAYLINK_LIB_LDFLAGS) -no-undefined +libjaylink_la_CFLAGS = $(JAYLINK_CFLAGS) $(libusb_CFLAGS) +libjaylink_la_LDFLAGS = $(JAYLINK_LDFLAGS) -no-undefined +libjaylink_la_LIBADD = $(JAYLINK_LIBS) $(libusb_LIBS) noinst_HEADERS = libjaylink-internal.h |