]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* shell.m4: Rename as...
authorAkim Demaille <akim@epita.fr>
Thu, 26 Oct 2000 09:52:34 +0000 (09:52 +0000)
committerAkim Demaille <akim@epita.fr>
Thu, 26 Oct 2000 09:52:34 +0000 (09:52 +0000)
* m4sh.m4: this.
* tests/m4sugar.m4, tests/shell.m4, tests/torture.m4: Rename as...
* tests/m4sugar.at, tests/m4sh.at, tests/torture.at: these.
* tests/semantics.m4, tests/base.m4, tests/suite.m4: Rename as...
* tests/semantics.at, tests/base.at, tests/suite.at: these.
* tests/tools.m4, tests/update.m4, tests/syntax.m4: Rename as...
* tests/tools.at, tests/update.at, tests/syntax.at: these.
* tests/mktests.sh: Adjust the output file names.

19 files changed:
ChangeLog
Makefile.am
Makefile.in
autoconf.m4
lib/autoconf/autoconf.m4
lib/m4sugar/m4sh.m4 [moved from shell.m4 with 100% similarity]
m4sh.m4 [new file with mode: 0644]
tests/Makefile.am
tests/Makefile.in
tests/base.at [moved from tests/base.m4 with 100% similarity]
tests/m4sh.at [moved from tests/shell.m4 with 100% similarity]
tests/m4sugar.at [moved from tests/m4sugar.m4 with 100% similarity]
tests/mktests.sh
tests/semantics.at [moved from tests/semantics.m4 with 100% similarity]
tests/suite.at [moved from tests/suite.m4 with 80% similarity]
tests/syntax.at [moved from tests/syntax.m4 with 100% similarity]
tests/tools.at [moved from tests/tools.m4 with 100% similarity]
tests/torture.at [moved from tests/torture.m4 with 100% similarity]
tests/update.at [moved from tests/update.m4 with 100% similarity]

index bf39822907c7f9693acc1c58034eabcecb6867e9..a39cec0f93fcb931070f02473ab4e0218e377564 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2000-10-26  Akim Demaille  <akim@epita.fr>
+
+       * shell.m4: Rename as...
+       * m4sh.m4: this.
+       * tests/m4sugar.m4, tests/shell.m4, tests/torture.m4: Rename as...
+       * tests/m4sugar.at, tests/m4sh.at, tests/torture.at: these.
+       * tests/semantics.m4, tests/base.m4, tests/suite.m4: Rename as...
+       * tests/semantics.at, tests/base.at, tests/suite.at: these.
+       * tests/tools.m4, tests/update.m4, tests/syntax.m4: Rename as...
+       * tests/tools.at, tests/update.at, tests/syntax.at: these.
+       * tests/mktests.sh: Adjust the output file names.
+
 2000-10-25  Pavel Roskin  <proski@gnu.org>
 
        * autoupdate.sh: Redirect stdin for sed to /dev/null to avoid
index 4729717a7bbf3d3fae20228f494986eb190bf6ad..deebca95d6de87d5a746fadf0656c3586b75dbd1 100644 (file)
@@ -35,7 +35,7 @@ EXTRA_SCRIPTS = autoscan
 # s/nodistpackageDATA/nodist_pkgdata_DATA/
 # and adapt dependencies once we use a more recent Automake
 
-m4sources =  m4sugar.m4 shell.m4  \
+m4sources =  m4sugar.m4 m4sh.m4  \
              autoconf.m4 \
              acgeneral.m4 acoldnames.m4 acspecific.m4 aclang.m4 acversion.m4 \
              acfunctions.m4
index f1b5d0df927abccf109c5bdb70395d217e399110..411a7fe6badc8a8c637efcc6e06ca9032a1a85c4 100644 (file)
@@ -80,7 +80,7 @@ EXTRA_SCRIPTS = autoscan
 # s/nodistpackageDATA/nodist_pkgdata_DATA/
 # and adapt dependencies once we use a more recent Automake
 
-m4sources = m4sugar.m4 shell.m4               autoconf.m4              acgeneral.m4 acoldnames.m4 acspecific.m4 aclang.m4 acversion.m4              acfunctions.m4
+m4sources = m4sugar.m4 m4sh.m4               autoconf.m4              acgeneral.m4 acoldnames.m4 acspecific.m4 aclang.m4 acversion.m4              acfunctions.m4
 
 
 distpkgdataDATA = acfunctions acheaders acidentifiers acmakevars acprograms                  $(m4sources)
