Jean-Marc Lasgouttes wrote:
>>>>>>"Rob" == Rob Lahaye <[EMAIL PROTECTED]> writes:
>>>>>
> 
> Rob> Hi
> 
> Rob> I reported this before, but was ignored :(. I still believe this
> Rob> is wrong, though not that critical:
> 
> So you mean a patch like the one appleneded?
>

Possibly, but my original patch from a while ago was more rigorous and I think
those changes were really needed.
Attached patch does:

1) Set ACLOCAL/AUTOHEADER/AUTOMAKE/AUTOCONF *before* the test of autoversion,
    that'll make the script easier to configure for people who have both
    autoversions installed (e.g. I have autoconf and autoconf213 ).

2) Be a little more verbose on which autoconf version is used.

3) Improve the (g)m4 search, and exit when not found.
    There's no point in continuing without having found the proper m4 compiler.

4) Add a few (harmless) spaces in the if test clauses.
    (This is not essential, just did it on the fly :).

Rob.
Index: autogen.sh
===================================================================
RCS file: /cvs/lyx/lyx-devel/autogen.sh,v
retrieving revision 1.36
diff -u -r1.36 autogen.sh
--- autogen.sh  2002/09/12 15:21:39     1.36
+++ autogen.sh  2002/10/09 13:57:34
@@ -1,8 +1,14 @@
 #!/bin/sh
 
+ACLOCAL=aclocal
+AUTOHEADER="autoheader"
+AUTOMAKE="automake -a -c --foreign"
+AUTOCONF="autoconf"
+
 # Discover what version of autoconf we are using.
-autoversion=`autoconf --version | head -n 1`
+autoversion=`$AUTOCONF --version | head -n 1`
 
+echo "Using $autoversion"
 case $autoversion in
     *2.13)
        cp config/acconfig.h .
@@ -19,35 +25,30 @@
        cp config/relyx_configure.ac lib/reLyX/configure.ac
        ;;
     *)
-       echo "You are running autoconf $autoversion, that"
-       echo "version is not supported by LyX."
+       echo "This autoconf version is not supported by LyX."
        echo "LyX only supports autoconf 2.13 and 2.53."
        exit
        ;;
 esac
 
 
-ACLOCAL=aclocal
-AUTOHEADER="autoheader"
-AUTOMAKE="automake -a -c --foreign"
-AUTOCONF="autoconf"
-GNUM4=
-
 ACINCLUDE_FILES="lyxinclude.m4 libtool.m4 codeset.m4 gettext.m4 glibc21.m4 iconv.m4 
isc-posix.m4 lcmessage.m4 progtest.m4 xforms.m4 qt.m4 gtk--.m4 gnome--.m4 gnome.m4 
pspell.m4 pkg.m4"
 SIGCPP_ACINCLUDE_FILES="libtool.m4"
 
 echo -n "Locating GNU m4... "
+GNUM4=
 for prog in $M4 gm4 gnum4 m4 ; do
-  case `$prog --version 2>&1` in
-    *GNU*) ok=yes
-          GNUM4=$prog
-          echo "found: $GNUM4"
-          break ;;
-    *) ;;
-  esac
+       if ! ( $prog --version ) < /dev/null > /dev/null 2>&1; then continue ; fi
+       case `$prog --version 2>&1` in
+       *GNU*)  GNUM4=$prog
+               echo "found: $GNUM4"
+               break ;;
+       *) ;;
+       esac
 done
-if test x$ok = xno ; then
-    echo "not found."
+if test -z $GNUM4 ; then
+       echo "not found."
+       exit
 fi
 
 # Generate acinclude.m4
@@ -57,7 +58,7 @@
 echo "done."
 
 # Generate the Makefiles and configure files
-if ( $ACLOCAL --version ) </dev/null > /dev/null 2>&1; then
+if ( $ACLOCAL --version ) < /dev/null > /dev/null 2>&1; then
        echo "Building macros..."
        for dir in . lib/reLyX ; do
            echo "        $dir"
@@ -69,7 +70,7 @@
        exit
 fi
 
-if ( $AUTOHEADER --version ) </dev/null > /dev/null 2>&1; then
+if ( $AUTOHEADER --version ) < /dev/null > /dev/null 2>&1; then
        echo "Building config header template..."
        for dir in . ; do
            echo "        $dir"
@@ -81,7 +82,7 @@
        exit
 fi
 
-if ( $AUTOMAKE --version ) </dev/null > /dev/null 2>&1; then
+if ( $AUTOMAKE --version ) < /dev/null > /dev/null 2>&1; then
        echo "Building Makefile templates..."
        for dir in . lib/reLyX ; do
            echo "        $dir"
@@ -93,7 +94,7 @@
        exit
 fi
 
-if ( $AUTOCONF --version ) </dev/null > /dev/null 2>&1; then
+if ( $AUTOCONF --version ) < /dev/null > /dev/null 2>&1; then
        echo "Building configure..."
        for dir in . lib/reLyX ; do
            echo "       $dir"
@@ -106,16 +107,11 @@
 fi
 
 # Autogenerate lib/configure.m4.
-if test x$GNUM4 != x ; then
-    echo -n "Building lib/configure ... "
-    rm -f lib/configure
-    $GNUM4 lib/configure.m4 > lib/configure
-    chmod a+x lib/configure
-    echo "done."
-else
-    echo "No GNU m4. Impossible to build lib/configure -- aborting"
-    exit
-fi
+echo -n "Building lib/configure ... "
+rm -f lib/configure
+$GNUM4 lib/configure.m4 > lib/configure
+chmod a+x lib/configure
+echo "done."
 
 echo
 echo 'run "./configure ; make"'

Reply via email to