Allow AC_REQUIREs in the configure.ac snippet.
authorBruno Haible <bruno@clisp.org>
Tue, 8 Aug 2006 11:35:22 +0000 (11:35 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 8 Aug 2006 11:35:22 +0000 (11:35 +0000)
ChangeLog
gnulib-tool

index bda1a304570299a03ff146f1ffb0fe964b55c77d..bab915ccfe393e00062c0fa917b4cf0073f97a9f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-08-07  Bruno Haible  <bruno@clisp.org>
+
+       * gnulib-tool (func_create_testdir): Wrap the set of autoconf snippets
+       in an AC_DEFUN. Needed so that the autoconf snippets can use
+       AC_REQUIRE.
+
 2006-08-06  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
 
        * gnulib-tool (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am):
index df02c69faabbe6ed6b89eb11f92c1d3a581c0f08..dfbdce8738bc1b3594177ce2eb3f941c3ec65620 100755 (executable)
@@ -22,7 +22,7 @@
 
 progname=$0
 package=gnulib
-cvsdatestamp='$Date: 2006-08-07 12:17:26 $'
+cvsdatestamp='$Date: 2006-08-08 11:35:22 $'
 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
 
@@ -1800,6 +1800,14 @@ func_create_testdir ()
      else
        echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [false])"
      fi
+     # Wrap the set of autoconf snippets into an autoconf macro that is then
+     # invoked. This is needed because autoconf does not support AC_REQUIRE
+     # at the top level:
+     #   error: AC_REQUIRE(gt_CSHARPCOMP): cannot be used outside of an AC_DEFUN'd macro
+     # but we want the AC_REQUIRE to have its normal meaning (provide one
+     # expansion of the required macro before the current point, and only one
+     # expansion total).
+     echo "AC_DEFUN([gl_INIT], ["
      if test "$auxdir" != "build-aux"; then
        sed_replace_build_aux='
          :a
@@ -1828,6 +1836,8 @@ func_create_testdir ()
            | sed -e "$sed_replace_build_aux"
        fi
      done
+     echo "])"
+     echo "gl_INIT"
      echo
      # Usually tests/config.h will be a superset of config.h. Verify this by
      # "merging" config.h into tests/config.h; look out for gcc warnings.
@@ -1881,6 +1891,14 @@ func_create_testdir ()
    else
      echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [false])"
    fi
+   # Wrap the set of autoconf snippets into an autoconf macro that is then
+   # invoked. This is needed because autoconf does not support AC_REQUIRE
+   # at the top level:
+   #   error: AC_REQUIRE(gt_CSHARPCOMP): cannot be used outside of an AC_DEFUN'd macro
+   # but we want the AC_REQUIRE to have its normal meaning (provide one
+   # expansion of the required macro before the current point, and only one
+   # expansion total).
+   echo "AC_DEFUN([gl_INIT], ["
    if test "$auxdir" != "build-aux"; then
      sed_replace_build_aux='
        :a
@@ -1899,6 +1917,8 @@ func_create_testdir ()
          | sed -e "$sed_replace_build_aux"
      fi
    done
+   echo "])"
+   echo "gl_INIT"
    echo
    if test -n "$subdirs_with_configure_ac"; then
      echo "AC_CONFIG_SUBDIRS(["`echo $subdirs_with_configure_ac`"])"