From 9d2220553fd6189b600bf2cb69394558d5ad286a Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 3 Nov 2013 00:05:20 +0100 Subject: [PATCH] Build: improve declared library dependencies - dependency on X-Lib explicit - always link explicitly agrainst lib rt - enforce strict dependencies on dynamic modules (--no-undefined) These changes were included in 0.pre.02-1 and applied to master --- admin/scons/Platform.py | 11 +++++------ admin/scons/Setup.py | 1 + doc/technical/build/Dependencies.txt | 2 +- src/SConscript | 10 +++++----- tests/SConscript | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/admin/scons/Platform.py b/admin/scons/Platform.py index 2a5931417..1ce12662c 100644 --- a/admin/scons/Platform.py +++ b/admin/scons/Platform.py @@ -56,6 +56,10 @@ def configure(env): conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD') conf.env.Append(CCFLAGS = ' -pthread') + if not conf.CheckLib(symbol='clock_gettime', library='rt'): + problems.append('We expect the POSIX realtime extensions to be available through librt. ' + + 'Unable to use clock_gettime()') + if conf.CheckCHeader('execinfo.h'): conf.env.Append(CPPFLAGS = ' -DHAVE_EXECINFO_H') @@ -89,12 +93,6 @@ def configure(env): problems.append('We need the boost regular expression lib (incl. binary lib for linking).') - if conf.CheckLib(symbol='clock_gettime'): - print 'Using function clock_gettime() as defined in the C-lib...' - else: - if not conf.CheckLib(symbol='clock_gettime', library='rt'): - problems.append('No library known to provide the clock_gettime() function.') - if not conf.CheckPkgConfig('gavl', 1.0): problems.append('Did not find Gmerlin Audio Video Lib [http://gmerlin.sourceforge.net/gavl.html].') else: @@ -129,6 +127,7 @@ def configure(env): problems.append('Xlib.h and Xutil.h required. Please install libx11-dev.') if not conf.CheckPkgConfig('xv') : problems.append('Need libXv...') + if not conf.CheckPkgConfig('x11') : problems.append('Need X-lib...') # for the xvdisplayer widget if not conf.CheckPkgConfig('xext'): problems.append('Need libXext.') diff --git a/admin/scons/Setup.py b/admin/scons/Setup.py index ee09a3889..4fae9d85b 100644 --- a/admin/scons/Setup.py +++ b/admin/scons/Setup.py @@ -77,6 +77,7 @@ def defineBuildEnvironment(): , CXXFLAGS='-Wno-enum-compare' , CFLAGS='-std=gnu99' ) + env.Append(LINKFLAGS='-Wl,--no-undefined') # require every dependency is given on link, in the right order handleVerboseMessages(env) handleNoBugSwitches(env) diff --git a/doc/technical/build/Dependencies.txt b/doc/technical/build/Dependencies.txt index 1b7b0262c..967ac6bbd 100644 --- a/doc/technical/build/Dependencies.txt +++ b/doc/technical/build/Dependencies.txt @@ -90,7 +90,7 @@ Libraries - libgtkmm-2.4-dev - libcairomm-1.0-dev - libglibmm-2.4-dev, requiring glib2.0 and gthread-2.0 - - libxv-dev + - libxv-dev and X-lib footnote:[for the XV viewer widget `gui/output/xvdisplayer.cpp`] - librsvg-2.0 and librsvg2-dev for rendering Icons - libgdl-1-dev -- old version of the Gnome Docking Library footnote:[GDL isn't directly related to GNOME any more. We contributed to the improvement of this library in the past. These improvements went upstream diff --git a/src/SConscript b/src/SConscript index e6da9dbb9..8db741cfe 100644 --- a/src/SConscript +++ b/src/SConscript @@ -11,10 +11,10 @@ Import('env icons config') # define the source file/dirs comprising each artifact to be built. -lLib = env.SharedLibrary('lumierasupport', srcSubtree('lib'), install=True) -lApp = env.SharedLibrary('lumieracommon', srcSubtree('common'), install=True) -lBack = env.SharedLibrary('lumierabackend', srcSubtree('backend'), install=True) -lProc = env.SharedLibrary('lumieraproc', srcSubtree('proc'), install=True) +lLib = env.SharedLibrary('lumierasupport', srcSubtree('lib'), install=True) +lApp = env.SharedLibrary('lumieracommon', srcSubtree('common'), addLibs=lLib, install=True) +lBack = env.SharedLibrary('lumierabackend', srcSubtree('backend'),addLibs=lLib+lApp, install=True) +lProc = env.SharedLibrary('lumieraproc', srcSubtree('proc'), addLibs=lLib+lApp+lBack, install=True) core = lProc+lBack+lApp+lLib # in reverse dependency order support_lib = lLib @@ -37,7 +37,7 @@ plugins = [] # currently none # the Lumiera GTK GUI envGtk = env.Clone() -envGtk.mergeConf(['gtkmm-2.4','gthread-2.0','cairomm-1.0','gdl','xv','xext','sm']) +envGtk.mergeConf(['gtkmm-2.4','gthread-2.0','cairomm-1.0','gdl','xv','x11','xext','sm']) envGtk.Append(LIBS=core) guimodule = envGtk.LumieraPlugin('gtk_gui', srcSubtree('gui'), install=True) diff --git a/tests/SConscript b/tests/SConscript index 80388a067..f8c0aa337 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -51,7 +51,7 @@ def testCases(env,dir): testlib = [] testClasses = list(scanSubtree(dir,['*.cpp'])) if testClasses: - testlib = sharedTestLibs[dir] = env.SharedLibrary('test-'+dir, testClasses) + testlib = sharedTestLibs[dir] = env.SharedLibrary('test-'+dir, testClasses, addLibs=core_lib) ### TICKET #938 : should be: addLibs=linkContext(dir)) # pick up standalone plain-C tests standaloneTests = list(scanSubtree(dir,['test-*.c'])) @@ -74,7 +74,7 @@ testrunner = env.Program("test-suite", ["testrunner.cpp"]+testLibs+core_lib) testsuite = ( testcases + testrunner - + createPlugins(env, 'plugin') + + createPlugins(env, 'plugin', addLibs=core_lib) + env.File(glob('*.tests')) # depend explicitly on the test definition files for test.sh + config )