]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acgeneral.m4 (AC_PLAIN_SCRIPT): New macro.
authorAkim Demaille <akim@epita.fr>
Mon, 10 Jul 2000 08:56:19 +0000 (08:56 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 10 Jul 2000 08:56:19 +0000 (08:56 +0000)
* tests/base.m4 (m4_wrap, AC_REQUIRE, AC_SHELL_MKDIR_P): Use it.
* autoconf.sh: Properly handle the case where `$output' is `-'
(i.e., stdout).
Handle `-ofile', not only `-o file'.

ChangeLog
acgeneral.m4
autoconf.in
autoconf.sh
bin/autoconf.in
lib/autoconf/general.m4
tests/base.m4

index 476ddd8a6e5f025fbc03615fc4ecfd89cb387848..90760569b4e7fc04c9b67dd50d037027eedbf0e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2000-07-10  Akim Demaille  <akim@epita.fr>
+
+       * acgeneral.m4 (AC_PLAIN_SCRIPT): New macro.
+       * tests/base.m4 (m4_wrap, AC_REQUIRE, AC_SHELL_MKDIR_P): Use it.
+       * autoconf.sh: Properly handle the case where `$output' is `-'
+       (i.e., stdout).
+       Handle `-ofile', not only `-o file'.
+
 2000-07-10  Akim Demaille  <akim@epita.fr>
 
        * autoreconf.sh: Formatting changes.
index ee192b7a05a4753864978f9e22f4e6c0bf1e96b2..46ce5f2fd7afe2d71d73c4f9358c0196abf7dff2 100644 (file)
@@ -1965,6 +1965,15 @@ ifval([$2], , [ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
 ])
 
 
+# AC_PLAIN_SCRIPT
+# ------------
+# Simulate AC_INIT, i.e., pretend this is the beginning of the `configure'
+# generation.  This is used by some tests, and let `autoconf' be used to
+# generate other scripts than `configure'.
+define([AC_PLAIN_SCRIPT],
+[AC_DIVERT_POP()])
+
+
 ## ----------------------------- ##
 ## Selecting optional features.  ##
 ## ----------------------------- ##
index e22db3d7facddd0f19f9a31b0161e539da79d128..a7d9003f077f5f89f12765c15644847ed42da29d 100644 (file)
@@ -184,6 +184,9 @@ while test $# -gt 0 ; do
     --output=* )
        outfile=`echo "$1" | sed -e 's/^[^=]*=//'`
        shift ;;
+    -o* )
+       outfile=`expr "$1" : '-o\(.*\)'`
+       shift ;;
 
     --warnings | -W )
        test $# = 1 && eval "$exit_missing_arg"
@@ -245,7 +248,7 @@ run_m4f="$M4 --reload $AC_MACRODIR/autoconf.m4f $m4_common"
 # Find the input file.
 case $# in
   0) infile=configure.in
-     test $task = script && test "x$outfile" = x && outfile=configure;;
+     test $task = script && test -z "$outfile" && outfile=configure;;
   1) infile=$1 ;;
   *) exec >&2
      echo "$me: invalid number of arguments."
@@ -253,6 +256,9 @@ case $# in
      exit 1 ;;
 esac
 
+# Unless specified, the output is stdout.
+test -z "$outfile" && outfile=-
+
 # We need an actual file.
 if test z$infile = z-; then
   infile=$tmp/stdin
@@ -264,7 +270,7 @@ fi
 
 # Output is produced into FD 4.  Prepare it.
 case "x$outfile" in
- x- | x )  # Output to stdout
+ x-)  # Output to stdout
   exec 4>&1 ;;
  * )
   exec 4>$outfile;;
@@ -297,7 +303,7 @@ case $task in
     status=1
   fi
 
-  if test -n "$outfile"; then
+  if test "x$outfile" != x-; then
     chmod +x $outfile
   fi
 
index e22db3d7facddd0f19f9a31b0161e539da79d128..a7d9003f077f5f89f12765c15644847ed42da29d 100644 (file)
@@ -184,6 +184,9 @@ while test $# -gt 0 ; do
     --output=* )
        outfile=`echo "$1" | sed -e 's/^[^=]*=//'`
        shift ;;
+    -o* )
+       outfile=`expr "$1" : '-o\(.*\)'`
+       shift ;;
 
     --warnings | -W )
        test $# = 1 && eval "$exit_missing_arg"
@@ -245,7 +248,7 @@ run_m4f="$M4 --reload $AC_MACRODIR/autoconf.m4f $m4_common"
 # Find the input file.
 case $# in
   0) infile=configure.in
-     test $task = script && test "x$outfile" = x && outfile=configure;;
+     test $task = script && test -z "$outfile" && outfile=configure;;
   1) infile=$1 ;;
   *) exec >&2
      echo "$me: invalid number of arguments."
