From c44d83752d832f1208986a79338178542702a771 Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Mon, 8 May 2006 03:37:49 +0000 Subject: [PATCH] scons build system: a few cygwin-related fixes. * SConstruct: pass -Wl, options correctly * scons_utils.py: find boost libraries with more complex names * qt4.py: fix a bug regarding the use of pkg_config * src/SConscript: build a static library for src/* git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13808 a592a061-630c-0410-9148-cb99ea01b6c8 --- SConstruct | 4 ++-- qt4.py | 3 ++- scons_utils.py | 9 +++------ src/SConscript | 12 ++++++++++-- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/SConstruct b/SConstruct index 3cfd21735a..956e0d2e06 100644 --- a/SConstruct +++ b/SConstruct @@ -697,8 +697,8 @@ env['BUILDERS']['fileCopy'] = Builder(action = utils.env_filecopy) if platform_name == 'cygwin' and env['frontend'] == 'qt3': ld_script_path = '/usr/lib/qt3/mkspecs/cygwin-g++' ld_script = utils.installCygwinLDScript(ld_script_path) - env.Append(LINKFLAGS = ['-Wl,--enable-runtime-pseudo-reloc -Wl,--script,%s -Wl,-s' % ld_script]) - + env.Append(LINKFLAGS = ['-Wl,--enable-runtime-pseudo-reloc', + '-Wl,--script,%s' % ld_script, '-Wl,-s']) # # Report results diff --git a/qt4.py b/qt4.py index a6ece5318b..40aef1271f 100644 --- a/qt4.py +++ b/qt4.py @@ -351,7 +351,8 @@ def enable_modules(self, modules, debug=False) : self.AppendUnique(LIBPATH=[os.path.join(self["QTDIR"],"lib",module)]) self.AppendUnique(CPPPATH=[os.path.join(self["QTDIR"],"include","qt4",module)]) modules.remove(module) - self.ParseConfig('PKG_CONFIG_PATH=%s/lib/pkgconfig pkg-config %s --libs --cflags'% + # modified by Bo Peng (/lib/pkgconfig => /lib) + self.ParseConfig('PKG_CONFIG_PATH=%s/lib pkg-config %s --libs --cflags'% ( self['QTDIR'], ' '.join(modules))) diff --git a/scons_utils.py b/scons_utils.py index 03ee03aff7..7da71d52ec 100644 --- a/scons_utils.py +++ b/scons_utils.py @@ -89,7 +89,6 @@ def checkPkgConfig(conf, version): def checkPackage(conf, pkg): ''' check if pkg is under the control of conf ''' conf.Message('Checking for package %s...' % pkg) - print "pkg-config --exists %s" % pkg ret = conf.TryAction("pkg-config --print-errors --exists %s" % pkg)[0] conf.Result(ret) return ret @@ -284,11 +283,9 @@ def checkBoostLibraries(conf, lib, pathes): conf.Result('yes') return (path, lib) # check things like libboost_iostreams-gcc.a - # I know, this does not look clever ... - files = glob.glob(os.path.join(path, 'lib%s-[a-z][a-z].a' % lib)) + \ - glob.glob(os.path.join(path, 'lib%s-[a-z][a-z][a-z].a' % lib)) + \ - glob.glob(os.path.join(path, 'lib%s-[a-z][a-z][a-z][a-z].a' % lib)) - # and not clean + files = glob.glob(os.path.join(path, 'lib%s-*.a' % lib)) + # if there are more than one, choose the first one + # FIXME: choose the best one. if len(files) >= 1: # get xxx-gcc from /usr/local/lib/libboost_xxx-gcc.a conf.Result('yes') diff --git a/src/SConscript b/src/SConscript index ad1f4af27d..4e90038cf0 100644 --- a/src/SConscript +++ b/src/SConscript @@ -34,7 +34,6 @@ if env['INCLUDED_BOOST']: env.substFile('version.C', 'version.C.in') lyx_source = Split(''' - main.C Bidi.C BufferView.C BufferView_pimpl.C @@ -152,13 +151,22 @@ elif env.has_key('USE_PSPELL') and env['USE_PSPELL']: elif env.has_key('USE_ISPELL') and env['USE_ISPELL']: lyx_source += ['ispell.C'] +# +# Create a static library for this directory as well +# +lyx_base = env.StaticLibrary( + target = '$LOCALLIBPATH/lyx_base', + source = lyx_source +) + # # Build lyx with given frontend # lyx = env.Program( target = 'lyx', - source = lyx_source, + source = ['main.C'], LIBS = [ + 'lyx_base', 'mathed', 'insets', 'frontends', -- 2.39.5