From 1fa4c88d0e6e5654bcd6e9738ebf4af6dc0bba50 Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 28 Dec 2001 22:29:59 +0000 Subject: [PATCH] Updates to build system to better support automake-1.5 - automake-1.4 sets default values for INCLUDES which we can't overwrite. - automake-1.5 renames this to DEFAULT_INCLUDES and leaves INCLUDES open for the developer to use. Thus for automake-1.4 we are forced to 'append' to INCLUDES and in automake-1.5 we can just set the value to whatever we like. Unfortunately, the behaviors of the two versions are mutually incompatible. The solution I am committing now works for both versions but automake-1.5 generates a lot of spurious warning messages that are annoying, but not fatal. --- src/ATC/Makefile.am | 4 ++++ src/Aircraft/Makefile.am | 4 ++++ src/Airports/Makefile.am | 4 ++++ src/Autopilot/Makefile.am | 4 ++++ src/Cockpit/Makefile.am | 4 ++++ src/Controls/Makefile.am | 4 ++++ src/FDM/Balloon/Makefile.am | 4 ++++ src/FDM/JSBSim/Makefile.am | 9 +++++++-- src/FDM/JSBSim/filtersjb/Makefile.am | 9 +++++++-- src/FDM/LaRCsim/Makefile.am | 4 ++++ src/FDM/Makefile.am | 4 ++++ src/FDM/UIUCModel/Makefile.am | 4 ++++ src/FDM/YASim/Makefile.am | 4 ++++ src/GUI/Makefile.am | 4 ++++ src/Input/Makefile.am | 4 ++++ src/Main/Makefile.am | 8 +++++++- src/Navaids/Makefile.am | 4 ++++ src/Network/Makefile.am | 4 ++++ src/NetworkOLK/Makefile.am | 4 ++++ src/Objects/Makefile.am | 4 ++++ src/Scenery/Makefile.am | 4 ++++ src/Sound/Makefile.am | 4 ++++ src/Time/Makefile.am | 4 ++++ src/Weather/Makefile.am | 4 ++++ src/WeatherCM/Makefile.am | 4 ++++ 25 files changed, 109 insertions(+), 5 deletions(-) diff --git a/src/ATC/Makefile.am b/src/ATC/Makefile.am index 7ec05a3ad..0c61ac5b1 100644 --- a/src/ATC/Makefile.am +++ b/src/ATC/Makefile.am @@ -4,4 +4,8 @@ libATC_a_SOURCES = \ atis.cxx atis.hxx atislist.hxx atislist.cxx \ ATCdisplay.hxx ATCdisplay.cxx +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Aircraft/Makefile.am b/src/Aircraft/Makefile.am index 18f90349e..bf84247b6 100644 --- a/src/Aircraft/Makefile.am +++ b/src/Aircraft/Makefile.am @@ -2,4 +2,8 @@ noinst_LIBRARIES = libAircraft.a libAircraft_a_SOURCES = aircraft.cxx aircraft.hxx +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Airports/Makefile.am b/src/Airports/Makefile.am index 2ce185263..33effd4cf 100644 --- a/src/Airports/Makefile.am +++ b/src/Airports/Makefile.am @@ -12,4 +12,8 @@ gensimple_LDADD = libAirports.a -lsgdebug -lsgmisc -lsgxml -lmk4 -lz genrunways_SOURCES = genrunways.cxx genrunways_LDADD = libAirports.a -lsgdebug -lsgmisc -lsgxml -lmk4 -lz +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Autopilot/Makefile.am b/src/Autopilot/Makefile.am index 0102e4a4a..6ed225010 100644 --- a/src/Autopilot/Makefile.am +++ b/src/Autopilot/Makefile.am @@ -4,4 +4,8 @@ libAutopilot_a_SOURCES = \ auto_gui.cxx auto_gui.hxx \ newauto.cxx newauto.hxx +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Cockpit/Makefile.am b/src/Cockpit/Makefile.am index fb57ac7db..1121d4236 100644 --- a/src/Cockpit/Makefile.am +++ b/src/Cockpit/Makefile.am @@ -12,4 +12,8 @@ libCockpit_a_SOURCES = \ radiostack.cxx radiostack.hxx \ steam.cxx steam.hxx +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Controls/Makefile.am b/src/Controls/Makefile.am index c05f6e90a..4d19a13cb 100644 --- a/src/Controls/Makefile.am +++ b/src/Controls/Makefile.am @@ -2,4 +2,8 @@ noinst_LIBRARIES = libControls.a libControls_a_SOURCES = controls.cxx controls.hxx +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/FDM/Balloon/Makefile.am b/src/FDM/Balloon/Makefile.am index 2d4ac60c7..7fb7d6ae8 100644 --- a/src/FDM/Balloon/Makefile.am +++ b/src/FDM/Balloon/Makefile.am @@ -2,4 +2,8 @@ noinst_LIBRARIES = libBalloon.a libBalloon_a_SOURCES = BalloonSim.cpp BalloonSim.h +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/FDM/JSBSim/Makefile.am b/src/FDM/JSBSim/Makefile.am index 7b6da412e..a141990dd 100644 --- a/src/FDM/JSBSim/Makefile.am +++ b/src/FDM/JSBSim/Makefile.am @@ -67,6 +67,11 @@ testJSBsim_LDADD = libJSBSim.a filtersjb/libfiltersjb.a # demo_LDADD = libJSBSim.a filtersjb/libfiltersjb.a -INCLUDES += -I$(top_srcdir)/src - +if OLD_AUTOMAKE +INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src DEFS += -DFGFS +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +AM_CXXFLAGS = -DFGFS +endif + diff --git a/src/FDM/JSBSim/filtersjb/Makefile.am b/src/FDM/JSBSim/filtersjb/Makefile.am index c58a91ca9..e8ca70905 100644 --- a/src/FDM/JSBSim/filtersjb/Makefile.am +++ b/src/FDM/JSBSim/filtersjb/Makefile.am @@ -12,6 +12,11 @@ libfiltersjb_a_SOURCES = \ FGSummer.cpp FGSummer.h \ FGSwitch.cpp FGSwitch.h -INCLUDES += -I$(top_srcdir)/src - +if OLD_AUTOMAKE +INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src DEFS += -DFGFS +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +AM_CXXFLAGS = -DFGFS +endif + diff --git a/src/FDM/LaRCsim/Makefile.am b/src/FDM/LaRCsim/Makefile.am index e7e3acab8..44a1a4a10 100644 --- a/src/FDM/LaRCsim/Makefile.am +++ b/src/FDM/LaRCsim/Makefile.am @@ -32,4 +32,8 @@ libLaRCsim_a_SOURCES = \ $(AIRCRAFT_MODEL) \ ls_interface.c ls_interface.h +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/FDM/Makefile.am b/src/FDM/Makefile.am index 696f8d72e..7c8680955 100644 --- a/src/FDM/Makefile.am +++ b/src/FDM/Makefile.am @@ -19,4 +19,8 @@ bin_PROGRAMS = pstest pstest_SOURCES = ps-10520c.cxx +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/FDM/UIUCModel/Makefile.am b/src/FDM/UIUCModel/Makefile.am index 9b1646350..54e1b8466 100644 --- a/src/FDM/UIUCModel/Makefile.am +++ b/src/FDM/UIUCModel/Makefile.am @@ -51,4 +51,8 @@ libUIUCModel_a_SOURCES = \ uiuc_warnings_errors.cpp uiuc_warnings_errors.h \ uiuc_wrapper.cpp uiuc_wrapper.h +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/FDM/YASim/Makefile.am b/src/FDM/YASim/Makefile.am index 715ee97dc..1b87c2884 100644 --- a/src/FDM/YASim/Makefile.am +++ b/src/FDM/YASim/Makefile.am @@ -6,4 +6,8 @@ libYASim_a_SOURCES = YASim.cxx Airplane.cpp Atmosphere.cpp ControlMap.cpp \ PropEngine.cpp RigidBody.cpp Surface.cpp \ Thruster.cpp Wing.cpp SimpleJet.cpp +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/GUI/Makefile.am b/src/GUI/Makefile.am index 143216f78..850dce46a 100644 --- a/src/GUI/Makefile.am +++ b/src/GUI/Makefile.am @@ -16,4 +16,8 @@ libGUI_a_SOURCES = \ sgVec3Slider.cxx sgVec3Slider.hxx \ trackball.c trackball.h +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Input/Makefile.am b/src/Input/Makefile.am index 1c5a25cdb..b9b50334e 100644 --- a/src/Input/Makefile.am +++ b/src/Input/Makefile.am @@ -12,4 +12,8 @@ fgjs_SOURCES = fgjs.cxx jsinput.cxx jsinput.h jssuper.cxx jssuper.h fgjs_LDADD = $(audio_LIBS) +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Main/Makefile.am b/src/Main/Makefile.am index a6937492e..35e7407a6 100644 --- a/src/Main/Makefile.am +++ b/src/Main/Makefile.am @@ -25,7 +25,7 @@ else THREAD_LIBS = endif -if OLD_AUTOMAKE +if ANCIENT_AUTOMAKE # nothing CXXFLAGS += -DPKGLIBDIR=\"$(pkglibdir)\" else AM_CXXFLAGS = -DPKGLIBDIR=\"$(pkglibdir)\" @@ -86,4 +86,10 @@ fgfs_LDADD = \ $(opengl_LIBS) \ $(audio_LIBS) +fgfs_CFLAGS = -DTHIS_IS_A_TEST + +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Navaids/Makefile.am b/src/Navaids/Makefile.am index ae9279719..262a2be5a 100644 --- a/src/Navaids/Makefile.am +++ b/src/Navaids/Makefile.am @@ -14,4 +14,8 @@ testnavs_LDADD = \ -lsgtiming -lsgmath -lsgmisc -lsgdebug -lsgmagvar -lsgxml \ -lz +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Network/Makefile.am b/src/Network/Makefile.am index 5a65aa5fd..5c1596cef 100644 --- a/src/Network/Makefile.am +++ b/src/Network/Makefile.am @@ -17,4 +17,8 @@ libNetwork_a_SOURCES = \ ray.cxx ray.hxx \ rul.cxx rul.hxx +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/NetworkOLK/Makefile.am b/src/NetworkOLK/Makefile.am index d0ece6191..ad1f31be3 100644 --- a/src/NetworkOLK/Makefile.am +++ b/src/NetworkOLK/Makefile.am @@ -3,4 +3,8 @@ noinst_LIBRARIES = libNetworkOLK.a libNetworkOLK_a_SOURCES = \ net_send.cxx net_hud.cxx network.cxx network.h fgd.h +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Objects/Makefile.am b/src/Objects/Makefile.am index 42ec6b400..079d6772d 100644 --- a/src/Objects/Makefile.am +++ b/src/Objects/Makefile.am @@ -7,4 +7,8 @@ libObjects_a_SOURCES = \ obj.cxx obj.hxx \ texload.c texload.h colours.h +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Scenery/Makefile.am b/src/Scenery/Makefile.am index c79da6009..4146df3a1 100644 --- a/src/Scenery/Makefile.am +++ b/src/Scenery/Makefile.am @@ -8,4 +8,8 @@ libScenery_a_SOURCES = \ tileentry.cxx tileentry.hxx \ tilemgr.cxx tilemgr.hxx +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Sound/Makefile.am b/src/Sound/Makefile.am index 005885006..57fad4fd9 100644 --- a/src/Sound/Makefile.am +++ b/src/Sound/Makefile.am @@ -6,4 +6,8 @@ libSound_a_SOURCES = \ morse.cxx morse.hxx \ soundmgr.cxx soundmgr.hxx +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Time/Makefile.am b/src/Time/Makefile.am index cf008a448..1e91358c3 100644 --- a/src/Time/Makefile.am +++ b/src/Time/Makefile.am @@ -12,4 +12,8 @@ libTime_a_SOURCES = \ # lowleveltime.cxx lowleveltime.h \ # timezone.cxx timezone.h +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/Weather/Makefile.am b/src/Weather/Makefile.am index b4dc076e5..59b3402c2 100644 --- a/src/Weather/Makefile.am +++ b/src/Weather/Makefile.am @@ -6,4 +6,8 @@ noinst_LIBRARIES = libWeather.a libWeather_a_SOURCES = weather.cxx weather.hxx +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif diff --git a/src/WeatherCM/Makefile.am b/src/WeatherCM/Makefile.am index a3b1e7bc2..036aca2e1 100644 --- a/src/WeatherCM/Makefile.am +++ b/src/WeatherCM/Makefile.am @@ -18,4 +18,8 @@ libWeatherCM_a_SOURCES = \ FGWeatherVectorWrap.h \ FGWindItem.cpp FGWindItem.h +if OLD_AUTOMAKE INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/src +else +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src +endif