]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* m4sh.m4 (_AS_UNSET_PREPARE): New macro, eved from
authorAkim Demaille <akim@epita.fr>
Fri, 3 Nov 2000 09:16:21 +0000 (09:16 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 3 Nov 2000 09:16:21 +0000 (09:16 +0000)
_AC_INIT_PREPARE_ENVIRONMENT, and fixed: set `FOO' before trying
to unset it: `unset' exits 1 if the variable is not defined.
(AS_UNSET): Require it.  Use `as_unset' not `ac_unset'.
* acgeneral.m4 (_AC_INIT_PREPARE_ENVIRONMENT): Use it.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4
lib/m4sugar/m4sh.m4
m4sh.m4

index da59dcf15f1abdda6f5fec54ef0fa50c81aa173b..30049ad03cef3aedf3795b600cc4c1c5ffa7c4e1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2000-11-03  Akim Demaille  <akim@epita.fr>
+
+       * m4sh.m4 (_AS_UNSET_PREPARE): New macro, eved from
+       _AC_INIT_PREPARE_ENVIRONMENT, and fixed: set `FOO' before trying
+       to unset it: `unset' exits 1 if the variable is not defined.
+       (AS_UNSET): Require it.  Use `as_unset' not `ac_unset'.
+       * acgeneral.m4 (_AC_INIT_PREPARE_ENVIRONMENT): Use it.
+
 2000-11-03  Akim Demaille  <akim@epita.fr>
 
        * m4sugar.m4 (builtin, changecom, changequote, decr, dumpdef)
@@ -9,7 +17,6 @@
        * autoconf.m4 (builtin, changecom, decr, incr, index, indir, len)
        (syscmd, sysval, traceoff, traceon): Reactivate.
 
-       
 2000-11-03  Akim Demaille  <akim@epita.fr>
 
        * m4sugar.m4 (m4_rename_m4, m4_copy_unm4): New macros.
index 32213a4b394148ef3a2714e09edadd196730a3dd..aa0600ea28e99e7c608becfbe1d219bf58c624bf 100644 (file)
@@ -1386,12 +1386,7 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
 
-# Support unset when possible.
-if (unset FOO) >/dev/null 2>&1; then
-  ac_unset=unset
-else
-  ac_unset=false
-fi
+_AS_UNSET_PREPARE
 
 # NLS nuisances.
 AS_UNSET([LANG],        [C])
index 32213a4b394148ef3a2714e09edadd196730a3dd..aa0600ea28e99e7c608becfbe1d219bf58c624bf 100644 (file)
@@ -1386,12 +1386,7 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
 
-# Support unset when possible.
-if (unset FOO) >/dev/null 2>&1; then
-  ac_unset=unset
-else
-  ac_unset=false
-fi
+_AS_UNSET_PREPARE
 
 # NLS nuisances.
 AS_UNSET([LANG],        [C])
index 70cb29595337d4f5289bef7766953bf6e791d90e..7337a9fc89b31db1590e660a3b5f33f6454e55dc 100644 (file)
@@ -77,12 +77,26 @@ fi
 ])# AS_IFELSE
 
 
+# _AS_UNSET_PREPARE
+# -----------------
+# AS_UNSET depends upon $as_unset: compute it.
+m4_defun([_AS_UNSET_PREPARE],
+[# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+])
+
+
 # AS_UNSET(VAR, [VALUE-IF-UNSET-NOT-SUPPORTED = `'])
 # --------------------------------------------------
 # Try to unset the env VAR, otherwise set it to
 # VALUE-IF-UNSET-NOT-SUPPORTED.  `ac_unset' must have been computed.
-m4_define([AS_UNSET],
-[$ac_unset $1 || test "${$1+set}" != set || { $1=$2; export $1; }])
+m4_defun([AS_UNSET],
+[m4_require([_AS_UNSET_PREPARE])dnl
+$as_unset $1 || test "${$1+set}" != set || { $1=$2; export $1; }])
 
 
 # AS_EXIT([EXIT-CODE = 1])
diff --git a/m4sh.m4 b/m4sh.m4
index 70cb29595337d4f5289bef7766953bf6e791d90e..7337a9fc89b31db1590e660a3b5f33f6454e55dc 100644 (file)
--- a/m4sh.m4
+++ b/m4sh.m4
@@ -77,12 +77,26 @@ fi
 ])# AS_IFELSE
 
 
+# _AS_UNSET_PREPARE
+# -----------------
+# AS_UNSET depends upon $as_unset: compute it.
+m4_defun([_AS_UNSET_PREPARE],
+[# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+])
+
+
 # AS_UNSET(VAR, [VALUE-IF-UNSET-NOT-SUPPORTED = `'])
 # --------------------------------------------------
 # Try to unset the env VAR, otherwise set it to
 # VALUE-IF-UNSET-NOT-SUPPORTED.  `ac_unset' must have been computed.
-m4_define([AS_UNSET],
-[$ac_unset $1 || test "${$1+set}" != set || { $1=$2; export $1; }])
+m4_defun([AS_UNSET],
+[m4_require([_AS_UNSET_PREPARE])dnl
+$as_unset $1 || test "${$1+set}" != set || { $1=$2; export $1; }])
 
 
 # AS_EXIT([EXIT-CODE = 1])