1 # vi:filetype=python:expandtab:tabstop=2:shiftwidth=2
5 # This file is part of LyX, the document processor.
6 # Licence details can be found in the file COPYING.
9 # Full author contact details are available in file CREDITS.
12 sys.path.append('config')
13 from scons_utils import globSource
17 def libExists(libname):
18 ''' Check whether or not lib $LOCALLIBNAME/libname already exists'''
19 return os.path.isfile(File(env.subst('$LOCALLIBPATH/${LIBPREFIX}%s$LIBSUFFIX'%libname)).abspath)
21 targets = env['BUILD_TARGETS']
22 # msvc need to pass full target name, so I have to look for path/lyx etc
23 build_lyx = targets == [] or True in ['lyx' in x for x in targets] \
24 or 'install' in targets or 'all' in targets
25 build_boost = (env['INCLUDED_BOOST'] and not libExists('boost_regex')) or 'boost' in targets
26 build_intl = (env['INCLUDED_GETTEXT'] and not libExists('included_intl')) or 'intl' in targets
27 build_support = build_lyx or True in [x in targets for x in ['support', 'client', 'tex2lyx']]
28 build_mathed = build_lyx or 'mathed' in targets
29 build_insets = build_lyx or 'insets' in targets
30 build_frontends = build_lyx or 'frontends' in targets
31 build_graphics = build_lyx or 'graphics' in targets
32 build_controllers = build_lyx or 'controllers' in targets
33 build_client = True in ['client' in x for x in targets] \
34 or 'install' in targets or 'all' in targets
35 build_tex2lyx = True in ['tex2lyx' in x for x in targets] \
36 or 'install' in targets or 'all' in targets
37 build_lyxbase = build_lyx or 'lyxbase' in targets
38 build_po = 'po' in targets or 'install' in targets or 'all' in targets
39 build_qt2 = (build_lyx and env['frontend'] == 'qt2') or 'qt2' in targets
40 build_qt3 = (build_lyx and env['frontend'] == 'qt3') or 'qt3' in targets
41 build_qt4 = (build_lyx and env['frontend'] == 'qt4') or 'qt4' in targets
42 build_msvs_projects = env['USE_VC'] and 'msvs_projects' in targets
45 # now, if rebuild_targets is specified, do not rebuild some targets
46 rebuild_targets = env['REBUILD_TARGETS']
48 def ifBuildLib(name, libname, old_value):
49 # explicitly asked to rebuild
50 if name in rebuild_targets:
52 # else if not rebuild, and if the library already exists
53 elif libExists(libname):
55 # do not change the original value
58 build_boost = ifBuildLib('boost', 'included_boost_filesystem', build_boost)
59 build_intl = ifBuildLib('intl', 'included_intl', build_intl)
60 build_support = ifBuildLib('support', 'support', build_support)
61 build_mathed = ifBuildLib('mathed', 'mathed', build_mathed)
62 build_insets = ifBuildLib('insets', 'insets', build_insets)
63 build_frontends = ifBuildLib('frontends', 'frontends', build_frontends)
64 build_graphics = ifBuildLib('graphics', 'graphics', build_graphics)
65 build_controllers = ifBuildLib('controllers', 'controllers', build_controllers)
66 build_lyxbase = ifBuildLib('lyxbase', 'lyxbase_pre', build_lyxbase)
67 build_qt2 = ifBuildLib('qt2', 'qt2', build_qt2)
68 build_qt3 = ifBuildLib('qt3', 'qt3', build_qt3)
69 build_qt4 = ifBuildLib('qt4', 'qt4', build_qt4)
71 # sync frontend and env['frontend'] (maybe build qt4 with frontend=qt3)
74 env['frontend'] = 'qt2'
77 env['frontend'] = 'qt3'
80 env['frontend'] = 'qt4'
82 frontend = env['frontend']
90 env.BuildDir('$BUILDDIR/boost', '$TOP_SRC_DIR/boost/libs', duplicate = 0)
93 boostenv.AppendUnique(CCFLAGS = '-DBOOST_USER_CONFIG="<config.h>"')
95 for lib in ['filesystem', 'regex', 'signals', 'iostreams']:
96 # lyx 1.4 does not have iostreams
97 if not os.path.isdir(os.path.join(env.subst('$TOP_SRC_DIR'), 'boost', 'libs', lib)):
100 print 'Processing files in boost/libs/%s/src...' % lib
102 boostlib = boostenv.StaticLibrary(
103 target = '$LOCALLIBPATH/included_boost_%s' % lib,
104 source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/%s/src' % lib),
105 pattern = '*.cpp', build_dir = '$BUILDDIR/boost/%s/src' % lib)
107 Alias('boost', boostlib)
114 print "Processing files in intl..."
116 env.BuildDir('$BUILDDIR/intl', '$TOP_SRC_DIR/intl', duplicate = 0)
119 # we need the original C compiler for these files
120 intlenv['CC'] = intlenv['C_COMPILER']
121 intlenv['CCFLAGS'] = intlenv['C_CCFLAGS']
122 intlenv['CPPPATH'] += ['intl']
124 intlenv.Append(CCFLAGS = [
125 r'-DLOCALEDIR=\"' + env['LOCALE_DIR'].replace('\\', '\\\\') + r'\"',
126 r'-DLOCALE_ALIAS_PATH=\"' + env['LOCALE_DIR'].replace('\\', '\\\\') + r'\"',
127 r'-DLIBDIR=\"' + env['TOP_SRC_DIR'].replace('\\', '\\\\') + r'/lib\"',
129 '-DENABLE_RELOCATABLE=1',
131 r'-DINSTALLDIR=\"' + env['PREFIX'].replace('\\', '\\\\') + r'/lib\"',
133 '-Dset_relocation_prefix=libintl_set_relocation_prefix',
134 '-Drelocate=libintl_relocate',
135 '-DDEPENDS_ON_LIBICONV=1',
140 # libgnuintl.h.in => libintl.h
141 env.substFile('$TOP_SRC_DIR/intl/libintl.h', '$TOP_SRC_DIR/intl/libgnuintl.h.in')
142 env.Command('$TOP_SRC_DIR/intl/libgnuintl.h', '$TOP_SRC_DIR/intl/libintl.h',
143 [Copy('$TARGET', '$SOURCE')])
145 intl = intlenv.StaticLibrary(
146 target = '$LOCALLIBPATH/included_intl',
148 source = globSource(dir = env.subst('$TOP_SRC_DIR/intl'), pattern = '*.c',
149 exclude = ['vasnprintf.c', 'printf-parse.c', 'printf-args.c', 'os2compat.c'],
150 build_dir = '$BUILDDIR/intl')
156 # Now, src code under src/
158 env.BuildDir('$BUILDDIR/common', '$TOP_SRC_DIR/src', duplicate = 0)
165 print "Processing files in src/support..."
167 env.substFile('$BUILDDIR/common/support/package.C', '$TOP_SRC_DIR/src/support/package.C.in')
169 support = env.StaticLibrary(
170 target = '$LOCALLIBPATH/support',
171 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/support'), pattern = env['LYX_EXT'],
172 exclude = ['os_win32.C', 'os_unix.C', 'os_cygwin.C', 'os_os2.C', 'atexit.c'],
173 include = ['package.C'], build_dir = '$BUILDDIR/common/support')
175 Alias('support', support)
182 print "Processing files in src/mathed..."
184 mathed = env.StaticLibrary(
185 target = '$LOCALLIBPATH/mathed',
186 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/mathed'), pattern = env['LYX_EXT'],
187 exclude = ['math_xyarrowinset.C', 'math_mboxinset.C', 'formulamacro.C'],
188 build_dir = '$BUILDDIR/common/mathed')
190 Alias('mathed', mathed)
197 print "Processing files in src/insets..."
199 insets = env.StaticLibrary(
200 target = '$LOCALLIBPATH/insets',
201 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/insets'), pattern = env['LYX_EXT'],
202 exclude = ['insettheorem.C'], build_dir = '$BUILDDIR/common/insets')
204 Alias('insets', insets)
211 print "Processing files in src/frontends..."
213 frontends = env.StaticLibrary(
214 target = '$LOCALLIBPATH/frontends',
215 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends'), pattern = env['LYX_EXT'],
216 build_dir = '$BUILDDIR/common/frontends')
218 Alias('frontends', frontends)
225 print "Processing files in src/graphics..."
227 graphics = env.StaticLibrary(
228 target = '$LOCALLIBPATH/graphics',
229 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/graphics'), pattern = env['LYX_EXT'],
230 build_dir = '$BUILDDIR/common/graphics')
232 Alias('graphics', graphics)
235 if build_controllers:
237 # src/frontends/controllers
239 print "Processing files in src/frontends/controllers..."
241 controllers = env.StaticLibrary(
242 target = '$LOCALLIBPATH/controllers',
243 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/controllers'), pattern = env['LYX_EXT'],
244 build_dir = '$BUILDDIR/common/frontends/controllers')
246 Alias('controllers', controllers)
250 # src/frontend/qt2/3/4
252 if build_qt2 or build_qt3 or build_qt4:
253 env.BuildDir('$BUILDDIR/$frontend', '$TOP_SRC_DIR/src/frontend/$frontend', duplicate = 0)
257 print "Processing files in src/frontends/qt2..."
260 # disable auto scan to speed up non build time
261 qt2env['QT_AUTOSCAN'] = 0
262 qt2env['QT_MOCHPREFIX'] = ''
267 qt2env.AppendUnique(CPPPATH = [
269 '$BUILDDIR/common/images',
270 '$BUILDDIR/common/frontends',
271 '$BUILDDIR/common/frontends/qt2',
272 '$BUILDDIR/common/frontends/controllers',
276 qt2_moc_files = ["$BUILDDIR/common/frontends/qt2/%s" % x for x in Split('''
318 QSpellcheckerDialog.C
320 QTabularCreateDialog.C
335 # manually moc and uic files for better performance
336 qt2_moced_files = [qt2env.Moc(x.replace('.C', '_moc.cpp'), x.replace('.C', '.h')) for x in qt2_moc_files]
338 qt2_uiced_files = [qt2env.Uic('$BUILDDIR/common/frontends/qt2/ui/'+x) for x in \
339 globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/qt2/ui'), pattern = '*.ui')]
341 qt2_uiced_cc_files = []
342 for x in qt2_uiced_files:
343 qt2_uiced_cc_files.extend(x[1:])
345 qt2 = qt2env.StaticLibrary(
346 target = '$LOCALLIBPATH/qt2',
347 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/qt2/'), pattern = env['LYX_EXT'],
348 build_dir = '$BUILDDIR/common/frontends/qt2') + qt2_moced_files + qt2_uiced_cc_files
354 print "Processing files in src/frontends/qt3..."
357 # disable auto scan to speed up non build time
358 qt3env['QT_AUTOSCAN'] = 0
359 qt3env['QT_MOCHPREFIX'] = ''
364 qt3env.AppendUnique(CPPPATH = [
366 '$BUILDDIR/common/images',
367 '$BUILDDIR/common/frontends',
368 '$BUILDDIR/common/frontends/qt3',
369 '$BUILDDIR/common/frontends/controllers',
373 qt3_moc_files = ["$BUILDDIR/common/frontends/qt3/%s" % x for x in Split('''
416 QSpellcheckerDialog.C
418 QTabularCreateDialog.C
433 # manually moc and uic files for better performance
434 qt3_moced_files = [qt3env.Moc(x.replace('.C', '_moc.cpp'), x.replace('.C', '.h')) for x in qt3_moc_files]
436 qt3_uiced_files = [qt3env.Uic('$BUILDDIR/common/frontends/qt3/ui/'+x) for x in \
437 globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/qt3/ui'), pattern = '*.ui')]
439 qt3_uiced_cc_files = []
440 for x in qt3_uiced_files:
441 qt3_uiced_cc_files.extend(x[1:])
443 qt3 = qt3env.StaticLibrary(
444 target = '$LOCALLIBPATH/qt3',
445 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/qt3/'), pattern = env['LYX_EXT'],
446 build_dir = '$BUILDDIR/common/frontends/qt3') + qt3_moced_files + qt3_uiced_cc_files
452 print "Processing files in src/frontends/qt4..."
455 qt4env['QT_AUTOSCAN'] = 0
457 # local qt4 toolset from
458 # http://www.iua.upf.es/~dgarcia/Codders/sconstools.html
460 # NOTE: I have to patch qt4.py since it does not automatically
461 # process .C file!!! (add to cxx_suffixes )
463 qt4env.Tool('qt4', [env['SCONS_DIR']])
464 qt4env.EnableQt4Modules(env['QT_LIB'], debug = False)
466 qt4env.AppendUnique(CPPPATH = [
468 '$BUILDDIR/common/images',
469 '$BUILDDIR/common/frontends',
470 '$BUILDDIR/common/frontends/qt4',
471 '$BUILDDIR/common/frontends/controllers'
475 # FIXME: replace by something from pkg_config
476 qt4env.Append(CCFLAGS = [
478 '-DQT_CLEAN_NAMESPACE',
486 qt4_moc_files = ["$BUILDDIR/common/frontends/qt4/%s" % x for x in Split('''
532 QSpellcheckerDialog.C
534 QTabularCreateDialog.C
553 resources = [qt4env.Uic4(x.split('.')[0]) for x in \
554 globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/qt4/ui'), pattern = '*.ui',
555 build_dir = '$BUILDDIR/common/frontends/qt4/ui')]
558 # moc qt4_moc_files, the moced files are included in the original files
560 qt4_moced_files = [qt4env.Moc4(x.replace('.C', '_moc.cpp'), x.replace('.C', '.h')) for x in qt4_moc_files]
562 qt4 = qt4env.StaticLibrary(
563 target = '$LOCALLIBPATH/qt4',
564 LIBS = qt4env['QT_LIB'],
565 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/qt4'), pattern = env['LYX_EXT'],
566 exclude = ['QBrowseBox.C'], build_dir = '$BUILDDIR/common/frontends/qt4')
575 env.BuildDir('$BUILDDIR/common', '$TOP_SRC_DIR/src', duplicate = 0)
577 print "Processing files in src/client..."
579 if env['HAVE_FCNTL']:
580 client = env.Program(
581 target = '$BUILDDIR/common/client/lyxclient',
582 LIBS = ['support'] + env['INTL_LIBS'] + env['SYSTEM_LIBS'] +
583 env['SOCKET_LIBS'] + env['BOOST_LIBRARIES'],
584 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/client'), pattern = env['LYX_EXT'],
585 build_dir = '$BUILDDIR/common/client')
587 Alias('client', env.Command(os.path.join('$BUILDDIR', os.path.split(str(client[0]))[1]),
588 client, [Copy('$TARGET', '$SOURCE')]))
591 Alias('client', client)
598 print "Processing files in src/tex2lyx..."
600 tex2lyx_env = env.Copy()
601 # the order is important here.
602 tex2lyx_env.Prepend(CPPPATH = ['$BUILDDIR/common/tex2lyx'])
603 tex2lyx_env.AppendUnique(LIBPATH = ['#$LOCALLIBPATH'])
605 for file in ['FloatList.C', 'Floating.C', 'counters.C', 'lyxlayout.h', 'lyxlayout.C',
606 'lyxtextclass.h', 'lyxtextclass.C', 'lyxlex.C', 'lyxlex_pimpl.C']:
607 env.Command('$BUILDDIR/common/tex2lyx/'+file, '$TOP_SRC_DIR/src/'+file,
608 [Copy('$TARGET', '$SOURCE')])
610 tex2lyx = tex2lyx_env.Program(
611 target = '$BUILDDIR/common/tex2lyx/tex2lyx',
612 LIBS = ['support'] + env['BOOST_LIBRARIES'] + env['SYSTEM_LIBS'],
613 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/tex2lyx'), pattern = env['LYX_EXT'],
614 include = ['FloatList.C', 'Floating.C', 'counters.C', 'lyxlayout.C',
615 'lyxtextclass.C', 'lyxlex.C', 'lyxlex_pimpl.C'],
616 build_dir = '$BUILDDIR/common/tex2lyx')
618 Alias('tex2lyx', env.Command(os.path.join('$BUILDDIR', os.path.split(str(tex2lyx[0]))[1]),
619 tex2lyx, [Copy('$TARGET', '$SOURCE')]))
620 Alias('tex2lyx', tex2lyx)
627 print "Processing files in src..."
629 env.substFile('$BUILDDIR/common/version.C', '$TOP_SRC_DIR/src/version.C.in')
631 lyx_post_source = Split('''
640 if env.has_key('USE_ASPELL') and env['USE_ASPELL']:
641 lyx_post_source.append('aspell.C')
642 elif env.has_key('USE_PSPELL') and env['USE_PSPELL']:
643 lyx_post_source.append('pspell.C')
644 elif env.has_key('USE_ISPELL') and env['USE_ISPELL']:
645 lyx_post_source.append('ispell.C')
647 # temporary fix for MSVC, will remove later.
648 if not env['USE_VC']:
649 main_source = ['main.C']
653 lyxbase_pre = env.StaticLibrary(
654 target = '$LOCALLIBPATH/lyxbase_pre',
655 source = globSource(dir = env.subst('$TOP_SRC_DIR/src'), pattern = env['LYX_EXT'],
656 exclude = lyx_post_source + ['main.C', 'aspell.C', 'pspell.C', 'ispell.C', 'Variables.C', 'Sectioning.C'],
657 include = ['version.C'] + main_source, build_dir = '$BUILDDIR/common')
659 lyxbase_post = env.StaticLibrary(
660 target = '$LOCALLIBPATH/lyxbase_post',
661 source = ["$BUILDDIR/common/%s" % x for x in lyx_post_source]
663 Alias('lyxbase', lyxbase_pre)
664 Alias('lyxbase', lyxbase_post)
669 # Build lyx with given frontend
671 # temporary fix for MSVC, will remove later.
673 lyx_source = ['$BUILDDIR/common/main.C']
677 target = '$BUILDDIR/$frontend/lyx',
690 env['BOOST_LIBRARIES'] +
691 env['FRONTEND_LIBS'] +
696 # [/path/to/lyx.ext] => lyx-qt3.ext
697 target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx-%s' % frontend)
698 Alias('lyx', env.Command(os.path.join('$BUILDDIR', target_name), lyx,
699 [Copy('$TARGET', '$SOURCE')]))
703 if build_msvs_projects:
704 def build_project(target, dir, full_target = None,
705 src_pattern = env['LYX_EXT'], include=[], resource=None, rebuild=True):
706 ''' build mavs project files
707 target: alias (correspond to directory name)
708 dir: source directory or directories (a list)
709 full_target: full path/filename of the target
710 src_pattern: glob pattern
711 include: files to include into source
712 resource: directory or directories with resource (.ui) files
713 rebuild: whether or not only rebuild this target
715 For non-debug-able targets like static libraries, target (alias) is
716 enough to build the target. For executable targets, msvs need to know
717 the full path to start debug them.
719 if resource is not None:
720 res = globSource(dir = env.subst('$TOP_SRC_DIR/'+resource), pattern = '*.ui',
721 build_dir = env.subst('$TOP_SRC_DIR/'+resource))
725 cmds = 'faststart=yes rebuild='+target
727 cmds = 'faststart=yes'
728 if type(dir) == type([]):
732 src.extend(globSource(dir = env.subst('$TOP_SRC_DIR/' + d),
733 pattern = src_pattern, include = include,
734 build_dir = env.subst('$TOP_SRC_DIR/' + d) ))
735 inc.extend(globSource(dir = env.subst('$TOP_SRC_DIR/' + d),
737 build_dir = env.subst('$TOP_SRC_DIR/' + d) ))
739 src = globSource(dir = env.subst('$TOP_SRC_DIR/' + dir),
740 pattern = src_pattern, include = include,
741 build_dir = env.subst('$TOP_SRC_DIR/' + dir) )
742 inc = globSource(dir = env.subst('$TOP_SRC_DIR/' + dir),
744 build_dir = env.subst('$TOP_SRC_DIR/' + dir) )
745 if full_target is None:
746 build_target = target
748 build_target = full_target
750 proj = env.MSVSProject(
751 target = '$MSVSPATH/' + target + env['MSVSPROJECTSUFFIX'],
753 incs = [env.subst('$TOP_SRC_DIR/src/config.h')],
756 buildtarget = build_target,
760 Alias('msvs_projects', proj)
762 build_project('boost', ['boost/libs/filesystem/src',
763 'boost/libs/regex/src', 'boost/libs/signals/src',
764 'boost/libs/iostreams/src'], src_pattern = '*.cpp')
766 build_project('intl', 'intl', src_pattern = '*.c')
768 build_project('support', 'src/support', include=['package.C.in'])
770 build_project('mathed', 'src/mathed')
772 build_project('insets', 'src/insets')
774 build_project('frontends', 'src/frontends')
776 build_project('graphics', 'src/graphics')
778 build_project('controllers', 'src/frontends/controllers')
780 build_project('qt3', 'src/frontends/qt3', resource = 'src/frontends/qt3/ui')
782 build_project('qt4', 'src/frontends/qt4', resource = 'src/frontends/qt4/ui')
784 build_project('client', 'src/client', rebuild=False,
785 full_target = File(env.subst('$BUILDDIR/common/client/lyxclient$PROGSUFFIX')).abspath)
787 build_project('tex2lyx', 'src/tex2lyx', rebuild=False,
788 full_target = File(env.subst('$BUILDDIR/common/tex2lyx/tex2lyx$PROGSUFFIX')).abspath)
790 build_project('lyxbase', 'src')
792 if frontend == 'qt3':
793 build_project('lyx', ['src', 'src/support', 'src/mathed', 'src/insets',
794 'src/frontends', 'src/graphics', 'src/frontends/controllers',
795 'src/frontends/qt3'], resource = 'src/frontends/qt3/ui',
796 full_target = File(env.subst('$BUILDDIR/$frontend/lyx$PROGSUFFIX')).abspath)
798 build_project('lyx', ['src', 'src/support', 'src/mathed', 'src/insets',
799 'src/frontends', 'src/graphics', 'src/frontends/controllers',
800 'src/frontends/qt4'], resource = 'src/frontends/qt4/ui',
801 full_target = File(env.subst('$BUILDDIR/$frontend/lyx$PROGSUFFIX')).abspath)
808 print 'Processing files in po...'
814 transfiles = glob.glob(os.path.join(env.subst('$TOP_SRC_DIR'), 'po', '*.po'))
815 # possibly *only* handle these languages
817 if env.has_key('languages'):
818 languages = env.make_list(env['lanauges'])
820 if not env['MSGFMT']:
821 print 'msgfmt does not exist. Can not process po files'
824 env['BUILDERS']['Transfiles'] = Builder(action='$MSGFMT $SOURCE -o $TARGET',suffix='.gmo',src_suffix='.po')
829 fname = os.path.split(f)[1]
831 country = fname.split('.')[0]
833 if not languages or country in languages:
834 gmo_files.extend(env.Transfiles(f))
837 if 'install' in targets:
838 # create the directory if needed
839 if not os.path.isdir(env['DEST_DIR']):
841 os.makedirs(env['DEST_DIR'])
844 if not os.path.isdir(env['DEST_DIR']):
845 print 'Can not create directory', env['DEST_DIR']
850 # do not install these files
851 exclude_list = ['Makefile.am', 'Makefile.in', 'Makefile',
852 'lyx2lyx_version.py', 'lyx2lyx_version.py.in']
854 def install(dest, src):
855 ''' recusive installation of src to dest '''
856 # separate file and directory
857 files = filter(lambda x: os.path.isfile(x) and not os.path.split(x)[1] in exclude_list, src)
858 dirs = filter(os.path.isdir, src)
860 env.Install(dest, files)
864 ins_dir.extend(install(os.path.join(dest, os.path.basename(dir)),
865 glob.glob(os.path.join(dir, '*'))) )
868 # executables (some of them may be none)
870 if env['ADD_SUFFIX']:
871 version_suffix = env['PROGRAM_SUFFIX']
876 target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx%s' % version_suffix)
877 target = os.path.join(env['BIN_DEST_DIR'], target_name)
878 env.InstallAs(target, lyx)
879 Alias('install', target)
880 # install lyx as lyx-qt3
881 target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx-%s%s' % (frontend, version_suffix))
882 target = os.path.join(env['BIN_DEST_DIR'], target_name)
883 env.InstallAs(target, lyx)
884 Alias('install', target)
887 target_name = os.path.split(str(tex2lyx[0]))[1].replace('tex2lyx', 'tex2lyx%s' % version_suffix)
888 target = os.path.join(env['BIN_DEST_DIR'], target_name)
889 env.InstallAs(target, tex2lyx)
890 Alias('install', target)
892 # install lyxclient, may not exist
894 target_name = os.path.split(str(client[0]))[1].replace('client', 'client%s' % version_suffix)
895 target = os.path.join(env['BIN_DEST_DIR'], target_name)
896 env.InstallAs(target, client)
897 Alias('install', target)
900 dirs = install(env['SHARE_DEST_DIR'],
901 [env.subst('$TOP_SRC_DIR/lib/') + file for file in ['configure.py', 'encodings',
902 'chkconfig.ltx', 'CREDITS', 'external_templates', 'symbols', 'languages',
903 'lyxrc.example', 'syntax.default', 'bind', 'images', 'layouts', 'scripts',
904 'templates', 'examples', 'kbd', 'lyx2lyx', 'tex', 'clipart', 'doc', 'ui']]
906 env.substFile('$SHARE_DEST_DIR/lyx2lyx/lyx2lyx_version.py',
907 '$TOP_SRC_DIR/lib/lyx2lyx/lyx2lyx_version.py.in')
908 Alias('install', dirs)
910 env.InstallAs(os.path.join(env['MAN_DEST_DIR'], 'lyx' + version_suffix + '.1'),
911 env.subst('$TOP_SRC_DIR/lyx.man'))
912 env.InstallAs(os.path.join(env['MAN_DEST_DIR'], 'tex2lyx' + version_suffix + '.1'),
913 env.subst('$TOP_SRC_DIR/src/tex2lyx/tex2lyx.man'))
914 env.InstallAs(os.path.join(env['MAN_DEST_DIR'], 'lyxclient' + version_suffix + '.1'),
915 env.subst('$TOP_SRC_DIR/src/client/lyxclient.man'))
916 Alias('install', [os.path.join(env['MAN_DEST_DIR'], x + version_suffix + '.1') for
917 x in ['lyx', 'tex2lyx', 'lyxclient']])
919 # ru.gmo ==> ru/LC_MESSAGES/lyxSUFFIX.mo
920 for gmo in gmo_files:
921 lan = os.path.split(str(gmo))[1].split('.')[0]
922 dest_file = os.path.join(env['LOCALE_DEST_DIR'], lan, 'LC_MESSAGES', 'lyx' + version_suffix + '.mo')
923 env.InstallAs(dest_file, gmo)
924 Alias('install', dest_file)
928 Alias('all', ['lyx', 'client', 'tex2lyx'])