From e5ae321dabe6069a0bd6423006e7c5f100a00860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Fri, 20 May 2005 16:56:28 +0000 Subject: [PATCH] the AM_* flags patch git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9963 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 5 +++ boost/libs/filesystem/src/Makefile.am | 2 +- boost/libs/regex/src/Makefile.am | 2 +- boost/libs/signals/src/Makefile.am | 2 +- config/lyxinclude.m4 | 57 ++++++++++++++------------ configure.ac | 19 ++++++--- src/Makefile.am | 2 +- src/client/Makefile.am | 2 +- src/frontends/Makefile.am | 2 +- src/frontends/controllers/Makefile.am | 2 +- src/frontends/gtk/Makefile.am | 2 +- src/frontends/qt2/Makefile.am | 2 +- src/frontends/qt2/moc/Makefile.am | 2 +- src/frontends/qt2/ui/Makefile.am | 2 +- src/frontends/qt2/ui/moc/Makefile.am | 2 +- src/frontends/xforms/Makefile.am | 4 +- src/frontends/xforms/forms/Makefile.am | 2 +- src/graphics/Makefile.am | 2 +- src/insets/Makefile.am | 2 +- src/mathed/Makefile.am | 2 +- src/support/Makefile.am | 2 +- src/support/tests/Makefile.am | 2 +- src/tex2lyx/Makefile.am | 2 +- 23 files changed, 69 insertions(+), 54 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3816fc8f63..fc1e4aef7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-05-20 + + * configure.ac: Use AM_* flags for CLAGS,CXXFLAGS where we require + the values to be properly set. + 2005-05-03 Angus Leeming * configure.ac: test for io.h and process.h. diff --git a/boost/libs/filesystem/src/Makefile.am b/boost/libs/filesystem/src/Makefile.am index 438d0edf8d..6765ad56d5 100644 --- a/boost/libs/filesystem/src/Makefile.am +++ b/boost/libs/filesystem/src/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/config/common.am noinst_LTLIBRARIES = libboost_filesystem.la -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ $(PCH_FLAGS) \ -DBOOST_USER_CONFIG="" \ $(BOOST_INCLUDES) diff --git a/boost/libs/regex/src/Makefile.am b/boost/libs/regex/src/Makefile.am index 7674459d66..21241e9e73 100644 --- a/boost/libs/regex/src/Makefile.am +++ b/boost/libs/regex/src/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/config/common.am noinst_LTLIBRARIES = libboost_regex.la -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ $(PCH_FLAGS) \ -DBOOST_USER_CONFIG="" \ $(BOOST_INCLUDES) diff --git a/boost/libs/signals/src/Makefile.am b/boost/libs/signals/src/Makefile.am index c84da747a5..99cee23980 100644 --- a/boost/libs/signals/src/Makefile.am +++ b/boost/libs/signals/src/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/config/common.am noinst_LTLIBRARIES = libboost_signals.la -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ $(PCH_FLAGS) \ -DBOOST_USER_CONFIG="" \ $(BOOST_INCLUDES) diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 15f28fe870..a1681c71e4 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -169,7 +169,7 @@ AC_ARG_ENABLE(warnings, enable_warnings=no; fi;]) if test x$enable_warnings = xyes ; then - lyx_flags="$lyx_flags warnings" + lyx_flags="warnings $lyx_flags" AC_DEFINE(WITH_WARNINGS, 1, [Define this if you want to see the warning directives put here and there by the developpers to get attention]) @@ -224,26 +224,39 @@ if test x$GXX = xyes; then if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS="$ac_save_CXXFLAGS" else - case $gxx_version in - 2.95.1) CXXFLAGS="$lyx_opt -fpermissive -ftemplate-depth-30";; - 2.95.*) CXXFLAGS="$lyx_opt -Wno-non-template-friend -ftemplate-depth-30";; - 2.96*) CXXFLAGS="$lyx_opt -fno-exceptions -ftemplate-depth-30 -Wno-non-template-friend";; - 3.1*) CXXFLAGS="$lyx_opt -finline-limit=500 -fno-exceptions";; - 3.2*|3.3*) CXXFLAGS="$lyx_opt -fno-exceptions";; - 3.4*|4.0*) - CXXFLAGS="$lyx_opt -fno-exceptions" - test $enable_pch = yes && lyx_pch_comp=yes - ;; - *) CXXFLAGS="$lyx_opt";; - esac + CFLAGS="$lyx_opt" + CXXFLAGS="$lyx_opt" if test x$enable_debug = xyes ; then + CFLAGS="-g $CFLAGS" CXXFLAGS="-g $CXXFLAGS" fi + if test x$enable_warnings = xyes ; then + case $gxx_version in + 2.*|3.1*|3.2*|3.3*) + CPPFLAGS="-W -Wall $CPPFLAGS" + ;; + *) + CPPFLAGS="-Wextra -Wall $CPPFLAGS " + ;; + esac + fi fi + case $gxx_version in + 2.95.1) AM_CXXFLAGS="-fpermissive -ftemplate-depth-30";; + 2.95.*) AM_CXXFLAGS="-Wno-non-template-friend -ftemplate-depth-30";; + 2.96*) AM_CXXFLAGS="-fno-exceptions -ftemplate-depth-30 -Wno-non-template-friend";; + 3.1*) AM_CXXFLAGS="-finline-limit=500 -fno-exceptions";; + 3.2*|3.3*) AM_CXXFLAGS="-fno-exceptions";; + 3.4*|4.0*) + AM_CXXFLAGS="-fno-exceptions" + test $enable_pch = yes && lyx_pch_comp=yes + ;; + *) AM_CXXFLAGS="";; + esac if test x$enable_stdlib_debug = xyes ; then case $gxx_version in 3.4*|4.0*) - lyx_flags="$lyx_flags stdlib-debug" + lyx_flags="stdlib-debug $lyx_flags" AC_DEFINE(_GLIBCXX_DEBUG, 1, [libstdc++ debug mode]) AC_DEFINE(_GLIBCXX_DEBUG_PEDANTIC, 1, [libstdc++ pedantic debug mode]) ;; @@ -252,27 +265,17 @@ if test x$GXX = xyes; then if test x$enable_concept_checks = xyes ; then case $gxx_version in 3.3*) - lyx_flags="$lyx_flags concept-checks" + lyx_flags="concept-checks $lyx_flags" AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS, 1, [libstdc++ concept checking]) ;; 3.4*|4.0*) - lyx_flags="$lyx_flags concept-checks" + lyx_flags="concept-checks $lyx_flags" AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS, 1, [libstdc++ concept checking]) ;; esac fi - if test x$enable_warnings = xyes ; then - case $gxx_version in - 2.*|3.1*|3.2*|3.3*) - CPPFLAGS="$CPPFLAGS -W -Wall" - ;; - *) - CPPFLAGS="$CPPFLAGS -Wextra -Wall" - ;; - esac - fi fi -test "$lyx_pch_comp" = yes && lyx_flags="$lyx_flags pch" +test "$lyx_pch_comp" = yes && lyx_flags="pch $lyx_flags" AM_CONDITIONAL(LYX_BUILD_PCH, test "$lyx_pch_comp" = yes) ])dnl diff --git a/configure.ac b/configure.ac index 22f641f306..9c953b608f 100644 --- a/configure.ac +++ b/configure.ac @@ -78,7 +78,7 @@ AC_ARG_ENABLE(assertions, enable_assertions=no; fi;]) if test "x$enable_assertions" = xyes ; then - lyx_flags="$lyx_flags assertions" + lyx_flags="assertions $lyx_flags" AC_DEFINE(ENABLE_ASSERTIONS,1, [Define if you want assertions to be enabled in the code]) fi @@ -112,7 +112,7 @@ if test x$lyx_use_aiksaurus != xno; then AC_CHECK_LIB(Aiksaurus, main, [AC_DEFINE(HAVE_LIBAIKSAURUS,1,[Define this if you have the AikSaurus library]) AIKSAURUS_LIBS="-lAiksaurus" - lyx_flags="$lyx_flags aiksaurus" + lyx_flags="aiksaurus $lyx_flags" ]) AC_CHECK_HEADER(Aiksaurus.h,[ ac_cv_header_aiksaurus_h=yes @@ -269,7 +269,7 @@ if test $use_compression=true ; then AC_CHECK_LIB(z, gzopen,[use_compression=true;LIBS="$LIBS -lz"], use_compression=false) if test $use_compression = true ; then AC_DEFINE(USE_COMPRESSION, 1, [Define as 1 if you want to support compressed files.]) - lyx_flags="$lyx_flags compression" + lyx_flags="compression $lyx_flags" fi fi AM_CONDITIONAL(USE_COMPRESSION, test x$use_compression = xtrue) @@ -301,12 +301,15 @@ real_bindir=`eval "echo \`eval \"echo ${bindir}\"\`"` real_datadir=`eval "echo \`eval \"echo ${datadir}/${PACKAGE}\"\`"` VERSION_INFO="Configuration\n\ Host type: ${host}\n\ - Special build flags: ${lyx_flags}\n\ - C Compiler: ${CC}\n\ + Special build flags: ${lyx_flags}\n\ + C Compiler: ${CC} ${CC_VERSION}\n\ + C Compiler LyX flags: ${AM_CPPFLAGS} ${AM_CFLAGS}\n\ C Compiler flags: ${CPPFLAGS} ${CFLAGS}\n\ C++ Compiler: ${CXX} ${CXX_VERSION}\n\ + C++ Compiler LyX flags: ${AM_CPPFLAGS} ${AM_CXXFLAGS}\n\ C++ Compiler flags: ${CPPFLAGS} ${CXXFLAGS}\n\ - Linker flags: ${LDFLAGS}\n\ + Linker flags: ${AM_LDFLAGS}\n\ + Linker user flags: ${LDFLAGS}\n\ ${FRONTEND_INFO}\ Packaging: ${lyx_use_packaging}\n\ LyX binary dir: ${real_bindir}\n\ @@ -315,6 +318,10 @@ ${FRONTEND_INFO}\ AC_SUBST(VERSION_INFO) AC_SUBST(RPM_FRONTEND) +AC_SUBST(AM_CPPFLAGS) +AC_SUBST(AM_CXXFLAGS) +AC_SUBST(AM_CFLAGS) +AC_SUBST(AM_LDFLAGS) ## Some config.h stuff diff --git a/src/Makefile.am b/src/Makefile.am index 6b556d44d1..ef9f546742 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -53,7 +53,7 @@ lyx$(EXEEXT): $(FRONTENDS_PROGS) BUILT_SOURCES = version.C -AM_CPPFLAGS = $(PCH_FLAGS) $(BOOST_INCLUDES) +AM_CPPFLAGS += $(PCH_FLAGS) $(BOOST_INCLUDES) if USE_ASPELL ASPELL = aspell.C aspell_local.h diff --git a/src/client/Makefile.am b/src/client/Makefile.am index 9454d542d9..feb68401fb 100644 --- a/src/client/Makefile.am +++ b/src/client/Makefile.am @@ -8,7 +8,7 @@ man_MANS = lyxclient.1 bin_PROGRAMS = lyxclient -AM_CPPFLAGS = $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) +AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) BOOST_LIBS = $(BOOST_REGEX) $(BOOST_FILESYSTEM) diff --git a/src/frontends/Makefile.am b/src/frontends/Makefile.am index 14a6613d3f..a310e8cc8c 100644 --- a/src/frontends/Makefile.am +++ b/src/frontends/Makefile.am @@ -6,7 +6,7 @@ DIST_SUBDIRS = controllers xforms qt2 gtk noinst_LTLIBRARIES = libfrontends.la -AM_CPPFLAGS = $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) +AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) libfrontends_la_SOURCES = \ Alert.C \ diff --git a/src/frontends/controllers/Makefile.am b/src/frontends/controllers/Makefile.am index 17d23becfe..618777ac1b 100644 --- a/src/frontends/controllers/Makefile.am +++ b/src/frontends/controllers/Makefile.am @@ -4,7 +4,7 @@ EXTRA_DIST = BCView.tmpl noinst_LTLIBRARIES = libcontrollers.la -AM_CPPFLAGS = $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES) +AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES) libcontrollers_la_SOURCES= \ Dialog.C \ diff --git a/src/frontends/gtk/Makefile.am b/src/frontends/gtk/Makefile.am index ba192dacbc..e8235cb84e 100644 --- a/src/frontends/gtk/Makefile.am +++ b/src/frontends/gtk/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = gimages glade noinst_LTLIBRARIES = libgtk.la -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ $(PCH_FLAGS) \ -I$(top_srcdir)/images \ -I$(top_srcdir)/src \ diff --git a/src/frontends/qt2/Makefile.am b/src/frontends/qt2/Makefile.am index 36298be8ca..afaf382cef 100644 --- a/src/frontends/qt2/Makefile.am +++ b/src/frontends/qt2/Makefile.am @@ -10,7 +10,7 @@ noinst_LTLIBRARIES = libqt2.la libqt2_la_LDFLAGS = $(QT_LDFLAGS) libqt2_la_LIBADD = $(QT_LIB) ui/*.lo moc/*.lo ui/moc/*.lo -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ $(QT_CPPFLAGS) \ $(PCH_FLAGS) \ -I$(top_srcdir)/src \ diff --git a/src/frontends/qt2/moc/Makefile.am b/src/frontends/qt2/moc/Makefile.am index 555814197b..bb3afe28aa 100644 --- a/src/frontends/qt2/moc/Makefile.am +++ b/src/frontends/qt2/moc/Makefile.am @@ -3,7 +3,7 @@ include $(srcdir)/../Makefile.dialogs DISTCLEANFILES += *.C -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ $(QT_CPPFLAGS) -DQT_NO_TRANSLATION \ $(PCH_FLAGS) \ -I$(top_srcdir)/src \ diff --git a/src/frontends/qt2/ui/Makefile.am b/src/frontends/qt2/ui/Makefile.am index c08a386edb..de7f55e6c8 100644 --- a/src/frontends/qt2/ui/Makefile.am +++ b/src/frontends/qt2/ui/Makefile.am @@ -7,7 +7,7 @@ SUBDIRS = . moc EXTRA_DIST = QPreambleDialogBase.ui $(UIFILES) -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ $(QT_CPPFLAGS) -DQT_NO_TRANSLATION \ $(PCH_FLAGS) \ -I$(top_srcdir)/src \ diff --git a/src/frontends/qt2/ui/moc/Makefile.am b/src/frontends/qt2/ui/moc/Makefile.am index 1cac7d84bf..0540aeb178 100644 --- a/src/frontends/qt2/ui/moc/Makefile.am +++ b/src/frontends/qt2/ui/moc/Makefile.am @@ -3,7 +3,7 @@ include $(srcdir)/../../Makefile.dialogs DISTCLEANFILES += $(UIFILES:.ui=_moc.C) -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ $(QT_CPPFLAGS) -DQT_NO_TRANSLATION \ $(PCH_FLAGS) \ -I$(top_srcdir)/src \ diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index e8d4378cc4..e8155c8fa1 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -7,7 +7,7 @@ BUILT_SOURCES = lyx_forms.h lyx_xpm.h EXTRA_DIST = lyx_forms.h.in lyx_xpm.h.in -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ -I$(top_srcdir)/images \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/frontends \ @@ -16,7 +16,7 @@ AM_CPPFLAGS = \ # This cannot be put in AM_CPPFLAGS since that is used both for C and C++ # And the precompiled header is setup only for C++ -AM_CXXFLAGS = $(PCH_FLAGS) +AM_CXXFLAGS += $(PCH_FLAGS) noinst_LTLIBRARIES = libxforms.la diff --git a/src/frontends/xforms/forms/Makefile.am b/src/frontends/xforms/forms/Makefile.am index 0e66f04a61..66d42463f2 100644 --- a/src/frontends/xforms/forms/Makefile.am +++ b/src/frontends/xforms/forms/Makefile.am @@ -5,7 +5,7 @@ DISTCLEANFILES += $(SRCS:.fd=.C) $(SRCS:.fd=.h) $(SRCS:.fd=.c) EXTRA_DIST = fdfixc.sed fdfixh.sed fdfix.sh tmp_str.sed README $(SRCS) # For (forms_fwd.h, forms_gettext.h) and support/std_string.h, respectively. -AM_CPPFLAGS = $(PCH_FLAGS) -I$(srcdir)/.. -I$(top_srcdir)/src -I.. +AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. -I$(top_srcdir)/src -I.. noinst_LTLIBRARIES = libfdesign.la diff --git a/src/graphics/Makefile.am b/src/graphics/Makefile.am index 0891b93b3f..923fd53eb3 100644 --- a/src/graphics/Makefile.am +++ b/src/graphics/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/config/common.am noinst_LTLIBRARIES = libgraphics.la -AM_CPPFLAGS = $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) +AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) libgraphics_la_SOURCES = \ GraphicsCache.h \ diff --git a/src/insets/Makefile.am b/src/insets/Makefile.am index 80b87e08b4..da08b05051 100644 --- a/src/insets/Makefile.am +++ b/src/insets/Makefile.am @@ -6,7 +6,7 @@ EXTRA_DIST = \ insettheorem.C \ insettheorem.h -AM_CPPFLAGS = $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) +AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) libinsets_la_SOURCES = \ mailinset.C \ diff --git a/src/mathed/Makefile.am b/src/mathed/Makefile.am index 7d5554c2ee..ae7aef24f5 100644 --- a/src/mathed/Makefile.am +++ b/src/mathed/Makefile.am @@ -4,7 +4,7 @@ EXTRA_DIST = formulamacro.C noinst_LTLIBRARIES = libmathed.la -AM_CPPFLAGS = $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) +AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) libmathed_la_SOURCES = \ textpainter.C \ diff --git a/src/support/Makefile.am b/src/support/Makefile.am index 55095ed187..da402acf27 100644 --- a/src/support/Makefile.am +++ b/src/support/Makefile.am @@ -14,7 +14,7 @@ endif BUILT_SOURCES = package.C -AM_CPPFLAGS = $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) +AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) libsupport_la_SOURCES = \ FileMonitor.h \ diff --git a/src/support/tests/Makefile.am b/src/support/tests/Makefile.am index 8f1c3c8c29..42700c411f 100644 --- a/src/support/tests/Makefile.am +++ b/src/support/tests/Makefile.am @@ -10,7 +10,7 @@ check_PROGRAMS = \ convert \ lstrings -AM_CPPFLAGS = $(BOOST_INCLUDES) +AM_CPPFLAGS += $(BOOST_INCLUDES) convert_LDADD = ../convert.o convert_SOURCES = \ diff --git a/src/tex2lyx/Makefile.am b/src/tex2lyx/Makefile.am index c7bcab1d88..ce7c147619 100644 --- a/src/tex2lyx/Makefile.am +++ b/src/tex2lyx/Makefile.am @@ -13,7 +13,7 @@ DISTCLEANFILES += $(BUILT_SOURCES) bin_PROGRAMS = tex2lyx -AM_CPPFLAGS = $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) +AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES) BOOST_LIBS = $(BOOST_REGEX) $(BOOST_FILESYSTEM)