Lars Gullik Bjønnes wrote:
> Rob Lahaye <[EMAIL PROTECTED]> writes:
> 
> | Lars Gullik Bjønnes wrote:
> 
>>>Rob Lahaye <[EMAIL PROTECTED]> writes:
>>>| Lars Gullik Bjønnes wrote:
>>>| > Rob Lahaye <[EMAIL PROTECTED]> writes:
>>>| > | +if test -z $GNUM4 ; then
>>>| > This test looks wrong... what happens if GNUM4 is not set?
>>>is isolation the test is not robust enough, and it costs nothing to
>>>make it robust.
>>
> | Do you mean by robust:
> 
> |    if test x$GNUM4 = x ; then
> 
> | ?
> 
> | If so, can you do that and apply the rest of my patch; or want me to do
> | it in my tree and send a new patch to the list ?
> 
> That would be nice (new patch.)

I read this as a promise to *eventually* commit my patch to CVS.
I'll treat you with a complete patch therefore; patch with a ChangLog entry ;).

Attached - Please apply.

Rob.
Index: ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/ChangeLog,v
retrieving revision 1.884
diff -u -r1.884 ChangeLog
--- ChangeLog   2002/10/09 14:38:16     1.884
+++ ChangeLog   2002/10/11 10:28:53
@@ -1,3 +1,10 @@
+2001-09-08  Rob Lahaye  <[EMAIL PROTECTED]>
+
+       * autogen.sh: add "< /dev/null" input to GNU m4 test, which prevents
+       a hang of the script on FreeBSD, exit if GNU m4 is not found;
+       set the autotool commands at the top of the file;
+       be more verbose on the used version of the autotools.
+
 2002-10-09  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
        * autogen.sh: fix test that says whether m4 has been found
Index: autogen.sh
===================================================================
RCS file: /cvs/lyx/lyx-devel/autogen.sh,v
retrieving revision 1.37
diff -u -r1.37 autogen.sh
--- autogen.sh  2002/10/09 14:38:17     1.37
+++ autogen.sh  2002/10/11 10:28:53
@@ -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... "
-for prog in $M4 gm4 gnum4 m4 ; do
-  case `$prog --version 2>&1` in
-    *GNU*) ok=yes
-          GNUM4=$prog
-          echo "found: $GNUM4"
-          break ;;
-    *) ;;
-  esac
+GNUM4=
+for prog in $M4 m4 gm4 gnum4 m4 ; do
+       # /dev/null input prevents a hang of the script for some m4 compilers (e.g. on 
+FreeBSD)
+       case `$prog --version < /dev/null 2>&1` in
+       *GNU*)  GNUM4=$prog
+               echo `which $GNUM4`
+               break ;;
+       *) ;;
+       esac
 done
-if test x$ok != xyes ; then
-    echo "not found."
+if test x$GNUM4 = x ; 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