Support CFLAGS_EXTRA to pass extra user-defined compiler flags (configure)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 9 Dec 2016 21:31:25 +0000 (00:31 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 6 Feb 2017 06:19:13 +0000 (09:19 +0300)
* configure.ac: Add AC_SUBST(CFLAGS_EXTRA).
* src/Makefile.am (CFLAGS): Append $(CFLAGS_EXTRA).
* tests/Makefile.am (CFLAGS): Likewise.

configure.ac
src/Makefile.am
tests/Makefile.am

index ca0377e..b38a65a 100644 (file)
@@ -89,6 +89,9 @@ fi
 AC_SUBST(PICFLAG)
 AC_SUBST(DEFS)
 
+# Extra user-defined C flags.
+AC_SUBST([CFLAGS_EXTRA])
+
 AH_TEMPLATE([_PTHREADS], [Indicates the use of pthreads (NetBSD).])
 
 AH_TEMPLATE([AO_USE_NANOSLEEP],
index fc09b27..3239f95 100644 (file)
@@ -1,6 +1,8 @@
 AM_CFLAGS=@PICFLAG@
 AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
 
+CFLAGS += $(CFLAGS_EXTRA)
+
 include_HEADERS = atomic_ops.h atomic_ops_stack.h atomic_ops_malloc.h
 lib_LTLIBRARIES = libatomic_ops.la libatomic_ops_gpl.la
 if NEED_ASM
index c8812bb..2ac9d8d 100644 (file)
@@ -10,6 +10,8 @@ AM_CPPFLAGS = \
         -I$(top_builddir)/src -I$(top_srcdir)/src \
         -I$(top_builddir)/tests -I$(top_srcdir)/tests
 
+CFLAGS += $(CFLAGS_EXTRA)
+
 if HAVE_PTHREAD_H
 TESTS=test_atomic test_atomic_pthreads test_stack test_malloc
 test_atomic_pthreads_SOURCES=$(test_atomic_SOURCES)