aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <swo-dev@marcschink.de>2016-11-02 16:04:03 +0100
committerMarc Schink <swo-dev@marcschink.de>2016-11-02 16:22:09 +0100
commit85f89c07f34d6d3312a00c23f526db48d97f1e3b (patch)
tree9d54873f25ab4c899f9ef0ef96c27abc9a2fa866
parent7ee2d3b8bf43012a04cbd126cbea4140a0c22287 (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
-rw-r--r--bindings/cxx/Makefile.am5
-rw-r--r--configure.ac12
-rw-r--r--libswo/Makefile.am3
3 files changed, 12 insertions, 8 deletions
diff --git a/bindings/cxx/Makefile.am b/bindings/cxx/Makefile.am
index 8e4d67e..564dc0b 100644
--- a/bindings/cxx/Makefile.am
+++ b/bindings/cxx/Makefile.am
@@ -41,9 +41,10 @@ libswocxx_la_SOURCES = \
Unknown.cpp \
Version.cpp
+libswocxx_la_CXXFLAGS = $(LIBSWO_CXXFLAGS) -I$(top_srcdir) \
+ -I$(top_builddir)/libswo
+libswocxx_la_LDFLAGS = $(LIBSWO_LDFLAGS) -no-undefined
libswocxx_la_LIBADD = $(top_builddir)/libswo/libswo.la
-libswocxx_la_LDFLAGS = $(LIBSWO_LIB_LDFLAGS) -no-undefined
-libswocxx_la_CXXFLAGS = -I$(top_srcdir) -I$(top_builddir)/libswo
library_includedir = $(includedir)/libswocxx
library_include_HEADERS = libswocxx.h
diff --git a/configure.ac b/configure.ac
index 2398264..f5a9d5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,8 +31,8 @@ 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.
C_CXX_FLAGS="-Wall -Wextra -Werror -fvisibility=hidden"
-CFLAGS="$CFLAGS $C_CXX_FLAGS"
-CXXFLAGS="$CXXFLAGS $C_CXX_FLAGS"
+LIBSWO_CFLAGS="$C_CXX_FLAGS"
+LIBSWO_CXXFLAGS="$C_CXX_FLAGS"
# Checks for programs.
AC_PROG_CC
@@ -87,9 +87,7 @@ LIBSWO_SET_PACKAGE_VERSION([LIBSWO_VERSION_PACKAGE], [AC_PACKAGE_VERSION])
# http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
LIBSWO_SET_LIBRARY_VERSION([LIBSWO_VERSION_LIBRARY], [0:0:0])
-LIBSWO_LIB_LDFLAGS="-version-info $LIBSWO_VERSION_LIBRARY"
-
-AC_SUBST([LIBSWO_LIB_LDFLAGS])
+LIBSWO_LDFLAGS="-version-info $LIBSWO_VERSION_LIBRARY"
AC_ARG_ENABLE(cxx, AS_HELP_STRING([--enable-cxx],
[enable C++ bindings [default=yes]]),
@@ -165,6 +163,10 @@ AS_CASE([$host_os], [mingw*],
[AC_DEFINE([__USE_MINGW_ANSI_STDIO], [1],
[Define to 1 to use C99 compatible stdio functions on MinGW.])])
+AC_SUBST([LIBSWO_CFLAGS])
+AC_SUBST([LIBSWO_CXXFLAGS])
+AC_SUBST([LIBSWO_LDFLAGS])
+
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([libswo/Makefile])
AC_CONFIG_FILES([libswo/version.h])
diff --git a/libswo/Makefile.am b/libswo/Makefile.am
index ff32dea..9ebba0f 100644
--- a/libswo/Makefile.am
+++ b/libswo/Makefile.am
@@ -28,7 +28,8 @@ libswo_la_SOURCES = \
log.c \
version.c
-libswo_la_LDFLAGS = $(LIBSWO_LIB_LDFLAGS) -no-undefined
+libswo_la_CFLAGS = $(LIBSWO_CFLAGS)
+libswo_la_LDFLAGS = $(LIBSWO_LDFLAGS) -no-undefined
library_includedir = $(includedir)/libswo
library_include_HEADERS = \