Do not change user variable CFLAGS in configure.ac

This commit is contained in:
Tatsuhiro Tsujikawa 2014-12-01 23:06:11 +09:00
parent 60cb3f67f2
commit 7036859823
5 changed files with 20 additions and 2 deletions

View File

@ -20,6 +20,10 @@ dnl NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
dnl Do not change user variables!
dnl http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
AC_PREREQ(2.61) AC_PREREQ(2.61)
AC_INIT([nghttp2], [0.6.8-DEV], [t-tujikawa@users.sourceforge.net]) AC_INIT([nghttp2], [0.6.8-DEV], [t-tujikawa@users.sourceforge.net])
LT_PREREQ([2.2.6]) LT_PREREQ([2.2.6])
@ -522,6 +526,9 @@ case "${host}" in
;; ;;
esac esac
ac_save_CFLAGS=$CFLAGS
CFLAGS=
if test "x$werror" != "xno"; then if test "x$werror" != "xno"; then
AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"]) AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])
AX_CHECK_COMPILE_FLAG([-Wextra], [CFLAGS="$CFLAGS -Wextra"]) AX_CHECK_COMPILE_FLAG([-Wextra], [CFLAGS="$CFLAGS -Wextra"])
@ -554,6 +561,11 @@ if test "x$werror" != "xno"; then
AX_CHECK_COMPILE_FLAG([-Wheader-guard], [CFLAGS="$CFLAGS -Wheader-guard"]) AX_CHECK_COMPILE_FLAG([-Wheader-guard], [CFLAGS="$CFLAGS -Wheader-guard"])
fi fi
WARNCFLAGS=$CFLAGS
CFLAGS=$ac_save_CFLAGS
AC_SUBST([WARNCFLAGS])
if test "x$debug" != "xno"; then if test "x$debug" != "xno"; then
AC_DEFINE([DEBUGBUILD], [1], [Define to 1 to enable debug output.]) AC_DEFINE([DEBUGBUILD], [1], [Define to 1 to enable debug output.])
fi fi
@ -609,6 +621,7 @@ AC_MSG_NOTICE([summary of build options:
Install prefix: ${prefix} Install prefix: ${prefix}
C compiler: ${CC} C compiler: ${CC}
CFLAGS: ${CFLAGS} CFLAGS: ${CFLAGS}
WARNCFLAGS: ${WARNCFLAGS}
LDFLAGS: ${LDFLAGS} LDFLAGS: ${LDFLAGS}
LIBS: ${LIBS} LIBS: ${LIBS}
CPPFLAGS: ${CPPFLAGS} CPPFLAGS: ${CPPFLAGS}

View File

@ -23,6 +23,7 @@
if ENABLE_EXAMPLES if ENABLE_EXAMPLES
AM_CFLAGS = $(WARNCFLAGS)
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-Wall \ -Wall \
-I$(top_srcdir)/lib/includes \ -I$(top_srcdir)/lib/includes \

View File

@ -24,7 +24,7 @@ SUBDIRS = includes
EXTRA_DIST = Makefile.msvc EXTRA_DIST = Makefile.msvc
AM_CFLAGS = -Wall AM_CFLAGS = $(WARNCFLAGS)
AM_CPPFLAGS = -I$(srcdir)/includes -I$(builddir)/includes @DEFS@ AM_CPPFLAGS = -I$(srcdir)/includes -I$(builddir)/includes @DEFS@
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig

View File

@ -26,6 +26,7 @@ bin_PROGRAMS =
check_PROGRAMS = check_PROGRAMS =
TESTS = TESTS =
AM_CFLAGS = $(WARNCFLAGS)
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-Wall \ -Wall \
-I$(top_srcdir)/lib/includes \ -I$(top_srcdir)/lib/includes \

View File

@ -60,7 +60,10 @@ failmalloc_LDADD = $(main_LDADD)
failmalloc_LDFLAGS = $(main_LDFLAGS) failmalloc_LDFLAGS = $(main_LDFLAGS)
endif # ENABLE_FAILMALLOC endif # ENABLE_FAILMALLOC
AM_CFLAGS = -Wall -I${top_srcdir}/lib -I${top_srcdir}/lib/includes -I${top_builddir}/lib/includes \ AM_CFLAGS = $(WARNCFLAGS) \
-I${top_srcdir}/lib \
-I${top_srcdir}/lib/includes \
-I${top_builddir}/lib/includes \
@CUNIT_CFLAGS@ @DEFS@ @CUNIT_CFLAGS@ @DEFS@
TESTS = main TESTS = main