print "Processing files in src/client"
print "Processing files in src/client"
+ if env['HAS_SOCKET_LIB']:
client = env.Program(
target = '$BUILDDIR/common/client/lyxclient',
LIBS = env['BOOST_LIBRARIES'] + env['SOCKET_LIBS'] + ['supports'],
client = env.Program(
target = '$BUILDDIR/common/client/lyxclient',
LIBS = env['BOOST_LIBRARIES'] + env['SOCKET_LIBS'] + ['supports'],
)
Alias('client', env.Command(os.path.join('$BUILDDIR', os.path.split(str(client[0]))[1]),
client, [Copy('$TARGET', '$SOURCE')]))
)
Alias('client', env.Command(os.path.join('$BUILDDIR', os.path.split(str(client[0]))[1]),
client, [Copy('$TARGET', '$SOURCE')]))
- except:
- print "Building of program lyxclient failed"
client = None
Alias('client', client)
client = None
Alias('client', client)
tex2lyx_env.fileCopy('$BUILDDIR/common/tex2lyx/lyxlex.C', '$TOP_SRC_DIR/src/lyxlex.C')
tex2lyx_env.fileCopy('$BUILDDIR/common/tex2lyx/lyxlex_pimpl.C', '$TOP_SRC_DIR/src/lyxlex_pimpl.C')
tex2lyx_env.fileCopy('$BUILDDIR/common/tex2lyx/lyxlex.C', '$TOP_SRC_DIR/src/lyxlex.C')
tex2lyx_env.fileCopy('$BUILDDIR/common/tex2lyx/lyxlex_pimpl.C', '$TOP_SRC_DIR/src/lyxlex_pimpl.C')
- try:
- tex2lyx = tex2lyx_env.Program(
- target = '$BUILDDIR/common/tex2lyx/tex2lyx',
- LIBS = ['supports'] + env['BOOST_LIBRARIES'] + env['SYSTEM_LIBS'],
- source = ["$BUILDDIR/common/tex2lyx/%s" % x for x in Split('''
- FloatList.C
- Floating.C
- counters.C
- lyxlayout.C
- lyxtextclass.C
- lyxlex.C
- lyxlex_pimpl.C
- boost.C
- context.C
- gettext.C
- lengthcommon.C
- lyxfont.C
- texparser.C
- tex2lyx.C
- preamble.C
- math.C
- table.C
- text.C
- ''')]
- )
- Alias('tex2lyx', env.Command(os.path.join('$BUILDDIR', os.path.split(str(tex2lyx[0]))[1]),
- tex2lyx, [Copy('$TARGET', '$SOURCE')]))
- except:
- print "Building of program tex2lyx failed"
- tex2lyx = None
+ tex2lyx = tex2lyx_env.Program(
+ target = '$BUILDDIR/common/tex2lyx/tex2lyx',
+ LIBS = ['supports'] + env['BOOST_LIBRARIES'] + env['SYSTEM_LIBS'],
+ source = ["$BUILDDIR/common/tex2lyx/%s" % x for x in Split('''
+ FloatList.C
+ Floating.C
+ counters.C
+ lyxlayout.C
+ lyxtextclass.C
+ lyxlex.C
+ lyxlex_pimpl.C
+ boost.C
+ context.C
+ gettext.C
+ lengthcommon.C
+ lyxfont.C
+ texparser.C
+ tex2lyx.C
+ preamble.C
+ math.C
+ table.C
+ text.C
+ ''')]
+ )
+ Alias('tex2lyx', env.Command(os.path.join('$BUILDDIR', os.path.split(str(tex2lyx[0]))[1]),
+ tex2lyx, [Copy('$TARGET', '$SOURCE')]))
Alias('tex2lyx', tex2lyx)
Alias('tex2lyx', tex2lyx)
#
# Build lyx with given frontend
#
#
# Build lyx with given frontend
#
- try:
- lyx = env.Program(
- target = '$BUILDDIR/$frontend/lyx',
- source = [],
- LIBS = [
- 'lyxbase_pre',
- 'mathed',
- 'insets',
- 'frontends',
- env['frontend'],
- 'controllers',
- 'graphics',
- 'supports',
- 'lyxbase_post',
- ] +
- env['BOOST_LIBRARIES'] +
- env['EXTRA_LIBS'] +
- env['SOCKET_LIBS'] +
- env['SYSTEM_LIBS']
- )
- # [/path/to/lyx.ext] => lyx-qt3.ext
- target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx-%s' % frontend)
- Alias('lyx', env.Command(os.path.join('$BUILDDIR', target_name), lyx,
- [Copy('$TARGET', '$SOURCE')]))
- except:
- print "Building of program lyx failed"
- lyx = None
- raise
+ lyx = env.Program(
+ target = '$BUILDDIR/$frontend/lyx',
+ source = [],
+ LIBS = [
+ 'lyxbase_pre',
+ 'mathed',
+ 'insets',
+ 'frontends',
+ env['frontend'],
+ 'controllers',
+ 'graphics',
+ 'supports',
+ 'lyxbase_post',
+ ] +
+ env['BOOST_LIBRARIES'] +
+ env['EXTRA_LIBS'] +
+ env['SOCKET_LIBS'] +
+ env['SYSTEM_LIBS']
+ )
+ # [/path/to/lyx.ext] => lyx-qt3.ext
+ target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx-%s' % frontend)
+ Alias('lyx', env.Command(os.path.join('$BUILDDIR', target_name), lyx,
+ [Copy('$TARGET', '$SOURCE')]))
env['QT_INC_PATH'] = '/usr/include/$frontend/'
# Note that this CPPPATH is for testing only
# it will be removed before calling SConscript
env['QT_INC_PATH'] = '/usr/include/$frontend/'
# Note that this CPPPATH is for testing only
# it will be removed before calling SConscript
-env.AppendUnique(CPPPATH = env['QT_INC_PATH'])
+env['CPPPATH'] = [env['QT_INC_PATH']]
#
# extra_inc_path and extra_lib_path
#
# extra_inc_path and extra_lib_path
env['SOCKET_LIBS'] = []
if conf.CheckLib('socket'):
env['SOCKET_LIBS'].append('socket')
env['SOCKET_LIBS'] = []
if conf.CheckLib('socket'):
env['SOCKET_LIBS'].append('socket')
+ env['HAS_SOCKET_LIB'] = True
+ else:
+ env['HAS_SOCKET_LIB'] = False
# nsl is the network services library and provides a
# transport-level interface to networking services.
# nsl is the network services library and provides a
# transport-level interface to networking services.
env['SOCKET_LIBS'].append('nsl')
env_cache['SOCKET_LIBS'] = env['SOCKET_LIBS']
env['SOCKET_LIBS'].append('nsl')
env_cache['SOCKET_LIBS'] = env['SOCKET_LIBS']
+ env_cache['HAS_SOCKET_LIB'] = env['HAS_SOCKET_LIB']
else:
env['SOCKET_LIBS'] = env_cache['SOCKET_LIBS']
else:
env['SOCKET_LIBS'] = env_cache['SOCKET_LIBS']
+ env['HAS_SOCKET_LIB'] = env_cache['HAS_SOCKET_LIB']
if not fast_start:
# check boost libraries
if not fast_start:
# check boost libraries
else:
print "Warning: Can not locate specified spell checker:", spell_engine
else:
print "Warning: Can not locate specified spell checker:", spell_engine
- # env['EXTRA_LIBS'] will be modified later, so a unique copy is needed
- # NOTE that we do *not* save qt_libs in environment.
- env_cache['EXTRA_LIBS'] = copy.copy(env['EXTRA_LIBS'])
- env_cache['USE_ASPELL'] = env['USE_ASPELL']
- env_cache['USE_PSPELL'] = env['USE_PSPELL']
- env_cache['USE_ISPELL'] = env['USE_ISPELL']
-
# USE_POSIX_PACKAGING
# USE_MACOSX_PACKAGING
# USE_WINDOWS_PACKAGING
# USE_POSIX_PACKAGING
# USE_MACOSX_PACKAGING
# USE_WINDOWS_PACKAGING
# WANT_GETFILEATTRIBUTESEX_WRAPPER
utils.endConfigH(TOP_SRC_DIR)
# WANT_GETFILEATTRIBUTESEX_WRAPPER
utils.endConfigH(TOP_SRC_DIR)
+ # env['EXTRA_LIBS'] will be modified later, so a unique copy is needed
+ # NOTE that we do *not* save qt_libs in environment.
+ env_cache['EXTRA_LIBS'] = copy.copy(env['EXTRA_LIBS'])
+ env_cache['USE_ASPELL'] = env['USE_ASPELL']
+ env_cache['USE_PSPELL'] = env['USE_PSPELL']
+ env_cache['USE_ISPELL'] = env['USE_ISPELL']
+
else:
# only a few variables need to be rescanned
env['EXTRA_LIBS'] = copy.copy(env_cache['EXTRA_LIBS'])
else:
# only a few variables need to be rescanned
env['EXTRA_LIBS'] = copy.copy(env_cache['EXTRA_LIBS'])
#
# boost is always in, src is needed for config.h
#
#
# boost is always in, src is needed for config.h
#
-# Note that previously added QT_DIR/include etc is removed
-# they will be added when processing for example src/qt3
-env['CPPPATH'] = ['$TOP_SRC_DIR/boost', '$TOP_SRC_DIR/src']
+# QT_INC_PATH is not needed for *every* source file
+env['CPPPATH'].remove(env['QT_INC_PATH'])
+env['CPPPATH'] += ['$TOP_SRC_DIR/boost', '$TOP_SRC_DIR/src']
# TODO: add (more) appropriate compiling options (-DNDEBUG etc)
# for debug/release mode
# TODO: add (more) appropriate compiling options (-DNDEBUG etc)
# for debug/release mode
Boost libraries: %s
Extra libraries: %s
System libraries: %s
Boost libraries: %s
Extra libraries: %s
System libraries: %s
+ include search path: %s
Frontend:
Frontend: %s
Packaging: %s
Frontend:
Frontend: %s
Packaging: %s
- LyX binary dir: FIXME
- LyX files dir: FIXME
+ LyX dir: %s
+ LyX binary dir: %s
+ LyX files dir: %s
''' % (platform_name,
env.subst('$CCFLAGS'), env.subst('$CC'),
env.subst('$CPPFLAGS'), env.subst('$CFLAGS'),
''' % (platform_name,
env.subst('$CCFLAGS'), env.subst('$CC'),
env.subst('$CPPFLAGS'), env.subst('$CFLAGS'),
env.subst('$LINKFLAGS'), env.subst('$LINKFLAGS'),
env.subst('$BUILDDIR'), env.subst('$LOCALLIBPATH'),
str(env['LIBPATH']), str(env['BOOST_LIBRARIES']),
env.subst('$LINKFLAGS'), env.subst('$LINKFLAGS'),
env.subst('$BUILDDIR'), env.subst('$LOCALLIBPATH'),
str(env['LIBPATH']), str(env['BOOST_LIBRARIES']),
- str(env['EXTRA_LIBS']), str(env['SYSTEM_LIBS']),
- env['frontend'], packaging_method)
+ str(env['EXTRA_LIBS']), str(env['SYSTEM_LIBS']), str(env['CPPPATH']),
+ env['frontend'], packaging_method,
+ env['PREFIX'], env['BIN_DIR'], env['SHARE_DIR'])
if env['frontend'] in ['qt3', 'qt4']:
env['VERSION_INFO'] += ''' include dir: %s
if env['frontend'] in ['qt3', 'qt4']:
env['VERSION_INFO'] += ''' include dir: %s
#----------------------------------------------------------
Export('env')
#----------------------------------------------------------
Export('env')
-# this has been the source of problem on some platforms...
-# needs more testing
-env.SConsignFile('%s/.sconsign' % env['BUILDDIR'][1:])
+# this has been the source of problems on some platforms...
+# I find that I need to supply it with full path name
+env.SConsignFile(os.path.join(Dir(env['BUILDDIR']).abspath, '.sconsign'))
# this usage needs further investigation.
#env.CacheDir('%s/Cache/%s' % (env['BUILDDIR'], frontend))
# this usage needs further investigation.
#env.CacheDir('%s/Cache/%s' % (env['BUILDDIR'], frontend))
env['QT4_QRCFLAGS'] = ''
# suffixes/prefixes for the headers / sources to generate
env['QT4_QRCFLAGS'] = ''
# suffixes/prefixes for the headers / sources to generate
- env['QT4_MOCHPREFIX'] = 'moc_'
+ env['QT4_MOCHPREFIX'] = ''
env['QT4_MOCHSUFFIX'] = '$CXXFILESUFFIX'
env['QT4_MOCCXXPREFIX'] = 'moc_'
env['QT4_MOCCXXSUFFIX'] = '.moc'
env['QT4_MOCHSUFFIX'] = '$CXXFILESUFFIX'
env['QT4_MOCCXXPREFIX'] = 'moc_'
env['QT4_MOCCXXSUFFIX'] = '.moc'
if not env.has_key(k):
print "Failed to subst key ", k, " from file", str(source[0])
raise
if not env.has_key(k):
print "Failed to subst key ", k, " from file", str(source[0])
raise
- contents = re.sub('@'+k+'@', env.subst('$'+k).replace('\n',r'\\n\\\n'), contents)
+ try:
+ contents = re.sub('@'+k+'@', env[k].replace('\n',r'\\n\\\n'), contents)
+ except:
+ print "Can not substitute %s with %s" % ('@'+k+'@', env[k])
target_file.write(contents + "\n")
target_file.close()
#st = os.stat(str(source[0]))
target_file.write(contents + "\n")
target_file.close()
#st = os.stat(str(source[0]))
-
- check_mkdir_one_arg_source2 = """
-#include <unistd.h>
-int main()
-{
- mkdir("somedir");
-}
-"""
-
conf.Message('Checking for the number of args for mkdir... ')
conf.Message('Checking for the number of args for mkdir... ')
- ret = conf.TryLink(check_mkdir_one_arg_source, '.c')
+ ret = conf.TryLink(check_mkdir_one_arg_source, '.c') or \
+ conf.TryLink('#include <unistd.h>' + check_mkdir_one_arg_source, '.c')
if ret:
conf.Result('one')
else:
if ret:
conf.Result('one')
else:
- ret = conf.TryLink(check_mkdir_one_arg_source2, '.c')
- if ret:
- conf.Result('one')
- else:
- conf.Result('two')