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_qt3 = (build_lyx and env['frontend'] == 'qt3') or 'qt3' in targets
40 build_qt4 = (build_lyx and env['frontend'] == 'qt4') or 'qt4' in targets
41 build_msvs_projects = env['USE_VC'] and 'msvs_projects' in targets
44 # now, if rebuild_targets is specified, do not rebuild some targets
45 rebuild_targets = env['REBUILD_TARGETS']
47 def ifBuildLib(name, libname, old_value):
48 # explicitly asked to rebuild
49 if name in rebuild_targets:
51 # else if not rebuild, and if the library already exists
52 elif libExists(libname):
54 # do not change the original value
57 build_boost = ifBuildLib('boost', 'included_boost_filesystem', build_boost)
58 build_intl = ifBuildLib('intl', 'included_intl', build_intl)
59 build_support = ifBuildLib('support', 'support', build_support)
60 build_mathed = ifBuildLib('mathed', 'mathed', build_mathed)
61 build_insets = ifBuildLib('insets', 'insets', build_insets)
62 build_frontends = ifBuildLib('frontends', 'frontends', build_frontends)
63 build_graphics = ifBuildLib('graphics', 'graphics', build_graphics)
64 build_controllers = ifBuildLib('controllers', 'controllers', build_controllers)
65 build_lyxbase = ifBuildLib('lyxbase', 'lyxbase_pre', build_lyxbase)
66 build_qt3 = ifBuildLib('qt3', 'qt3', build_qt3)
67 build_qt4 = ifBuildLib('qt4', 'qt4', build_qt4)
69 # sync frontend and env['frontend'] (maybe build qt4 with frontend=qt3)
72 env['frontend'] = 'qt3'
75 env['frontend'] = 'qt4'
77 frontend = env['frontend']
85 env.BuildDir('$BUILDDIR/boost', '$TOP_SRC_DIR/boost/libs', duplicate = 0)
88 boostenv.AppendUnique(CCFLAGS = '-DBOOST_USER_CONFIG="<config.h>"')
90 print 'Processing files in boost/libs/filesystem/src...'
92 filesystem = boostenv.StaticLibrary(
93 target = '$LOCALLIBPATH/included_boost_filesystem',
94 source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/filesystem/src'),
95 pattern = '*.cpp', build_dir = '$BUILDDIR/boost/filesystem/src')
98 print 'Processing files in boost/libs/regex/src...'
100 regex = boostenv.StaticLibrary(
101 target = '$LOCALLIBPATH/included_boost_regex',
102 source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/regex/src'),
103 pattern = '*.cpp', build_dir = '$BUILDDIR/boost/regex/src')
106 print 'Processing files in boost/libs/signals/src...'
108 signals = boostenv.StaticLibrary(
109 target = '$LOCALLIBPATH/included_boost_signals',
110 source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/signals/src'),
111 pattern = '*.cpp', build_dir = '$BUILDDIR/boost/signals/src')
114 print 'Processing files in boost/libs/iostreams/src...'
116 iostreams = boostenv.StaticLibrary(
117 target = '$LOCALLIBPATH/included_boost_iostreams',
118 source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/iostreams/src'),
119 pattern = '*.cpp', build_dir = '$BUILDDIR/boost/iostreams/src')
121 Alias('boost', filesystem)
122 Alias('boost', regex)
123 Alias('boost', signals)
124 Alias('boost', iostreams)
131 print "Processing files in intl..."
133 env.BuildDir('$BUILDDIR/intl', '$TOP_SRC_DIR/intl', duplicate = 0)
136 # we need the original C compiler for these files
137 intlenv['CC'] = intlenv['C_COMPILER']
138 intlenv['CCFLAGS'] = intlenv['C_CCFLAGS']
139 intlenv['CPPPATH'] += ['intl']
141 intlenv.Append(CCFLAGS = [
142 r'-DLOCALEDIR=\"' + env['LOCALE_DIR'].replace('\\', '\\\\') + r'\"',
143 r'-DLOCALE_ALIAS_PATH=\"' + env['LOCALE_DIR'].replace('\\', '\\\\') + r'\"',
144 r'-DLIBDIR=\"' + env['TOP_SRC_DIR'].replace('\\', '\\\\') + r'/lib\"',
146 '-DENABLE_RELOCATABLE=1',
148 r'-DINSTALLDIR=\"' + env['PREFIX'].replace('\\', '\\\\') + r'/lib\"',
150 '-Dset_relocation_prefix=libintl_set_relocation_prefix',
151 '-Drelocate=libintl_relocate',
152 '-DDEPENDS_ON_LIBICONV=1',
157 # libgnuintl.h.in => libintl.h
158 env.substFile('$TOP_SRC_DIR/intl/libintl.h', '$TOP_SRC_DIR/intl/libgnuintl.h.in')
159 env.Command('$TOP_SRC_DIR/intl/libgnuintl.h', '$TOP_SRC_DIR/intl/libintl.h',
160 [Copy('$TARGET', '$SOURCE')])
162 intl = intlenv.StaticLibrary(
163 target = '$LOCALLIBPATH/included_intl',
165 source = globSource(dir = env.subst('$TOP_SRC_DIR/intl'), pattern = '*.c',
166 exclude = ['vasnprintf.c', 'printf-parse.c', 'printf-args.c', 'os2compat.c'],
167 build_dir = '$BUILDDIR/intl')
173 # Now, src code under src/
175 env.BuildDir('$BUILDDIR/common', '$TOP_SRC_DIR/src', duplicate = 0)
182 print "Processing files in src/support..."
184 env.substFile('$BUILDDIR/common/support/package.C', '$TOP_SRC_DIR/src/support/package.C.in')
186 support = env.StaticLibrary(
187 target = '$LOCALLIBPATH/support',
188 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/support'), pattern = env['LYX_EXT'],
189 exclude = ['os_win32.C', 'os_unix.C', 'os_cygwin.C', 'atexit.c'],
190 include = ['package.C'], build_dir = '$BUILDDIR/common/support')
192 Alias('support', support)
199 print "Processing files in src/mathed..."
201 mathed = env.StaticLibrary(
202 target = '$LOCALLIBPATH/mathed',
203 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/mathed'), pattern = env['LYX_EXT'],
204 exclude = ['math_xyarrowinset.C', 'math_mboxinset.C', 'formulamacro.C'],
205 build_dir = '$BUILDDIR/common/mathed')
207 Alias('mathed', mathed)
214 print "Processing files in src/insets..."
216 insets = env.StaticLibrary(
217 target = '$LOCALLIBPATH/insets',
218 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/insets'), pattern = env['LYX_EXT'],
219 exclude = ['insettheorem.C'], build_dir = '$BUILDDIR/common/insets')
221 Alias('insets', insets)
228 print "Processing files in src/frontends..."
230 frontends = env.StaticLibrary(
231 target = '$LOCALLIBPATH/frontends',
232 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends'), pattern = env['LYX_EXT'],
233 build_dir = '$BUILDDIR/common/frontends')
235 Alias('frontends', frontends)
242 print "Processing files in src/graphics..."
244 graphics = env.StaticLibrary(
245 target = '$LOCALLIBPATH/graphics',
246 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/graphics'), pattern = env['LYX_EXT'],
247 build_dir = '$BUILDDIR/common/graphics')
249 Alias('graphics', graphics)
252 if build_controllers:
254 # src/frontends/controllers
256 print "Processing files in src/frontends/controllers..."
258 controllers = env.StaticLibrary(
259 target = '$LOCALLIBPATH/controllers',
260 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/controllers'), pattern = env['LYX_EXT'],
261 build_dir = '$BUILDDIR/common/frontends/controllers')
263 Alias('controllers', controllers)
269 if build_qt3 or build_qt4:
270 env.BuildDir('$BUILDDIR/$frontend', '$TOP_SRC_DIR/src/frontend/$frontend', duplicate = 0)
273 print "Processing files in src/frontends/qt3..."
276 # disable auto scan to speed up non build time
277 qt3env['QT_AUTOSCAN'] = 0
278 qt3env['QT_MOCHPREFIX'] = ''
283 qt3env.AppendUnique(CPPPATH = [
285 '$BUILDDIR/common/images',
286 '$BUILDDIR/common/frontends',
287 '$BUILDDIR/common/frontends/qt3',
288 '$BUILDDIR/common/frontends/controllers',
292 qt3_moc_files = ["$BUILDDIR/common/frontends/qt3/%s" % x for x in Split('''
335 QSpellcheckerDialog.C
337 QTabularCreateDialog.C
352 # manually moc and uic files for better performance
353 qt3_moced_files = [qt3env.Moc(x.replace('.C', '_moc.cpp'), x.replace('.C', '.h')) for x in qt3_moc_files]
355 qt3_uiced_files = [qt3env.Uic('$BUILDDIR/common/frontends/qt3/ui/'+x) for x in \
356 globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/qt3/ui'), pattern = '*.ui')]
358 qt3_uiced_cc_files = []
359 for x in qt3_uiced_files:
360 qt3_uiced_cc_files.extend(x[1:])
362 qt3 = qt3env.StaticLibrary(
363 target = '$LOCALLIBPATH/qt3',
364 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/qt3/'), pattern = env['LYX_EXT'],
365 build_dir = '$BUILDDIR/common/frontends/qt3') + qt3_moced_files + qt3_uiced_cc_files
371 print "Processing files in src/frontends/qt4..."
374 qt4env['QT_AUTOSCAN'] = 0
376 # local qt4 toolset from
377 # http://www.iua.upf.es/~dgarcia/Codders/sconstools.html
379 # NOTE: I have to patch qt4.py since it does not automatically
380 # process .C file!!! (add to cxx_suffixes )
382 qt4env.Tool('qt4', [env['SCONS_DIR']])
383 qt4env.EnableQt4Modules(env['QT_LIB'], debug = False)
385 qt4env.AppendUnique(CPPPATH = [
387 '$BUILDDIR/common/images',
388 '$BUILDDIR/common/frontends',
389 '$BUILDDIR/common/frontends/qt4',
390 '$BUILDDIR/common/frontends/controllers'
394 # FIXME: replace by something from pkg_config
395 qt4env.Append(CCFLAGS = [
397 '-DQT_CLEAN_NAMESPACE',
405 qt4_moc_files = ["$BUILDDIR/common/frontends/qt4/%s" % x for x in Split('''
451 QSpellcheckerDialog.C
453 QTabularCreateDialog.C
472 resources = [qt4env.Uic4(x.split('.')[0]) for x in \
473 globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/qt4/ui'), pattern = '*.ui',
474 build_dir = '$BUILDDIR/common/frontends/qt4/ui')]
477 # moc qt4_moc_files, the moced files are included in the original files
479 qt4_moced_files = [qt4env.Moc4(x.replace('.C', '_moc.cpp'), x.replace('.C', '.h')) for x in qt4_moc_files]
481 qt4 = qt4env.StaticLibrary(
482 target = '$LOCALLIBPATH/qt4',
483 LIBS = qt4env['QT_LIB'],
484 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/frontends/qt4'), pattern = env['LYX_EXT'],
485 exclude = ['QBrowseBox.C'], build_dir = '$BUILDDIR/common/frontends/qt4')
494 env.BuildDir('$BUILDDIR/common', '$TOP_SRC_DIR/src', duplicate = 0)
496 print "Processing files in src/client..."
498 if env['HAVE_FCNTL']:
499 client = env.Program(
500 target = '$BUILDDIR/common/client/lyxclient',
501 LIBS = ['support'] + env['INTL_LIBS'] + env['SYSTEM_LIBS'] +
502 env['SOCKET_LIBS'] + env['BOOST_LIBRARIES'],
503 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/client'), pattern = env['LYX_EXT'],
504 build_dir = '$BUILDDIR/common/client')
506 Alias('client', env.Command(os.path.join('$BUILDDIR', os.path.split(str(client[0]))[1]),
507 client, [Copy('$TARGET', '$SOURCE')]))
510 Alias('client', client)
517 print "Processing files in src/tex2lyx..."
519 tex2lyx_env = env.Copy()
520 # the order is important here.
521 tex2lyx_env.Prepend(CPPPATH = ['$BUILDDIR/common/tex2lyx'])
522 tex2lyx_env.AppendUnique(LIBPATH = ['#$LOCALLIBPATH'])
524 for file in ['FloatList.C', 'Floating.C', 'counters.C', 'lyxlayout.h', 'lyxlayout.C',
525 'lyxtextclass.h', 'lyxtextclass.C', 'lyxlex.C', 'lyxlex_pimpl.C']:
526 env.Command('$BUILDDIR/common/tex2lyx/'+file, '$TOP_SRC_DIR/src/'+file,
527 [Copy('$TARGET', '$SOURCE')])
529 tex2lyx = tex2lyx_env.Program(
530 target = '$BUILDDIR/common/tex2lyx/tex2lyx',
531 LIBS = ['support'] + env['BOOST_LIBRARIES'] + env['SYSTEM_LIBS'],
532 source = globSource(dir = env.subst('$TOP_SRC_DIR/src/tex2lyx'), pattern = env['LYX_EXT'],
533 include = ['FloatList.C', 'Floating.C', 'counters.C', 'lyxlayout.C',
534 'lyxtextclass.C', 'lyxlex.C', 'lyxlex_pimpl.C'],
535 build_dir = '$BUILDDIR/common/tex2lyx')
537 Alias('tex2lyx', env.Command(os.path.join('$BUILDDIR', os.path.split(str(tex2lyx[0]))[1]),
538 tex2lyx, [Copy('$TARGET', '$SOURCE')]))
539 Alias('tex2lyx', tex2lyx)
546 print "Processing files in src..."
548 env.substFile('$BUILDDIR/common/version.C', '$TOP_SRC_DIR/src/version.C.in')
550 lyx_post_source = Split('''
559 if env.has_key('USE_ASPELL') and env['USE_ASPELL']:
560 lyx_post_source.append('aspell.C')
561 elif env.has_key('USE_PSPELL') and env['USE_PSPELL']:
562 lyx_post_source.append('pspell.C')
563 elif env.has_key('USE_ISPELL') and env['USE_ISPELL']:
564 lyx_post_source.append('ispell.C')
566 # temporary fix for MSVC, will remove later.
567 if not env['USE_VC']:
568 main_source = ['main.C']
572 lyxbase_pre = env.StaticLibrary(
573 target = '$LOCALLIBPATH/lyxbase_pre',
574 source = globSource(dir = env.subst('$TOP_SRC_DIR/src'), pattern = env['LYX_EXT'],
575 exclude = lyx_post_source + ['main.C', 'aspell.C', 'pspell.C', 'ispell.C', 'Variables.C', 'Sectioning.C'],
576 include = ['version.C'] + main_source, build_dir = '$BUILDDIR/common')
578 lyxbase_post = env.StaticLibrary(
579 target = '$LOCALLIBPATH/lyxbase_post',
580 source = ["$BUILDDIR/common/%s" % x for x in lyx_post_source]
582 Alias('lyxbase', lyxbase_pre)
583 Alias('lyxbase', lyxbase_post)
588 # Build lyx with given frontend
590 # temporary fix for MSVC, will remove later.
592 lyx_source = ['$BUILDDIR/common/main.C']
596 target = '$BUILDDIR/$frontend/lyx',
609 env['BOOST_LIBRARIES'] +
610 env['FRONTEND_LIBS'] +
615 # [/path/to/lyx.ext] => lyx-qt3.ext
616 target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx-%s' % frontend)
617 Alias('lyx', env.Command(os.path.join('$BUILDDIR', target_name), lyx,
618 [Copy('$TARGET', '$SOURCE')]))
622 if build_msvs_projects:
623 def build_project(target, dir, full_target = None,
624 src_pattern = env['LYX_EXT'], include=[], resource=None, rebuild=True):
625 ''' build mavs project files
626 target: alias (correspond to directory name)
627 dir: source directory or directories (a list)
628 full_target: full path/filename of the target
629 src_pattern: glob pattern
630 include: files to include into source
631 resource: directory or directories with resource (.ui) files
632 rebuild: whether or not only rebuild this target
634 For non-debug-able targets like static libraries, target (alias) is
635 enough to build the target. For executable targets, msvs need to know
636 the full path to start debug them.
638 if resource is not None:
639 res = globSource(dir = env.subst('$TOP_SRC_DIR/'+resource), pattern = '*.ui',
640 build_dir = env.subst('$TOP_SRC_DIR/'+resource))
644 cmds = 'faststart=yes rebuild='+target
646 cmds = 'faststart=yes'
647 if type(dir) == type([]):
651 src.extend(globSource(dir = env.subst('$TOP_SRC_DIR/' + d),
652 pattern = src_pattern, include = include,
653 build_dir = env.subst('$TOP_SRC_DIR/' + d) ))
654 inc.extend(globSource(dir = env.subst('$TOP_SRC_DIR/' + d),
656 build_dir = env.subst('$TOP_SRC_DIR/' + d) ))
658 src = globSource(dir = env.subst('$TOP_SRC_DIR/' + dir),
659 pattern = src_pattern, include = include,
660 build_dir = env.subst('$TOP_SRC_DIR/' + dir) )
661 inc = globSource(dir = env.subst('$TOP_SRC_DIR/' + dir),
663 build_dir = env.subst('$TOP_SRC_DIR/' + dir) )
664 if full_target is None:
665 build_target = target
667 build_target = full_target
669 proj = env.MSVSProject(
670 target = '$MSVSPATH/' + target + env['MSVSPROJECTSUFFIX'],
672 incs = [env.subst('$TOP_SRC_DIR/src/config.h')],
675 buildtarget = build_target,
679 Alias('msvs_projects', proj)
681 build_project('boost', ['boost/libs/filesystem/src',
682 'boost/libs/regex/src', 'boost/libs/signals/src',
683 'boost/libs/iostreams/src'], src_pattern = '*.cpp')
685 build_project('intl', 'intl', src_pattern = '*.c')
687 build_project('support', 'src/support', include=['package.C.in'])
689 build_project('mathed', 'src/mathed')
691 build_project('insets', 'src/insets')
693 build_project('frontends', 'src/frontends')
695 build_project('graphics', 'src/graphics')
697 build_project('controllers', 'src/frontends/controllers')
699 build_project('qt3', 'src/frontends/qt3', resource = 'src/frontends/qt3/ui')
701 build_project('qt4', 'src/frontends/qt4', resource = 'src/frontends/qt4/ui')
703 build_project('client', 'src/client', rebuild=False,
704 full_target = File(env.subst('$BUILDDIR/common/client/lyxclient$PROGSUFFIX')).abspath)
706 build_project('tex2lyx', 'src/tex2lyx', rebuild=False,
707 full_target = File(env.subst('$BUILDDIR/common/tex2lyx/tex2lyx$PROGSUFFIX')).abspath)
709 build_project('lyxbase', 'src')
711 if frontend == 'qt3':
712 build_project('lyx', ['src', 'src/support', 'src/mathed', 'src/insets',
713 'src/frontends', 'src/graphics', 'src/frontends/controllers',
714 'src/frontends/qt3'], resource = 'src/frontends/qt3/ui',
715 full_target = File(env.subst('$BUILDDIR/$frontend/lyx$PROGSUFFIX')).abspath)
717 build_project('lyx', ['src', 'src/support', 'src/mathed', 'src/insets',
718 'src/frontends', 'src/graphics', 'src/frontends/controllers',
719 'src/frontends/qt4'], resource = 'src/frontends/qt4/ui',
720 full_target = File(env.subst('$BUILDDIR/$frontend/lyx$PROGSUFFIX')).abspath)
727 print 'Processing files in po...'
733 transfiles = glob.glob(os.path.join(env.subst('$TOP_SRC_DIR'), 'po', '*.po'))
734 # possibly *only* handle these languages
736 if env.has_key('languages'):
737 languages = env.make_list(env['lanauges'])
739 if not env['MSGFMT']:
740 print 'msgfmt does not exist. Can not process po files'
743 env['BUILDERS']['Transfiles'] = Builder(action='$MSGFMT $SOURCE -o $TARGET',suffix='.gmo',src_suffix='.po')
748 fname = os.path.split(f)[1]
750 country = fname.split('.')[0]
752 if not languages or country in languages:
753 gmo_files.extend(env.Transfiles(f))
756 if 'install' in targets:
757 # create the directory if needed
758 if not os.path.isdir(env['DEST_DIR']):
760 os.makedirs(env['DEST_DIR'])
763 if not os.path.isdir(env['DEST_DIR']):
764 print 'Can not create directory', env['DEST_DIR']
769 # do not install these files
770 exclude_list = ['Makefile.am', 'Makefile.in', 'Makefile',
771 'lyx2lyx_version.py', 'lyx2lyx_version.py.in']
773 def install(dest, src):
774 ''' recusive installation of src to dest '''
775 # separate file and directory
776 files = filter(lambda x: os.path.isfile(x) and not os.path.split(x)[1] in exclude_list, src)
777 dirs = filter(os.path.isdir, src)
779 env.Install(dest, files)
783 ins_dir.extend(install(os.path.join(dest, os.path.basename(dir)),
784 glob.glob(os.path.join(dir, '*'))) )
787 # executables (some of them may be none)
789 if env['ADD_SUFFIX']:
790 version_suffix = env['PROGRAM_SUFFIX']
795 target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx%s' % version_suffix)
796 target = os.path.join(env['BIN_DEST_DIR'], target_name)
797 env.InstallAs(target, lyx)
798 Alias('install', target)
799 # install lyx as lyx-qt3
800 target_name = os.path.split(str(lyx[0]))[1].replace('lyx', 'lyx-%s%s' % (frontend, version_suffix))
801 target = os.path.join(env['BIN_DEST_DIR'], target_name)
802 env.InstallAs(target, lyx)
803 Alias('install', target)
806 target_name = os.path.split(str(tex2lyx[0]))[1].replace('tex2lyx', 'tex2lyx%s' % version_suffix)
807 target = os.path.join(env['BIN_DEST_DIR'], target_name)
808 env.InstallAs(target, tex2lyx)
809 Alias('install', target)
811 # install lyxclient, may not exist
813 target_name = os.path.split(str(client[0]))[1].replace('client', 'client%s' % version_suffix)
814 target = os.path.join(env['BIN_DEST_DIR'], target_name)
815 env.InstallAs(target, client)
816 Alias('install', target)
819 dirs = install(env['SHARE_DEST_DIR'],
820 [env.subst('$TOP_SRC_DIR/lib/') + file for file in ['configure.py', 'encodings',
821 'chkconfig.ltx', 'CREDITS', 'external_templates', 'symbols', 'languages',
822 'lyxrc.example', 'syntax.default', 'bind', 'images', 'layouts', 'scripts',
823 'templates', 'examples', 'kbd', 'lyx2lyx', 'tex', 'clipart', 'doc', 'ui']]
825 env.substFile('$SHARE_DEST_DIR/lyx2lyx/lyx2lyx_version.py',
826 '$TOP_SRC_DIR/lib/lyx2lyx/lyx2lyx_version.py.in')
827 Alias('install', dirs)
829 env.InstallAs(os.path.join(env['MAN_DEST_DIR'], 'lyx' + version_suffix + '.1'),
830 env.subst('$TOP_SRC_DIR/lyx.man'))
831 env.InstallAs(os.path.join(env['MAN_DEST_DIR'], 'tex2lyx' + version_suffix + '.1'),
832 env.subst('$TOP_SRC_DIR/src/tex2lyx/tex2lyx.man'))
833 env.InstallAs(os.path.join(env['MAN_DEST_DIR'], 'lyxclient' + version_suffix + '.1'),
834 env.subst('$TOP_SRC_DIR/src/client/lyxclient.man'))
835 Alias('install', [os.path.join(env['MAN_DEST_DIR'], x + version_suffix + '.1') for
836 x in ['lyx', 'tex2lyx', 'lyxclient']])
838 # ru.gmo ==> ru/LC_MESSAGES/lyxSUFFIX.mo
839 for gmo in gmo_files:
840 lan = os.path.split(str(gmo))[1].split('.')[0]
841 dest_file = os.path.join(env['LOCALE_DEST_DIR'], lan, 'LC_MESSAGES', 'lyx' + version_suffix + '.mo')
842 env.InstallAs(dest_file, gmo)
843 Alias('install', dest_file)
847 Alias('all', ['lyx', 'client', 'tex2lyx'])