diff --git a/Makefile.am b/Makefile.am --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,7 @@ ACLOCAL_AMFLAGS = -I m4 +AM_CXXFLAGS = $(WARNINGCXXFLAGS) + AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) LDADD = $(top_builddir)/lemon/libemon.la diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -19,8 +19,6 @@ AC_CONFIG_SRCDIR([lemon/list_graph.h]) AC_CONFIG_HEADERS([config.h lemon/config.h]) -lx_cmdline_cxxflags_set=${CXXFLAGS+set} - dnl Do compilation tests using the C++ compiler. AC_LANG([C++]) @@ -46,9 +44,10 @@ fi dnl Set custom compiler flags when using g++. -if test x"$lx_cmdline_cxxflags_set" != x"set" -a "$GXX" = yes -a "$ICC" = no; then - CXXFLAGS="$CXXFLAGS -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas" +if test "$GXX" = yes -a "$ICC" = no; then + WARNINGCXXFLAGS="-Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas" fi +AC_SUBST([WARNINGCXXFLAGS]) dnl Checks for libraries. #LX_CHECK_GLPK @@ -113,7 +112,7 @@ echo Package version............... : $PACKAGE-$VERSION echo echo C++ compiler.................. : $CXX -echo C++ compiles flags............ : $CXXFLAGS +echo C++ compiles flags............ : $WARNINGCXXFLAGS $CXXFLAGS echo #echo GLPK support.................. : $lx_glpk_found #echo CPLEX support................. : $lx_cplex_found diff --git a/lemon/Makefile.am b/lemon/Makefile.am --- a/lemon/Makefile.am +++ b/lemon/Makefile.am @@ -12,7 +12,7 @@ lemon/color.cc \ lemon/random.cc -#lemon_libemon_la_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS) $(SOPLEX_CXXFLAGS) +#lemon_libemon_la_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS) $(SOPLEX_CXXFLAGS) $(AM_CXXFLAGS) #lemon_libemon_la_LDFLAGS = $(GLPK_LIBS) $(CPLEX_LIBS) $(SOPLEX_LIBS) lemon_HEADERS += \