]> git.lyx.org Git - lyx.git/commitdiff
iNew configure flag --with-lyxname. Misc small compilation fixes.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 10 Jan 2000 16:28:29 +0000 (16:28 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 10 Jan 2000 16:28:29 +0000 (16:28 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@411 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
INSTALL
NEWS
configure.in
lib/reLyX/configure.in
lib/reLyX/reLyX.in
src/Makefile.am
src/lyxlex.h
src/mathed/math_defs.h
src/support/block.h
src/support/lstrings.h

index f77a6937cac4f4cb229c2922d4ee6b2cfc6eacbb..8169912f67274d6456e2bd77a216a3c1de6cc403 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2000-01-10  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * 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  <larsbj@lyx.org>
 
        * src/bufferlist.C (close): don't call insetUnlock if the buffer
diff --git a/INSTALL b/INSTALL
index e5d95b98ee64975a5dab11c5992624a1d5cc2a58..e33439b9392b0993ef1337ed43af0d059a5132fb 100644 (file)
--- 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 76b2a17cc916710fe5782f5e93644717868ec576..110454b375429775f23c605abc186f29e6c93dcf 100644 (file)
--- 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 ;)
 
 
index 6b97c2f2f39d5940683f80480ecb256f6e5c07bb..2c6f427863da17751798b63b06dadead46cdacf7 100644 (file)
@@ -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
index b90fb676ff5dcd1394e24cf94c2506cc487104c9..53ab8f750afd9b2265273a0a927f3102e00fb671 100644 (file)
@@ -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
index 38e7160b946897a7dcd28d73a1024f6d42dcd667..4f1368c6914995ddfe462692f9eb87cd7bf1ea9d 100644 (file)
@@ -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
index 9ac3093aa2adb4f01410038efdad9deffa4276ab..beeb0db15a91320c35fe350f66dd1bc22f4557d3 100644 (file)
@@ -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
index 215bde91c62682e6a77e9a762dc994e221a77292..7531bb16fb037a9e19511556e61b6e83411091a2 100644 (file)
@@ -14,6 +14,8 @@
 #include <fstream>
 using std::filebuf;
 
+#include "support/LIstream.h"
+
 #include "LString.h"
 
 ///
index 74317388e87f603d310a19b50293c718f08fe8fb..b7de91e845fe53f9b0cbab65882352c1c1fdedb8 100644 (file)
 #pragma interface
 #endif
 
+#include "support/LIstream.h"
+
 #include "LString.h"
 #include "debug.h"
 
 #include "array.h"
 
+
 ///
 enum math_align {
        ///
index 7c44eedd9c5719e451be87d69b7c4a814c2e1407..560cc76d9dc6b7b222c15366f220c66720b327b5 100644 (file)
@@ -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];
index f1110316585ca268279ba6d4ec98c1560ffc334a..b419798e11311b8b4264dc13f0fe836ab5bc18bf 100644 (file)
@@ -32,8 +32,12 @@ T * lstrchr(T const * t, int c)
 {
   Assert(t); // we don't want null pointers
   T * r = const_cast<T*>(t);
-  while(*r != 0) 
-    if (*r == c) return r; else ++r;
+  while(*r != 0) { 
+    if (*r == c) 
+      return r; 
+    else 
+      ++r;
+  }
   return 0;
 }