Scons: version_suffix windows fix

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14063 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2006-06-09 18:44:28 +00:00
parent 210dbf394f
commit c8eb10bbef
2 changed files with 23 additions and 20 deletions

View File

@ -743,31 +743,31 @@ if 'install' in targets:
# #
# executables (some of them may be none) # executables (some of them may be none)
# #
if env['ADD_SUFFIX_TO_EXECUTABLES']: if env['ADD_SUFFIX']:
program_suffix = env['PROGRAM_SUFFIX'] version_suffix = env['PROGRAM_SUFFIX']
else: else:
program_suffix = '' version_suffix = ''
# #
# install lyx # install lyx
target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx%s' % program_suffix) target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx%s' % version_suffix)
target = os.path.join(env['BIN_DEST_DIR'], target_name) target = os.path.join(env['BIN_DEST_DIR'], target_name)
env.InstallAs(target, lyx) env.InstallAs(target, lyx)
Alias('install', target) Alias('install', target)
# install lyx as lyx-qt3 # install lyx as lyx-qt3
target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx-%s%s' % (frontend, program_suffix)) target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx-%s%s' % (frontend, version_suffix))
target = os.path.join(env['BIN_DEST_DIR'], target_name) target = os.path.join(env['BIN_DEST_DIR'], target_name)
env.InstallAs(target, lyx) env.InstallAs(target, lyx)
Alias('install', target) Alias('install', target)
# #
# install tex2lyx # install tex2lyx
target_name = os.path.split(str(tex2lyx[0]))[1].replace('tex2lyx', 'tex2lyx%s' % program_suffix) target_name = os.path.split(str(tex2lyx[0]))[1].replace('tex2lyx', 'tex2lyx%s' % version_suffix)
target = os.path.join(env['BIN_DEST_DIR'], target_name) target = os.path.join(env['BIN_DEST_DIR'], target_name)
env.InstallAs(target, tex2lyx) env.InstallAs(target, tex2lyx)
Alias('install', target) Alias('install', target)
# #
# install lyxclient, may not exist # install lyxclient, may not exist
if client != None: if client != None:
target_name = os.path.split(str(client[0]))[1].replace('client', 'client%s' % program_suffix) target_name = os.path.split(str(client[0]))[1].replace('client', 'client%s' % version_suffix)
target = os.path.join(env['BIN_DEST_DIR'], target_name) target = os.path.join(env['BIN_DEST_DIR'], target_name)
env.InstallAs(target, client) env.InstallAs(target, client)
Alias('install', target) Alias('install', target)
@ -783,19 +783,19 @@ if 'install' in targets:
'$TOP_SRC_DIR/lib/lyx2lyx/lyx2lyx_version.py.in') '$TOP_SRC_DIR/lib/lyx2lyx/lyx2lyx_version.py.in')
Alias('install', dirs) Alias('install', dirs)
# man # man
env.InstallAs(os.path.join(env['MAN_DEST_DIR'], 'lyx' + env['PROGRAM_SUFFIX'] + '.1'), env.InstallAs(os.path.join(env['MAN_DEST_DIR'], 'lyx' + version_suffix + '.1'),
env.subst('$TOP_SRC_DIR/lyx.man')) env.subst('$TOP_SRC_DIR/lyx.man'))
env.InstallAs(os.path.join(env['MAN_DEST_DIR'], 'tex2lyx' + env['PROGRAM_SUFFIX'] + '.1'), env.InstallAs(os.path.join(env['MAN_DEST_DIR'], 'tex2lyx' + version_suffix + '.1'),
env.subst('$TOP_SRC_DIR/src/tex2lyx/tex2lyx.man')) env.subst('$TOP_SRC_DIR/src/tex2lyx/tex2lyx.man'))
env.InstallAs(os.path.join(env['MAN_DEST_DIR'], 'lyxclient' + env['PROGRAM_SUFFIX'] + '.1'), env.InstallAs(os.path.join(env['MAN_DEST_DIR'], 'lyxclient' + version_suffix + '.1'),
env.subst('$TOP_SRC_DIR/src/client/lyxclient.man')) env.subst('$TOP_SRC_DIR/src/client/lyxclient.man'))
Alias('install', [os.path.join(env['MAN_DEST_DIR'], x + env['PROGRAM_SUFFIX'] + '.1') for Alias('install', [os.path.join(env['MAN_DEST_DIR'], x + version_suffix + '.1') for
x in ['lyx', 'tex2lyx', 'lyxclient']]) x in ['lyx', 'tex2lyx', 'lyxclient']])
# locale files? # locale files?
# ru.gmo ==> ru/LC_MESSAGES/lyxSUFFIX.mo # ru.gmo ==> ru/LC_MESSAGES/lyxSUFFIX.mo
for gmo in gmo_files: for gmo in gmo_files:
lan = os.path.split(str(gmo))[1].split('.')[0] lan = os.path.split(str(gmo))[1].split('.')[0]
dest_file = os.path.join(env['LOCALE_DEST_DIR'], lan, 'LC_MESSAGES', 'lyx' + env['PROGRAM_SUFFIX'] + '.mo') dest_file = os.path.join(env['LOCALE_DEST_DIR'], lan, 'LC_MESSAGES', 'lyx' + version_suffix + '.mo')
env.InstallAs(dest_file, gmo) env.InstallAs(dest_file, gmo)
Alias('install', dest_file) Alias('install', dest_file)

