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>
Fri, 9 Dec 2016 21:31:25 +0000 (00:31 +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 796dccd..28e10c0 100644 (file)
@@ -113,6 +113,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 8971370..ad4a21c 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 4cd04de..cc4aefd 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)