summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2014-08-16 18:43:51 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2014-08-16 21:36:16 +0200
commit11bd6317ec8d00b3a421516c2e9747a8f7a551ea (patch)
treec63d2ec9d0a4fe1e27cc2bf7d69daa062227a68f
parent98c47d1107c0f0509cb7e40f2805286e1319afef (diff)
downloadlibsigrokdecode-11bd6317ec8d00b3a421516c2e9747a8f7a551ea.tar.gz
libsigrokdecode-11bd6317ec8d00b3a421516c2e9747a8f7a551ea.zip
configure.ac: Use AM_CFLAGS instead of CFLAGS.
CFLAGS, CPPFLAGS, LDFLAGS and so on are so-called "user variables" and are meant for users of the package to use/override. The package itself should not set or modify them in any way. Instead, the "shadow variables" such as AM_CFLAGS, AM_CPPFLAGS, AM_LDFLAGS and so on, can be modified by the package.
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac6
2 files changed, 5 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index df8fb86..41054b2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -60,7 +60,7 @@ tests_check_main_SOURCES = \
tests/check_decoder.c \
tests/check_inst.c \
tests/check_session.c
-tests_check_main_CFLAGS = @check_CFLAGS@
+tests_check_main_CFLAGS = $(AM_CFLAGS) @check_CFLAGS@
tests_check_main_LDADD = $(top_builddir)/libsigrokdecode.la @check_LIBS@
tests_check_main_CPPFLAGS = $(CPPFLAGS_PYTHON) \
-DDECODERS_DIR='"$(abs_top_builddir)/decoders"'
diff --git a/configure.ac b/configure.ac
index 10213a7..05c876e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,7 +44,7 @@ AH_BOTTOM([#endif /* SRD_CONFIG_H */])
# Enable more compiler warnings via -Wall and -Wextra. Add -fvisibility=hidden
# and enforce use of SRD_API to explicitly mark all public API functions.
-CFLAGS="$CFLAGS -Wall -Wextra -Wmissing-prototypes -fvisibility=hidden"
+AM_CFLAGS="$AM_CFLAGS -Wall -Wextra -Wmissing-prototypes -fvisibility=hidden"
# Checks for programs.
AC_PROG_CC
@@ -86,7 +86,7 @@ build_runtc="yes"
# Note: glib-2.0 is part of the libsigrokdecode API
# (hard pkg-config requirement).
AM_PATH_GLIB_2_0([2.24.0],
- [CFLAGS="$CFLAGS $GLIB_CFLAGS"; LIBS="$LIBS $GLIB_LIBS"])
+ [AM_CFLAGS="$AM_CFLAGS $GLIB_CFLAGS"; LIBS="$LIBS $GLIB_LIBS"])
# Python 3 is always needed.
# Note: We need to try a few different variants, since some systems have a
@@ -163,6 +163,8 @@ AC_SUBST(SRD_PACKAGE_VERSION_MINOR)
AC_SUBST(SRD_PACKAGE_VERSION_MICRO)
AC_SUBST(SRD_PACKAGE_VERSION)
+AC_SUBST(AM_CFLAGS)
+
AM_CONDITIONAL(BUILD_RUNTC, test x"$build_runtc" = "xyes")
AC_CONFIG_FILES([Makefile version.h libsigrokdecode.pc])