From dea70e3fb1f6791c78f82fdd4793ef630b276efa Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 9 Dec 2016 03:21:05 +0300 Subject: [PATCH] Support CFLAGS_EXTRA to pass extra user-defined compiler flags (configure) * Makefile.am (CFLAGS, CXXFLAGS): Append $(CFLAGS_EXTRA). * configure.ac: Add AC_SUBST(CFLAGS_EXTRA). --- Makefile.am | 3 +++ configure.ac | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Makefile.am b/Makefile.am index 03449aaf..175484be 100644 --- a/Makefile.am +++ b/Makefile.am @@ -128,6 +128,9 @@ EXTRA_DIST += gc_cpp.cpp AM_CXXFLAGS = @GC_CFLAGS@ AM_CFLAGS = $(WERROR_CFLAGS) @GC_CFLAGS@ +CFLAGS += $(CFLAGS_EXTRA) +CXXFLAGS += $(CFLAGS_EXTRA) + ## FIXME: relies on internal code generated by automake. ## FIXME: ./configure --enable-dependency-tracking should be used #all_objs = @addobjs@ $(libgc_la_OBJECTS) diff --git a/configure.ac b/configure.ac index 1c4e2a4a..d675f21f 100644 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,9 @@ esac GC_CFLAGS=${gc_cflags} AC_SUBST(GC_CFLAGS) +# Extra user-defined flags to pass both to C and C++ compilers. +AC_SUBST([CFLAGS_EXTRA]) + AC_ARG_ENABLE(threads, [AC_HELP_STRING([--enable-threads=TYPE], [choose threading package])], THREADS=$enableval, -- 2.40.0