mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 17:20:55 +00:00
Fix bug 2285 (tex2lyx is not found by lib/configure when compiling with
--with-version-suffix): * src/lyx_cb.C (reconfigure): get the configure command from package() * src/lyx_main.C (showFileError): ditto * src/support/package.[Ch] (configure_command): new, return the configure command * src/support/package.C.in (with_version_suffix): new, return the version suffix argument of the configure command * src/support/Makefile.am (package.C.in): substitute %PROGRAM_SUFFIX% in package.C.in * config/lyxinclude.m4: substitute program_suffix git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@13723 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
dc67ce04e3
commit
5a755b4e1e
@ -29,6 +29,7 @@ dnl
|
|||||||
dnl
|
dnl
|
||||||
AC_DEFUN([LYX_VERSION_SUFFIX],[
|
AC_DEFUN([LYX_VERSION_SUFFIX],[
|
||||||
AC_MSG_CHECKING([for version suffix])
|
AC_MSG_CHECKING([for version suffix])
|
||||||
|
dnl We need the literal double quotes in the rpm spec file
|
||||||
RPM_VERSION_SUFFIX='""'
|
RPM_VERSION_SUFFIX='""'
|
||||||
AC_ARG_WITH(version-suffix,
|
AC_ARG_WITH(version-suffix,
|
||||||
[ --with-version-suffix[=<version>] install lyx files as lyx<version>],
|
[ --with-version-suffix[=<version>] install lyx files as lyx<version>],
|
||||||
@ -609,6 +610,7 @@ case $lyx_use_packaging in
|
|||||||
*) LYX_ERROR([Unknown packaging type $lyx_use_packaging]) ;;
|
*) LYX_ERROR([Unknown packaging type $lyx_use_packaging]) ;;
|
||||||
esac
|
esac
|
||||||
AC_SUBST(pkgdatadir)
|
AC_SUBST(pkgdatadir)
|
||||||
|
AC_SUBST(program_suffix)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
@ -446,9 +446,7 @@ void Reconfigure(BufferView * bv)
|
|||||||
|
|
||||||
// Run configure in user lyx directory
|
// Run configure in user lyx directory
|
||||||
Path p(package().user_support());
|
Path p(package().user_support());
|
||||||
string const configure_script =
|
string const configure_command = package().configure_command();
|
||||||
AddName(package().system_support(), "configure");
|
|
||||||
string const configure_command = "sh " + QuoteName(configure_script);
|
|
||||||
Systemcall one;
|
Systemcall one;
|
||||||
one.startscript(Systemcall::Wait, configure_command);
|
one.startscript(Systemcall::Wait, configure_command);
|
||||||
p.pop();
|
p.pop();
|
||||||
|
@ -116,10 +116,7 @@ void showFileError(string const & error)
|
|||||||
|
|
||||||
void reconfigureUserLyXDir()
|
void reconfigureUserLyXDir()
|
||||||
{
|
{
|
||||||
string const configure_script =
|
string const configure_command = package().configure_command();
|
||||||
AddName(package().system_support(), "configure");
|
|
||||||
string const configure_command =
|
|
||||||
"sh " + QuoteName(configure_script);
|
|
||||||
|
|
||||||
lyxerr << _("LyX: reconfiguring user directory") << endl;
|
lyxerr << _("LyX: reconfiguring user directory") << endl;
|
||||||
Path p(package().user_support());
|
Path p(package().user_support());
|
||||||
|
@ -88,7 +88,8 @@ build_package: package.C.in
|
|||||||
@rm -f tmp_package ;\
|
@rm -f tmp_package ;\
|
||||||
sed "s,%LYX_DIR%,$(LYX_ABS_INSTALLED_DATADIR),;\
|
sed "s,%LYX_DIR%,$(LYX_ABS_INSTALLED_DATADIR),;\
|
||||||
s,%LOCALEDIR%,$(LYX_ABS_INSTALLED_LOCALEDIR),;\
|
s,%LOCALEDIR%,$(LYX_ABS_INSTALLED_LOCALEDIR),;\
|
||||||
s,%TOP_SRCDIR%,$(LYX_ABS_TOP_SRCDIR)," \
|
s,%TOP_SRCDIR%,$(LYX_ABS_TOP_SRCDIR),;\
|
||||||
|
s,%PROGRAM_SUFFIX%,$(program_suffix)," \
|
||||||
$(srcdir)/package.C.in > tmp_package ;\
|
$(srcdir)/package.C.in > tmp_package ;\
|
||||||
if cmp -s tmp_package package.C ; then \
|
if cmp -s tmp_package package.C ; then \
|
||||||
rm -f tmp_package ;\
|
rm -f tmp_package ;\
|
||||||
|
@ -111,6 +111,9 @@ std::pair<string, bool> const
|
|||||||
get_user_support_dir(string const & default_user_support_dir,
|
get_user_support_dir(string const & default_user_support_dir,
|
||||||
string const & command_line_user_support_dir);
|
string const & command_line_user_support_dir);
|
||||||
|
|
||||||
|
|
||||||
|
string const & with_version_suffix();
|
||||||
|
|
||||||
} // namespace anon
|
} // namespace anon
|
||||||
|
|
||||||
|
|
||||||
@ -144,6 +147,10 @@ Package::Package(string const & command_line_arg0,
|
|||||||
get_user_support_dir(default_user_support_dir,
|
get_user_support_dir(default_user_support_dir,
|
||||||
command_line_user_support_dir);
|
command_line_user_support_dir);
|
||||||
|
|
||||||
|
string const configure_script = AddName(system_support(), "configure");
|
||||||
|
configure_command_ = "sh " + QuoteName(configure_script)
|
||||||
|
+ with_version_suffix();
|
||||||
|
|
||||||
lyxerr[Debug::INIT]
|
lyxerr[Debug::INIT]
|
||||||
<< "<package>\n"
|
<< "<package>\n"
|
||||||
<< "\tbinary_dir " << binary_dir() << '\n'
|
<< "\tbinary_dir " << binary_dir() << '\n'
|
||||||
@ -180,6 +187,15 @@ string const hardcoded_system_support_dir()
|
|||||||
return string("%LYX_DIR%");
|
return string("%LYX_DIR%");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string const & with_version_suffix()
|
||||||
|
{
|
||||||
|
static string const program_suffix("%PROGRAM_SUFFIX%");
|
||||||
|
static string const
|
||||||
|
with_version_suffix(" --with-version-suffix=%PROGRAM_SUFFIX%");
|
||||||
|
return program_suffix.empty() ? program_suffix : with_version_suffix;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace anon
|
} // namespace anon
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,9 +116,13 @@ public:
|
|||||||
* Used by the XForms file dialog.
|
* Used by the XForms file dialog.
|
||||||
* Used in emergencyWrite (bufferlist.C) as one possible location
|
* Used in emergencyWrite (bufferlist.C) as one possible location
|
||||||
* for the dump.
|
* for the dump.
|
||||||
|
* This may be empty (e. g. when run under a CGI environment)
|
||||||
*/
|
*/
|
||||||
std::string const & home_dir() const;
|
std::string const & home_dir() const;
|
||||||
|
|
||||||
|
/// Command to run the configure script
|
||||||
|
std::string const & configure_command() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string binary_dir_;
|
std::string binary_dir_;
|
||||||
std::string system_support_dir_;
|
std::string system_support_dir_;
|
||||||
@ -128,6 +132,7 @@ private:
|
|||||||
mutable std::string document_dir_;
|
mutable std::string document_dir_;
|
||||||
mutable std::string temp_dir_;
|
mutable std::string temp_dir_;
|
||||||
std::string home_dir_;
|
std::string home_dir_;
|
||||||
|
std::string configure_command_;
|
||||||
bool explicit_user_support_dir_;
|
bool explicit_user_support_dir_;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -189,6 +194,12 @@ std::string const & Package::home_dir() const
|
|||||||
return home_dir_;
|
return home_dir_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
std::string const & Package::configure_command() const
|
||||||
|
{
|
||||||
|
return configure_command_;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace support
|
} // namespace support
|
||||||
} // namespace lyx
|
} // namespace lyx
|
||||||
|
|
||||||
|
@ -63,3 +63,6 @@ What's new
|
|||||||
- Make LyX/Win work under windows 98.
|
- Make LyX/Win work under windows 98.
|
||||||
|
|
||||||
- Fix compilation on DragonFly BSD.
|
- Fix compilation on DragonFly BSD.
|
||||||
|
|
||||||
|
- Fix lib/configure to find tex2lyx when compiling with --with-version-suffix
|
||||||
|
(bug 2285)
|
||||||
|
Loading…
Reference in New Issue
Block a user