From 1fd5e5ed974338edef45216c3e3a3f678b180676 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 10 Jan 2000 16:28:29 +0000 Subject: [PATCH] iNew configure flag --with-lyxname. Misc small compilation fixes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@411 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 26 ++++++++++++++++++++++++++ INSTALL | 11 ++++++----- NEWS | 5 +++++ configure.in | 6 +++++- lib/reLyX/configure.in | 22 +++++++++++----------- lib/reLyX/reLyX.in | 6 +++--- src/Makefile.am | 5 ++--- src/lyxlex.h | 2 ++ src/mathed/math_defs.h | 3 +++ src/support/block.h | 6 +++++- src/support/lstrings.h | 8 ++++++-- 11 files changed, 74 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index f77a6937ca..8169912f67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2000-01-10 Jean-Marc Lasgouttes + + * src/support/block.h: disable operator T* (), since it causes + problems with both compilers I tried. See comments in the file. + + * lib/reLyX/configure.in: do not define LYX_DIR. support flag + --with-lyxname. + + * lib/reLyX/reLyX.in: change LYX_DIR to pkgdatadir; change env. + variable LYX_DIR_10x to LYX_DIR_11x. + + * src/Makefile.am: replace variable LYX_DIR with pkgdatadir. + + * INSTALL: document --with-lyxname. + * NEWS: ditto. + + * configure.in: new configure flag --with-lyxname which allows to + choose the name under which lyx is installed. Default is "lyx", of + course. It used to be possible to do this with --program-suffix, + but the later has in fact a different meaning for autoconf. + + * src/support/lstrings.h (lstrchr): reformat a bit. + + * src/lyxlex.h: include LIstream.h, for Sun CC this time. + * src/mathed/math_defs.h: ditto. + 2000-01-08 Lars Gullik Bjønnes * src/bufferlist.C (close): don't call insetUnlock if the buffer diff --git a/INSTALL b/INSTALL index e5d95b98ee..e33439b939 100644 --- a/INSTALL +++ b/INSTALL @@ -119,7 +119,12 @@ flags: o --with-extra-prefix[=DIRECTORY] that is equivalent to --with-extra-lib=DIRECTORY/lib --with-extra-inc=DIRECTORY/include - If DIRECTORY is not specified, the current prefix is used. + If DIRECTORY is not specified, the current prefix is used. + + o --with-lyxname=STRING sets the name of the installed LyX binary and + of the LyX library directory to STRING. This may be used to + compile lyx as lyx-1.1 and avoid clashes with earlier/later + versions. Default is "lyx". o --with-two-colors=[yes|no] that forces LyX to use two colors pixmaps (bitmaps) instead of the full-colored standard ones. Defaults to no. @@ -151,10 +156,6 @@ Moreover, the following generic configure flags may be useful: installation. [defaults to where lyx has already been installed or /usr/local] - o --program-suffix=STRING sets the name of the installed LyX binary and - of the LyX library directory to lyxSTRING. This may be used to - compile lyx as lyx-1.0.0 and avoid clashes with earlier/later versions. - o --datadir=DIRECTORY gives the directory where all extra LyX files (lyxrc example, documentation, templates and layouts definitions) will be installed. diff --git a/NEWS b/NEWS index 76b2a17cc9..110454b375 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,11 @@ In the user-visible department, we find: - improved translations, in particular in finnish (overhauled UI translation), dutch (tutorial and examples), german +- new configure flag --with-lyxname which allows to choose the name + under which lyx is installed. Default is "lyx", of course. It used + to be possible to do this with --program-suffix, but the later has + in fact a different meaning for autoconf. + And of course, a lot of old bugs have been replaced by new ones ;) diff --git a/configure.in b/configure.in index 6b97c2f2f3..2c6f427863 100644 --- a/configure.in +++ b/configure.in @@ -11,7 +11,11 @@ LYX_GET_VERSION(${srcdir}/src/version.h) AC_CANONICAL_SYSTEM AC_VALIDATE_CACHE_SYSTEM_TYPE -AM_INIT_AUTOMAKE(lyx, $VERSION) +AC_ARG_WITH(lyxname, + [ --with-lyxname the name under which lyx will be installed], + [lyxname=$withval],[lyxname=lyx]) + +AM_INIT_AUTOMAKE($lyxname, $VERSION) # The list of languages known to LyX # This is needed by GNU gettext diff --git a/lib/reLyX/configure.in b/lib/reLyX/configure.in index b90fb676ff..53ab8f750a 100644 --- a/lib/reLyX/configure.in +++ b/lib/reLyX/configure.in @@ -3,27 +3,27 @@ AC_INIT(reLyX.in) AC_PREREQ(2.13) dnl We want to use autoconf 2.13 AC_CONFIG_AUX_DIR(../../config) +dnl PACKAGE=reLyX +dnl Do this to install in $datadir/lyx/reLyX instead of $datadir/reLyX/reLyX + +AC_ARG_WITH(lyxname, + [ --with-lyxname the name under which lyx will be installed], + [lyxname=$withval],[lyxname=lyx]) + +dnl must make a macro that gets the reLyX version +VERSION=2.0 +AM_INIT_AUTOMAKE($lyxname, $VERSION) + AC_PREFIX_PROGRAM(reLyX) # fix the value of the prefixes. test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -dnl PACKAGE=reLyX -dnl Do this to install in $datadir/lyx/reLyX instead of $datadir/reLyX/reLyX -PACKAGE=lyx -VERSION=2.0 -dnl must make a macro that gets the reLyX version -AM_INIT_AUTOMAKE($PACKAGE, $VERSION) - dnl Checks for programs. AC_PROG_INSTALL RELYX_CHECK_PERL dnl Finish the work -test $program_suffix = NONE && program_suffix= -LYX_DIR=`eval "echo \`eval \"echo ${datadir}/lyx${program_suffix}\"\`"` -AC_SUBST(LYX_DIR) - AC_OUTPUT(Makefile reLyX noweb2lyx, chmod 755 reLyX noweb2lyx) RELYX_CHECK_ERRORS diff --git a/lib/reLyX/reLyX.in b/lib/reLyX/reLyX.in index 38e7160b94..4f1368c691 100644 --- a/lib/reLyX/reLyX.in +++ b/lib/reLyX/reLyX.in @@ -18,7 +18,7 @@ my $mainscript = "reLyXmain.pl"; # Do this in a BEGIN block so it's done before the 'use lib' below BEGIN{ # This points to LyX library dir, e.g. /usr/local/share/lyx -$lyxdir = "@LYX_DIR@"; +$lyxdir = "@pkgdatadir@"; # This is just "." if you compiled from the source directory my $srcdir = "@srcdir@"; # This is the name of the program, usually just "lyx" @@ -34,8 +34,8 @@ my $dir = &dirname($name); my $i = 0; # case 1: for developers, e.g. - reLyX and $mainscript in same directory $maybe_dir[$i++] = "."; -# case 2: environment variable LYX_DIR_12 has been set -if (exists $ENV{LYX_DIR_10x}) { $maybe_dir[$i++] = "$ENV{LYX_DIR_10x}/reLyX"}; +# case 2: environment variable LYX_DIR_11x has been set +if (exists $ENV{LYX_DIR_11x}) { $maybe_dir[$i++] = "$ENV{LYX_DIR_11x}/reLyX"}; # case 3: ran make but not make install. $maybe_dir[$i++] = "$dir/$srcdir"; # case 4: e.g., reLyX in /opt/bin, $mainscript in /opt/share/lyx/reLyX diff --git a/src/Makefile.am b/src/Makefile.am index 9ac3093aa2..beeb0db15a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,7 +7,6 @@ lyx_DEPENDENCIES = mathed/libmathed.o insets/libinsets.o support/libsupport.la lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(LYX_LIBS) EXTRA_DIST = config.h.in stamp-h.in cheaders ETAGS_ARGS = --c++ -LYX_DIR = $(datadir)/$(PACKAGE) INCLUDES = -I${top_srcdir}/images localedir = $(datadir)/locale lyx_SOURCES = \ @@ -180,8 +179,8 @@ lyx_main.o: lyx_main.C lyx_main.h config.h version.h debug.h gettext.h \ lyx_gui.h lyx_gui_misc.h lyxrc.h support/path.h support/filetools.h \ bufferlist.h support/FileInfo.h lastfiles.h intl.h \ lyxserver.h layout.h gettext.h - $(CXXCOMPILE) -DLYX_DIR=\"$(LYX_DIR)\" -DTOP_SRCDIR=\"$(top_srcdir)\" \ - -c $(top_srcdir)/src/lyx_main.C + $(CXXCOMPILE) -DLYX_DIR=\"$(pkgdatadir)\" \ + -DTOP_SRCDIR=\"$(top_srcdir)\" -c $(top_srcdir)/src/lyx_main.C main.o: main.C config.h lyx_main.h gettext.h LString.h support/filetools.h $(CXXCOMPILE) -DLOCALEDIR=\"$(localedir)\" -c $(top_srcdir)/src/main.C diff --git a/src/lyxlex.h b/src/lyxlex.h index 215bde91c6..7531bb16fb 100644 --- a/src/lyxlex.h +++ b/src/lyxlex.h @@ -14,6 +14,8 @@ #include using std::filebuf; +#include "support/LIstream.h" + #include "LString.h" /// diff --git a/src/mathed/math_defs.h b/src/mathed/math_defs.h index 74317388e8..b7de91e845 100644 --- a/src/mathed/math_defs.h +++ b/src/mathed/math_defs.h @@ -24,11 +24,14 @@ #pragma interface #endif +#include "support/LIstream.h" + #include "LString.h" #include "debug.h" #include "array.h" + /// enum math_align { /// diff --git a/src/support/block.h b/src/support/block.h index 7c44eedd9c..560cc76d9d 100644 --- a/src/support/block.h +++ b/src/support/block.h @@ -17,7 +17,11 @@ public: typedef T * iterator; typedef T const * const_iterator; size_type size() const { return s; } - operator T* () { return arr; } +#warning I disabled this to be able to compile... (JMarc) + // I think that, sor the same reason that string->char* is not + // automatic, we should have a c_array() method to do that. However, + // Lars, it is your choice... + // operator T* () { return arr; } reference at(int i) { Assert(i >= 0 && i < s); return arr[i]; diff --git a/src/support/lstrings.h b/src/support/lstrings.h index f111031658..b419798e11 100644 --- a/src/support/lstrings.h +++ b/src/support/lstrings.h @@ -32,8 +32,12 @@ T * lstrchr(T const * t, int c) { Assert(t); // we don't want null pointers T * r = const_cast(t); - while(*r != 0) - if (*r == c) return r; else ++r; + while(*r != 0) { + if (*r == c) + return r; + else + ++r; + } return 0; }