2006-05-07 22:44:54 +00:00
|
|
|
# vi:filetype=python:expandtab:tabstop=2:shiftwidth=2
|
|
|
|
#
|
|
|
|
# file SConstruct
|
2006-05-15 20:35:01 +00:00
|
|
|
#
|
2006-05-07 22:44:54 +00:00
|
|
|
# This file is part of LyX, the document processor.
|
|
|
|
# Licence details can be found in the file COPYING.
|
2006-05-15 20:35:01 +00:00
|
|
|
#
|
2006-05-07 22:44:54 +00:00
|
|
|
# \author Bo Peng
|
|
|
|
# Full author contact details are available in file CREDITS.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# This is a scons based building system for lyx, you can use it as follows:
|
2006-05-15 20:35:01 +00:00
|
|
|
#
|
2006-05-11 05:35:01 +00:00
|
|
|
# $ cd development/scons
|
|
|
|
# $ scons [options] [targets]
|
|
|
|
# or:
|
|
|
|
# $ scons -f development/scons/SConstruct [options] [targets]
|
2006-05-15 20:35:01 +00:00
|
|
|
# and:
|
2006-05-11 05:35:01 +00:00
|
|
|
# $ scons [prefix=.] install
|
2006-05-07 22:44:54 +00:00
|
|
|
#
|
|
|
|
# Where:
|
2006-05-15 20:35:01 +00:00
|
|
|
# * targets can be one or more of lyx, tex2lyx, client, po, install.
|
|
|
|
# default to lyx, you can use 'scons all' to build all targets except
|
|
|
|
# for install
|
|
|
|
# * options: use scons -h for details about options, the most important
|
2006-06-13 14:16:54 +00:00
|
|
|
# one is frontend=qt2|qt3|qt4.
|
|
|
|
# - qt2 is used by lyx1.4.x
|
2006-05-15 20:35:01 +00:00
|
|
|
# - qt3 is used by default on linux, cygwin and mac
|
|
|
|
# - qt4 is used by default on win32/mingw
|
2006-05-07 22:44:54 +00:00
|
|
|
#
|
|
|
|
# File layouts (Important):
|
|
|
|
# * Unless you specify builddir=dir, building will happen
|
2006-05-11 05:35:01 +00:00
|
|
|
# in $BUILDDIR = $mode, which can be debug or release
|
|
|
|
# * $BUILDDIR has subdirectories
|
|
|
|
# libs: all intermediate libraries
|
|
|
|
# boost: boost libraries, if boost=included is used
|
2006-05-15 20:35:01 +00:00
|
|
|
# qt3/4: frontend-specific objects
|
|
|
|
# * executables will be copied to $BUILDDIR/
|
|
|
|
#
|
2006-05-07 22:44:54 +00:00
|
|
|
# Hints:
|
2006-05-15 20:35:01 +00:00
|
|
|
# * scons fast_start=yes
|
|
|
|
# If env.cache exists, bypass all tests and use existing src/config.h
|
|
|
|
#
|
2006-05-07 22:44:54 +00:00
|
|
|
# * scons --config=force
|
|
|
|
# force re-configuration (use scons -H for details)
|
2006-05-15 20:35:01 +00:00
|
|
|
#
|
2006-05-07 22:44:54 +00:00
|
|
|
# * check config.log to see why config has failed
|
|
|
|
#
|
|
|
|
# * use extra_inc_path, extra_lib_path, qt_dir, qt_inc_path
|
2006-05-15 20:35:01 +00:00
|
|
|
# qt_lib_path to help locate qt and other libraries.
|
|
|
|
# There are also extra_inc_path1, extra_lib_path1 if you need to spacify
|
|
|
|
# more than one extra paths.
|
2006-05-07 22:44:54 +00:00
|
|
|
#
|
2006-05-15 20:35:01 +00:00
|
|
|
# * executed commands will be logged in scons_lyx.log. You can use logfile=
|
|
|
|
# option to save log to another file.
|
2006-05-07 22:44:54 +00:00
|
|
|
#
|
|
|
|
# Notes:
|
|
|
|
#
|
2006-05-15 20:35:01 +00:00
|
|
|
# * scons dist etc may be added later. Interested contributors can follow
|
2006-05-07 22:44:54 +00:00
|
|
|
# http://www.scons.org/cgi-sys/cgiwrap/scons/moin.cgi/AccumulateBuilder
|
|
|
|
# or
|
|
|
|
# http://www.scons.org/cgi-sys/cgiwrap/scons/moin.cgi/DistTarBuilder
|
|
|
|
# Please also see the commented out code in scons_utils.py
|
2006-05-15 20:35:01 +00:00
|
|
|
#
|
2006-05-07 22:44:54 +00:00
|
|
|
# * NSIS support can be found here.
|
|
|
|
# http://www.scons.org/cgi-sys/cgiwrap/scons/moin.cgi/NsisSconsTool
|
|
|
|
#
|
|
|
|
# * rpm support?
|
|
|
|
# http://www.scons.org/cgi-sys/cgiwrap/scons/moin.cgi/RpmHonchoTemp
|
|
|
|
#
|
|
|
|
# However, I decide to wait since scons seems to be standardizing these
|
|
|
|
# features.
|
|
|
|
#
|
|
|
|
|
2006-06-02 18:36:29 +00:00
|
|
|
import os, sys, copy, cPickle, glob
|
2006-05-07 22:44:54 +00:00
|
|
|
|
2006-05-08 21:03:01 +00:00
|
|
|
# config/scons_utils.py defines a few utility function
|
|
|
|
sys.path.append('config')
|
2006-05-07 22:44:54 +00:00
|
|
|
import scons_utils as utils
|
|
|
|
|
|
|
|
#----------------------------------------------------------
|
|
|
|
# Required runtime environment
|
|
|
|
#----------------------------------------------------------
|
|
|
|
|
2006-06-09 17:11:15 +00:00
|
|
|
# scons asks for 1.5.2, lyx requires 2.2
|
|
|
|
EnsurePythonVersion(2, 2)
|
2006-05-07 22:44:54 +00:00
|
|
|
# Please use at least 0.96.91 (not 0.96.1)
|
|
|
|
EnsureSConsVersion(0, 96)
|
|
|
|
|
2006-05-11 05:35:01 +00:00
|
|
|
# determine where I am ...
|
|
|
|
#
|
|
|
|
# called as 'scons -f development/scons/SConstruct'
|
|
|
|
if os.path.isfile('SConstruct'):
|
|
|
|
TOP_SRC_DIR = '../..'
|
|
|
|
SCONS_DIR = '.'
|
|
|
|
# called as 'cd development/scons; scons'
|
|
|
|
else:
|
|
|
|
TOP_SRC_DIR = '.'
|
|
|
|
SCONS_DIR = 'development/scons'
|
2006-05-10 21:53:31 +00:00
|
|
|
|
2006-05-07 22:44:54 +00:00
|
|
|
#----------------------------------------------------------
|
|
|
|
# Global definitions
|
|
|
|
#----------------------------------------------------------
|
|
|
|
|
|
|
|
# some global settings
|
2006-06-13 14:16:54 +00:00
|
|
|
#
|
|
|
|
# detect version of lyx
|
|
|
|
# only 1.4.x has frontends/qt2
|
|
|
|
if os.path.isdir(os.path.join(TOP_SRC_DIR, 'src', 'frontends', 'qt2')):
|
|
|
|
PACKAGE_VERSION = '1.4.2svn'
|
|
|
|
else:
|
|
|
|
PACKAGE_VERSION = '1.5.0svn'
|
|
|
|
|
2006-05-07 22:44:54 +00:00
|
|
|
DEVEL_VERSION = True
|
|
|
|
default_build_mode = 'debug'
|
2006-06-02 18:36:29 +00:00
|
|
|
lyx_ext = '*.C'
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
PACKAGE = 'lyx'
|
|
|
|
PACKAGE_BUGREPORT = 'lyx-devel@lists.lyx.org'
|
|
|
|
PACKAGE_NAME = 'LyX'
|
|
|
|
PACKAGE_TARNAME = 'lyx'
|
|
|
|
PACKAGE_STRING = '%s %s' % (PACKAGE_NAME, PACKAGE_VERSION)
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# various cache/log files
|
2006-05-07 22:44:54 +00:00
|
|
|
default_log_file = 'scons_lyx.log'
|
2006-05-15 20:35:01 +00:00
|
|
|
env_cache_file = 'env.cache'
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
#----------------------------------------------------------
|
|
|
|
# platform dependent settings
|
|
|
|
#----------------------------------------------------------
|
2006-05-07 22:44:54 +00:00
|
|
|
if os.name == 'nt':
|
|
|
|
platform_name = 'win32'
|
|
|
|
default_frontend = 'qt4'
|
|
|
|
# boost and gettext are unlikely to be installed already
|
|
|
|
default_boost_opt = 'included'
|
|
|
|
default_gettext_opt = 'included'
|
|
|
|
default_pch_opt = False
|
|
|
|
default_with_x = False
|
|
|
|
spell_checker = 'auto'
|
2006-05-15 20:35:01 +00:00
|
|
|
# boost_posix indicates to boost which API to use (posix or windows).
|
2006-05-10 05:34:20 +00:00
|
|
|
# If not specified, boost tries to figure out by itself, but it may fail.
|
2006-05-07 22:44:54 +00:00
|
|
|
boost_posix = False
|
|
|
|
packaging_method = 'windows'
|
2006-05-15 20:35:01 +00:00
|
|
|
default_prefix = 'c:/program files/lyx'
|
2006-05-12 14:21:30 +00:00
|
|
|
share_dir = 'Resources'
|
2006-05-15 20:35:01 +00:00
|
|
|
man_dir = 'Resources/man/man1'
|
2006-05-12 14:21:30 +00:00
|
|
|
locale_dir = 'Resources/locale'
|
2006-05-07 22:44:54 +00:00
|
|
|
elif os.name == 'posix' and sys.platform != 'cygwin':
|
2006-05-10 05:34:20 +00:00
|
|
|
platform_name = sys.platform
|
2006-05-07 22:44:54 +00:00
|
|
|
default_frontend = 'qt3'
|
|
|
|
# try to use system boost/gettext libraries
|
|
|
|
default_boost_opt = 'auto'
|
|
|
|
default_gettext_opt = 'auto'
|
|
|
|
default_pch_opt = False
|
|
|
|
default_with_x = True
|
2006-05-10 05:34:20 +00:00
|
|
|
boost_posix = True
|
2006-05-07 22:44:54 +00:00
|
|
|
packaging_method = 'posix'
|
2006-05-15 20:35:01 +00:00
|
|
|
default_prefix = '/usr/local/'
|
2006-05-12 14:21:30 +00:00
|
|
|
share_dir = 'share/lyx'
|
|
|
|
man_dir = 'man/man1'
|
|
|
|
locale_dir = 'share/locale'
|
2006-05-07 22:44:54 +00:00
|
|
|
elif os.name == 'posix' and sys.platform == 'cygwin':
|
|
|
|
platform_name = 'cygwin'
|
|
|
|
default_frontend = 'qt3'
|
|
|
|
# force the use of cygwin/boost/gettext
|
|
|
|
default_boost_opt = 'system'
|
|
|
|
default_gettext_opt = 'system'
|
|
|
|
default_pch_opt = False
|
|
|
|
default_with_x = True
|
|
|
|
boost_posix = True
|
|
|
|
packaging_method = 'posix'
|
2006-05-15 20:35:01 +00:00
|
|
|
default_prefix = '/usr/local/'
|
2006-05-12 14:21:30 +00:00
|
|
|
share_dir = 'share/lyx'
|
|
|
|
man_dir = 'man/man1'
|
|
|
|
locale_dir = 'share/locale'
|
2006-05-07 22:44:54 +00:00
|
|
|
elif os.name == 'darwin':
|
|
|
|
platform_name = 'mac'
|
|
|
|
default_frontend = 'qt3'
|
|
|
|
# to be safe
|
|
|
|
default_boost_opt = 'included'
|
|
|
|
default_gettext_opt = 'included'
|
|
|
|
default_pch_opt = False
|
|
|
|
default_with_x = False
|
2006-05-10 05:34:20 +00:00
|
|
|
boost_posix = True
|
2006-05-15 20:35:01 +00:00
|
|
|
packaging_method = 'mac'
|
|
|
|
# FIXME: where to install?
|
|
|
|
default_prefix = '/usr/local/'
|
2006-05-12 14:21:30 +00:00
|
|
|
share_dir = 'Resources'
|
2006-05-15 20:35:01 +00:00
|
|
|
man_dir = 'Resources/man/man1'
|
2006-05-12 14:21:30 +00:00
|
|
|
locale_dir = 'Resources/locale'
|
2006-05-07 22:44:54 +00:00
|
|
|
else: # unsupported system
|
|
|
|
platform_name = 'others'
|
|
|
|
default_frontend = 'qt3'
|
|
|
|
# to be safe
|
|
|
|
default_boost_opt = 'included'
|
|
|
|
default_gettext_opt = 'included'
|
|
|
|
default_pch_opt = False
|
|
|
|
default_with_x = True
|
|
|
|
boost_posix = False
|
|
|
|
packaging_method = 'posix'
|
2006-05-15 20:35:01 +00:00
|
|
|
default_prefix = '/usr/local/'
|
2006-05-12 14:21:30 +00:00
|
|
|
share_dir = 'share/lyx'
|
|
|
|
man_dir = 'man/man1'
|
|
|
|
locale_dir = 'share/locale'
|
2006-05-07 22:44:54 +00:00
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
|
2006-05-07 22:44:54 +00:00
|
|
|
#---------------------------------------------------------
|
|
|
|
# Handling options
|
|
|
|
#----------------------------------------------------------
|
2006-05-15 20:35:01 +00:00
|
|
|
#
|
2006-05-09 20:04:27 +00:00
|
|
|
if os.path.isfile('config.py'):
|
|
|
|
print "Getting options from config.py..."
|
|
|
|
print open('config.py').read()
|
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
opts = Options(['config.py'])
|
2006-05-07 22:44:54 +00:00
|
|
|
opts.AddOptions(
|
2006-05-15 20:35:01 +00:00
|
|
|
# frontend,
|
|
|
|
EnumOption('frontend', 'Main GUI', default_frontend,
|
2006-06-13 14:16:54 +00:00
|
|
|
allowed_values = ('xform', 'qt2', 'qt3', 'qt4', 'gtk') ),
|
2006-05-07 22:44:54 +00:00
|
|
|
# debug or release build
|
|
|
|
EnumOption('mode', 'Building method', default_build_mode,
|
|
|
|
allowed_values = ('debug', 'release') ),
|
|
|
|
# boost libraries
|
2006-05-15 20:35:01 +00:00
|
|
|
EnumOption('boost',
|
|
|
|
'Use included, system boost library, or try sytem boost first.',
|
2006-05-07 22:44:54 +00:00
|
|
|
default_boost_opt,
|
|
|
|
allowed_values = (
|
|
|
|
'auto', # detect boost, if not found, use included
|
|
|
|
'included', # always use included boost
|
|
|
|
'system', # always use system boost, fail if can not find
|
|
|
|
) ),
|
2006-05-15 20:35:01 +00:00
|
|
|
# FIXME: not implemented yet.
|
|
|
|
EnumOption('gettext',
|
|
|
|
'Use included, system gettext library, or try sytem gettext first',
|
2006-05-07 22:44:54 +00:00
|
|
|
default_gettext_opt,
|
|
|
|
allowed_values = (
|
|
|
|
'auto', # detect gettext, if not found, use included
|
|
|
|
'included', # always use included gettext
|
|
|
|
'system', # always use system gettext, fail if can not find
|
|
|
|
) ),
|
2006-05-15 20:35:01 +00:00
|
|
|
#
|
|
|
|
EnumOption('spell', 'Choose spell checker to use.', 'auto',
|
|
|
|
allowed_values = ('aspell', 'pspell', 'ispell', 'auto') ),
|
|
|
|
#
|
|
|
|
BoolOption('fast_start', 'Whether or not use cached tests and keep current config.h', True),
|
2006-05-29 16:58:14 +00:00
|
|
|
#
|
|
|
|
BoolOption('load_option', 'load option from previous scons run', True),
|
2006-05-07 22:44:54 +00:00
|
|
|
# FIXME: I do not know how pch is working. Ignore this option now.
|
|
|
|
BoolOption('pch', '(NA) Whether or not use pch', default_pch_opt),
|
2006-05-15 20:35:01 +00:00
|
|
|
# enable assertion, (config.h has ENABLE_ASSERTIOS
|
2006-05-07 22:44:54 +00:00
|
|
|
BoolOption('assertions', 'Use assertions', True),
|
2006-05-15 20:35:01 +00:00
|
|
|
# enable warning, (config.h has WITH_WARNINGS)
|
2006-05-07 22:44:54 +00:00
|
|
|
BoolOption('warnings', 'Use warnings', True),
|
2006-05-15 20:35:01 +00:00
|
|
|
# enable glib, (config.h has _GLIBCXX_CONCEPT_CHECKS)
|
2006-05-07 22:44:54 +00:00
|
|
|
BoolOption('concept_checks', 'Enable concept checks', True),
|
2006-05-20 15:59:56 +00:00
|
|
|
#
|
|
|
|
BoolOption('nls', 'Whether or not use native language support', True),
|
2006-05-07 22:44:54 +00:00
|
|
|
# FIXME: not implemented
|
|
|
|
BoolOption('profile', '(NA) Whether or not enable profiling', False),
|
|
|
|
# FIXME: not implemented
|
|
|
|
BoolOption('std_debug', '(NA) Whether or not turn on stdlib debug', False),
|
|
|
|
# using x11?
|
|
|
|
BoolOption('X11', 'Use x11 windows system', default_with_x),
|
2006-05-29 16:58:14 +00:00
|
|
|
# use MS VC++ to build lyx
|
|
|
|
BoolOption('use_vc', 'Use MS VC++ to build lyx', False),
|
|
|
|
#
|
2006-05-15 20:35:01 +00:00
|
|
|
PathOption('qt_dir', 'Path to qt directory', None),
|
|
|
|
#
|
|
|
|
PathOption('qt_include_path', 'Path to qt include directory', None),
|
|
|
|
#
|
|
|
|
PathOption('qt_lib_path', 'Path to qt library directory', None),
|
|
|
|
# build directory, will use $mode if not set
|
|
|
|
PathOption('build_dir', 'Build directory', None),
|
|
|
|
# extra include and libpath
|
|
|
|
PathOption('extra_inc_path', 'Extra include path', None),
|
|
|
|
#
|
|
|
|
PathOption('extra_lib_path', 'Extra library path', None),
|
|
|
|
#
|
2006-06-10 21:02:11 +00:00
|
|
|
PathOption('extra_bin_path', 'A convenient way to add a path to $PATH', None),
|
|
|
|
#
|
2006-05-15 20:35:01 +00:00
|
|
|
PathOption('extra_inc_path1', 'Extra include path', None),
|
|
|
|
#
|
|
|
|
PathOption('extra_lib_path1', 'Extra library path', None),
|
2006-05-29 14:59:20 +00:00
|
|
|
# rebuild only specifed, comma separated targets
|
|
|
|
('rebuild', 'rebuild only specifed, comma separated targets', None),
|
2006-05-15 20:35:01 +00:00
|
|
|
# can be set to a non-existing directory
|
|
|
|
('prefix', 'install architecture-independent files in PREFIX', None),
|
2006-05-23 00:27:05 +00:00
|
|
|
# will install to dest_dir if defined. Otherwise, prefix will be used.
|
|
|
|
('dest_dir', 'install to dest_dir', None),
|
2006-05-17 04:07:45 +00:00
|
|
|
# version suffix
|
|
|
|
('version_suffix', 'install lyx as lyx-suffix', ''),
|
2006-05-15 20:35:01 +00:00
|
|
|
#
|
|
|
|
PathOption('exec_prefix', 'install architecture-independent executable files in PREFIX', None),
|
2006-05-07 22:44:54 +00:00
|
|
|
# log file
|
|
|
|
('logfile', 'save commands (not outputs) to logfile', default_log_file),
|
2006-06-11 04:48:22 +00:00
|
|
|
# Path to aiksaurus
|
|
|
|
PathOption('aiksaurus_path', 'Path to aiksaurus library', None),
|
2006-05-15 20:35:01 +00:00
|
|
|
# environment variable can be set as options. (DO NOT set defaults)
|
|
|
|
('CC', '$CC', None),
|
|
|
|
('LINK', '$LINK', None),
|
|
|
|
('CPP', '$CPP', None),
|
|
|
|
('CXX', '$CXX', None),
|
|
|
|
('CXXCPP', '$CXXCPP', None),
|
|
|
|
('CCFLAGS', '$CCFLAGS', None),
|
|
|
|
('CPPFLAGS', '$CPPFLAGS', None),
|
|
|
|
('LDFLAGS', '$LDFLAGS', None),
|
|
|
|
)
|
2006-05-07 22:44:54 +00:00
|
|
|
|
2006-05-23 00:27:05 +00:00
|
|
|
# whether or not use current config.h, and cached tests
|
|
|
|
if (not ARGUMENTS.has_key('fast_start') or \
|
|
|
|
ARGUMENTS['fast_start'] in ['y', 'yes', 't', 'true', '1', 'all']) \
|
|
|
|
and os.path.isfile(env_cache_file):
|
|
|
|
fast_start = True
|
|
|
|
cache_file = open(env_cache_file)
|
|
|
|
env_cache = cPickle.load(cache_file)
|
|
|
|
cache_file.close()
|
|
|
|
print '------------ fast_start mode --------------------'
|
|
|
|
print ' Use cached test results and current config.h'
|
|
|
|
print ' use fast_start=no to override'
|
|
|
|
print
|
|
|
|
else:
|
|
|
|
fast_start = False
|
|
|
|
env_cache = {}
|
|
|
|
|
2006-05-29 16:58:14 +00:00
|
|
|
if (not ARGUMENTS.has_key('load_option') or \
|
|
|
|
ARGUMENTS['load_option'] in ['y', 'yes', 't', 'true', '1', 'all']) \
|
|
|
|
and os.path.isfile(env_cache_file):
|
|
|
|
cache_file = open(env_cache_file)
|
|
|
|
opt_cache = cPickle.load(cache_file)['arg_cache']
|
|
|
|
cache_file.close()
|
|
|
|
# import cached options, but we should ignore qt_dir when frontend changes
|
|
|
|
if ARGUMENTS.has_key('frontend') and opt_cache.has_key('frontend') \
|
|
|
|
and ARGUMENTS['frontend'] != opt_cache['frontend'] \
|
|
|
|
and opt_cache.has_key('qt_dir'):
|
|
|
|
opt_cache.pop('qt_dir')
|
2006-06-09 17:11:15 +00:00
|
|
|
# some options will require full rebuild
|
|
|
|
# these are in general things that will change src/config.h
|
2006-06-13 14:16:54 +00:00
|
|
|
for arg in ['version_suffix', 'nls', 'boost']:
|
2006-06-09 17:11:15 +00:00
|
|
|
if ARGUMENTS.has_key(arg) and ((not opt_cache.has_key(arg)) or \
|
|
|
|
ARGUMENTS[arg] != opt_cache[arg]):
|
|
|
|
if fast_start:
|
|
|
|
print " ** fast_start is disabled because of the change of option", arg
|
|
|
|
print
|
|
|
|
fast_start = False
|
2006-06-03 22:15:35 +00:00
|
|
|
# and we do not cache some options
|
2006-06-13 14:16:54 +00:00
|
|
|
for arg in ['fast_start', 'load_option']:
|
2006-06-03 22:15:35 +00:00
|
|
|
if opt_cache.has_key(arg):
|
|
|
|
opt_cache.pop(arg)
|
2006-05-29 16:58:14 +00:00
|
|
|
for key in opt_cache.keys():
|
|
|
|
if not ARGUMENTS.has_key(key):
|
|
|
|
ARGUMENTS[key] = opt_cache[key]
|
|
|
|
print "Restoring cached option %s=%s" % (key, ARGUMENTS[key])
|
|
|
|
print
|
|
|
|
|
2006-05-23 00:27:05 +00:00
|
|
|
# save arguments
|
|
|
|
env_cache['arg_cache'] = ARGUMENTS
|
|
|
|
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
#---------------------------------------------------------
|
|
|
|
# Setting up environment
|
|
|
|
#---------------------------------------------------------
|
|
|
|
|
2006-06-10 21:02:11 +00:00
|
|
|
# I do not really like ENV=os.environ, but you may
|
2006-05-29 16:58:14 +00:00
|
|
|
# add it here if you experience some environment related problem
|
2006-05-11 05:35:01 +00:00
|
|
|
env = Environment(options = opts)
|
2006-05-07 22:44:54 +00:00
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
# Determine the frontend to use, which may be loaded
|
2006-05-11 21:28:13 +00:00
|
|
|
# from option cache
|
|
|
|
frontend = env.get('frontend', default_frontend)
|
2006-05-15 20:35:01 +00:00
|
|
|
# make sure the key exists
|
|
|
|
env['frontend'] = frontend
|
2006-06-02 18:36:29 +00:00
|
|
|
env['LYX_EXT'] = lyx_ext
|
2006-05-15 20:35:01 +00:00
|
|
|
#
|
2006-05-11 21:28:13 +00:00
|
|
|
use_X11 = env.get('X11', default_with_x)
|
2006-05-29 16:58:14 +00:00
|
|
|
use_vc = env.get('use_vc', False)
|
|
|
|
# use it only once for s scons-bug, will remove it later.
|
|
|
|
env['USE_VC'] = use_vc
|
2006-05-11 21:28:13 +00:00
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# set individual variables since I do not really like ENV = os.environ
|
2006-05-11 05:35:01 +00:00
|
|
|
env['ENV']['PATH'] = os.environ.get('PATH')
|
2006-05-07 22:44:54 +00:00
|
|
|
env['ENV']['HOME'] = os.environ.get('HOME')
|
2006-05-29 16:58:14 +00:00
|
|
|
# these are defined for MSVC
|
|
|
|
env['ENV']['LIB'] = os.environ.get('LIB')
|
|
|
|
env['ENV']['INCLUDE'] = os.environ.get('INCLUDE')
|
2006-06-03 22:15:35 +00:00
|
|
|
if use_vc:
|
|
|
|
# full path name is used to build msvs project files
|
|
|
|
env['TOP_SRC_DIR'] = Dir(TOP_SRC_DIR).abspath
|
|
|
|
else:
|
|
|
|
env['TOP_SRC_DIR'] = TOP_SRC_DIR
|
2006-05-11 05:35:01 +00:00
|
|
|
env['SCONS_DIR'] = SCONS_DIR
|
2006-05-15 20:35:01 +00:00
|
|
|
# install to default_prefix by default
|
|
|
|
env['PREFIX'] = env.get('prefix', default_prefix)
|
2006-05-20 15:59:56 +00:00
|
|
|
# program suffix
|
|
|
|
if env.has_key('version_suffix'):
|
2006-06-09 17:11:15 +00:00
|
|
|
if env['version_suffix'] in ['y', 'yes', 't', 'true', '1', 'all']:
|
|
|
|
env['PROGRAM_SUFFIX'] = PACKAGE_VERSION
|
|
|
|
else:
|
|
|
|
env['PROGRAM_SUFFIX'] = env['version_suffix']
|
2006-05-20 15:59:56 +00:00
|
|
|
else:
|
|
|
|
env['PROGRAM_SUFFIX'] = ''
|
2006-06-09 18:44:28 +00:00
|
|
|
|
|
|
|
# whether or not add suffix to file and directory names
|
|
|
|
env['ADD_SUFFIX'] = packaging_method != 'windows'
|
|
|
|
if env['ADD_SUFFIX']:
|
|
|
|
env['SHARE_DIR'] = os.path.join(env['PREFIX'], share_dir + env['PROGRAM_SUFFIX'])
|
|
|
|
else:
|
|
|
|
env['SHARE_DIR'] = os.path.join(env['PREFIX'], share_dir)
|
2006-05-12 14:21:30 +00:00
|
|
|
env['LOCALE_DIR'] = os.path.join(env['PREFIX'], locale_dir)
|
2006-05-23 00:27:05 +00:00
|
|
|
#
|
|
|
|
# if dest_dir is different from prefix.
|
|
|
|
env['DEST_DIR'] = env.get('dest_dir', env['PREFIX'])
|
|
|
|
if env.has_key('exec_prefix'):
|
|
|
|
env['BIN_DEST_DIR'] = env['exec_prefix']
|
|
|
|
else:
|
|
|
|
env['BIN_DEST_DIR'] = os.path.join(env['DEST_DIR'], 'bin')
|
2006-06-09 18:44:28 +00:00
|
|
|
if env['ADD_SUFFIX']:
|
|
|
|
env['SHARE_DEST_DIR'] = os.path.join(env['DEST_DIR'], share_dir + env['PROGRAM_SUFFIX'])
|
|
|
|
else:
|
|
|
|
env['SHARE_DEST_DIR'] = os.path.join(env['DEST_DIR'], share_dir)
|
2006-05-23 00:27:05 +00:00
|
|
|
env['MAN_DEST_DIR'] = os.path.join(env['DEST_DIR'], man_dir)
|
|
|
|
env['LOCALE_DEST_DIR'] = os.path.join(env['DEST_DIR'], locale_dir)
|
2006-05-10 21:53:31 +00:00
|
|
|
|
2006-05-20 15:59:56 +00:00
|
|
|
#
|
|
|
|
# this is a bit out of place (after auto-configration) but
|
|
|
|
# it is required to do the tests. Since Tool('mingw') will
|
2006-05-29 16:58:14 +00:00
|
|
|
# reset CCFLAGS etc, this should be done before getEnvVariable
|
|
|
|
if platform_name == 'win32' and not use_vc:
|
2006-05-20 15:59:56 +00:00
|
|
|
env.Tool('mingw')
|
|
|
|
env.AppendUnique(CPPPATH = ['#c:/MinGW/include'])
|
2006-05-29 16:58:14 +00:00
|
|
|
elif use_vc:
|
|
|
|
env.Tool('msvc')
|
|
|
|
env.Tool('mslink')
|
2006-05-20 15:59:56 +00:00
|
|
|
|
|
|
|
|
2006-05-09 20:04:27 +00:00
|
|
|
# speed up source file processing
|
|
|
|
#env['CPPSUFFIXES'] = ['.C', '.cc', '.cpp']
|
|
|
|
#env['CXXSUFFIX'] = ['.C']
|
|
|
|
|
|
|
|
def getEnvVariable(env, name):
|
|
|
|
# first try command line argument (override environment settings)
|
|
|
|
if ARGUMENTS.has_key(name) and ARGUMENTS[name].strip() != '':
|
2006-05-21 15:50:55 +00:00
|
|
|
# multiple options may be passed like "-02 -g"
|
|
|
|
env[name] = ARGUMENTS[name].split()
|
|
|
|
# it does not seem necessary, but it is safer to change ['a'] back to 'a'
|
|
|
|
if len(env[name]) == 1:
|
|
|
|
env[name] = env[name][0]
|
2006-05-15 20:35:01 +00:00
|
|
|
# then use environment default
|
2006-05-09 20:04:27 +00:00
|
|
|
elif os.environ.has_key(name) and os.environ[name].strip() != '':
|
|
|
|
print "Acquiring varaible %s from system environment: %s" % (name, env[name])
|
2006-05-21 15:50:55 +00:00
|
|
|
env[name] = os.environ[name].split()
|
|
|
|
if len(env[name]) == 1:
|
|
|
|
env[name] = env[name][0]
|
2006-05-15 20:35:01 +00:00
|
|
|
# finally, env['CC'] etc is set to the default values of Options.
|
|
|
|
# and env['CPP'] etc does not exist
|
2006-05-09 20:04:27 +00:00
|
|
|
|
|
|
|
getEnvVariable(env, 'CC')
|
2006-05-15 20:35:01 +00:00
|
|
|
getEnvVariable(env, 'LINK')
|
2006-05-09 20:04:27 +00:00
|
|
|
getEnvVariable(env, 'CPP')
|
|
|
|
getEnvVariable(env, 'CXX')
|
|
|
|
getEnvVariable(env, 'CXXCPP')
|
|
|
|
getEnvVariable(env, 'CCFLAGS')
|
|
|
|
getEnvVariable(env, 'CXXFLAGS')
|
|
|
|
getEnvVariable(env, 'CPPFLAGS')
|
|
|
|
getEnvVariable(env, 'LDFLAGS')
|
|
|
|
|
2006-05-09 13:01:45 +00:00
|
|
|
|
2006-05-07 22:44:54 +00:00
|
|
|
#
|
|
|
|
# frontend, mode, BUILDDIR and LOCALLIBPATH=BUILDDIR/libs
|
2006-05-15 20:35:01 +00:00
|
|
|
#
|
2006-05-11 21:28:13 +00:00
|
|
|
env['mode'] = env.get('mode', default_build_mode)
|
2006-05-07 22:44:54 +00:00
|
|
|
# lyx will be built to $build/build_dir so it is possible
|
2006-05-15 20:35:01 +00:00
|
|
|
# to build multiple build_dirs using the same source
|
2006-05-07 22:44:54 +00:00
|
|
|
# $mode can be debug or release
|
2006-05-15 20:35:01 +00:00
|
|
|
if env.has_key('build_dir') and env['build_dir']:
|
|
|
|
build_dir = env['build_dir']
|
2006-05-07 22:44:54 +00:00
|
|
|
env['BUILDDIR'] = build_dir
|
|
|
|
else:
|
2006-05-15 20:35:01 +00:00
|
|
|
# Determine the name of the build $mode
|
2006-05-11 05:35:01 +00:00
|
|
|
env['BUILDDIR'] = '#' + env['mode']
|
2006-05-07 22:44:54 +00:00
|
|
|
# all built libraries will go to build_dir/libs
|
|
|
|
# (This is different from the make file approach)
|
2006-05-11 05:35:01 +00:00
|
|
|
env['LOCALLIBPATH'] = '$BUILDDIR/libs'
|
2006-06-03 22:15:35 +00:00
|
|
|
# to make use of local cached parameters, this one has to be '.'
|
|
|
|
env['MSVSPATH'] = '.'
|
2006-05-10 05:34:20 +00:00
|
|
|
env.AppendUnique(LIBPATH = ['$LOCALLIBPATH'])
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# QTDIR, QT_LIB_PATH, QT_INC_PATH
|
|
|
|
#
|
2006-05-15 20:35:01 +00:00
|
|
|
if env.has_key('qt_dir') and env['qt_dir']:
|
2006-05-11 21:28:13 +00:00
|
|
|
env['QTDIR'] = env['qt_dir']
|
2006-05-07 22:44:54 +00:00
|
|
|
# add path to the qt tools
|
2006-05-11 21:28:13 +00:00
|
|
|
env.AppendUnique(LIBPATH = [os.path.join(env['qt_dir'], 'lib')])
|
2006-05-07 22:44:54 +00:00
|
|
|
# set environment so that moc etc can be found even if its path is not set properly
|
2006-05-11 21:28:13 +00:00
|
|
|
env.PrependENVPath('PATH', os.path.join(env['qt_dir'], 'bin'))
|
2006-05-07 22:44:54 +00:00
|
|
|
else:
|
|
|
|
env['QTDIR'] = os.environ.get('QTDIR', '/usr/lib/qt-3.3')
|
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
if env.has_key('qt_lib_path') and env['qt_lib_path']:
|
2006-05-11 21:28:13 +00:00
|
|
|
env['QT_LIB_PATH'] = env['qt_lib_path']
|
2006-05-07 22:44:54 +00:00
|
|
|
else:
|
|
|
|
env['QT_LIB_PATH'] = '$QTDIR/lib'
|
2006-05-10 05:34:20 +00:00
|
|
|
env.AppendUnique(LIBPATH = ['$QT_LIB_PATH'])
|
2006-05-07 22:44:54 +00:00
|
|
|
# qt4 seems to be using pkg_config
|
2006-05-10 05:34:20 +00:00
|
|
|
env.PrependENVPath('PKG_CONFIG_PATH', env.subst('$QT_LIB_PATH'))
|
2006-05-07 22:44:54 +00:00
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
if env.has_key('qt_inc_path') and env['qt_inc_path']:
|
2006-05-11 21:28:13 +00:00
|
|
|
env['QT_INC_PATH'] = env['qt_inc_path']
|
2006-05-07 22:44:54 +00:00
|
|
|
elif os.path.isdir(os.path.join(env.subst('$QTDIR'), 'include')):
|
|
|
|
env['QT_INC_PATH'] = '$QTDIR/include'
|
|
|
|
else: # have to guess
|
|
|
|
env['QT_INC_PATH'] = '/usr/include/$frontend/'
|
2006-05-15 20:35:01 +00:00
|
|
|
# Note that this CPPPATH is for testing only
|
|
|
|
# it will be removed before calling SConscript
|
2006-05-16 14:14:05 +00:00
|
|
|
env['CPPPATH'] = [env['QT_INC_PATH']]
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# extra_inc_path and extra_lib_path
|
|
|
|
#
|
2006-05-15 20:35:01 +00:00
|
|
|
if env.has_key('extra_inc_path') and env['extra_inc_path']:
|
2006-05-11 21:28:13 +00:00
|
|
|
env.AppendUnique(CPPPATH = [env['extra_inc_path']])
|
2006-05-15 20:35:01 +00:00
|
|
|
if env.has_key('extra_lib_path') and env['extra_lib_path']:
|
2006-05-11 21:28:13 +00:00
|
|
|
env.AppendUnique(LIBPATH = [env['extra_lib_path']])
|
2006-05-15 20:35:01 +00:00
|
|
|
if env.has_key('extra_inc_path1') and env['extra_inc_path1']:
|
2006-05-11 21:28:13 +00:00
|
|
|
env.AppendUnique(CPPPATH = [env['extra_inc_path1']])
|
2006-05-15 20:35:01 +00:00
|
|
|
if env.has_key('extra_lib_path1') and env['extra_lib_path1']:
|
2006-05-11 21:28:13 +00:00
|
|
|
env.AppendUnique(LIBPATH = [env['extra_lib_path1']])
|
2006-06-10 21:02:11 +00:00
|
|
|
if env.has_key('extra_bin_path') and env['extra_bin_path']:
|
|
|
|
# maybe only one of them is needed
|
|
|
|
os.environ['PATH'] += os.pathsep + env['extra_bin_path']
|
|
|
|
env['ENV']['PATH'] += os.pathsep + env['extra_bin_path']
|
2006-06-11 04:48:22 +00:00
|
|
|
if env.has_key('aiksaurus_path') and env['aiksaurus_path']:
|
|
|
|
env.AppendUnique(LIBPATH = [env['aiksaurus_path']])
|
2006-05-07 22:44:54 +00:00
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# under windows, scons is confused by .C/.c and uses gcc instead of
|
|
|
|
# g++. I am forcing the use of g++ here. This is expected to change
|
|
|
|
# after lyx renames all .C files to .cpp
|
|
|
|
#
|
|
|
|
# Note that this step has to be after env.Tool('mingw') step
|
|
|
|
# since env.Tool('mingw') will set env['CC'] etc.
|
|
|
|
#
|
2006-05-29 16:58:14 +00:00
|
|
|
# save the old c compiler and CCFLAGS (used by libintl)
|
|
|
|
env['C_COMPILER'] = env.subst('$CC')
|
2006-06-02 18:36:29 +00:00
|
|
|
env['C_CCFLAGS'] = env.subst('$CCFLAGS').split()
|
2006-05-29 16:58:14 +00:00
|
|
|
# if we use ms vc, the commands are fine (cl.exe and link.exe)
|
|
|
|
if not use_vc:
|
|
|
|
if env.has_key('CXX') and env['CXX']:
|
|
|
|
env['CC'] = env.subst('$CXX')
|
|
|
|
env['LINK'] = env.subst('$CXX')
|
|
|
|
else:
|
|
|
|
env['CC'] = 'g++'
|
|
|
|
env['LINK'] = 'g++'
|
|
|
|
else:
|
|
|
|
# /TP treat all source code as C++
|
|
|
|
# C4819: The file contains a character that cannot be represented
|
|
|
|
# in the current code page (number)
|
|
|
|
# C4996: foo was decleared deprecated
|
|
|
|
env.Append(CCFLAGS=['/TP', '/EHsc', '/wd4819', '/wd4996'])
|
2006-06-02 18:36:29 +00:00
|
|
|
env.Append(C_CCFLAGS=['/Dinline#', '/D__attribute__(x)#', '/Duintmax_t=UINT_MAX'])
|
2006-05-15 20:35:01 +00:00
|
|
|
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
#----------------------------------------------------------
|
2006-05-15 20:35:01 +00:00
|
|
|
# Autoconf business
|
2006-05-07 22:44:54 +00:00
|
|
|
#----------------------------------------------------------
|
|
|
|
|
|
|
|
conf = Configure(env,
|
|
|
|
custom_tests = {
|
|
|
|
'CheckPkgConfig' : utils.checkPkgConfig,
|
|
|
|
'CheckPackage' : utils.checkPackage,
|
|
|
|
'CheckMkdirOneArg' : utils.checkMkdirOneArg,
|
|
|
|
'CheckSelectArgType' : utils.checkSelectArgType,
|
|
|
|
'CheckBoostLibraries' : utils.checkBoostLibraries,
|
2006-05-20 15:59:56 +00:00
|
|
|
'CheckCommand' : utils.checkCommand,
|
2006-05-29 16:58:14 +00:00
|
|
|
'CheckCXXGlobalCstd' : utils.checkCXXGlobalCstd,
|
2006-06-09 15:57:13 +00:00
|
|
|
'CheckLC_MESSAGES' : utils.checkLC_MESSAGES,
|
|
|
|
'CheckIconvConst' : utils.checkIconvConst,
|
2006-05-07 22:44:54 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2006-06-09 15:57:13 +00:00
|
|
|
|
2006-05-07 22:44:54 +00:00
|
|
|
# pkg-config? (if not, we use hard-coded options)
|
2006-05-15 20:35:01 +00:00
|
|
|
if not fast_start:
|
|
|
|
if conf.CheckPkgConfig('0.15.0'):
|
|
|
|
env['HAS_PKG_CONFIG'] = True
|
|
|
|
else:
|
|
|
|
print 'pkg-config >= 0.1.50 is not found'
|
|
|
|
env['HAS_PKG_CONFIG'] = False
|
|
|
|
env_cache['HAS_PKG_CONFIG'] = env['HAS_PKG_CONFIG']
|
2006-05-07 22:44:54 +00:00
|
|
|
else:
|
2006-05-15 20:35:01 +00:00
|
|
|
env['HAS_PKG_CONFIG'] = env_cache['HAS_PKG_CONFIG']
|
2006-05-07 22:44:54 +00:00
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
# zlib? This is required. (fast_start assumes the existance of zlib)
|
2006-06-01 03:01:46 +00:00
|
|
|
if not fast_start:
|
|
|
|
if (not use_vc and not conf.CheckLibWithHeader('z', 'zlib.h', 'C')) \
|
|
|
|
or (use_vc and not conf.CheckLibWithHeader('zdll', 'zlib.h', 'C')):
|
|
|
|
print 'Did not find zdll.lib or zlib.h, exiting!'
|
2006-05-15 20:35:01 +00:00
|
|
|
Exit(1)
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
# qt libraries?
|
2006-05-15 20:35:01 +00:00
|
|
|
if not fast_start:
|
|
|
|
#
|
|
|
|
# qt3 does not use pkg_config
|
2006-06-13 14:16:54 +00:00
|
|
|
if frontend in ['qt2', 'qt3']:
|
2006-05-15 20:35:01 +00:00
|
|
|
if not conf.CheckLibWithHeader('qt-mt', 'qapp.h', 'c++', 'QApplication qapp();'):
|
|
|
|
print 'Did not find qt libraries, exiting!'
|
|
|
|
Exit(1)
|
|
|
|
elif frontend == 'qt4':
|
|
|
|
succ = False
|
|
|
|
# first: try pkg_config
|
|
|
|
if env['HAS_PKG_CONFIG']:
|
|
|
|
succ = conf.CheckPackage('QtCore') or conf.CheckPackage('QtCore4')
|
|
|
|
env['QT4_PKG_CONFIG'] = succ
|
|
|
|
# second: try to link to it
|
|
|
|
if not succ:
|
|
|
|
# FIXME: under linux, I can test the following perfectly
|
|
|
|
# However, under windows, lib names need to passed as libXXX4.a ...
|
|
|
|
succ = conf.CheckLibWithHeader('QtCore', 'QtGui/QApplication', 'c++', 'QApplication qapp();') or \
|
|
|
|
conf.CheckLibWithHeader('QtCore4', 'QtGui/QApplication', 'c++', 'QApplication qapp();')
|
|
|
|
# third: try to look up the path
|
|
|
|
if not succ:
|
|
|
|
succ = True
|
|
|
|
for lib in ['QtCore', 'QtGui']:
|
|
|
|
# windows version has something like QtGui4 ...
|
|
|
|
if not (os.path.isfile(os.path.join(env.subst('$QT_LIB_PATH'), 'lib%s.a' % lib)) or \
|
|
|
|
os.path.isfile(os.path.join(env.subst('$QT_LIB_PATH'), 'lib%s4.a' % lib))):
|
|
|
|
succ = False
|
|
|
|
break
|
|
|
|
# still can not find it
|
|
|
|
if succ:
|
|
|
|
print "Qt4 libraries are found."
|
|
|
|
else:
|
|
|
|
print 'Did not find qt libraries, exiting!'
|
|
|
|
Exit(1)
|
|
|
|
|
2006-06-02 18:36:29 +00:00
|
|
|
# now, if msvc2005 is used, we will need that QT_LIB_PATH/QT_LIB.manifest file
|
|
|
|
if use_vc:
|
|
|
|
# glob file xxx.dll.manifest (msvc 2003 may not have it)
|
|
|
|
manifests = glob.glob(os.path.join(env.subst('$QT_LIB_PATH'), '*.dll.manifest'))
|
|
|
|
if manifests != []:
|
|
|
|
env['LINKCOM'] = [env['LINKCOM'], 'mt.exe /MANIFEST %s /outputresource:$TARGET;1' % manifests[0]]
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# check socket libs
|
|
|
|
if not fast_start:
|
|
|
|
env['SOCKET_LIBS'] = []
|
|
|
|
if conf.CheckLib('socket'):
|
|
|
|
env['SOCKET_LIBS'].append('socket')
|
|
|
|
|
|
|
|
# nsl is the network services library and provides a
|
|
|
|
# transport-level interface to networking services.
|
|
|
|
if conf.CheckLib('nsl'):
|
|
|
|
env['SOCKET_LIBS'].append('nsl')
|
|
|
|
|
|
|
|
env_cache['SOCKET_LIBS'] = env['SOCKET_LIBS']
|
|
|
|
else:
|
|
|
|
env['SOCKET_LIBS'] = env_cache['SOCKET_LIBS']
|
|
|
|
|
|
|
|
if not fast_start:
|
|
|
|
# check boost libraries
|
|
|
|
boost_opt = ARGUMENTS.get('boost', default_boost_opt)
|
|
|
|
# check for system boost
|
2006-06-13 14:16:54 +00:00
|
|
|
paths = env['LIBPATH'] + ['/usr/lib', '/usr/local/lib']
|
|
|
|
env['BOOST_LIBRARIES'] = []
|
2006-06-11 04:48:22 +00:00
|
|
|
boost_libpath = None
|
2006-06-13 14:16:54 +00:00
|
|
|
# here I assume that all libraries are in the same directory
|
|
|
|
for lib in ['signals', 'regex', 'filesystem', 'iostreams']:
|
|
|
|
# lyx1.4 does not use iostreams
|
|
|
|
if not os.path.isdir(os.path.join(env.subst('$TOP_SRC_DIR'), 'boost', 'libs', lib)):
|
|
|
|
continue
|
|
|
|
if boost_opt == 'included':
|
|
|
|
env['BOOST_LIBRARIES'].append('included_boost_%s' % lib)
|
|
|
|
env['INCLUDED_BOOST'] = True
|
|
|
|
elif boost_opt == 'auto':
|
|
|
|
res = conf.CheckBoostLibraries('boost_%s' % lib , paths)
|
|
|
|
# if not found
|
|
|
|
if res[0] == '':
|
|
|
|
env['BOOST_LIBRARIES'].append('included_boost_%s' % lib)
|
|
|
|
env['INCLUDED_BOOST'] = True
|
|
|
|
else:
|
|
|
|
env['BOOST_LIBRARIES'].append(res[1])
|
|
|
|
env['INCLUDED_BOOST'] = False
|
|
|
|
boost_libpath = res[0]
|
|
|
|
elif boost_opt == 'system':
|
|
|
|
res = conf.CheckBoostLibraries('boost_%s' % lib , paths)
|
|
|
|
if res[0] == '':
|
2006-05-15 20:35:01 +00:00
|
|
|
print "Can not find system boost libraries"
|
|
|
|
print "Please supply a path through extra_lib_path and try again."
|
|
|
|
print "Or use boost=included to use included boost libraries."
|
|
|
|
Exit(2)
|
2006-06-13 14:16:54 +00:00
|
|
|
else:
|
|
|
|
env['BOOST_LIBRARIES'].append(res[1])
|
|
|
|
env.AppendUnique(LIBPATH = [res[0]])
|
|
|
|
boost_libpath = res[0]
|
2006-05-15 20:35:01 +00:00
|
|
|
env_cache['BOOST_LIBRARIES'] = env['BOOST_LIBRARIES']
|
|
|
|
env_cache['INCLUDED_BOOST'] = env['INCLUDED_BOOST']
|
2006-06-11 04:48:22 +00:00
|
|
|
env_cache['BOOST_LIBPATH'] = boost_libpath
|
2006-05-15 20:35:01 +00:00
|
|
|
else:
|
|
|
|
env['BOOST_LIBRARIES'] = env_cache['BOOST_LIBRARIES']
|
2006-06-11 04:48:22 +00:00
|
|
|
if env_cache['BOOST_LIBPATH'] is not None:
|
|
|
|
env.AppendUnique(LIBPATH = [env_cache['BOOST_LIBPATH']])
|
2006-05-15 20:35:01 +00:00
|
|
|
env['INCLUDED_BOOST'] = env_cache['INCLUDED_BOOST']
|
2006-05-07 22:44:54 +00:00
|
|
|
|
2006-05-20 15:59:56 +00:00
|
|
|
|
2006-05-29 14:59:20 +00:00
|
|
|
env['ENABLE_NLS'] = not env.has_key('nls') or env['nls']
|
2006-05-20 15:59:56 +00:00
|
|
|
|
|
|
|
if not fast_start:
|
|
|
|
if not env['ENABLE_NLS']:
|
2006-05-21 15:50:55 +00:00
|
|
|
env['INTL_LIBS'] = []
|
2006-05-20 15:59:56 +00:00
|
|
|
env['INCLUDED_GETTEXT'] = False
|
|
|
|
else:
|
|
|
|
# check gettext libraries
|
|
|
|
gettext_opt = ARGUMENTS.get('gettext', default_gettext_opt)
|
|
|
|
# check for system gettext
|
|
|
|
succ = False
|
|
|
|
if gettext_opt in ['auto', 'system']:
|
|
|
|
if conf.CheckLib('intl'):
|
|
|
|
env['INCLUDED_GETTEXT'] = False
|
2006-05-21 15:50:55 +00:00
|
|
|
env['INTL_LIBS'] = ['intl']
|
2006-05-20 15:59:56 +00:00
|
|
|
succ = True
|
|
|
|
else: # no found
|
|
|
|
if gettext_opt == 'system':
|
|
|
|
print "Can not find system gettext library"
|
|
|
|
print "Please supply a path through extra_lib_path and try again."
|
|
|
|
print "Or use gettext=included to use included gettext libraries."
|
|
|
|
Exit(2)
|
|
|
|
# now, auto and succ = false, or gettext=included
|
|
|
|
if not succ:
|
|
|
|
# we do not need to set LIBPATH now.
|
|
|
|
env['INCLUDED_GETTEXT'] = True
|
2006-05-21 15:50:55 +00:00
|
|
|
env['INTL_LIBS'] = ['included_intl']
|
2006-05-20 15:59:56 +00:00
|
|
|
env_cache['INCLUDED_GETTEXT'] = env['INCLUDED_GETTEXT']
|
2006-05-21 15:50:55 +00:00
|
|
|
env_cache['INTL_LIBS'] = env['INTL_LIBS']
|
2006-05-20 15:59:56 +00:00
|
|
|
else:
|
2006-05-21 15:50:55 +00:00
|
|
|
env['INTL_LIBS'] = env_cache['INTL_LIBS']
|
2006-05-20 15:59:56 +00:00
|
|
|
env['INCLUDED_GETTEXT'] = env_cache['INCLUDED_GETTEXT']
|
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
#
|
|
|
|
# check for msgfmt command
|
|
|
|
if not fast_start:
|
2006-05-20 15:59:56 +00:00
|
|
|
env['MSGFMT'] = conf.CheckCommand('msgfmt')
|
2006-05-15 20:35:01 +00:00
|
|
|
env_cache['MSGFMT'] = env['MSGFMT']
|
|
|
|
else:
|
|
|
|
env['MSGFMT'] = env_cache['MSGFMT']
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
#----------------------------------------------------------
|
|
|
|
# Generating config.h
|
|
|
|
#----------------------------------------------------------
|
|
|
|
if not fast_start:
|
|
|
|
print "Generating ", utils.config_h, "..."
|
|
|
|
|
|
|
|
# I do not handle all macros in src/config.h.in, rather I am following a list
|
|
|
|
# of *used-by-lyx* macros compiled by Abdelrazak Younes <younes.a@free.fr>
|
|
|
|
#
|
|
|
|
# Note: addToConfig etc are defined in scons_util
|
2006-05-25 23:33:39 +00:00
|
|
|
utils.startConfigH()
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# HAVE_IO_H
|
|
|
|
# HAVE_LIMITS_H
|
|
|
|
# HAVE_LOCALE_H
|
|
|
|
# HAVE_LOCALE
|
|
|
|
# HAVE_PROCESS_H
|
|
|
|
# HAVE_STDLIB_H
|
|
|
|
# HAVE_SYS_STAT_H
|
|
|
|
# HAVE_SYS_TIME_H
|
|
|
|
# HAVE_SYS_TYPES_H
|
|
|
|
# HAVE_SYS_UTIME_H
|
|
|
|
# HAVE_UNISTD_H
|
|
|
|
# HAVE_UTIME_H
|
2006-05-23 00:27:05 +00:00
|
|
|
# HAVE_STRINGS_H
|
2006-05-29 16:58:14 +00:00
|
|
|
# HAVE_DIRECT_H
|
2006-05-15 20:35:01 +00:00
|
|
|
# HAVE_ISTREAM
|
|
|
|
# HAVE_OSTREAM
|
|
|
|
# HAVE_IOS
|
|
|
|
|
2006-05-25 23:33:39 +00:00
|
|
|
# for libintl % grep HAVE * | grep _H | cut -d: -f2 | sort -u
|
|
|
|
|
|
|
|
#
|
|
|
|
# HAVE_INTTYPES_H
|
|
|
|
# HAVE_STDINT_H
|
|
|
|
# HAVE_ALLOCA_H
|
|
|
|
# HAVE_STDLIB_H
|
|
|
|
# HAVE_STRING_H
|
|
|
|
# HAVE_STDDEF_H
|
|
|
|
# HAVE_LIMITS_H
|
|
|
|
# HAVE_ARGZ_H
|
|
|
|
# HAVE_UNISTD_H
|
|
|
|
# HAVE_SYS_PARAM_H
|
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
# Check header files
|
|
|
|
headers = [
|
|
|
|
('io.h', 'HAVE_IO_H', 'c'),
|
|
|
|
('limits.h', 'HAVE_LIMITS_H', 'c'),
|
|
|
|
('locale.h', 'HAVE_LOCALE_H', 'c'),
|
|
|
|
('locale', 'HAVE_LOCALE', 'cxx'),
|
|
|
|
('process.h', 'HAVE_PROCESS_H', 'c'),
|
|
|
|
('stdlib.h', 'HAVE_STDLIB_H', 'c'),
|
|
|
|
('sys/stat.h', 'HAVE_SYS_STAT_H', 'c'),
|
|
|
|
('sys/time.h', 'HAVE_SYS_TIME_H', 'c'),
|
|
|
|
('sys/types.h', 'HAVE_SYS_TYPES_H', 'c'),
|
|
|
|
('sys/utime.h', 'HAVE_SYS_UTIME_H', 'c'),
|
|
|
|
('sys/socket.h', 'HAVE_SYS_SOCKET_H', 'c'),
|
|
|
|
('unistd.h', 'HAVE_UNISTD_H', 'c'),
|
2006-05-20 15:59:56 +00:00
|
|
|
('inttypes.h', 'HAVE_INTTYPES_H', 'c'),
|
2006-05-15 20:35:01 +00:00
|
|
|
('utime.h', 'HAVE_UTIME_H', 'c'),
|
2006-05-23 00:27:05 +00:00
|
|
|
('string.h', 'HAVE_STRING_H', 'c'),
|
|
|
|
('strings.h', 'HAVE_STRINGS_H', 'c'),
|
2006-05-29 16:58:14 +00:00
|
|
|
('direct.h', 'HAVE_DIRECT_H', 'c'),
|
2006-05-15 20:35:01 +00:00
|
|
|
('istream', 'HAVE_ISTREAM', 'cxx'),
|
|
|
|
('ostream', 'HAVE_OSTREAM', 'cxx'),
|
2006-05-23 00:27:05 +00:00
|
|
|
('ios', 'HAVE_IOS', 'cxx'),
|
2006-05-25 23:33:39 +00:00
|
|
|
('argz.h', 'HAVE_ARGZ_H', 'c'),
|
|
|
|
('limits.h', 'HAVE_LIMITS_H', 'c'),
|
|
|
|
('alloca.h', 'HAVE_ALLOCA_H', 'c'),
|
|
|
|
('stddef.h', 'HAVE_STDDEF_H', 'c'),
|
|
|
|
('stdint.h', 'HAVE_STDINT_H', 'c'),
|
2006-06-13 14:16:54 +00:00
|
|
|
('sys/param.h', 'HAVE_SYS_PARAM_H', 'c'),
|
2006-05-15 20:35:01 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
for header in headers:
|
2006-06-10 02:21:28 +00:00
|
|
|
description = "Define to 1 if you have the <%s> header file." % header[0]
|
2006-05-15 20:35:01 +00:00
|
|
|
if (header[2] == 'c' and conf.CheckCHeader(header[0])) or \
|
|
|
|
(header[2] == 'cxx' and conf.CheckCXXHeader(header[0])):
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define %s 1' % header[1], desc = description)
|
2006-05-15 20:35:01 +00:00
|
|
|
else:
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('/* #undef %s */' % header[1], desc = description)
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# HAVE_OPEN
|
|
|
|
# HAVE_CLOSE
|
|
|
|
# HAVE_POPEN
|
|
|
|
# HAVE_PCLOSE
|
|
|
|
# HAVE__OPEN
|
|
|
|
# HAVE__CLOSE
|
|
|
|
# HAVE__POPEN
|
|
|
|
# HAVE__PCLOSE
|
|
|
|
# HAVE_GETPID
|
|
|
|
# HAVE__GETPID
|
|
|
|
# HAVE_MKDIR
|
|
|
|
# HAVE__MKDIR
|
2006-05-20 15:59:56 +00:00
|
|
|
# HAVE_PUTENV
|
2006-05-15 20:35:01 +00:00
|
|
|
# HAVE_MKTEMP
|
|
|
|
# HAVE_MKSTEMP
|
|
|
|
# HAVE_STRERROR
|
2006-05-20 15:59:56 +00:00
|
|
|
# HAVE_STD_COUNT
|
2006-05-21 15:50:55 +00:00
|
|
|
# HAVE_GETCWD
|
2006-05-23 00:27:05 +00:00
|
|
|
# HAVE_STRCPY
|
|
|
|
# HAVE_STRCASECMP
|
|
|
|
# HAVE_STRDUP
|
|
|
|
# HAVE_STRTOUL
|
2006-05-25 23:33:39 +00:00
|
|
|
# HAVE_WCSLEN
|
|
|
|
# HAVE_MMAP ?
|
|
|
|
# HAVE_ALLOCA
|
|
|
|
# HAVE___FSETLOCKING
|
|
|
|
# HAVE_MEMPCPY
|
|
|
|
# HAVE_STRCASECMP
|
|
|
|
# HAVE___ARGZ_COUNT
|
|
|
|
# HAVE___ARGZ_NEXT
|
|
|
|
# HAVE___ARGZ_STRINGIFY
|
|
|
|
# HAVE___FSETLOCKING
|
|
|
|
# HAVE_GETCWD
|
|
|
|
# HAVE_STRTOUL
|
|
|
|
# HAVE_STRCASECMP
|
|
|
|
# HAVE_STRDUP
|
|
|
|
# HAVE_TSEARCH
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# Check functions
|
|
|
|
functions = [
|
2006-05-20 15:59:56 +00:00
|
|
|
('open', 'HAVE_OPEN', None),
|
|
|
|
('close', 'HAVE_CLOSE', None),
|
|
|
|
('popen', 'HAVE_POPEN', None),
|
|
|
|
('pclose', 'HAVE_PCLOSE', None),
|
|
|
|
('_open', 'HAVE__OPEN', None),
|
|
|
|
('_close', 'HAVE__CLOSE', None),
|
|
|
|
('_popen', 'HAVE__POPEN', None),
|
|
|
|
('_pclose', 'HAVE__PCLOSE', None),
|
|
|
|
('getpid', 'HAVE_GETPID', None),
|
|
|
|
('_getpid', 'HAVE__GETPID', None),
|
|
|
|
('mkdir', 'HAVE_MKDIR', None),
|
|
|
|
('_mkdir', 'HAVE__MKDIR', None),
|
|
|
|
('putenv', 'HAVE_PUTENV', None),
|
|
|
|
('mktemp', 'HAVE_MKTEMP', None),
|
|
|
|
('mkstemp', 'HAVE_MKSTEMP', None),
|
|
|
|
('strerror', 'HAVE_STRERROR', None),
|
|
|
|
('count', 'HAVE_STD_COUNT', '''
|
|
|
|
#include <algorithm>
|
|
|
|
int count()
|
|
|
|
{
|
|
|
|
char a[] = "hello";
|
|
|
|
return std::count(a, a+5, 'l');
|
|
|
|
}
|
2006-05-21 15:50:55 +00:00
|
|
|
'''),
|
|
|
|
('getcwd', 'HAVE_GETCWD', None),
|
2006-05-23 00:27:05 +00:00
|
|
|
('stpcpy', 'HAVE_STPCPY', None),
|
|
|
|
('strcasecmp', 'HAVE_STRCASECMP', None),
|
|
|
|
('strdup', 'HAVE_STRDUP', None),
|
2006-05-25 23:33:39 +00:00
|
|
|
('strtoul', 'HAVE_STRTOUL', None),
|
|
|
|
('alloca', 'HAVE_ALLOCA', None),
|
|
|
|
('__fsetlocking', 'HAVE___FSETLOCKING', None),
|
|
|
|
('mempcpy', 'HAVE_MEMPCPY', None),
|
|
|
|
('__argz_count', 'HAVE___ARGZ_COUNT', None),
|
|
|
|
('__argz_next', 'HAVE___ARGZ_NEXT', None),
|
|
|
|
('__argz_stringify', 'HAVE___ARGZ_STRINGIFY', None),
|
|
|
|
('setlocale', 'HAVE_SETLOCALE', None),
|
|
|
|
('tsearch', 'HAVE_TSEARCH', None),
|
|
|
|
('getegid', 'HAVE_GETEGID', None),
|
|
|
|
('getgid', 'HAVE_GETGID', None),
|
|
|
|
('getuid', 'HAVE_GETUID', None),
|
|
|
|
('wcslen', 'HAVE_WCSLEN', None)
|
2006-05-15 20:35:01 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
for func in functions:
|
2006-06-10 02:21:28 +00:00
|
|
|
description = "Define to 1 if you have the `%s' function." % func[0]
|
2006-05-20 15:59:56 +00:00
|
|
|
if conf.CheckFunc(func[0], header=func[2]):
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define %s 1' % func[1], desc = description)
|
2006-05-20 15:59:56 +00:00
|
|
|
else:
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('/* #undef %s */' % func[1], desc = description)
|
2006-05-20 15:59:56 +00:00
|
|
|
|
2006-06-09 15:57:13 +00:00
|
|
|
|
|
|
|
# HAVE_ASPRINTF
|
|
|
|
# HAVE_WPRINTF
|
|
|
|
# HAVE_SNPRINTF
|
|
|
|
# HAVE_POSIX_PRINTF
|
|
|
|
# HAVE_FCNTL
|
|
|
|
|
2006-05-20 15:59:56 +00:00
|
|
|
env_functions = [
|
|
|
|
('asprintf', 'HAVE_ASPRINTF'),
|
|
|
|
('wprintf', 'HAVE_WPRINTF'),
|
|
|
|
('snprintf', 'HAVE_SNPRINTF'),
|
|
|
|
('printf', 'HAVE_POSIX_PRINTF'),
|
|
|
|
('fcntl', 'HAVE_FCNTL')
|
|
|
|
]
|
|
|
|
|
|
|
|
for func in env_functions:
|
2006-06-10 02:21:28 +00:00
|
|
|
description = "Define to 1 if you have the `%s' function." % func[0]
|
2006-05-15 20:35:01 +00:00
|
|
|
if conf.CheckFunc(func[0]):
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define %s 1' % func[1], desc = description)
|
2006-05-20 15:59:56 +00:00
|
|
|
env[func[1]] = 1
|
2006-05-15 20:35:01 +00:00
|
|
|
else:
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('/* #undef %s */' % func[1], desc = description)
|
2006-05-20 15:59:56 +00:00
|
|
|
env[func[1]] = 0
|
2006-05-15 20:35:01 +00:00
|
|
|
|
2006-05-20 15:59:56 +00:00
|
|
|
# HAVE_INTMAX_T
|
|
|
|
# HAVE_DECL_ISTREAMBUF_ITERATOR
|
2006-06-10 02:21:28 +00:00
|
|
|
description = "Define to 1 if you have the `intmax_t' type."
|
2006-05-20 15:59:56 +00:00
|
|
|
if conf.CheckType('intmax_t', includes='#include <stdint.h>') or \
|
|
|
|
conf.CheckType('intmax_t', includes='#include <inttypes.h>'):
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define HAVE_INTMAX_T 1', desc = description)
|
2006-05-17 04:07:45 +00:00
|
|
|
else:
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('/* #undef HAVE_INTMAX_T */',desc = description)
|
2006-05-17 04:07:45 +00:00
|
|
|
|
2006-05-25 23:33:39 +00:00
|
|
|
# HAVE_INTMAX_T
|
|
|
|
# HAVE_LONG_DOUBLE
|
|
|
|
# HAVE_LONG_LONG
|
|
|
|
# HAVE_WCHAR_T
|
|
|
|
# HAVE_WINT_T
|
|
|
|
# HAVE_INTTYPES_H_WITH_UINTMAX
|
2006-06-02 18:36:29 +00:00
|
|
|
# HAVE_STDINT_H_WITH_UINTMAX
|
2006-06-09 15:57:13 +00:00
|
|
|
|
2006-05-25 23:33:39 +00:00
|
|
|
types = [
|
|
|
|
('intmax_t', 'HAVE_INTMAX_T', None),
|
|
|
|
('long double', 'HAVE_LONG_DOUBLE', None),
|
|
|
|
('long long', 'HAVE_LONG_LONG', None),
|
|
|
|
('wchar_t', 'HAVE_WCHAR_T', None),
|
|
|
|
('wint_t', 'HAVE_WINT_T', None),
|
|
|
|
('uintmax_t', 'HAVE_INTTYPES_H_WITH_UINTMAX', '#include <inttypes.h>'),
|
2006-06-02 18:36:29 +00:00
|
|
|
('uintmax_t', 'HAVE_STDINT_H_WITH_UINTMAX', '#include <stdint.h>'),
|
2006-05-25 23:33:39 +00:00
|
|
|
('std::istreambuf_iterator<std::istream>', 'HAVE_DECL_ISTREAMBUF_ITERATOR',
|
|
|
|
'#include <streambuf>\n#include <istream>')
|
|
|
|
]
|
|
|
|
for t in types:
|
2006-06-10 02:21:28 +00:00
|
|
|
description = "Define to 1 if you have the `%s' type." % t[0]
|
2006-05-25 23:33:39 +00:00
|
|
|
if conf.CheckType(t[0], includes=t[2]):
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define %s 1' % t[1], desc = description)
|
2006-05-25 23:33:39 +00:00
|
|
|
else:
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('/* #undef %s */' % t[1], desc = description)
|
2006-05-29 16:58:14 +00:00
|
|
|
|
|
|
|
# windows/msvc sys/types.h does not have pid_t
|
|
|
|
# FIXME: #include <windows.h> is the right way?
|
|
|
|
if not conf.CheckType('pid_t', includes='#include <sys/types.h>'):
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define pid_t int', desc = 'Define is sys/types.h does not have pid_t')
|
2006-06-09 15:57:13 +00:00
|
|
|
|
2006-05-29 16:58:14 +00:00
|
|
|
# determine the use of std::tolower or tolower
|
2006-06-10 02:21:28 +00:00
|
|
|
description = 'Define if your C++ compiler puts C library functions in the global namespace'
|
2006-05-29 16:58:14 +00:00
|
|
|
if conf.CheckCXXGlobalCstd():
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define CXX_GLOBAL_CSTD 1', desc = description)
|
2006-05-29 16:58:14 +00:00
|
|
|
else:
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('/* #undef CXX_GLOBAL_CSTD */', desc = description)
|
2006-05-29 16:58:14 +00:00
|
|
|
|
2006-06-09 15:57:13 +00:00
|
|
|
# HAVE_LIBGDI32
|
|
|
|
# HAVE_ICONV
|
|
|
|
# HAVE_LIBC
|
2006-06-10 02:21:28 +00:00
|
|
|
# HAVE_LIBAIKSAURUS
|
2006-06-09 15:57:13 +00:00
|
|
|
libs = [
|
|
|
|
('gdi32', 'HAVE_LIBGDI32'),
|
|
|
|
('iconv', 'HAVE_ICONV'),
|
2006-06-10 02:21:28 +00:00
|
|
|
('c', 'HAVE_LIBC'),
|
|
|
|
('Aiksaurus', 'HAVE_LIBAIKSAURUS'),
|
2006-06-09 15:57:13 +00:00
|
|
|
]
|
|
|
|
for lib in libs:
|
2006-06-10 02:21:28 +00:00
|
|
|
description = "Define to 1 if you have the `%s' library (-l%s)." % (lib[0], lib[0])
|
2006-06-09 15:57:13 +00:00
|
|
|
if conf.CheckLib(lib[0]):
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define %s 1' % lib[1], desc = description)
|
2006-06-09 15:57:13 +00:00
|
|
|
env[lib[1]] = True
|
|
|
|
else:
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('/* #undef %s */' % lib[1], desc = description)
|
2006-06-09 15:57:13 +00:00
|
|
|
env[lib[1]] = False
|
|
|
|
|
|
|
|
# HAVE_LC_MESSAGES
|
2006-06-10 02:21:28 +00:00
|
|
|
description = 'Define if your <locale.h> file defines LC_MESSAGES.'
|
2006-06-09 15:57:13 +00:00
|
|
|
if conf.CheckLC_MESSAGES():
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define HAVE_LC_MESSAGES 1', desc = description)
|
2006-06-09 15:57:13 +00:00
|
|
|
else:
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('/* #undef HAVE_LC_MESSAGES */', desc = description)
|
2006-06-09 15:57:13 +00:00
|
|
|
|
|
|
|
# ICONV_CONST
|
2006-06-10 02:21:28 +00:00
|
|
|
description = 'Define as const if the declaration of iconv() needs const.'
|
2006-06-09 15:57:13 +00:00
|
|
|
if conf.CheckIconvConst():
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define ICONV_CONST', desc = description)
|
2006-06-09 15:57:13 +00:00
|
|
|
else:
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('/* #undef ICONV_CONST */', desc = description)
|
2006-06-09 15:57:13 +00:00
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
# PACKAGE
|
|
|
|
# PACKAGE_VERSION
|
2006-06-09 17:11:15 +00:00
|
|
|
# PACKAGE_BUGREPORT
|
|
|
|
# PACKAGE_NAME
|
|
|
|
# PACKAGE_STRING
|
2006-05-15 20:35:01 +00:00
|
|
|
# DEVEL_VERSION
|
2006-06-09 17:11:15 +00:00
|
|
|
utils.addToConfig('#define PACKAGE "%s%s"' % (PACKAGE, env['PROGRAM_SUFFIX']),
|
2006-06-10 02:21:28 +00:00
|
|
|
desc = "Name of package")
|
2006-06-09 17:11:15 +00:00
|
|
|
|
|
|
|
utils.addToConfig('#define PACKAGE_BUGREPORT "%s"' % PACKAGE_BUGREPORT,
|
2006-06-10 02:21:28 +00:00
|
|
|
desc = 'Define to the address where bug reports for this package should be sent.')
|
2006-06-09 17:11:15 +00:00
|
|
|
|
|
|
|
utils.addToConfig('#define PACKAGE_NAME "%s"' % PACKAGE_NAME,
|
2006-06-10 02:21:28 +00:00
|
|
|
desc = 'Define to the full name of this package.')
|
2006-06-09 17:11:15 +00:00
|
|
|
|
|
|
|
utils.addToConfig('#define PACKAGE_STRING "%s"' % PACKAGE_STRING,
|
2006-06-10 02:21:28 +00:00
|
|
|
desc = "Define to the full name and version of this package.")
|
2006-06-09 17:11:15 +00:00
|
|
|
|
|
|
|
utils.addToConfig('#define PACKAGE_TARNAME "%s"' % PACKAGE_TARNAME,
|
2006-06-10 02:21:28 +00:00
|
|
|
desc = "Define to the one symbol short name of this package.")
|
2006-06-09 17:11:15 +00:00
|
|
|
|
|
|
|
utils.addToConfig('#define PACKAGE_VERSION "%s"' % PACKAGE_VERSION,
|
2006-06-10 02:21:28 +00:00
|
|
|
desc = "Define to the version of this package.")
|
2006-06-09 17:11:15 +00:00
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
if DEVEL_VERSION:
|
2006-05-25 23:33:39 +00:00
|
|
|
utils.addToConfig('#define DEVEL_VERSION 1')
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# ENABLE_ASSERTIONS
|
|
|
|
# ENABLE_NLS
|
|
|
|
# WITH_WARNINGS
|
|
|
|
# _GLIBCXX_CONCEPT_CHECKS
|
|
|
|
|
|
|
|
# items are (ENV, ARGUMENTS)
|
|
|
|
values = [
|
2006-06-10 02:21:28 +00:00
|
|
|
('ENABLE_ASSERTIONS', 'assertions', 'Define if you want assertions to be enabled in the code'),
|
|
|
|
('ENABLE_NLS', 'nls', "Define to 1 if translation of program messages to the user's native anguage is requested."),
|
|
|
|
('WITH_WARNINGS', 'warnings', 'Define this if you want to see the warning directives put here and there by the developpers to get attention'),
|
|
|
|
('_GLIBCXX_CONCEPT_CHECKS', 'concept_checks', 'libstdc++ concept checking'),
|
2006-05-15 20:35:01 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
for val in values:
|
|
|
|
if (env.has_key(val[0]) and env[val[0]]) or \
|
2006-05-29 16:58:14 +00:00
|
|
|
(env.has_key(val[1]) and env[val[1]]):
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define %s 1' % val[0], desc = val[2])
|
2006-05-15 20:35:01 +00:00
|
|
|
else:
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('/* #undef %s */' % val[0], desc = val[2])
|
2006-05-15 20:35:01 +00:00
|
|
|
|
2006-05-29 16:58:14 +00:00
|
|
|
# disable automatic linking of boost libraries.
|
|
|
|
# This is an interesting feature that is supposed to be useful under
|
|
|
|
# windows but since I can not find a way to use it on all platforms,
|
|
|
|
# I disable it for now.
|
|
|
|
utils.addToConfig('#define BOOST_ALL_NO_LIB 1')
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# AIKSAURUS_H_LOCATION
|
2006-06-10 02:21:28 +00:00
|
|
|
if (conf.CheckCXXHeader("Aiksaurus.h")):
|
|
|
|
utils.addToConfig("#define AIKSAURUS_H_LOCATION <Aiksaurus.h>")
|
|
|
|
elif (conf.CheckCXXHeader("Aiksaurus/Aiksaurus.h")):
|
|
|
|
utils.addToConfig("#define AIKSAURUS_H_LOCATION <Aiksaurus/Aiksaurus.h>")
|
|
|
|
else:
|
|
|
|
utils.addToConfig("#define AIKSAURUS_H_LOCATION")
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# USE_ASPELL
|
|
|
|
# USE_PSPELL
|
|
|
|
# USE_ISPELL
|
|
|
|
|
|
|
|
# determine headers to use
|
|
|
|
spell_engine = ARGUMENTS.get('spell', 'auto')
|
|
|
|
spell_detected = False
|
|
|
|
if spell_engine in ['auto', 'aspell'] and \
|
|
|
|
conf.CheckLib('aspell'):
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define USE_ASPELL 1', desc = 'Define as 1 to use the aspell library')
|
2006-05-15 20:35:01 +00:00
|
|
|
env['USE_ASPELL'] = True
|
|
|
|
env['USE_PSPELL'] = False
|
|
|
|
env['USE_ISPELL'] = False
|
|
|
|
spell_detected = True
|
|
|
|
elif spell_engine in ['auto', 'pspell'] and \
|
|
|
|
conf.CheckLib('pspell'):
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define USE_PSPELL 1', desc = 'Define as 1 to use the pspell library')
|
2006-05-15 20:35:01 +00:00
|
|
|
env['USE_ASPELL'] = False
|
|
|
|
env['USE_PSPELL'] = True
|
|
|
|
env['USE_ISPELL'] = False
|
|
|
|
spell_detected = True
|
|
|
|
elif spell_engine in ['auto', 'ispell'] and \
|
|
|
|
conf.CheckLib('ispell'):
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define USE_ISPELL 1', desc = 'Define as 1 to use the ispell library')
|
2006-05-15 20:35:01 +00:00
|
|
|
env['USE_ASPELL'] = False
|
|
|
|
env['USE_PSPELL'] = False
|
|
|
|
env['USE_ISPELL'] = True
|
|
|
|
spell_detected = True
|
|
|
|
|
|
|
|
if not spell_detected:
|
|
|
|
env['USE_ASPELL'] = False
|
|
|
|
env['USE_PSPELL'] = False
|
|
|
|
env['USE_ISPELL'] = False
|
|
|
|
# FIXME: can lyx work without an spell engine
|
|
|
|
if spell_engine == 'auto':
|
|
|
|
print "Warning: Can not locate any spell checker"
|
|
|
|
else:
|
|
|
|
print "Warning: Can not locate specified spell checker:", spell_engine
|
|
|
|
|
|
|
|
# USE_POSIX_PACKAGING
|
|
|
|
# USE_MACOSX_PACKAGING
|
|
|
|
# USE_WINDOWS_PACKAGING
|
|
|
|
if packaging_method == 'windows':
|
2006-05-25 23:33:39 +00:00
|
|
|
utils.addToConfig('#define USE_WINDOWS_PACKAGING 1')
|
2006-05-15 20:35:01 +00:00
|
|
|
elif packaging_method == 'posix':
|
2006-05-25 23:33:39 +00:00
|
|
|
utils.addToConfig('#define USE_POSIX_PACKAGING 1')
|
2006-05-15 20:35:01 +00:00
|
|
|
elif packaging_method == 'mac':
|
2006-05-25 23:33:39 +00:00
|
|
|
utils.addToConfig('#define USE_MACOSX_PACKAGING 1')
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# BOOST_POSIX
|
|
|
|
if boost_posix:
|
2006-05-25 23:33:39 +00:00
|
|
|
utils.addToConfig('#define BOOST_POSIX 1')
|
2006-05-07 22:44:54 +00:00
|
|
|
else:
|
2006-05-25 23:33:39 +00:00
|
|
|
utils.addToConfig('/* #undef BOOST_POSIX */')
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# MKDIR_TAKES_ONE_ARG
|
2006-06-10 02:21:28 +00:00
|
|
|
description = 'Define if mkdir takes only one argument.'
|
2006-05-15 20:35:01 +00:00
|
|
|
if conf.CheckMkdirOneArg():
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define MKDIR_TAKES_ONE_ARG 1', desc = description)
|
2006-05-10 05:34:20 +00:00
|
|
|
else:
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('/* #undef MKDIR_TAKES_ONE_ARG */', desc = description)
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
# SELECT_TYPE_ARG1
|
|
|
|
# SELECT_TYPE_ARG234
|
|
|
|
# SELECT_TYPE_ARG5
|
|
|
|
(arg1, arg234, arg5) = conf.CheckSelectArgType()
|
2006-06-10 02:21:28 +00:00
|
|
|
utils.addToConfig('#define SELECT_TYPE_ARG1 %s' % arg1,
|
|
|
|
desc = "Define to the type of arg 1 for `select'.")
|
|
|
|
utils.addToConfig('#define SELECT_TYPE_ARG234 %s' % arg234,
|
|
|
|
desc = "Define to the type of arg 2, 3, 4 for `select'.")
|
|
|
|
utils.addToConfig('#define SELECT_TYPE_ARG5 %s' % arg5,
|
|
|
|
desc = "Define to the type of arg 5 for `select'.")
|
2006-05-07 22:44:54 +00:00
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
# mkstemp
|
|
|
|
# USE_BOOST_FORMAT
|
|
|
|
# WANT_GETFILEATTRIBUTESEX_WRAPPER
|
|
|
|
utils.endConfigH(TOP_SRC_DIR)
|
2006-05-07 22:44:54 +00:00
|
|
|
|
2006-06-10 02:21:28 +00:00
|
|
|
for key in ['USE_ASPELL', 'USE_PSPELL', 'USE_ISPELL', 'HAVE_ASPRINTF', \
|
|
|
|
'HAVE_WPRINTF', 'HAVE_SNPRINTF', 'HAVE_POSIX_PRINTF', 'HAVE_FCNTL', \
|
|
|
|
'HAVE_ICONV', 'HAVE_LIBGDI32', 'HAVE_LIBC', 'HAVE_LIBAIKSAURUS']:
|
|
|
|
env_cache[key] = env[key]
|
2006-05-07 22:44:54 +00:00
|
|
|
else:
|
2006-05-17 04:07:45 +00:00
|
|
|
#
|
|
|
|
# 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')
|
2006-05-15 20:35:01 +00:00
|
|
|
# only a few variables need to be rescanned
|
2006-06-10 02:21:28 +00:00
|
|
|
for key in ['USE_ASPELL', 'USE_PSPELL', 'USE_ISPELL', 'HAVE_ASPRINTF', \
|
|
|
|
'HAVE_WPRINTF', 'HAVE_SNPRINTF', 'HAVE_POSIX_PRINTF', 'HAVE_FCNTL', \
|
|
|
|
'HAVE_ICONV', 'HAVE_LIBGDI32', 'HAVE_LIBC', 'HAVE_LIBAIKSAURUS']:
|
|
|
|
env[key] = env_cache[key]
|
|
|
|
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Finish auto-configuration
|
|
|
|
env = conf.Finish()
|
|
|
|
|
|
|
|
#----------------------------------------------------------
|
2006-05-15 20:35:01 +00:00
|
|
|
# Now set up our build process accordingly
|
2006-05-07 22:44:54 +00:00
|
|
|
#----------------------------------------------------------
|
|
|
|
|
|
|
|
#
|
2006-06-10 02:21:28 +00:00
|
|
|
# QT_LIB
|
2006-05-07 22:44:54 +00:00
|
|
|
#
|
|
|
|
# NOTE: Tool('qt') or Tool('qt4') will be loaded later
|
|
|
|
# in their respective directory and specialized env.
|
|
|
|
try:
|
2006-06-13 14:16:54 +00:00
|
|
|
if frontend in ['qt2', 'qt3']:
|
2006-05-07 22:44:54 +00:00
|
|
|
# note: env.Tool('qt') my set QT_LIB to qt
|
|
|
|
env['QT_LIB'] = 'qt-mt'
|
2006-06-10 02:21:28 +00:00
|
|
|
env['FRONTEND_LIBS'] = ['qt-mt']
|
2006-05-07 22:44:54 +00:00
|
|
|
if platform_name == 'cygwin' and use_X11:
|
2006-05-10 05:34:20 +00:00
|
|
|
env.AppendUnique(LIBPATH = ['/usr/X11R6/lib'])
|
2006-05-07 22:44:54 +00:00
|
|
|
elif frontend == 'qt4':
|
2006-05-08 21:03:01 +00:00
|
|
|
if platform_name == "win32":
|
2006-05-11 11:50:08 +00:00
|
|
|
env['QT_LIB'] = ['QtCore4', 'QtGui4']
|
2006-05-08 21:03:01 +00:00
|
|
|
else:
|
2006-05-11 11:50:08 +00:00
|
|
|
env['QT_LIB'] = ['QtCore', 'QtGui']
|
2006-06-10 02:21:28 +00:00
|
|
|
env['FRONTEND_LIBS'] = env['QT_LIB']
|
2006-05-07 22:44:54 +00:00
|
|
|
except:
|
|
|
|
print "Can not locate qt tools"
|
|
|
|
print "What I get is "
|
|
|
|
print " QTDIR: ", env['QTDIR']
|
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
|
|
|
|
if platform_name in ['win32', 'cygwin']:
|
|
|
|
# the final link step needs stdc++ to succeed under mingw
|
|
|
|
# FIXME: shouldn't g++ automatically link to stdc++?
|
2006-05-29 16:58:14 +00:00
|
|
|
if use_vc:
|
2006-06-09 15:57:13 +00:00
|
|
|
env['SYSTEM_LIBS'] = ['shlwapi', 'shell32', 'advapi32', 'zdll']
|
2006-05-29 16:58:14 +00:00
|
|
|
else:
|
2006-06-01 03:01:46 +00:00
|
|
|
env['SYSTEM_LIBS'] = ['shlwapi', 'stdc++', 'z']
|
2006-06-10 02:21:28 +00:00
|
|
|
elif platform_name == 'cygwin' and use_X11:
|
|
|
|
env['SYSTEM_LIBS'] = ['GL', 'Xmu', 'Xi', 'Xrender', 'Xrandr', 'Xcursor',
|
|
|
|
'Xft', 'freetype', 'fontconfig', 'Xext', 'X11', 'SM', 'ICE', 'resolv',
|
|
|
|
'pthread', 'z']
|
2006-05-09 13:01:45 +00:00
|
|
|
else:
|
2006-05-12 14:21:30 +00:00
|
|
|
env['SYSTEM_LIBS'] = ['z']
|
2006-05-09 13:01:45 +00:00
|
|
|
|
2006-06-10 02:21:28 +00:00
|
|
|
libs = [
|
|
|
|
('HAVE_ICONV', 'iconv'),
|
|
|
|
('HAVE_LIBGDI32', 'gdi32'),
|
|
|
|
('HAVE_LIBAIKSAURUS', 'Aiksaurus'),
|
|
|
|
('USE_ASPELL', 'aspell'),
|
|
|
|
('USE_ISPELL', 'ispell'),
|
|
|
|
('USE_PSPELL', 'pspell'),
|
|
|
|
]
|
|
|
|
|
|
|
|
for lib in libs:
|
|
|
|
if env[lib[0]]:
|
|
|
|
env['SYSTEM_LIBS'].append(lib[1])
|
2006-06-09 15:57:13 +00:00
|
|
|
|
2006-05-07 22:44:54 +00:00
|
|
|
#
|
|
|
|
# Build parameters CPPPATH etc
|
|
|
|
#
|
2006-05-15 20:35:01 +00:00
|
|
|
# boost is always in, src is needed for config.h
|
|
|
|
#
|
2006-05-16 14:14:05 +00:00
|
|
|
# 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']
|
2006-05-07 22:44:54 +00:00
|
|
|
|
2006-06-09 15:57:13 +00:00
|
|
|
# add appropriate compiling options (-DNDEBUG etc)
|
2006-05-15 20:35:01 +00:00
|
|
|
# for debug/release mode
|
2006-06-10 21:02:11 +00:00
|
|
|
# /Zi: debug info
|
2006-05-07 22:44:54 +00:00
|
|
|
if ARGUMENTS.get('mode', default_build_mode) == 'debug':
|
2006-06-09 15:57:13 +00:00
|
|
|
if use_vc:
|
2006-06-10 21:02:11 +00:00
|
|
|
env.AppendUnique(CCFLAGS = ['/Zi'])
|
|
|
|
env.AppendUnique(LINKFLAGS = ['/debug', '/map'])
|
2006-06-09 15:57:13 +00:00
|
|
|
else:
|
|
|
|
env.AppendUnique(CCFLAGS = ['-Wall', '-g'])
|
2006-05-07 22:44:54 +00:00
|
|
|
else:
|
2006-06-09 15:57:13 +00:00
|
|
|
if use_vc:
|
|
|
|
env.AppendUnique(CCFLAGS = ['/O2'])
|
|
|
|
else:
|
|
|
|
env.AppendUnique(CCFLAGS = ['-Wall', '-O2'])
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Customized builders
|
|
|
|
#
|
|
|
|
# install customized builders
|
|
|
|
env['BUILDERS']['substFile'] = Builder(action = utils.env_subst)
|
|
|
|
|
|
|
|
#
|
|
|
|
# A Link script for cygwin see
|
|
|
|
# http://www.cygwin.com/ml/cygwin/2004-09/msg01101.html
|
|
|
|
# http://www.cygwin.com/ml/cygwin-apps/2004-09/msg00309.html
|
|
|
|
# for details
|
2006-05-15 20:35:01 +00:00
|
|
|
#
|
|
|
|
if platform_name == 'cygwin':
|
2006-05-07 22:44:54 +00:00
|
|
|
ld_script_path = '/usr/lib/qt3/mkspecs/cygwin-g++'
|
|
|
|
ld_script = utils.installCygwinLDScript(ld_script_path)
|
2006-05-15 20:35:01 +00:00
|
|
|
env.AppendUnique(LINKFLAGS = ['-Wl,--enable-runtime-pseudo-reloc',
|
2006-05-08 03:37:49 +00:00
|
|
|
'-Wl,--script,%s' % ld_script, '-Wl,-s'])
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Report results
|
|
|
|
#
|
|
|
|
# src/support/package.C.in needs the following to replace
|
2006-05-15 20:35:01 +00:00
|
|
|
# LYX_ABS_INSTALLED_DATADIR (e.g. /usr/local/lyx/share/lyx)
|
2006-06-09 17:11:15 +00:00
|
|
|
env['LYX_DIR'] = Dir(env['SHARE_DIR']).abspath
|
2006-05-15 20:35:01 +00:00
|
|
|
# LYX_ABS_INSTALLED_LOCALEDIR
|
2006-06-09 17:11:15 +00:00
|
|
|
env['LOCALEDIR'] = Dir(env['LOCALE_DIR']).abspath
|
|
|
|
# during variable substitution, absolute path is needed.
|
|
|
|
env['TOP_SRCDIR'] = Dir(env['TOP_SRC_DIR']).abspath
|
2006-05-07 22:44:54 +00:00
|
|
|
# needed by src/version.C.in => src/version.C
|
|
|
|
env['PACKAGE_VERSION'] = PACKAGE_VERSION
|
|
|
|
# fill in the version info
|
|
|
|
env['VERSION_INFO'] = '''Configuration
|
|
|
|
Host type: %s
|
|
|
|
Special build flags: %s
|
|
|
|
C Compiler: %s
|
|
|
|
C Compiler flags: %s %s
|
|
|
|
C++ Compiler: %s
|
|
|
|
C++ Compiler LyX flags: %s
|
|
|
|
C++ Compiler flags: %s %s
|
|
|
|
Linker flags: %s
|
|
|
|
Linker user flags: %s
|
2006-05-15 20:35:01 +00:00
|
|
|
Build info:
|
2006-05-07 22:44:54 +00:00
|
|
|
Builing directory: %s
|
|
|
|
Local library directory: %s
|
2006-06-11 04:48:22 +00:00
|
|
|
Libraries paths: %s
|
2006-05-07 22:44:54 +00:00
|
|
|
Boost libraries: %s
|
2006-06-10 02:21:28 +00:00
|
|
|
Frontend libraries: %s
|
2006-05-09 20:04:27 +00:00
|
|
|
System libraries: %s
|
2006-05-16 14:14:05 +00:00
|
|
|
include search path: %s
|
2006-05-15 20:35:01 +00:00
|
|
|
Frontend:
|
2006-05-07 22:44:54 +00:00
|
|
|
Frontend: %s
|
|
|
|
Packaging: %s
|
2006-05-16 14:14:05 +00:00
|
|
|
LyX dir: %s
|
|
|
|
LyX binary dir: %s
|
|
|
|
LyX files dir: %s
|
2006-05-15 20:35:01 +00:00
|
|
|
''' % (platform_name,
|
2006-05-07 22:44:54 +00:00
|
|
|
env.subst('$CCFLAGS'), env.subst('$CC'),
|
|
|
|
env.subst('$CPPFLAGS'), env.subst('$CFLAGS'),
|
|
|
|
env.subst('$CXX'), env.subst('$CXXFLAGS'),
|
|
|
|
env.subst('$CPPFLAGS'), env.subst('$CXXFLAGS'),
|
|
|
|
env.subst('$LINKFLAGS'), env.subst('$LINKFLAGS'),
|
|
|
|
env.subst('$BUILDDIR'), env.subst('$LOCALLIBPATH'),
|
|
|
|
str(env['LIBPATH']), str(env['BOOST_LIBRARIES']),
|
2006-06-10 02:21:28 +00:00
|
|
|
str(env['FRONTEND_LIBS']), str(env['SYSTEM_LIBS']), str(env['CPPPATH']),
|
2006-05-16 14:14:05 +00:00
|
|
|
env['frontend'], packaging_method,
|
2006-05-23 00:27:05 +00:00
|
|
|
env['PREFIX'], env['BIN_DEST_DIR'], env['SHARE_DIR'])
|
2006-05-07 22:44:54 +00:00
|
|
|
|
2006-06-13 14:16:54 +00:00
|
|
|
if env['frontend'] in ['qt2', 'qt3', 'qt4']:
|
2006-05-07 22:44:54 +00:00
|
|
|
env['VERSION_INFO'] += ''' include dir: %s
|
|
|
|
library dir: %s
|
|
|
|
X11: %s
|
|
|
|
''' % (env.subst('$QT_INC_PATH'), env.subst('$QT_LIB_PATH'), use_X11)
|
|
|
|
|
2006-05-15 20:35:01 +00:00
|
|
|
if not fast_start:
|
|
|
|
print env['VERSION_INFO']
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
#
|
2006-05-15 20:35:01 +00:00
|
|
|
# Mingw command line may be too short for our link usage,
|
2006-05-07 22:44:54 +00:00
|
|
|
# Here we use a trick from scons wiki
|
|
|
|
# http://www.scons.org/cgi-sys/cgiwrap/scons/moin.cgi/LongCmdLinesOnWin32
|
|
|
|
#
|
|
|
|
# I also would like to add logging (commands only) capacity to the
|
2006-05-15 20:35:01 +00:00
|
|
|
# spawn system.
|
|
|
|
logfile = env.get('logfile', default_log_file)
|
2006-05-07 22:44:54 +00:00
|
|
|
if logfile != '' or platform_name == 'win32':
|
|
|
|
import time
|
|
|
|
utils.setLoggedSpawn(env, logfile, longarg = (platform_name == 'win32'),
|
|
|
|
info = '''# This is a log of commands used by scons to build lyx
|
2006-05-15 20:35:01 +00:00
|
|
|
# Time: %s
|
2006-05-07 22:44:54 +00:00
|
|
|
# Command: %s
|
|
|
|
# Info: %s
|
2006-05-15 20:35:01 +00:00
|
|
|
''' % (time.asctime(), ' '.join(sys.argv),
|
2006-05-07 22:44:54 +00:00
|
|
|
env['VERSION_INFO'].replace('\n','\n# ')) )
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Cleanup stuff
|
|
|
|
#
|
|
|
|
# -h will print out help info
|
|
|
|
Help(opts.GenerateHelpText(env))
|
2006-05-15 20:35:01 +00:00
|
|
|
# save environment settings (for fast_start option)
|
|
|
|
cache_file = open(env_cache_file, 'w')
|
|
|
|
cPickle.dump(env_cache, cache_file)
|
|
|
|
cache_file.close()
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
#----------------------------------------------------------
|
|
|
|
# Start building
|
|
|
|
#----------------------------------------------------------
|
2006-05-10 21:53:31 +00:00
|
|
|
Export('env')
|
2006-05-10 17:46:02 +00:00
|
|
|
|
2006-05-16 14:14:05 +00:00
|
|
|
# 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'))
|
2006-05-15 20:35:01 +00:00
|
|
|
# this usage needs further investigation.
|
|
|
|
#env.CacheDir('%s/Cache/%s' % (env['BUILDDIR'], frontend))
|
2006-05-10 18:05:12 +00:00
|
|
|
|
2006-05-11 17:20:25 +00:00
|
|
|
env['BUILD_TARGETS'] = BUILD_TARGETS
|
2006-05-29 14:59:20 +00:00
|
|
|
if env.has_key('rebuild'):
|
|
|
|
env['REBUILD_TARGETS'] = env['rebuild'].split(',')
|
|
|
|
else:
|
|
|
|
env['REBUILD_TARGETS'] = None
|
2006-05-11 17:20:25 +00:00
|
|
|
|
2006-05-10 21:53:31 +00:00
|
|
|
print "Building all targets recursively"
|
2006-05-10 18:05:12 +00:00
|
|
|
|
2006-05-11 05:35:01 +00:00
|
|
|
env.SConscript('$SCONS_DIR/SConscript', duplicate = 0)
|
2006-05-07 22:44:54 +00:00
|
|
|
|
|
|
|
|