[cpp-opensaml] 03/10: Don't change the C(XX)FLAGS provided by the user

Scott Cantor cantor.2 at osu.edu
Mon Feb 3 19:30:05 EST 2020


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository cpp-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-opensaml.git;a=commit;h=4f0a17b89b9e14dd9c9f2f9be8526a0860a3bb82

commit 4f0a17b89b9e14dd9c9f2f9be8526a0860a3bb82
Author: Ferenc Wágner <wferi at debian.org>
AuthorDate: Tue Dec 18 11:09:37 2018 +0100

    Don't change the C(XX)FLAGS provided by the user
    
    Leave the default at -g -O2 as AC_PROG_CC sets it.
    Defining NDEBUG is risky, don't do that; use --enable-debug for
    producing the debug variant only.
    Enable another bunch of warnings (-W) under GCC.
---
 configure.ac         | 24 ++++++++----------------
 saml/Makefile.am     |  3 ++-
 samlsign/Makefile.am |  1 +
 samltest/Makefile.am |  1 +
 4 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/configure.ac b/configure.ac
index ff7699a..7f5325d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,15 +19,12 @@ DX_PS_FEATURE(OFF)
 DX_INIT_DOXYGEN(opensaml, doxygen.cfg, doc/api)
 
 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 -Wall -g -D_DEBUG"
-    GCC_CXXFLAGS="$CXXFLAGS -Wall -g -D_DEBUG"
-else
-    GCC_CFLAGS="$CFLAGS -Wall -O2 -DNDEBUG"
-    GCC_CXXFLAGS="$CXXFLAGS -Wall -O2 -DNDEBUG"
+    AM_CFLAGS="-D_DEBUG"
+    AM_CXXFLAGS="-D_DEBUG"
 fi
 
 AC_CONFIG_HEADERS([config.h])
@@ -39,25 +36,20 @@ AC_PROG_CXX([g++ g++3 c++ CC])
 AC_CANONICAL_HOST
 
 if test "$GCC" = "yes" ; then
-#    AC_HAVE_GCC_VERSION(4,0,0,0,
-#        [
-#        AC_DEFINE(GCC_HASCLASSVISIBILITY,1,
-#            [Define to enable class visibility control in gcc.])
-#        GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
-#        GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
-#        ])
-    CFLAGS="$GCC_CFLAGS"
-    CXXFLAGS="$GCC_CXXFLAGS"
+    AM_CFLAGS="$AM_CFLAGS -Wall -W"
+    AM_CXXFLAGS="$AM_CXXFLAGS -Wall -W"
 fi
 
 # Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
 case "${host_cpu}-${host_os}" in
     *solaris*)
 	if test "$CXX" = "CC" ; then
-		CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
+		AM_CXXFLAGS="$AM_CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
 	fi
     ;;
 esac
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_CXXFLAGS])
 
 LT_INIT([disable-static])
 
diff --git a/saml/Makefile.am b/saml/Makefile.am
index 88276be..f7aa95c 100644
--- a/saml/Makefile.am
+++ b/saml/Makefile.am
@@ -74,7 +74,7 @@ saml2bindinclude_HEADERS = \
 	saml2/binding/SAML2ArtifactType0004.h \
 	saml2/binding/SAML2MessageDecoder.h \
 	saml2/binding/SAML2SOAPClient.h
-	
+
 saml2mdinclude_HEADERS = \
 	saml2/metadata/AbstractMetadataProvider.h \
 	saml2/metadata/DiscoverableMetadataProvider.h \
@@ -183,6 +183,7 @@ libsaml_la_LDFLAGS = -version-info 10:1:0
 libsaml_la_CPPFLAGS = \
     $(BOOST_CPPFLAGS)
 libsaml_la_CXXFLAGS = \
+    $(AM_CXXFLAGS) \
     $(PTHREAD_CFLAGS) \
     $(xerces_CFLAGS) \
     $(xmlsec_CFLAGS) \
diff --git a/samlsign/Makefile.am b/samlsign/Makefile.am
index 126d08a..220755b 100644
--- a/samlsign/Makefile.am
+++ b/samlsign/Makefile.am
@@ -7,6 +7,7 @@ samlsign_SOURCES = samlsign.cpp
 samlsign_LDADD = $(top_builddir)/saml/libsaml.la
 samlsign_CPPFLAGS = $(BOOST_CPPFLAGS)
 samlsign_CXXFLAGS = \
+    $(AM_CXXFLAGS) \
     $(xerces_CFLAGS) \
     $(xmltooling_CFLAGS) \
     $(log4shib_CFLAGS) $(log4cpp_CFLAGS)
diff --git a/samltest/Makefile.am b/samltest/Makefile.am
index 1e4f460..9bc5855 100644
--- a/samltest/Makefile.am
+++ b/samltest/Makefile.am
@@ -112,6 +112,7 @@ $(samltest_h:.h=.cpp): %.cpp: %.h
 	$(CXXTEST) --have-eh --have-std --abort-on-fail --part -o $@ $<
 
 samltest_CXXFLAGS = \
+    $(AM_CXXFLAGS) \
     $(CXXTESTFLAGS) \
     $(xerces_CFLAGS) \
     $(xmlsec_CFLAGS) \

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list