]> git.lyx.org Git - lyx.git/blob - src/support/Package.cpp
1d54cd1d561be501516ebd71986ced52bb0dce40
[lyx.git] / src / support / Package.cpp
1 // -*- C++ -*-
2 /**
3  * \file package.C
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "support/Package.h"
15
16 #include "debug.h"
17 #include "gettext.h"
18
19 #include "support/environment.h"
20 #include "support/filetools.h"
21 #include "support/lstrings.h"
22 #include "support/ExceptionMessage.h"
23 #include "support/os.h"
24
25 #if defined (USE_WINDOWS_PACKAGING)
26 # include "support/os_win32.h"
27 #endif
28
29
30 #include <list>
31
32 #if !defined (USE_WINDOWS_PACKAGING) && \
33     !defined (USE_MACOSX_PACKAGING) && \
34     !defined (USE_POSIX_PACKAGING)
35 #error USE_FOO_PACKAGING must be defined for FOO = WINDOWS, MACOSX or POSIX.
36 #endif
37
38 #if defined (USE_MACOSX_PACKAGING)
39 # include <CoreServices/CoreServices.h> // FSFindFolder, FSRefMakePath
40 #endif
41
42 using std::string;
43
44 namespace lyx {
45 namespace support {
46
47 namespace {
48
49 Package package_;
50 bool initialised_ = false;
51
52 } // namespace anon
53
54
55 void init_package(string const & command_line_arg0,
56                   string const & command_line_system_support_dir,
57                   string const & command_line_user_support_dir,
58                   exe_build_dir_to_top_build_dir top_build_dir_location)
59 {
60         // Can do so only once.
61         if (initialised_)
62                 return;
63
64         package_ = Package(command_line_arg0,
65                            command_line_system_support_dir,
66                            command_line_user_support_dir,
67                            top_build_dir_location);
68         initialised_ = true;
69 }
70
71
72 Package const & package()
73 {
74         // Commented out because package().locale_dir() can be called
75         // from the message translation code in Messages.cpp before
76         // init_package() is called. Lars is on the case...
77         // BOOST_ASSERT(initialised_);
78         return package_;
79 }
80
81
82 namespace {
83
84 FileName const abs_path_from_binary_name(string const & exe);
85
86 void buildDirs(FileName const & abs_binary,
87         exe_build_dir_to_top_build_dir top_build_dir_location,
88         FileName &, FileName &);
89
90 FileName const get_document_dir(FileName const & home_dir);
91
92 FileName const get_home_dir();
93
94 FileName const get_locale_dir(FileName const & system_support_dir);
95
96 FileName const get_system_support_dir(FileName const & abs_binary,
97                                     string const & command_line_system_support_dir);
98
99 FileName const get_temp_dir();
100
101 FileName const get_default_user_support_dir(FileName const & home_dir);
102
103 bool userSupportDir(FileName const & default_user_support_dir,
104                      string const & command_line_user_support_dir, FileName & result);
105
106
107 string const & with_version_suffix();
108
109 } // namespace anon
110
111
112 Package::Package(string const & command_line_arg0,
113                  string const & command_line_system_support_dir,
114                  string const & command_line_user_support_dir,
115                  exe_build_dir_to_top_build_dir top_build_dir_location)
116         : explicit_user_support_dir_(false)
117 {
118         home_dir_ = get_home_dir();
119         system_temp_dir_ = get_temp_dir();
120         temp_dir_ = system_temp_dir_;
121         document_dir_ = get_document_dir(home_dir_);
122
123         FileName const abs_binary = abs_path_from_binary_name(command_line_arg0);
124         string const bdir = onlyPath(abs_binary.absFilename());
125         // We may be using libtools
126         if (suffixIs(bdir, ".libs/"))
127                 binary_dir_ = FileName(addPath(bdir, "../"));
128         else
129                 binary_dir_ = FileName(bdir);
130
131         // Is LyX being run in-place from the build tree?
132         buildDirs(abs_binary, top_build_dir_location,
133                 build_support_dir_, system_support_dir_);
134
135         if (build_support_dir_.empty())
136                 system_support_dir_ =
137                         get_system_support_dir(abs_binary,
138                                                command_line_system_support_dir);
139
140         locale_dir_ = get_locale_dir(system_support_dir_);
141
142         FileName const default_user_support_dir =
143                 get_default_user_support_dir(home_dir_);
144
145         explicit_user_support_dir_ = userSupportDir(default_user_support_dir,
146                                      command_line_user_support_dir, user_support_dir_);
147
148         FileName const configure_script(addName(system_support().absFilename(), "configure.py"));
149         configure_command_ = os::python() + ' ' +
150                         quoteName(configure_script.toFilesystemEncoding()) +
151                         with_version_suffix();
152
153         LYXERR(Debug::INIT, "<package>\n"
154                 << "\tbinary_dir " << binary_dir().absFilename() << '\n'
155                 << "\tsystem_support " << system_support().absFilename() << '\n'
156                 << "\tbuild_support " << build_support().absFilename() << '\n'
157                 << "\tuser_support " << user_support().absFilename() << '\n'
158                 << "\tlocale_dir " << locale_dir().absFilename() << '\n'
159                 << "\tdocument_dir " << document_dir().absFilename() << '\n'
160                 << "\ttemp_dir " << temp_dir().absFilename() << '\n'
161                 << "\thome_dir " << home_dir().absFilename() << '\n'
162                 << "</package>\n");
163 }
164
165
166 namespace {
167
168 // These next functions contain the stuff that is substituted at
169 // configuration-time.
170 FileName const hardcoded_localedir()
171 {
172         // FIXME UNICODE
173         // The build system needs to make sure that this is in utf8 encoding.
174         return FileName(LYX_ABS_INSTALLED_LOCALEDIR);
175 }
176
177
178 FileName const hardcoded_system_support_dir()
179 {
180         // FIXME UNICODE
181         // The build system needs to make sure that this is in utf8 encoding.
182         return FileName(LYX_ABS_INSTALLED_DATADIR);
183 }
184
185
186 string const & with_version_suffix()
187 {
188         static string const program_suffix = PROGRAM_SUFFIX;
189         static string const with_version_suffix =
190                 " --with-version-suffix=" PROGRAM_SUFFIX;
191         return program_suffix.empty() ? program_suffix : with_version_suffix;
192 }
193
194 } // namespace anon
195
196
197 FileName const & Package::top_srcdir()
198 {
199         // FIXME UNICODE
200         // The build system needs to make sure that this is in utf8 encoding.
201         static FileName const dir(LYX_ABS_TOP_SRCDIR);
202         return dir;
203 }
204
205
206 namespace {
207
208 bool check_command_line_dir(string const & dir,
209                             string const & file,
210                             string const & command_line_switch);
211
212 FileName const extract_env_var_dir(string const & env_var);
213
214 bool check_env_var_dir(FileName const & dir,
215                        string const & env_var);
216
217 bool check_env_var_dir(FileName const & dir,
218                        string const & file,
219                        string const & env_var);
220
221 string const relative_locale_dir();
222
223 string const relative_system_support_dir();
224
225
226 /**
227  * Convert \p name to internal path and strip a trailing slash, since it
228  * comes from user input (commandline or environment).
229  * \p name is encoded in utf8.
230  */
231 string const fix_dir_name(string const & name)
232 {
233         return rtrim(os::internal_path(name), "/");
234 }
235
236
237 FileName buildSupportDir(string const & binary_dir,
238                       exe_build_dir_to_top_build_dir top_build_dir_location)
239 {
240         string indirection;
241         switch (top_build_dir_location) {
242         case top_build_dir_is_one_level_up:
243                 indirection = "../lib";
244                 break;
245         case top_build_dir_is_two_levels_up:
246                 indirection = "../../lib";
247                 break;
248         }
249         return FileName(addPath(binary_dir, indirection));
250 }
251
252
253 void buildDirs(FileName const & abs_binary,
254   exe_build_dir_to_top_build_dir top_build_dir_location,
255         FileName & build_support_dir, FileName & system_support_dir)
256 {
257         string const check_text = "Checking whether LyX is run in place...";
258
259         // We're looking for "Makefile" in a directory
260         //   binary_dir/../lib
261         // We're also looking for "chkconfig.ltx" in a directory
262         //   top_srcdir()/lib
263         // If both are found, then we're running LyX in-place.
264
265         // Note that the name of the lyx binary may be a symbolic link.
266         // If that is the case, then we follow the links too.
267         FileName binary = abs_binary;
268         while (true) {
269                 // Try and find "lyxrc.defaults".
270                 string binary_dir = onlyPath(binary.absFilename());
271                 // We may be using libtools with static linking.
272                 if (suffixIs(binary_dir, ".libs/"))
273                         binary_dir = addPath(binary_dir, "../");
274                 build_support_dir = buildSupportDir(binary_dir, top_build_dir_location);
275                 if (!fileSearch(build_support_dir.absFilename(), "Makefile").empty()) {
276                         // Try and find "chkconfig.ltx".
277                         system_support_dir =
278                                 FileName(addPath(Package::top_srcdir().absFilename(), "lib"));
279
280                         if (!fileSearch(system_support_dir.absFilename(), "chkconfig.ltx").empty()) {
281                                 LYXERR(Debug::INIT, check_text << " yes");
282                                 return;
283                         }
284                 }
285
286                 // Check whether binary is a symbolic link.
287                 // If so, resolve it and repeat the exercise.
288                 if (!binary.isSymLink())
289                         break;
290
291                 FileName link;
292                 if (readLink(binary, link)) {
293                         binary = link;
294                 } else {
295                         // Unable to resolve the link.
296                         break;
297                 }
298         }
299
300         LYXERR(Debug::INIT, check_text << " no");
301         system_support_dir = FileName();
302         build_support_dir = FileName();
303 }
304
305
306 // Specification of document_dir_ may be reset by LyXRC,
307 // but the default is fixed for a given OS.
308 FileName const get_document_dir(FileName const & home_dir)
309 {
310 #if defined (USE_WINDOWS_PACKAGING)
311         (void)home_dir; // Silence warning about unused variable.
312         os::GetFolderPath win32_folder_path;
313         return FileName(win32_folder_path(os::GetFolderPath::PERSONAL));
314 #else // Posix-like.
315         return home_dir;
316 #endif
317 }
318
319
320 // The specification of home_dir_ is fixed for a given OS.
321 // A typical example on Windows: "C:/Documents and Settings/USERNAME"
322 // and on a Posix-like machine: "/home/USERNAME".
323 FileName const get_home_dir()
324 {
325 #if defined (USE_WINDOWS_PACKAGING)
326         string const home_dir = getEnv("USERPROFILE");
327 #else // Posix-like.
328         string const home_dir = getEnv("HOME");
329 #endif
330
331         return FileName(fix_dir_name(home_dir));
332 }
333
334
335 // Several sources are probed to ascertain the locale directory.
336 // The only requirement is that the result is indeed a directory.
337 FileName const get_locale_dir(FileName const & system_support_dir)
338 {
339         // 1. Use the "LYX_LOCALEDIR" environment variable.
340         FileName const path_env = extract_env_var_dir("LYX_LOCALEDIR");
341         if (!path_env.empty() && check_env_var_dir(path_env, "LYX_LOCALEDIR"))
342                 return path_env;
343
344         // 2. Search for system_support_dir / <relative locale dir>
345         // The <relative locale dir> is OS-dependent. (On Unix, it will
346         // be "../locale/".)
347         FileName path(addPath(system_support_dir.absFilename(),
348                 relative_locale_dir()));
349
350         if (path.exists() && path.isDirectory())
351                 return path;
352
353         // 3. Fall back to the hard-coded LOCALEDIR.
354         path = hardcoded_localedir();
355         if (path.exists() && path.isDirectory())
356                 return path;
357
358         return FileName();
359 }
360
361
362 // Specification of temp_dir_ may be reset by LyXRC,
363 // but the default is fixed for a given OS.
364 FileName const get_temp_dir()
365 {
366 #if defined (USE_WINDOWS_PACKAGING)
367         // Typical example: C:/TEMP/.
368         char path[MAX_PATH];
369         GetTempPath(MAX_PATH, path);
370         return FileName(to_utf8(from_local8bit(path)));
371 #else // Posix-like.
372         return FileName("/tmp");
373 #endif
374 }
375
376
377 // Extracts the absolute path from the foo of "-sysdir foo" or "-userdir foo"
378 FileName const abs_path_from_command_line(string const & command_line)
379 {
380         if (command_line.empty())
381                 return FileName();
382
383         string const path = fix_dir_name(command_line);
384         return os::is_absolute_path(path) ? FileName(path) : makeAbsPath(path);
385 }
386
387
388 // Does the grunt work for abs_path_from_binary_name()
389 FileName const get_binary_path(string const & exe)
390 {
391 #if defined (USE_WINDOWS_PACKAGING)
392         // The executable may have been invoked either with or
393         // without the .exe extension.
394         // Ensure that it is present.
395         string const as_internal_path = os::internal_path(exe);
396         string const exe_path = suffixIs(as_internal_path, ".exe") ?
397                 as_internal_path : as_internal_path + ".exe";
398 #else
399         string const exe_path = os::internal_path(exe);
400 #endif
401         if (os::is_absolute_path(exe_path))
402                 return FileName(exe_path);
403
404         // Two possibilities present themselves.
405         // 1. The binary is relative to the CWD.
406         FileName const abs_exe_path = makeAbsPath(exe_path);
407         if (abs_exe_path.exists())
408                 return abs_exe_path;
409
410         // 2. exe must be the name of the binary only and it
411         // can be found on the PATH.
412         string const exe_name = onlyFilename(exe_path);
413         if (exe_name != exe_path)
414                 return FileName();
415
416         std::vector<string> const path = getEnvPath("PATH");
417         std::vector<string>::const_iterator it = path.begin();
418         std::vector<string>::const_iterator const end = path.end();
419         for (; it != end; ++it) {
420                 // This will do nothing if *it is already absolute.
421                 string const exe_dir = makeAbsPath(*it).absFilename();
422
423                 FileName const exe_path(addName(exe_dir, exe_name));
424                 if (exe_path.exists())
425                         return exe_path;
426         }
427
428         // Didn't find anything.
429         return FileName();
430 }
431
432
433 // Extracts the absolute path to the binary name received as argv[0].
434 FileName const abs_path_from_binary_name(string const & exe)
435 {
436         FileName const abs_binary = get_binary_path(exe);
437         if (abs_binary.empty()) {
438                 // FIXME UNICODE
439                 throw ExceptionMessage(ErrorException,
440                         _("LyX binary not found"),
441                         bformat(_("Unable to determine the path to the LyX binary from the command line %1$s"),
442                                 from_utf8(exe)));
443         }
444         return abs_binary;
445 }
446
447
448 // A plethora of directories is searched to ascertain the system
449 // lyxdir which is defined as the first directory to contain
450 // "chkconfig.ltx".
451 FileName const
452 get_system_support_dir(FileName const & abs_binary,
453                   string const & command_line_system_support_dir)
454 {
455         string const chkconfig_ltx = "chkconfig.ltx";
456
457         // searched_dirs is used for diagnostic purposes only in the case
458         // that "chkconfig.ltx" is not found.
459         std::list<FileName> searched_dirs;
460
461         // 1. Use the -sysdir command line parameter.
462         FileName path = abs_path_from_command_line(command_line_system_support_dir);
463         if (!path.empty()) {
464                 searched_dirs.push_back(path);
465                 if (check_command_line_dir(path.absFilename(), chkconfig_ltx, "-sysdir"))
466                         return path;
467         }
468
469         // 2. Use the "LYX_DIR_15x" environment variable.
470         path = extract_env_var_dir("LYX_DIR_15x");
471         if (!path.empty()) {
472                 searched_dirs.push_back(path);
473                 if (check_env_var_dir(path, chkconfig_ltx, "LYX_DIR_15x"))
474                         return path;
475         }
476
477         // 3. Search relative to the lyx binary.
478         // We're looking for "chkconfig.ltx" in a directory
479         //   OnlyPath(abs_binary) / <relative dir> / PACKAGE /
480         // PACKAGE is hardcoded in config.h. Eg "lyx" or "lyx-1.3.6cvs".
481         // <relative dir> is OS-dependent; on Unix, it will be "../share/".
482         string const relative_lyxdir = relative_system_support_dir();
483
484         // One subtlety to be aware of. The name of the lyx binary may be
485         // a symbolic link. If that is the case, then we follow the links too.
486         FileName binary = abs_binary;
487         while (true) {
488                 // Try and find "chkconfig.ltx".
489                 string const binary_dir = onlyPath(binary.absFilename());
490
491                 FileName const lyxdir(addPath(binary_dir, relative_lyxdir));
492                 searched_dirs.push_back(lyxdir);
493
494                 if (!fileSearch(lyxdir.absFilename(), chkconfig_ltx).empty()) {
495                         // Success! "chkconfig.ltx" has been found.
496                         return lyxdir;
497                 }
498
499                 // Check whether binary is a symbolic link.
500                 // If so, resolve it and repeat the exercise.
501                 if (!binary.isSymLink())
502                         break;
503
504                 FileName link;
505                 if (readLink(binary, link)) {
506                         binary = link;
507                 } else {
508                         // Unable to resolve the link.
509                         break;
510                 }
511         }
512
513         // 4. Repeat the exercise on the directory itself.
514         FileName binary_dir(onlyPath(abs_binary.absFilename()));
515         while (true) {
516                 // This time test whether the directory is a symbolic link
517                 // *before* looking for "chkconfig.ltx".
518                 // (We've looked relative to the original already.)
519                 if (!binary.isSymLink())
520                         break;
521
522                 FileName link;
523                 if (readLink(binary_dir, link)) {
524                         binary_dir = link;
525                 } else {
526                         // Unable to resolve the link.
527                         break;
528                 }
529
530                 // Try and find "chkconfig.ltx".
531                 FileName const lyxdir(addPath(binary_dir.absFilename(),
532                         relative_lyxdir));
533                 searched_dirs.push_back(lyxdir);
534
535                 if (!fileSearch(lyxdir.absFilename(), chkconfig_ltx).empty()) {
536                         // Success! "chkconfig.ltx" has been found.
537                         return lyxdir;
538                 }
539         }
540
541         // 5. In desparation, try the hard-coded system support dir.
542         path = hardcoded_system_support_dir();
543         if (!fileSearch(path.absFilename(), chkconfig_ltx).empty())
544                 return path;
545
546         // Everything has failed :-(
547         // So inform the user and exit.
548         string searched_dirs_str;
549         typedef std::list<FileName>::const_iterator iterator;
550         iterator const begin = searched_dirs.begin();
551         iterator const end = searched_dirs.end();
552         for (iterator it = begin; it != end; ++it) {
553                 if (it != begin)
554                         searched_dirs_str += "\n\t";
555                 searched_dirs_str += it->absFilename();
556         }
557
558         // FIXME UNICODE
559         throw ExceptionMessage(ErrorException, _("No system directory"),
560                 bformat(_("Unable to determine the system directory "
561                                          "having searched\n"
562                                          "\t%1$s\n"
563                                          "Use the '-sysdir' command line parameter or "
564                                          "set the environment variable LYX_DIR_15x to "
565                                          "the LyX system directory containing the file "
566                                          "`chkconfig.ltx'."),
567                           from_utf8(searched_dirs_str)));
568
569         // Keep the compiler happy.
570         return FileName();
571 }
572
573
574 // Returns the absolute path to the user lyxdir, together with a flag
575 // indicating whether this directory was specified explicitly (as -userdir
576 // or through an environment variable) or whether it was deduced.
577 bool userSupportDir(FileName const & default_user_support_dir,
578         string const & command_line_user_support_dir, FileName & result)
579 {
580         // 1. Use the -userdir command line parameter.
581         result = abs_path_from_command_line(command_line_user_support_dir);
582         if (!result.empty())
583                 return true;
584
585         // 2. Use the LYX_USERDIR_15x environment variable.
586         result = extract_env_var_dir("LYX_USERDIR_15x");
587         if (!result.empty())
588                 return true;
589
590         // 3. Use the OS-dependent default_user_support_dir
591         result = default_user_support_dir;
592         return false;
593 }
594
595
596 // $HOME/.lyx on POSIX but on Win32 it will be something like
597 // "C:/Documents and Settings/USERNAME/Application Data/LyX"
598 FileName const get_default_user_support_dir(FileName const & home_dir)
599 {
600 #if defined (USE_WINDOWS_PACKAGING)
601         (void)home_dir; // Silence warning about unused variable.
602
603         os::GetFolderPath win32_folder_path;
604         return FileName(addPath(win32_folder_path(os::GetFolderPath::APPDATA), PACKAGE));
605
606 #elif defined (USE_MACOSX_PACKAGING)
607         (void)home_dir; // Silence warning about unused variable.
608
609         FSRef fsref;
610         OSErr const error_code =
611                 FSFindFolder(kUserDomain, kApplicationSupportFolderType,
612                              kDontCreateFolder, &fsref);
613         if (error_code != 0)
614                 return FileName();
615
616         // FSRefMakePath returns the result in utf8
617         char store[PATH_MAX + 1];
618         OSStatus const status_code =
619                 FSRefMakePath(&fsref,
620                               reinterpret_cast<UInt8*>(store), PATH_MAX);
621         if (status_code != 0)
622                 return FileName();
623
624         return FileName(addPath(reinterpret_cast<char const *>(store), PACKAGE));
625
626 #else // USE_POSIX_PACKAGING
627         return FileName(addPath(home_dir.absFilename(), string(".") + PACKAGE));
628 #endif
629 }
630
631
632 // Check that directory @c dir contains @c file.
633 // Else emit a warning about an invalid @c command_line_switch.
634 bool check_command_line_dir(string const & dir,
635                             string const & file,
636                             string const & command_line_switch)
637 {
638         FileName const abs_path = fileSearch(dir, file);
639         if (abs_path.empty()) {
640                 // FIXME UNICODE
641                 throw ExceptionMessage(WarningException, _("File not found"), bformat(
642                         _("Invalid %1$s switch.\nDirectory %2$s does not contain %3$s."),
643                         from_utf8(command_line_switch), from_utf8(dir),
644                         from_utf8(file)));
645         }
646
647         return !abs_path.empty();
648 }
649
650
651 // The environment variable @c env_var expands to a (single) file path.
652 FileName const extract_env_var_dir(string const & env_var)
653 {
654         string const dir = fix_dir_name(getEnv(env_var));
655         return dir.empty() ? FileName() : makeAbsPath(dir);
656 }
657
658
659 // Check that directory @c dir contains @c file.
660 // Else emit a warning about an invalid @c env_var.
661 bool check_env_var_dir(FileName const & dir,
662                        string const & file,
663                        string const & env_var)
664 {
665         FileName const abs_path = fileSearch(dir.absFilename(), file);
666         if (abs_path.empty()) {
667                 // FIXME UNICODE
668                 throw ExceptionMessage(WarningException, _("File not found"), bformat(
669                         _("Invalid %1$s environment variable.\n"
670                                 "Directory %2$s does not contain %3$s."),
671                         from_utf8(env_var), from_utf8(dir.absFilename()),
672                         from_utf8(file)));
673         }
674
675         return !abs_path.empty();
676 }
677
678
679 // Check that directory @c dir is indeed a directory.
680 // Else emit a warning about an invalid @c env_var.
681 bool check_env_var_dir(FileName const & dir,
682                        string const & env_var)
683 {
684         bool const success = dir.exists() && dir.isDirectory();
685
686         if (!success) {
687                 // Put this string on a single line so that the gettext
688                 // search mechanism in po/Makefile.in.in will register
689                 // Package.cpp.in as a file containing strings that need
690                 // translation.
691                 // FIXME UNICODE
692                 docstring const fmt =
693                         _("Invalid %1$s environment variable.\n%2$s is not a directory.");
694
695                 throw ExceptionMessage(WarningException, _("Directory not found"), bformat(
696                         fmt, from_utf8(env_var), from_utf8(dir.absFilename())));
697         }
698
699         return success;
700 }
701
702
703 // The locale directory relative to the LyX system directory.
704 string const relative_locale_dir()
705 {
706 #if defined (USE_WINDOWS_PACKAGING) || defined (USE_MACOSX_PACKAGING)
707         return "locale/";
708 #else
709         return "../locale/";
710 #endif
711 }
712
713
714 // The system lyxdir is relative to the directory containing the LyX binary.
715 string const relative_system_support_dir()
716 {
717         string result;
718
719 #if defined (USE_WINDOWS_PACKAGING) || defined (USE_MACOSX_PACKAGING)
720         result = "../Resources/";
721 #else // Posix-like.
722         result = addPath("../share/", PACKAGE);
723 #endif
724
725         return result;
726 }
727
728 } // namespace anon
729
730 } // namespace support
731 } // namespace lyx