support for new -version command line option

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2725 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2001-09-11 13:13:03 +00:00
parent b6113c5b8a
commit a4eb2c3040
7 changed files with 128 additions and 75 deletions

View File

@ -1,3 +1,13 @@
2001-09-10 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lyxinclude.m4:
* configure.in: add VERSION_INFO to config.h
(from a first proposal by Rob Lahaye)
2001-09-08 Rob Lahaye <lahaye@users.sourceforge.net>
* lyx.man: add -version commandline flag
2001-08-19 John Levon <moz@compsoc.man.ac.uk>
* configure.in: output new qt2 makefiles

View File

@ -212,6 +212,8 @@ dnl normal versions of a library), tasteless as that idea is.
CXXFLAGS=
dnl Check the version of g++
gxx_version=`${CXX} --version`
dnl Useful for global version info
CXX_VERSION="($gxx_version)"
AC_PROG_CXX_G
if test "$ac_test_CXXFLAGS" = set; then
@ -560,6 +562,7 @@ changequote([,])
esac
lyx_cv_xpmversion="$lyx_cv_xpmv.$lyx_cv_xpmr$lyxxpmv_alpha"
rm -f conftest*])
XPM_VERSION=${lyx_cv_xpmversion}
case "$lyx_cv_xpmr" in
changequote(,)
[789]|[0-9][0-9]*) ;;
@ -605,6 +608,7 @@ lyx_cv_xfversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
grep '^"%%%"' 2>/dev/null | \
sed -e 's/^"%%%"\(.*\)"%%%"/\1/' -e 's/ //g'`
rm -f conftest*])
XFORMS_VERSION=$lyx_cv_xfversion
case "$lyx_cv_xfversion" in
"(unknown)"|0.8[1-7]*)
LYX_ERROR(dnl
@ -916,7 +920,6 @@ AC_ARG_WITH(frontend,
Possible values: xforms, qt2, gnome],
[lyx_use_frontend="$withval"], [lyx_use_frontend="xforms"])
AC_MSG_RESULT($lyx_use_frontend)
lyx_flags="$lyx_flags frontend-$lyx_use_frontend"
AC_SUBST(FRONTEND)
AC_SUBST(FRONTEND_GUILIB)
AC_SUBST(FRONTEND_LDFLAGS)

View File

@ -185,8 +185,7 @@ dnl The code below is not in a macro, because this would cause big
dnl problems with the AC_REQUIRE contained in KDE_DO_IT_ALL.
case "$lyx_use_frontend" in
xforms)
# for now don't set it for xforms as this is always entered
FRONTEND=""
FRONTEND="xforms"
FRONTEND_GUILIB="xforms/libxforms.la";;
gnome)
AM_PATH_GTKMM(1.2.1,,
@ -227,6 +226,11 @@ if test "$have_x" = yes ; then
# version numbers...
LYX_PATH_XPM
LYX_PATH_XFORMS
FRONTEND_INFO=`cat <<EOF
libXpm version: ${XPM_VERSION}\n\
libforms version: ${XFORMS_VERSION}\n
EOF`
AC_SUBST(LYX_LIBS)
else
LYX_ERROR(dnl
@ -304,6 +308,26 @@ AC_REPLACE_FUNCS(strerror atexit)
LYX_CHECK_DECL_HDRS(mkstemp,[unistd.h stdlib.h])
### Some information on what just happened
real_bindir=`eval "echo \`eval \"echo ${bindir}\"\`"`
real_datadir=`eval "echo \`eval \"echo ${datadir}/${PACKAGE}\"\`"`
VERSION_INFO=`cat <<EOF
Configuration\n\
Host type: ${host_alias}\n\
Special build flags: ${lyx_flags}\n\
C Compiler: ${CC}\n\
C Compiler flags: ${CFLAGS}\n\
C++ Compiler: ${CXX} ${CXX_VERSION}\n\
C++ Compiler flags: ${CXXFLAGS}\n\
Linker flags: ${LDFLAGS}\n\
Frontend: ${FRONTEND}\n\
${FRONTEND_INFO}\
LyX binary dir: ${real_bindir}\n\
LyX files dir: ${real_datadir}\n
EOF`
AC_DEFINE_UNQUOTED(VERSION_INFO, "${VERSION_INFO}", Version information on the current build of LyX)
### Finish the work.
AC_CONFIG_SUBDIRS(sigc++ lib lib/reLyX)
AC_OUTPUT([Makefile \
@ -329,20 +353,10 @@ AC_OUTPUT([Makefile \
src/frontends/gnome/Makefile \
])
cat <<EOF
Configuration:
Source code location: ${srcdir}
C++ Compiler: ${CXX}
C++ Compiler flags: ${CXXFLAGS}
C Compiler: ${CC}
C Compiler flags: ${CFLAGS}
LyX binary dir: `eval "echo \`eval \"echo ${bindir}\"\`"`
LyX files dir: `eval "echo \`eval \"echo ${datadir}/${PACKAGE}\"\`"`
Special flags: ${lyx_flags}
EOF
# show version information
echo
printf "$VERSION_INFO"
echo
# Display a final warning if there has been a LYX_ERROR
LYX_CHECK_ERRORS

View File

@ -44,6 +44,9 @@ name \fBLyX\fR:
.BI \-help
summarizes LyX usage
.TP
.BI \-version
provides version information on the build of LyX.
.TP
.BI \-sysdir " directory"
sets system directory. Normally not needed.
.TP

View File

@ -1,21 +1,25 @@
src/buffer.C
src/bufferlist.C
src/BufferView2.C
src/bufferview_funcs.C
src/BufferView_pimpl.C
src/Chktex.C
src/ColorHandler.C
src/converter.C
src/CutAndPaste.C
src/FontLoader.C
src/LColor.C
src/LaTeX.C
src/LyXAction.C
src/LyXSendto.C
src/LyXView.C
src/MenuBackend.C
src/buffer.C
src/bufferlist.C
src/bufferview_funcs.C
src/converter.C
src/debug.C
src/exporter.C
src/ext_l10n.h
src/figure_form.C
src/figureForm.C
src/FontLoader.C
src/frontends/controllers/biblio.C
src/figure_form.C
src/frontends/controllers/ButtonController.h
src/frontends/controllers/character.C
src/frontends/controllers/ControlAboutlyx.C
src/frontends/controllers/ControlBibtex.C
src/frontends/controllers/ControlCharacter.C
@ -27,6 +31,8 @@ src/frontends/controllers/ControlPrint.C
src/frontends/controllers/ControlSearch.C
src/frontends/controllers/ControlSpellchecker.C
src/frontends/controllers/ControlThesaurus.C
src/frontends/controllers/biblio.C
src/frontends/controllers/character.C
src/frontends/controllers/helper_funcs.C
src/frontends/gnome/FormCitation.C
src/frontends/gnome/FormIndex.C
@ -35,7 +41,6 @@ src/frontends/gnome/FormRef.C
src/frontends/gnome/FormToc.C
src/frontends/gnome/Menubar_pimpl.C
src/frontends/qt2/FileDialog.C
src/frontends/qt2/lengthcombo.C
src/frontends/qt2/QAbout.C
src/frontends/qt2/QBibitem.C
src/frontends/qt2/QBibtex.C
@ -44,8 +49,8 @@ src/frontends/qt2/QCharacter.C
src/frontends/qt2/QCitation.C
src/frontends/qt2/QCitationDialog.C
src/frontends/qt2/QDocument.C
src/frontends/qt2/QError.C
src/frontends/qt2/QERT.C
src/frontends/qt2/QError.C
src/frontends/qt2/QExternal.C
src/frontends/qt2/QExternalDialog.C
src/frontends/qt2/QGraphics.C
@ -67,84 +72,85 @@ src/frontends/qt2/QThesaurus.C
src/frontends/qt2/QToc.C
src/frontends/qt2/QURL.C
src/frontends/qt2/QVCLog.C
src/frontends/xforms/combox.C
src/frontends/qt2/lengthcombo.C
src/frontends/xforms/FileDialog.C
src/frontends/xforms/form_aboutlyx.C
src/frontends/xforms/FormAboutlyx.C
src/frontends/xforms/form_bibitem.C
src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibtex.C
src/frontends/xforms/FormBibtex.C
src/frontends/xforms/form_browser.C
src/frontends/xforms/form_character.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_document.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/form_error.C
src/frontends/xforms/FormError.C
src/frontends/xforms/form_ert.C
src/frontends/xforms/FormERT.C
src/frontends/xforms/form_external.C
src/frontends/xforms/FormError.C
src/frontends/xforms/FormExternal.C
src/frontends/xforms/form_filedialog.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/form_float.C
src/frontends/xforms/FormFloat.C
src/frontends/xforms/form_graphics.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_include.C
src/frontends/xforms/FormInclude.C
src/frontends/xforms/form_index.C
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormLog.C
src/frontends/xforms/FormMathsBitmap.C
src/frontends/xforms/form_maths_deco.C
src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_delim.C
src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/form_maths_matrix.C
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/form_maths_panel.C
src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/form_maths_space.C
src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/form_minipage.C
src/frontends/xforms/FormMinipage.C
src/frontends/xforms/form_paragraph.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/form_preamble.C
src/frontends/xforms/FormPreamble.C
src/frontends/xforms/form_preferences.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/form_print.C
src/frontends/xforms/FormPrint.C
src/frontends/xforms/form_ref.C
src/frontends/xforms/FormRef.C
src/frontends/xforms/form_search.C
src/frontends/xforms/FormSearch.C
src/frontends/xforms/form_spellchecker.C
src/frontends/xforms/FormSpellchecker.C
src/frontends/xforms/form_tabular.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/form_thesaurus.C
src/frontends/xforms/FormThesaurus.C
src/frontends/xforms/form_toc.C
src/frontends/xforms/FormToc.C
src/frontends/xforms/form_url.C
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormVCLog.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/combox.C
src/frontends/xforms/form_aboutlyx.C
src/frontends/xforms/form_bibitem.C
src/frontends/xforms/form_bibtex.C
src/frontends/xforms/form_browser.C
src/frontends/xforms/form_character.C
src/frontends/xforms/form_citation.C
src/frontends/xforms/form_document.C
src/frontends/xforms/form_error.C
src/frontends/xforms/form_ert.C
src/frontends/xforms/form_external.C
src/frontends/xforms/form_filedialog.C
src/frontends/xforms/form_float.C
src/frontends/xforms/form_graphics.C
src/frontends/xforms/form_include.C
src/frontends/xforms/form_index.C
src/frontends/xforms/form_maths_deco.C
src/frontends/xforms/form_maths_delim.C
src/frontends/xforms/form_maths_matrix.C
src/frontends/xforms/form_maths_panel.C
src/frontends/xforms/form_maths_space.C
src/frontends/xforms/form_minipage.C
src/frontends/xforms/form_paragraph.C
src/frontends/xforms/form_preamble.C
src/frontends/xforms/form_preferences.C
src/frontends/xforms/form_print.C
src/frontends/xforms/form_ref.C
src/frontends/xforms/form_search.C
src/frontends/xforms/form_spellchecker.C
src/frontends/xforms/form_tabular.C
src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/form_thesaurus.C
src/frontends/xforms/form_toc.C
src/frontends/xforms/form_url.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/xforms_helpers.C
src/gettext.h
src/importer.C
src/insets/figinset.C
src/insets/insetbib.C
src/insets/inset.C
src/insets/insetbib.C
src/insets/insetcaption.C
src/insets/inseterror.C
src/insets/insetert.C
@ -169,25 +175,19 @@ src/insets/insettoc.C
src/insets/inseturl.C
src/kbsequence.C
src/language.C
src/LaTeX.C
src/layout.C
src/LColor.C
src/LyXAction.C
src/lyx_cb.C
src/lyx_gui_misc.C
src/lyx_main.C
src/lyxfind.C
src/lyxfont.C
src/lyxfunc.C
src/lyx_gui_misc.C
src/lyx_main.C
src/lyxrc.C
src/LyXSendto.C
src/lyxvc.C
src/LyXView.C
src/mathed/formulabase.C
src/mathed/formula.C
src/mathed/formulabase.C
src/mathed/formulamacro.C
src/mathed/math_cursor.C
src/MenuBackend.C
src/minibuffer.C
src/paragraph.C
src/print_form.C
@ -196,6 +196,6 @@ src/support/getUserName.C
src/support/path.C
src/support/path.h
src/tabular.C
src/text2.C
src/text.C
src/text2.C
src/ext_l10n.h

View File

@ -1,3 +1,11 @@
2001-09-10 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lyx_main.C (commandLineHelp): remove version information
2001-09-08 Rob Lahaye <lahaye@users.sourceforge.net>
* lyx_main.C: add -version commandline option
2001-09-09 Lars Gullik Bjønnes <larsbj@birdstep.com>
* paragraph.h: make the optional constructor arg required instead.

View File

@ -752,7 +752,6 @@ void setDebuggingLevel(string const & dbgLevel)
// Give command line help
void commandLineHelp()
{
lyxerr << "LyX " LYX_VERSION << " of " LYX_RELEASE << endl;
lyxerr <<
_("Usage: lyx [ command line switches ] [ name.lyx ... ]\n"
"Command line switches (case sensitive):\n"
@ -770,9 +769,20 @@ void commandLineHelp()
"\t-i [--import] fmt file.xxx\n"
" where fmt is the import format of choice\n"
" and file.xxx is the file to be imported.\n"
"\t-version summarize version and build info\n"
"Check the LyX man page for more details.") << endl;
}
// Give command line version information
void commandLineVersionInfo()
{
lyxerr << "LyX " LYX_VERSION << " of " LYX_RELEASE << endl;
lyxerr << "Built on " << __DATE__ << ", " << __TIME__ << endl;
lyxerr << VERSION_INFO << endl;
}
} // namespace anon
@ -822,6 +832,11 @@ bool LyX::easyParse(int * argc, char * argv[])
commandLineHelp();
exit(0);
}
// Check for --version or -version
else if (arg == "--version" || arg == "-version") {
commandLineVersionInfo();
exit(0);
}
// Check for "-nw": No XWindows as for emacs this should
// give a LyX that could be used in a terminal window.
//else if (arg == "-nw") {