@@ -253,6 +256,9 @@ case $# in
      exit 1 ;;
 esac
 
+# Unless specified, the output is stdout.
+test -z "$outfile" && outfile=-
+
 # We need an actual file.
 if test z$infile = z-; then
   infile=$tmp/stdin
@@ -264,7 +270,7 @@ fi
 
 # Output is produced into FD 4.  Prepare it.
 case "x$outfile" in
- x- | x )  # Output to stdout
+ x-)  # Output to stdout
   exec 4>&1 ;;
  * )
   exec 4>$outfile;;
@@ -297,7 +303,7 @@ case $task in
     status=1
   fi
 
-  if test -n "$outfile"; then
+  if test "x$outfile" != x-; then
     chmod +x $outfile
   fi
 
index e22db3d7facddd0f19f9a31b0161e539da79d128..a7d9003f077f5f89f12765c15644847ed42da29d 100644 (file)
@@ -184,6 +184,9 @@ while test $# -gt 0 ; do
     --output=* )
        outfile=`echo "$1" | sed -e 's/^[^=]*=//'`
        shift ;;
+    -o* )
+       outfile=`expr "$1" : '-o\(.*\)'`
+       shift ;;
 
     --warnings | -W )
        test $# = 1 && eval "$exit_missing_arg"
@@ -245,7 +248,7 @@ run_m4f="$M4 --reload $AC_MACRODIR/autoconf.m4f $m4_common"
 # Find the input file.
 case $# in
   0) infile=configure.in
-     test $task = script && test "x$outfile" = x && outfile=configure;;
+     test $task = script && test -z "$outfile" && outfile=configure;;
   1) infile=$1 ;;
   *) exec >&2
      echo "$me: invalid number of arguments."
@@ -253,6 +256,9 @@ case $# in
      exit 1 ;;
 esac
 
+# Unless specified, the output is stdout.
+test -z "$outfile" && outfile=-
+
 # We need an actual file.
 if test z$infile = z-; then
   infile=$tmp/stdin
@@ -264,7 +270,7 @@ fi
 
 # Output is produced into FD 4.  Prepare it.
 case "x$outfile" in
- x- | x )  # Output to stdout
+ x-)  # Output to stdout
   exec 4>&1 ;;
  * )
   exec 4>$outfile;;
@@ -297,7 +303,7 @@ case $task in
     status=1
   fi
 
-  if test -n "$outfile"; then
+  if test "x$outfile" != x-; then
     chmod +x $outfile
   fi
 
index ee192b7a05a4753864978f9e22f4e6c0bf1e96b2..46ce5f2fd7afe2d71d73c4f9358c0196abf7dff2 100644 (file)
@@ -1965,6 +1965,15 @@ ifval([$2], , [ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
 ])
 
 
+# AC_PLAIN_SCRIPT
+# ------------
+# Simulate AC_INIT, i.e., pretend this is the beginning of the `configure'
+# generation.  This is used by some tests, and let `autoconf' be used to
+# generate other scripts than `configure'.
+define([AC_PLAIN_SCRIPT],
+[AC_DIVERT_POP()])
+
+
 ## ----------------------------- ##
 ## Selecting optional features.  ##
 ## ----------------------------- ##
index 7bbff8cf1041b7aa8fcf56c083f15f0c2997971d..c9ae50cf2588cda5b781928785e3b6456e2cef9f 100644 (file)
@@ -15,8 +15,8 @@ AT_SETUP(m4_wrap)
 # commas are not swallowed.  This can easily happen because of
 # m4-listification.
 
-AT_DATA(libm4.in,
-[[include(libm4.m4)divert(0)dnl
+AT_DATA(configure.in,
+[[AC_PLAIN_SCRIPT()dnl
 m4_wrap([Short string */], [   ], [/* ], 20)
 
 m4_wrap([Much longer string */], [   ], [/* ], 20)
@@ -48,7 +48,7 @@ AT_DATA(expout,
 First, second , third, [,quoted]
 ]])
 
-AT_CHECK([$M4 -I $at_top_srcdir libm4.in], 0, expout)
+AT_CHECK([../autoconf -m .. -l $at_srcdir -o-], 0, expout)
 
 AT_CLEANUP()
 
@@ -82,7 +82,7 @@ AC_DEFUN([TEST3],
 [REQUIRE_AND_CHECK([TEST2a])
 test3=set])
 
-AC_DIVERT_POP()
+AC_PLAIN_SCRIPT
 TEST1
 test -z "$test1" && exit 1
 exit 0
@@ -102,7 +102,7 @@ AT_CLEANUP(configure)
 AT_SETUP(AC_SHELL_MKDIR_P)
 
 AT_DATA(configure.in,
-[[AC_DIVERT_POP()
+[[AC_PLAIN_SCRIPT
 pwd=`pwd`
 set -e
 # Absolute