View File

@ -134,7 +134,6 @@ if os.name == 'nt':
# If not specified, boost tries to figure out by itself, but it may fail. # If not specified, boost tries to figure out by itself, but it may fail.
boost_posix = False boost_posix = False
packaging_method = 'windows' packaging_method = 'windows'
add_suffix_to_executables = False
default_prefix = 'c:/program files/lyx' default_prefix = 'c:/program files/lyx'
share_dir = 'Resources' share_dir = 'Resources'
man_dir = 'Resources/man/man1' man_dir = 'Resources/man/man1'
@ -149,7 +148,6 @@ elif os.name == 'posix' and sys.platform != 'cygwin':
default_with_x = True default_with_x = True
boost_posix = True boost_posix = True
packaging_method = 'posix' packaging_method = 'posix'
add_suffix_to_executables = True
default_prefix = '/usr/local/' default_prefix = '/usr/local/'
share_dir = 'share/lyx' share_dir = 'share/lyx'
man_dir = 'man/man1' man_dir = 'man/man1'
@ -164,7 +162,6 @@ elif os.name == 'posix' and sys.platform == 'cygwin':
default_with_x = True default_with_x = True
boost_posix = True boost_posix = True
packaging_method = 'posix' packaging_method = 'posix'
add_suffix_to_executables = True
default_prefix = '/usr/local/' default_prefix = '/usr/local/'
share_dir = 'share/lyx' share_dir = 'share/lyx'
man_dir = 'man/man1' man_dir = 'man/man1'
@ -179,7 +176,6 @@ elif os.name == 'darwin':
default_with_x = False default_with_x = False
boost_posix = True boost_posix = True
packaging_method = 'mac' packaging_method = 'mac'
add_suffix_to_executables = True
# FIXME: where to install? # FIXME: where to install?
default_prefix = '/usr/local/' default_prefix = '/usr/local/'
share_dir = 'Resources' share_dir = 'Resources'
@ -195,7 +191,6 @@ else: # unsupported system
default_with_x = True default_with_x = True
boost_posix = False boost_posix = False
packaging_method = 'posix' packaging_method = 'posix'
add_suffix_to_executables = True
default_prefix = '/usr/local/' default_prefix = '/usr/local/'
share_dir = 'share/lyx' share_dir = 'share/lyx'
man_dir = 'man/man1' man_dir = 'man/man1'
@ -395,8 +390,13 @@ if env.has_key('version_suffix'):
env['PROGRAM_SUFFIX'] = env['version_suffix'] env['PROGRAM_SUFFIX'] = env['version_suffix']
else: else:
env['PROGRAM_SUFFIX'] = '' env['PROGRAM_SUFFIX'] = ''
env['ADD_SUFFIX_TO_EXECUTABLES'] = add_suffix_to_executables
env['SHARE_DIR'] = os.path.join(env['PREFIX'], share_dir + env['PROGRAM_SUFFIX']) # 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)
env['LOCALE_DIR'] = os.path.join(env['PREFIX'], locale_dir) env['LOCALE_DIR'] = os.path.join(env['PREFIX'], locale_dir)
# #
# if dest_dir is different from prefix. # if dest_dir is different from prefix.
@ -405,7 +405,10 @@ if env.has_key('exec_prefix'):
env['BIN_DEST_DIR'] = env['exec_prefix'] env['BIN_DEST_DIR'] = env['exec_prefix']
else: else:
env['BIN_DEST_DIR'] = os.path.join(env['DEST_DIR'], 'bin') env['BIN_DEST_DIR'] = os.path.join(env['DEST_DIR'], 'bin')
env['SHARE_DEST_DIR'] = os.path.join(env['DEST_DIR'], share_dir + env['PROGRAM_SUFFIX']) 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)
env['MAN_DEST_DIR'] = os.path.join(env['DEST_DIR'], man_dir) env['MAN_DEST_DIR'] = os.path.join(env['DEST_DIR'], man_dir)
env['LOCALE_DEST_DIR'] = os.path.join(env['DEST_DIR'], locale_dir) env['LOCALE_DEST_DIR'] = os.path.join(env['DEST_DIR'], locale_dir)