#
print "Processing files in src/support"
- env['SUBST_KEYS'] = ['LYX_DIR', 'LOCALEDIR', 'TOP_SRCDIR', 'PROGRAM_SUFFIX']
env.substFile('$BUILDDIR/common/support/package.C', '$TOP_SRC_DIR/src/support/package.C.in')
supports = env.StaticLibrary(
print "Processing files in src/client"
- if env['HAS_SOCKET_LIB']:
+ if env['HAVE_FCNTL']:
client = env.Program(
target = '$BUILDDIR/common/client/lyxclient',
LIBS = env['BOOST_LIBRARIES'] + env['SOCKET_LIBS'] + ['supports'],
#
print "Processing files in src"
- env['SUBST_KEYS'] = ['PACKAGE_VERSION', 'VERSION_INFO']
env.substFile('$BUILDDIR/common/version.C', '$TOP_SRC_DIR/src/version.C.in')
lyx_source_pre = Split('''
# windows: $PREFIX/Resources/locale
# others: $PREFIX/share/locale
locale_dir = env['LOCALE_DIR']
+ # do not install these files
+ execlude_list = ['Makefile.am', 'Makefile.in', 'Makefile',
+ 'lyx2lyx_version.py', 'lyx2lyx_version.py.in']
def install(dest, src):
''' recusive installation of src to dest '''
# separate file and directory
- files = filter(os.path.isfile, [x for x in src])
- dirs = filter(os.path.isdir, [x for x in src])
+ files = filter(lambda x: os.path.isfile(x) and not os.path.split(x)[1] in execlude_list, src)
+ dirs = filter(os.path.isdir, src)
# install file
env.Install(dest, files)
# install directory
'lyxrc.example', 'syntax.default', 'bind', 'images', 'layouts', 'scripts',
'templates', 'examples', 'kbd', 'lyx2lyx', 'tex', 'clipart', 'doc', 'ui']]
)
+ env.substFile('$SHARE_DIR/lyx2lyx/lyx2lyx_version.py',
+ '$TOP_SRC_DIR/lib/lyx2lyx/lyx2lyx_version.py.in')
Alias('install', dirs)
# man
env.InstallAs(os.path.join(env['MAN_DIR'], 'lyx.1'),
PACKAGE_NAME = 'LyX'
PACKAGE_TARNAME = 'lyx'
PACKAGE_STRING = '%s %s' % (PACKAGE_NAME, PACKAGE_VERSION)
-PROGRAM_SUFFIX = ''
# various cache/log files
default_log_file = 'scons_lyx.log'
BoolOption('fast_start', 'Whether or not use cached tests and keep current config.h', True),
# FIXME: I do not know how pch is working. Ignore this option now.
BoolOption('pch', '(NA) Whether or not use pch', default_pch_opt),
- # FIXME: Not implemented yet.
- BoolOption('version_suffix', '(NA) Whether or not add version suffix', False),
# enable assertion, (config.h has ENABLE_ASSERTIOS
BoolOption('assertions', 'Use assertions', True),
# enable warning, (config.h has WITH_WARNINGS)
PathOption('extra_lib_path1', 'Extra library path', None),
# can be set to a non-existing directory
('prefix', 'install architecture-independent files in PREFIX', None),
+ # version suffix
+ ('version_suffix', 'install lyx as lyx-suffix', ''),
#
PathOption('exec_prefix', 'install architecture-independent executable files in PREFIX', None),
# FIXME: not implemented
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.
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']
- env['HAS_SOCKET_LIB'] = env_cache['HAS_SOCKET_LIB']
if not fast_start:
# check boost libraries
('mktemp', 'HAVE_MKTEMP'),
('mkstemp', 'HAVE_MKSTEMP'),
('strerror', 'HAVE_STRERROR'),
- ('fcntl', 'HAVE_FCNTL')
]
for func in functions:
else:
utils.addToConfig('/* #undef %s */' % func[1], TOP_SRC_DIR)
+ if conf.CheckFunc('fcntl'):
+ utils.addToConfig('#define HAVE_FCNTL 1', TOP_SRC_DIR)
+ env['HAVE_FCNTL'] = True
+ else:
+ utils.addToConfig('/* #undef HAVE_FCNTL */', TOP_SRC_DIR)
+ env['HAVE_FCNTL'] = False
+
# PACKAGE
# PACKAGE_VERSION
# DEVEL_VERSION
env_cache['USE_ASPELL'] = env['USE_ASPELL']
env_cache['USE_PSPELL'] = env['USE_PSPELL']
env_cache['USE_ISPELL'] = env['USE_ISPELL']
+ env_cache['HAVE_FCNTL'] = env['HAVE_FCNTL']
else:
+ #
+ # this comes as a big surprise, without this line
+ # (doing nothing obvious), adding fast_start=yes
+ # to a build with fast_start=no will result in a rebuild
+ # Note that the exact header file to check does not matter
+ conf.CheckCHeader('io.h')
# only a few variables need to be rescanned
env['EXTRA_LIBS'] = copy.copy(env_cache['EXTRA_LIBS'])
env['USE_ASPELL'] = env_cache['USE_ASPELL']
env['USE_PSPELL'] = env_cache['USE_PSPELL']
env['USE_ISPELL'] = env_cache['USE_ISPELL']
+ env['HAVE_FCNTL'] = env_cache['HAVE_FCNTL']
#
# Finish auto-configuration
# LYX_ABS_INSTALLED_LOCALEDIR
env['LOCALEDIR'] = env['LOCALE_DIR']
env['TOP_SRCDIR'] = env['TOP_SRC_DIR']
-env['PROGRAM_SUFFIX'] = PROGRAM_SUFFIX
+# program suffix
+if env.has_key('version_suffix'):
+ env['PROGRAM_SUFFIX'] = env['version_suffix']
+else:
+ env['PROGRAM_SUFFIX'] = ''
# needed by src/version.C.in => src/version.C
env['PACKAGE_VERSION'] = PACKAGE_VERSION
# fill in the version info
source_file = file(str(source[0]), "r")
contents = source_file.read()
- for k in env.get('SUBST_KEYS', []):
- if not env.has_key(k):
- print "Failed to subst key ", k, " from file", str(source[0])
- raise
+ for k, v in env.items():
try:
- contents = re.sub('@'+k+'@', env[k].replace('\n',r'\\n\\\n'), contents)
+ contents = re.sub('@'+k+'@', env.subst('$'+k).replace('\n',r'\\n\\\n'), contents)
+ contents = re.sub('%'+k+'%', env.subst('$'+k).replace('\n',r'\\n\\\n'), contents)
except:
- print "Can not substitute %s with %s" % ('@'+k+'@', env[k])
+ pass
target_file.write(contents + "\n")
target_file.close()
#st = os.stat(str(source[0]))