index 5ee3690c05c49894a9d1fd9acccc49ccc25e2718..92322ae9ac66552a89e0d6494c749166e40bf0de 100644 (file)
@@ -24,7 +24,7 @@ include(m4sugar.m4)#                                        -*- Autoconf -*-
 # yet when Autoconf is frozen.
 # Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
 
-m4_include(shell.m4)
+m4_include(m4sh.m4)
 
 m4_include(acversion.m4)
 m4_include(acgeneral.m4)
index 5ee3690c05c49894a9d1fd9acccc49ccc25e2718..92322ae9ac66552a89e0d6494c749166e40bf0de 100644 (file)
@@ -24,7 +24,7 @@ include(m4sugar.m4)#                                        -*- Autoconf -*-
 # yet when Autoconf is frozen.
 # Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
 
-m4_include(shell.m4)
+m4_include(m4sh.m4)
 
 m4_include(acversion.m4)
 m4_include(acgeneral.m4)
similarity index 100%
rename from shell.m4
rename to lib/m4sugar/m4sh.m4
diff --git a/m4sh.m4 b/m4sh.m4
new file mode 100644 (file)
index 0000000..7c3360d
--- /dev/null
+++ b/m4sh.m4
@@ -0,0 +1,209 @@
+divert(-1)                                                   -*- Autoconf -*-
+# This file is part of Autoconf.
+# M4 sugar for common shell constructs.
+# Requires GNU M4 and M4sugar.
+# Copyright 2000 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the Free Software Foundation gives unlimited
+# permission to copy, distribute and modify the configure scripts that
+# are the output of Autoconf.  You need not follow the terms of the GNU
+# General Public License when using or distributing such scripts, even
+# though portions of the text of Autoconf appear in them.  The GNU
+# General Public License (GPL) does govern all other use of the material
+# that constitutes the Autoconf program.
+#
+# Certain portions of the Autoconf source text are designed to be copied
+# (in certain cases, depending on the input) into the output of
+# Autoconf.  We call these the "data" portions.  The rest of the Autoconf
+# source text consists of comments plus executable code that decides which
+# of the data portions to output in any given case.  We call these
+# comments and executable code the "non-data" portions.  Autoconf never
+# copies any of the non-data portions into its output.
+#
+# This special exception to the GPL applies to versions of Autoconf
+# released by the Free Software Foundation.  When you make and
+# distribute a modified version of Autoconf, you may extend this special
+# exception to the GPL to apply to your modified version as well, *unless*
+# your modified version has the potential to copy into its output some
+# of the text that was the non-data portion of the version that you started
+# with.  (In other words, unless your change moves or copies text from
+# the non-data portions to the data portions.)  If your modification has
+# such potential, you must delete any notice of this special exception
+# to the GPL from your modified version.
+#
+# Written by Akim Demaille, Pavel Roskin, Alexandre Oliva, Lars J. Aas
+# and many other people.
+
+# Set the quotes, whatever the current quoting system.
+changequote()
+changequote([, ])
+
+# Some old m4's don't support m4exit.  But they provide
+# equivalent functionality by core dumping because of the
+# long macros we define.
+ifdef([__gnu__], ,
+[errprint(Autoconf requires GNU m4. Install it before installing Autoconf or
+set the M4 environment variable to its path name.)
+m4exit(2)])
+
+
+
+## ----------------------------- ##
+## 1. Wrappers around builtins.  ##
+## ----------------------------- ##
+
+# This section is lexicographically sorted.
+
+# AS_IFELSE(TEST, [IF-TRUE], [IF-FALSE])
+# --------------------------------------
+# Expand into
+# | if TEST; then
+# |   IF-TRUE
+# | else
+# |   IF-FALSE
+# | fi
+# with simplifications is IF-TRUE and/or IF-FALSE is empty.
+define([AS_IFELSE],
+[ifval([$2$3],
+[if $1; then
+  ifval([$2], [$2], :)
+m4_ifvanl([$3],
+[else
+  $3])dnl
+fi
+])dnl
+])# AS_IFELSE
+
+
+# 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.
+define([AS_UNSET],
+[$ac_unset $1 || test "${$1+set}" != set || { $1=$2; export $1; }])
+
+
+
+
+## ------------------------------------------- ##
+## 2. Portable versions of common file utils.  ##
+## ------------------------------------------- ##
+
+# This section is lexicographically sorted.
+
+
+# AS_MKDIR_P(PATH)
+# ----------------
+# Emulate `mkdir -p' with plain `mkdir'.
+define([AS_MKDIR_P],
+[{ case $1 in
+  [[\\/]]* | ?:[[\\/]]* ) ac_incr_dir=;;
+  *)                      ac_incr_dir=.;;
+esac
+ac_dummy="$1"
+for ac_mkdir_dir in `IFS=/; set X $ac_dummy; shift; echo "$[@]"`; do
+  ac_incr_dir=$ac_incr_dir/$ac_mkdir_dir
+  test -d $ac_incr_dir || mkdir $ac_incr_dir
+done; }
+])# AS_MKDIR_P
+
+
+# AS_DIRNAME(PATHNAME)
+# --------------------
+# Simulate running `dirname(1)' on PATHNAME, not all systems have it.
+# This macro must be usable from inside ` `.
+#
+# Paul Eggert answers:
+# Question: Under UN*X, should `//1' give `/'?
+#
+#   No, under some older flavors of Unix, leading // is a special path
+#   name: it refers to a "super-root" and is used to access other
+#   machines' files.  Leading ///, ////, etc. are equivalent to /; but
+#   leading // is special.  I think this tradition started with Apollo
+#   Domain/OS, an OS that is still in use on some older hosts.
+#
+#   POSIX.2 allows but does not require the special treatment for //.
+#   It says that the behavior of dirname on path names of the form
+#   //([^/]+/*)? is implementation defined.  In these cases, GNU dirname
+#   returns /, but it's more portable to return // as this works even on
+#   those older flavors of Unix.
+#
+#   I have heard rumors that this special treatment of // may be dropped
+#   in future versions of POSIX, but for now it's still the standard.
+#
+# Prefer expr to echo|sed, since expr is usually faster and it handles
+# backslashes and newlines correctly.  However, older expr
+# implementations (e.g. SunOS 4 expr and Solaris 8 /usr/ucb/expr) have
+# a silly length limit that causes expr to fail if the matched
+# substring is longer than 120 bytes.  So fall back on echo|sed if
+# expr fails.
+define([AS_DIRNAME_EXPR],
+[expr X[]$1 : 'X\(.*[[^/]]\)//*[[^/][^/]]*/*$' \| \
+      X[]$1 : 'X\(//\)[[^/]]' \| \
+      X[]$1 : 'X\(//\)$' \| \
+      X[]$1 : 'X\(/\)' \| \
+      .     : '\(.\)'])
+
+define([AS_DIRNAME_SED],
+[echo "X[]$1" |
+    sed ['/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+         /^X\(\/\/\)$/{ s//\1/; q; }
+         /^X\(\/\).*/{ s//\1/; q; }
+         s/.*/./; q']])
+
+define([AS_DIRNAME],
+[AS_DIRNAME_EXPR([$1]) 2>/dev/null ||
+AS_DIRNAME_SED([$1])])
+
+
+
+## ------------------ ##
+## 3. Common idioms.  ##
+## ------------------ ##
+
+# This section is lexicographically sorted.
+
+# AS_TMPDIR(PREFIX)
+# -----------------
+# Create as safely as possible a temporary directory which name is
+# inspired by PREFIX (should be 2-4 chars max), and set trap
+# mechanisms to remove it.
+define([AS_TMPDIR],
+[# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap 'exit $?' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/$1XXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=$TMPDIR/$1$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+   exit 1;
+}dnl
+])# AS_TMPDIR
index ad07c28e6aae7465fcafef1b0620024a937d13bd..912bd6ada637b60cfba25a4e324011a143eceaa4 100644 (file)
 
 AUTOMAKE_OPTIONS = gnits
 
-SUITE = m4sugar.m4 shell.m4 \
-        base.m4 tools.m4 semantics.m4 torture.m4 syntax.m4 update.m4
+SUITE = suite.at \
+        m4sugar.at m4sh.at \
+        base.at tools.at semantics.at torture.at syntax.at update.at
 
 # We don't actually distribute the testsuite, since one only
 # needs m4 to build it, m4 being required anyway to install Autoconf.
-EXTRA_DIST = atgeneral.m4 atspecific.m4 suite.m4 aclocal.m4 \
+EXTRA_DIST = atgeneral.m4 atspecific.m4 aclocal.m4 \
              $(SUITE) mktests.sh
 
 check-local: atconfig testsuite
        $(SHELL) testsuite
 
-testsuite: atgeneral.m4 atspecific.m4 suite.m4 $(SUITE)
-       $(M4) -I $(srcdir) atspecific.m4 suite.m4 | \
+testsuite: atgeneral.m4 atspecific.m4 $(SUITE)
+       $(M4) -I $(srcdir) atspecific.m4 suite.at | \
           sed -e 's/[  ]*$$//' | \
          sed -e '/^$$/N;/\n$$/D' > $@-tmp
        chmod +x $@-tmp
@@ -43,10 +44,10 @@ testsuite: atgeneral.m4 atspecific.m4 suite.m4 $(SUITE)
 MACRO_FILES = ../acgeneral.m4   ../acspecific.m4 \
               ../acfunctions.m4 ../aclang.m4
 
-syntax.m4: mktests.sh $(MACRO_FILES)
+syntax.at: mktests.sh $(MACRO_FILES)
        cd $(srcdir) && ./mktests.sh $(MACRO_FILES)
 
-update.m4: mktests.sh $(MACRO_FILES)
+update.at: mktests.sh $(MACRO_FILES)
        cd $(srcdir) && ./mktests.sh $(MACRO_FILES)
 
 CLEANFILES = debug-*.sh macro configure configure.in config.status \
index 316c4c076dba38be50688b65736c21f6441ac75a..a6394b0d0c16102c6245810297cbd4439eae5072 100644 (file)
@@ -66,12 +66,12 @@ standards_texi = @standards_texi@
 
 AUTOMAKE_OPTIONS = gnits
 
-SUITE = m4sugar.m4 shell.m4         base.m4 tools.m4 semantics.m4 torture.m4 syntax.m4 update.m4
+SUITE = suite.at         m4sugar.at m4sh.at         base.at tools.at semantics.at torture.at syntax.at update.at
 
 
 # We don't actually distribute the testsuite, since one only
 # needs m4 to build it, m4 being required anyway to install Autoconf.
-EXTRA_DIST = atgeneral.m4 atspecific.m4 suite.m4 aclocal.m4              $(SUITE) mktests.sh
+EXTRA_DIST = atgeneral.m4 atspecific.m4 aclocal.m4              $(SUITE) mktests.sh
 
 
 # The files which contains macro we check for syntax.
@@ -83,7 +83,7 @@ CLEANFILES = debug-*.sh macro configure configure.in config.status
 DISTCLEANFILES = atconfig testsuite
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_CLEAN_FILES =  atconfig
-DIST_COMMON =  Makefile.am Makefile.in atconfig.in configure.in
+DIST_COMMON =  Makefile.am Makefile.in atconfig.in
 
 
 PACKAGE = @PACKAGE@
@@ -195,17 +195,17 @@ mostlyclean distclean maintainer-clean
 check-local: atconfig testsuite
        $(SHELL) testsuite
 
-testsuite: atgeneral.m4 atspecific.m4 suite.m4 $(SUITE)
-       $(M4) -I $(srcdir) atspecific.m4 suite.m4 | \
+testsuite: atgeneral.m4 atspecific.m4 $(SUITE)
+       $(M4) -I $(srcdir) atspecific.m4 suite.at | \
           sed -e 's/[  ]*$$//' | \
          sed -e '/^$$/N;/\n$$/D' > $@-tmp
        chmod +x $@-tmp
        mv $@-tmp $@
 
-syntax.m4: mktests.sh $(MACRO_FILES)
+syntax.at: mktests.sh $(MACRO_FILES)
        cd $(srcdir) && ./mktests.sh $(MACRO_FILES)
 
-update.m4: mktests.sh $(MACRO_FILES)
+update.at: mktests.sh $(MACRO_FILES)
        cd $(srcdir) && ./mktests.sh $(MACRO_FILES)
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
similarity index 100%
rename from tests/base.m4
rename to tests/base.at
similarity index 100%
rename from tests/shell.m4
rename to tests/m4sh.at
similarity index 100%
rename from tests/m4sugar.m4
rename to tests/m4sugar.at
index 8af138cf140484382273ab56c40769a7696d2dae..89e79091e60608d81a5b46dab2b04752193df822 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Build some of the Autoconf test files.
-# Copyright (C) 2000 Free Software Foundation, Inc.
+# Copyright 2000 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,9 +22,9 @@
 # because we used some non portable tool, but we just don't care: this
 # shell script is a maintainer tool, and we do expect good tools.
 trap 'echo "'$0': failed.  To proceed run make check." >&2
-      rm -f acdefuns audefuns requires syntax.tm4 update.tm4
-      touch syntax.m4
-      touch update.m4
+      rm -f acdefuns audefuns requires syntax.tat update.tat
+      touch syntax.at
+      touch update.at
       trap 0
       exit 1' \
      0 1 2 15
@@ -44,16 +44,16 @@ export LANG; LANG=C
 export LC_ALL; LC_ALL=C
 
 
-# --------- #
-# syntax.m4 #
-# --------- #
+## ----------- ##
+## syntax.at.  ##
+## ----------- ##
 
 # syntax_exclude_list
 # -------------------
-# The test `syntax.m4' tries to run all the macros of Autoconf to check
+# The test `syntax.at' tries to run all the macros of Autoconf to check
 # for syntax problems, etc.  Not all the macros can be run without argument,
 # and some are already tested elsewhere.  EGREP_EXCLUDE must filter out
-# the macros we don't want to test in syntax.m4.
+# the macros we don't want to test in syntax.at.
 #
 # - AC_CANONICALIZE, AC_PREFIX_PROGRAM, AC_PREREQ
 #   Need an argument.
@@ -109,7 +109,7 @@ _AC_'
 syntax_exclude_egrep=`echo "$syntax_exclude_list" | tr '
 ' '|' | sed 's/.$//'`
 
-sed 's/^ *//' >syntax.tm4 <<MK_EOF
+sed 's/^ *//' >syntax.tat <<MK_EOF
 # Generated by mktests.sh, do not edit by hand.                -*- autoconf -*-
 
 cat <<\EOF
@@ -140,16 +140,16 @@ cat $src |
 # Filter out.
 for macro in `cat acdefuns`; do
   if fgrep "$macro" requires >/dev/null 2>&1; then :; else
-    echo "AT_CHECK_MACRO([$macro])" >>syntax.tm4
+    echo "AT_CHECK_MACRO([$macro])" >>syntax.tat
   fi
 done
 
-mv syntax.tm4 syntax.m4
+mv syntax.tat syntax.at
 
 
-# --------- #
-# update.m4 #
-# --------- #
+## ----------- ##
+## update.at.  ##
+## ----------- ##
 
 # update_exclude_list
 # -------------------
@@ -171,7 +171,7 @@ update_exclude_egrep=`echo "$update_exclude_list" | tr '
 ' '|' | sed 's/.$//'`
 
 
-sed 's/^ *//' >update.tm4 <<MK_EOF
+sed 's/^ *//' >update.tat <<MK_EOF
 # Generated by mktests.sh, do not edit by hand.                -*- autoconf -*-
 
 cat <<EOF
@@ -189,9 +189,9 @@ cat $src |
   sort |
   uniq |
   egrep -v "$update_exclude_egrep" |
-  sed 's/.*/AT_CHECK_UPDATE([&])/'  >>update.tm4
+  sed 's/.*/AT_CHECK_UPDATE([&])/'  >>update.tat
 
-mv update.tm4 update.m4
+mv update.tat update.at
 
 rm -f acdefuns audefuns requires
 
similarity index 100%
rename from tests/semantics.m4
rename to tests/semantics.at
similarity index 80%
rename from tests/suite.m4
rename to tests/suite.at
index b17e76f6cd1a71e8197a422f4021e14259a2d8e0..822900edd79ef7006a6730a4745c518689a08025 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/sh                                             -*- Autoconf -*-
 # Validation suite for Autoconf
 # Copyright 2000 Free Software Foundation, Inc.
 
@@ -18,25 +18,25 @@ EOF
 # the most selective to the easiest.
 
 # M4sugar.
-AT_INCLUDE(m4sugar.m4)
+AT_INCLUDE(m4sugar.at)
 
-# shell.m4.
-AT_INCLUDE(shell.m4)
+# M4sh.m4.
+AT_INCLUDE(m4sh.at)
 
 # Autoconf base macros.
-AT_INCLUDE(base.m4)
+AT_INCLUDE(base.at)
 
 # The executables.
-AT_INCLUDE(tools.m4)
+AT_INCLUDE(tools.at)
 
 # Checking that AC_CHECK_FOO macros work properly.
-AT_INCLUDE(semantics.m4)
+AT_INCLUDE(semantics.at)
 
 # Stressing config.status.
-AT_INCLUDE(torture.m4)
+AT_INCLUDE(torture.at)
 
 # Checking all the AC_DEFUN'd macros.
-AT_INCLUDE(syntax.m4)
+AT_INCLUDE(syntax.at)
 
 # Checking that updatiing an obsolete macro produces a valid configure.in
-AT_INCLUDE(update.m4)
+AT_INCLUDE(update.at)
similarity index 100%
rename from tests/syntax.m4
rename to tests/syntax.at
similarity index 100%
rename from tests/tools.m4
rename to tests/tools.at
similarity index 100%
rename from tests/torture.m4
rename to tests/torture.at
similarity index 100%
rename from tests/update.m4
rename to tests/update.at