From cbbb1e925d699c8b42b2724740d68839c81684c3 Mon Sep 17 00:00:00 2001 From: Mikko Koppanen Date: Sat, 18 Dec 2010 12:13:10 +0100 Subject: Fix passing through CFLAGS/CPPFLAGS/CXXFLAGS when using --enable-debug Signed-off-by: Mikko Koppanen --- acinclude.m4 | 12 ++++++------ configure.in | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 7da2e0b..1257c9e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -302,14 +302,14 @@ AC_DEFUN([AC_ZMQ_CHECK_ENABLE_DEBUG], [{ CXXFLAGS="-g0 " fi - if test "x$LOCAL_CFLAGS" != "xnone"; then - CFLAGS="${CFLAGS} ${LOCAL_CFLAGS}" + if test "x$ZMQ_ORIG_CFLAGS" != "xnone"; then + CFLAGS="${CFLAGS} ${ZMQ_ORIG_CFLAGS}" fi - if test "x$LOCAL_CPPFLAGS" != "xnone"; then - CPPFLAGS="${CPPFLAGS} ${LOCAL_CPPFLAGS}" + if test "x$ZMQ_ORIG_CPPFLAGS" != "xnone"; then + CPPFLAGS="${CPPFLAGS} ${ZMQ_ORIG_CPPFLAGS}" fi - if test "x$LOCAL_CXXFLAGS" != "xnone"; then - CXXFLAGS="${CXXFLAGS} ${LOCAL_CXXFLAGS}" + if test "x$ZMQ_ORIG_CXXFLAGS" != "xnone"; then + CXXFLAGS="${CXXFLAGS} ${ZMQ_ORIG_CXXFLAGS}" fi AC_MSG_RESULT(yes) else diff --git a/configure.in b/configure.in index 0dfd98e..9c03518 100644 --- a/configure.in +++ b/configure.in @@ -31,6 +31,11 @@ AC_SUBST(PACKAGE_VERSION) LTVER="1:0:0" AC_SUBST(LTVER) +# Take a copy of original flags +ZMQ_ORIG_CFLAGS="${CFLAGS:-none}" +ZMQ_ORIG_CPPFLAGS="${CPPFLAGS:-none}" +ZMQ_ORIG_CXXFLAGS="${CXXFLAGS:-none}" + # Checks for programs. AC_PROG_CC AC_PROG_CC_C99 -- cgit v1.2.3