Don't change the C(XX)FLAGS provided by the user

git-svn-id: https://svn.apache.org/repos/asf/santuario/xml-security-cpp/trunk@1894409 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/configure.ac b/configure.ac
index ee115b7..7889656 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,15 +27,12 @@
 AC_SYS_LARGEFILE
 
 AC_ARG_ENABLE(debug,
-    AS_HELP_STRING([--enable-debug],[Have GCC compile with symbols (Default = no)]),
+    AS_HELP_STRING([--enable-debug],[Produce debug variant (Default = no)]),
     enable_debug=$enableval, enable_debug=no)
 
 if test "$enable_debug" = "yes" ; then
-    GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
-    GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
-else
-    GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"
-    GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
+    AM_CFLAGS="-D_DEBUG"
+    AM_CXXFLAGS="-D_DEBUG"
 fi
 
 
@@ -56,10 +53,13 @@
 AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
 
 if test "$GCC" = "yes" ; then
-    CFLAGS="-Wall $GCC_CFLAGS"
-    CXXFLAGS="-Wall $GCC_CXXFLAGS"
+    AM_CFLAGS="$AM_CFLAGS -Wall -W"
+    AM_CXXFLAGS="$AM_CXXFLAGS -Wall -W"
 fi
 
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_CXXFLAGS])
+
 AX_PTHREAD(,[AC_MSG_ERROR([unable to find pthreads, currently this is required])])
 
 # Check for required includes
diff --git a/xsec/Makefile.am b/xsec/Makefile.am
index f222544..8b692e8 100644
--- a/xsec/Makefile.am
+++ b/xsec/Makefile.am
@@ -21,7 +21,7 @@
 noinst_PROGRAMS = ${samples}
 bin_PROGRAMS = ${tools}
 
-AM_CXXFLAGS = $(xerces_CXXFLAGS) $(xalan_CXXFLAGS)
+AM_CXXFLAGS += $(xerces_CXXFLAGS) $(xalan_CXXFLAGS)
 LDADD = libxml-security-c.la $(xerces_LIBS) $(xalan_LIBS)
 
 #