`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
+2000-10-25 Akim Demaille <akim@epita.fr>
+
+ Move the Autoconf independent shell macros into the file
+ `shell.m4' and the name space `AS_*'.
+
+ * acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
+ (AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
+ * shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
+ (AS_DIRNAME): here, a new file.
+ Adjust all dependencies.
+
+ * tests/base.m4 (m4_wrap): Eve out into...
+ * tests/shell.m4: here, new file.
+ * tests/base.m4 (AC_SHELL_MKDIR_P)
+ (AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
+ * tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
+ here, new file.
+ Adjust the test suite.
+
2000-10-25 Akim Demaille <akim@epita.fr>
* acgeneral.m4 (AC_SHELL_DIRNAME): Split its code into...
# 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
+
distpkgdataDATA = acfunctions acheaders acidentifiers acmakevars acprograms \
- m4sugar.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 \
- autoconf.m4 aclang.m4 acversion.m4 acfunctions.m4
+ $(m4sources)
nodistpkgdataDATA = autoconf.m4f
.m4.m4f:
$(M4) -I $(srcdir) $(srcdir)/$*.m4 --freeze-state=$*.m4f
-common = m4sugar.m4 acgeneral.m4 acspecific.m4 acoldnames.m4 acversion.m4 \
- aclang.m4 acfunctions.m4
-
-autoconf.m4f: autoconf.m4 $(common)
+autoconf.m4f: $(m4sources)
## ---------- ##
# s/nodistpackageDATA/nodist_pkgdata_DATA/
# and adapt dependencies once we use a more recent Automake
-distpkgdataDATA = acfunctions acheaders acidentifiers acmakevars acprograms m4sugar.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 autoconf.m4 aclang.m4 acversion.m4 acfunctions.m4
+m4sources = m4sugar.m4 shell.m4 autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 aclang.m4 acversion.m4 acfunctions.m4
+
+
+distpkgdataDATA = acfunctions acheaders acidentifiers acmakevars acprograms $(m4sources)
nodistpkgdataDATA = autoconf.m4f
editpl = sed -e 's,@datadir\@,$(pkgdatadir),g' -e 's,@PERL\@,$(PERL),g' -e 's,@VERSION\@,$(VERSION),g' -e 's,@PACKAGE\@,$(PACKAGE),g'
-
-common = m4sugar.m4 acgeneral.m4 acspecific.m4 acoldnames.m4 acversion.m4 aclang.m4 acfunctions.m4
-
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
.m4.m4f:
$(M4) -I $(srcdir) $(srcdir)/$*.m4 --freeze-state=$*.m4f
-autoconf.m4f: autoconf.m4 $(common)
+autoconf.m4f: $(m4sources)
wget-update:
$(WGET) ftp://ftp.gnu.org/gnu/GNUinfo/standards.texi -O $(srcdir)/doc/standards.texi
[AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
[AC_VAR_SET(ac_var, yes)],
[AC_VAR_SET(ac_var, no)])])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_var) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_var) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_var])dnl
])# AC_CHECK_FUNC
define([_AH_COUNTER], [0])
-## --------------------- ##
-## Some /bin/sh idioms. ##
-## --------------------- ##
-
-
-# AC_SHELL_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([AC_SHELL_IFELSE],
-[ifval([$2$3],
-[if $1; then
- ifval([$2], [$2], :)
-m4_ifvanl([$3],
-[else
- $3])dnl
-fi
-])dnl
-])# AC_SHELL_IFELSE
-
-
-# _AC_SHELL_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([_AC_SHELL_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
-])# _AC_SHELL_TMPDIR
-
-
-# AC_SHELL_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([AC_SHELL_UNSET],
-[$ac_unset $1 || test "${$1+set}" != set || { $1=$2; export $1; }])
-
-
-# AC_SHELL_MKDIR_P(PATH)
-# ----------------------
-# Emulate `mkdir -p' with plain `mkdir'.
-define([AC_SHELL_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; }
-])# AC_SHELL_MKDIR_P
-
-
-# AC_SHELL_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([AC_SHELL_DIRNAME_EXPR],
-[expr X[]$1 : 'X\(.*[[^/]]\)//*[[^/][^/]]*/*$' \| \
- X[]$1 : 'X\(//\)[[^/]]' \| \
- X[]$1 : 'X\(//\)$' \| \
- X[]$1 : 'X\(/\)' \| \
- . : '\(.\)'])
-
-define([AC_SHELL_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([AC_SHELL_DIRNAME],
-[AC_SHELL_DIRNAME_EXPR([$1]) 2>/dev/null ||
-AC_SHELL_DIRNAME_SED([$1])])
## --------------------------------------------------- ##
# Implement a shell `if-then-else' depending whether VARIABLE is set
# or not. Polymorphic.
define([AC_VAR_SET_IFELSE],
-[AC_SHELL_IFELSE([AC_VAR_TEST_SET([$1])], [$2], [$3])])
+[AS_IFELSE([AC_VAR_TEST_SET([$1])], [$2], [$3])])
# AC_VAR_PUSHDEF and AC_VAR_POPDEF
fi
# NLS nuisances.
-AC_SHELL_UNSET([LANG], [C])
-AC_SHELL_UNSET([LC_ALL], [C])
-AC_SHELL_UNSET([LC_TIME], [C])
-AC_SHELL_UNSET([LC_CTYPE], [C])
-AC_SHELL_UNSET([LANGUAGE], [C])
-AC_SHELL_UNSET([LC_COLLATE], [C])
-AC_SHELL_UNSET([LC_NUMERIC], [C])
-AC_SHELL_UNSET([LC_MESSAGES], [C])
+AS_UNSET([LANG], [C])
+AS_UNSET([LC_ALL], [C])
+AS_UNSET([LC_TIME], [C])
+AS_UNSET([LC_CTYPE], [C])
+AS_UNSET([LANGUAGE], [C])
+AS_UNSET([LC_COLLATE], [C])
+AS_UNSET([LC_NUMERIC], [C])
+AS_UNSET([LC_MESSAGES], [C])
# IFS
# We need space, tab and new line, in precisely that order.
IFS=" $ac_nl"
# CDPATH.
-AC_SHELL_UNSET([CDPATH], [:])
+AS_UNSET([CDPATH], [:])
])
foo.patsubst([$1], [^[^.]*\.]);])],
AC_VAR_SET(ac_Member, yes),
AC_VAR_SET(ac_Member, no))])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_Member) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_Member) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_Member])dnl
])# AC_CHECK_MEMBER
echo $ECHO_N "checking for prefix by $ECHO_C" >&AC_FD_MSG
AC_PATH_PROG(m4_quote(AC_Prog), [$1])
if test -n "$ac_cv_path_[]AC_Prog"; then
- prefix=`AC_SHELL_DIRNAME([$ac_cv_path_[]AC_Prog])`
+ prefix=`AS_DIRNAME([$ac_cv_path_[]AC_Prog])`
fi
fi
popdef([AC_Prog])dnl
break])
done
LIBS=$ac_func_search_save_LIBS])
-AC_SHELL_IFELSE([test "$ac_cv_search_$1" != no],
+AS_IFELSE([test "$ac_cv_search_$1" != no],
[test "$ac_cv_search_$1" = "none required" || LIBS="$ac_cv_search_$1 $LIBS"
$3],
[$4])[]dnl
[AC_VAR_SET(ac_Lib, yes)],
[AC_VAR_SET(ac_Lib, no)])
LIBS=$ac_check_lib_save_LIBS])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_Lib) = yes],
- [m4_default([$3],
- [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
+AS_IFELSE([test AC_VAR_GET(ac_Lib) = yes],
+ [m4_default([$3],
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
LIBS="-l$1 $LIBS"
])],
[$4])dnl
[AC_TRY_CPP([#include <$1>
],
AC_VAR_SET(ac_Header, yes), AC_VAR_SET(ac_Header, no))])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_Header) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_Header) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_Header])dnl
])# AC_CHECK_HEADER
else
AC_VAR_SET(ac_File, no)
fi])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_File) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_File) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_File])dnl
])# AC_CHECK_FILE
#endif
])],
AC_VAR_SET(ac_Symbol, yes), AC_VAR_SET(ac_Symbol, no))])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_Symbol) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_Symbol) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_Symbol])dnl
])# AC_CHECK_DECL
return 0;])],
AC_VAR_SET(ac_Type, yes),
AC_VAR_SET(ac_Type, no))])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_Type) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_Type) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_Type])dnl
])# _AC_CHECK_TYPE_NEW
])dnl
fi
-_AC_SHELL_TMPDIR(cs)
+AS_TMPDIR(cs)
EOF
])[]dnl ifval
esac
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
- ac_dir=`AC_SHELL_DIRNAME("$ac_file")`
+ ac_dir=`AS_DIRNAME("$ac_file")`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- AC_SHELL_MKDIR_P("$ac_dir")
+ AS_MKDIR_P("$ac_dir")
ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
# A "../" for each directory in $ac_dir_suffix.
ac_dots=`echo "$ac_dir_suffix" | sed 's,/[[^/]]*,../,g'`
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
echo "$ac_file is unchanged"
else
- ac_dir=`AC_SHELL_DIRNAME("$ac_file")`
+ ac_dir=`AS_DIRNAME("$ac_file")`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- AC_SHELL_MKDIR_P("$ac_dir")
+ AS_MKDIR_P("$ac_dir")
fi
rm -f $ac_file
mv $tmp/config.h $ac_file
rm -f $ac_dest
# Make relative symlinks.
- ac_dest_dir=`AC_SHELL_DIRNAME("$ac_dest")`
+ ac_dest_dir=`AS_DIRNAME("$ac_dest")`
if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
- AC_SHELL_MKDIR_P("$ac_dest_dir")
+ AS_MKDIR_P("$ac_dest_dir")
ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's,^\./,,'`"
# A "../" for each directory in $ac_dest_dir_suffix.
ac_dots=`echo $ac_dest_dir_suffix|sed 's,/[[^/]]*,../,g'`
echo configuring in $ac_subdir
case $srcdir in
.) ;;
- *) AC_SHELL_MKDIR_P(./$ac_subdir)
+ *) AS_MKDIR_P(./$ac_subdir)
if test -d ./$ac_subdir; then :;
else
AC_MSG_ERROR(cannot create `pwd`/$ac_subdir)
fi
done
- AC_SHELL_IFELSE([test x"$ac_exists" = xtrue], [$3], [$4])
+ AS_IFELSE([test x"$ac_exists" = xtrue], [$3], [$4])
])
[DIR *dirp = 0;])],
[AC_VAR_SET(ac_Header, yes)],
[AC_VAR_SET(ac_Header, no)])])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_Header) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_Header) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_Header])dnl
])# _AC_CHECK_HEADER_DIRENT
# Do not sinclude acsite.m4 here, because it may not be installed
# yet when Autoconf is frozen.
# Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
+
+m4_include(shell.m4)
+
m4_include(acversion.m4)
m4_include(acgeneral.m4)
m4_include(aclang.m4)
# Do not sinclude acsite.m4 here, because it may not be installed
# yet when Autoconf is frozen.
# Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
+
+m4_include(shell.m4)
+
m4_include(acversion.m4)
m4_include(acgeneral.m4)
m4_include(aclang.m4)
[AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
[AC_VAR_SET(ac_var, yes)],
[AC_VAR_SET(ac_var, no)])])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_var) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_var) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_var])dnl
])# AC_CHECK_FUNC
define([_AH_COUNTER], [0])
-## --------------------- ##
-## Some /bin/sh idioms. ##
-## --------------------- ##
-
-
-# AC_SHELL_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([AC_SHELL_IFELSE],
-[ifval([$2$3],
-[if $1; then
- ifval([$2], [$2], :)
-m4_ifvanl([$3],
-[else
- $3])dnl
-fi
-])dnl
-])# AC_SHELL_IFELSE
-
-
-# _AC_SHELL_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([_AC_SHELL_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
-])# _AC_SHELL_TMPDIR
-
-
-# AC_SHELL_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([AC_SHELL_UNSET],
-[$ac_unset $1 || test "${$1+set}" != set || { $1=$2; export $1; }])
-
-
-# AC_SHELL_MKDIR_P(PATH)
-# ----------------------
-# Emulate `mkdir -p' with plain `mkdir'.
-define([AC_SHELL_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; }
-])# AC_SHELL_MKDIR_P
-
-
-# AC_SHELL_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([AC_SHELL_DIRNAME_EXPR],
-[expr X[]$1 : 'X\(.*[[^/]]\)//*[[^/][^/]]*/*$' \| \
- X[]$1 : 'X\(//\)[[^/]]' \| \
- X[]$1 : 'X\(//\)$' \| \
- X[]$1 : 'X\(/\)' \| \
- . : '\(.\)'])
-
-define([AC_SHELL_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([AC_SHELL_DIRNAME],
-[AC_SHELL_DIRNAME_EXPR([$1]) 2>/dev/null ||
-AC_SHELL_DIRNAME_SED([$1])])
## --------------------------------------------------- ##
# Implement a shell `if-then-else' depending whether VARIABLE is set
# or not. Polymorphic.
define([AC_VAR_SET_IFELSE],
-[AC_SHELL_IFELSE([AC_VAR_TEST_SET([$1])], [$2], [$3])])
+[AS_IFELSE([AC_VAR_TEST_SET([$1])], [$2], [$3])])
# AC_VAR_PUSHDEF and AC_VAR_POPDEF
fi
# NLS nuisances.
-AC_SHELL_UNSET([LANG], [C])
-AC_SHELL_UNSET([LC_ALL], [C])
-AC_SHELL_UNSET([LC_TIME], [C])
-AC_SHELL_UNSET([LC_CTYPE], [C])
-AC_SHELL_UNSET([LANGUAGE], [C])
-AC_SHELL_UNSET([LC_COLLATE], [C])
-AC_SHELL_UNSET([LC_NUMERIC], [C])
-AC_SHELL_UNSET([LC_MESSAGES], [C])
+AS_UNSET([LANG], [C])
+AS_UNSET([LC_ALL], [C])
+AS_UNSET([LC_TIME], [C])
+AS_UNSET([LC_CTYPE], [C])
+AS_UNSET([LANGUAGE], [C])
+AS_UNSET([LC_COLLATE], [C])
+AS_UNSET([LC_NUMERIC], [C])
+AS_UNSET([LC_MESSAGES], [C])
# IFS
# We need space, tab and new line, in precisely that order.
IFS=" $ac_nl"
# CDPATH.
-AC_SHELL_UNSET([CDPATH], [:])
+AS_UNSET([CDPATH], [:])
])
foo.patsubst([$1], [^[^.]*\.]);])],
AC_VAR_SET(ac_Member, yes),
AC_VAR_SET(ac_Member, no))])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_Member) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_Member) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_Member])dnl
])# AC_CHECK_MEMBER
echo $ECHO_N "checking for prefix by $ECHO_C" >&AC_FD_MSG
AC_PATH_PROG(m4_quote(AC_Prog), [$1])
if test -n "$ac_cv_path_[]AC_Prog"; then
- prefix=`AC_SHELL_DIRNAME([$ac_cv_path_[]AC_Prog])`
+ prefix=`AS_DIRNAME([$ac_cv_path_[]AC_Prog])`
fi
fi
popdef([AC_Prog])dnl
break])
done
LIBS=$ac_func_search_save_LIBS])
-AC_SHELL_IFELSE([test "$ac_cv_search_$1" != no],
+AS_IFELSE([test "$ac_cv_search_$1" != no],
[test "$ac_cv_search_$1" = "none required" || LIBS="$ac_cv_search_$1 $LIBS"
$3],
[$4])[]dnl
[AC_VAR_SET(ac_Lib, yes)],
[AC_VAR_SET(ac_Lib, no)])
LIBS=$ac_check_lib_save_LIBS])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_Lib) = yes],
- [m4_default([$3],
- [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
+AS_IFELSE([test AC_VAR_GET(ac_Lib) = yes],
+ [m4_default([$3],
+ [AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_LIB$1))
LIBS="-l$1 $LIBS"
])],
[$4])dnl
[AC_TRY_CPP([#include <$1>
],
AC_VAR_SET(ac_Header, yes), AC_VAR_SET(ac_Header, no))])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_Header) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_Header) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_Header])dnl
])# AC_CHECK_HEADER
else
AC_VAR_SET(ac_File, no)
fi])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_File) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_File) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_File])dnl
])# AC_CHECK_FILE
#endif
])],
AC_VAR_SET(ac_Symbol, yes), AC_VAR_SET(ac_Symbol, no))])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_Symbol) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_Symbol) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_Symbol])dnl
])# AC_CHECK_DECL
return 0;])],
AC_VAR_SET(ac_Type, yes),
AC_VAR_SET(ac_Type, no))])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_Type) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_Type) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_Type])dnl
])# _AC_CHECK_TYPE_NEW
])dnl
fi
-_AC_SHELL_TMPDIR(cs)
+AS_TMPDIR(cs)
EOF
])[]dnl ifval
esac
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
- ac_dir=`AC_SHELL_DIRNAME("$ac_file")`
+ ac_dir=`AS_DIRNAME("$ac_file")`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- AC_SHELL_MKDIR_P("$ac_dir")
+ AS_MKDIR_P("$ac_dir")
ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
# A "../" for each directory in $ac_dir_suffix.
ac_dots=`echo "$ac_dir_suffix" | sed 's,/[[^/]]*,../,g'`
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
echo "$ac_file is unchanged"
else
- ac_dir=`AC_SHELL_DIRNAME("$ac_file")`
+ ac_dir=`AS_DIRNAME("$ac_file")`
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- AC_SHELL_MKDIR_P("$ac_dir")
+ AS_MKDIR_P("$ac_dir")
fi
rm -f $ac_file
mv $tmp/config.h $ac_file
rm -f $ac_dest
# Make relative symlinks.
- ac_dest_dir=`AC_SHELL_DIRNAME("$ac_dest")`
+ ac_dest_dir=`AS_DIRNAME("$ac_dest")`
if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
- AC_SHELL_MKDIR_P("$ac_dest_dir")
+ AS_MKDIR_P("$ac_dest_dir")
ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's,^\./,,'`"
# A "../" for each directory in $ac_dest_dir_suffix.
ac_dots=`echo $ac_dest_dir_suffix|sed 's,/[[^/]]*,../,g'`
echo configuring in $ac_subdir
case $srcdir in
.) ;;
- *) AC_SHELL_MKDIR_P(./$ac_subdir)
+ *) AS_MKDIR_P(./$ac_subdir)
if test -d ./$ac_subdir; then :;
else
AC_MSG_ERROR(cannot create `pwd`/$ac_subdir)
fi
done
- AC_SHELL_IFELSE([test x"$ac_exists" = xtrue], [$3], [$4])
+ AS_IFELSE([test x"$ac_exists" = xtrue], [$3], [$4])
])
[DIR *dirp = 0;])],
[AC_VAR_SET(ac_Header, yes)],
[AC_VAR_SET(ac_Header, no)])])
-AC_SHELL_IFELSE([test AC_VAR_GET(ac_Header) = yes],
- [$2], [$3])dnl
+AS_IFELSE([test AC_VAR_GET(ac_Header) = yes],
+ [$2], [$3])dnl
AC_VAR_POPDEF([ac_Header])dnl
])# _AC_CHECK_HEADER_DIRENT
--- /dev/null
+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
## Process this file with automake to create Makefile.in.
## Makefile for Autoconf testsuite.
-## 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
AUTOMAKE_OPTIONS = gnits
-SUITE = base.m4 tools.m4 semantics.m4 torture.m4 syntax.m4 update.m4
+SUITE = m4sugar.m4 shell.m4 \
+ base.m4 tools.m4 semantics.m4 torture.m4 syntax.m4 update.m4
# We don't actually distribute the testsuite, since one only
# needs m4 to build it, m4 being required anyway to install Autoconf.
cd $(srcdir) && ./mktests.sh $(MACRO_FILES)
CLEANFILES = debug-*.sh macro configure configure.in config.status \
-config.cache config.log config.h.in config.h
+ config.cache config.log config.h.in config.h
DISTCLEANFILES = atconfig testsuite
AUTOMAKE_OPTIONS = gnits
-SUITE = base.m4 tools.m4 semantics.m4 torture.m4 syntax.m4 update.m4
+SUITE = m4sugar.m4 shell.m4 base.m4 tools.m4 semantics.m4 torture.m4 syntax.m4 update.m4
+
# We don't actually distribute the testsuite, since one only
# needs m4 to build it, m4 being required anyway to install Autoconf.
MACRO_FILES = ../acgeneral.m4 ../acspecific.m4 ../acfunctions.m4 ../aclang.m4
-CLEANFILES = debug-*.sh macro configure configure.in config.status config.cache config.log config.h.in config.h
+CLEANFILES = debug-*.sh macro configure configure.in config.status config.cache config.log config.h.in config.h
DISTCLEANFILES = atconfig testsuite
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES = atconfig
-DIST_COMMON = Makefile.am Makefile.in atconfig.in
+DIST_COMMON = Makefile.am Makefile.in atconfig.in configure.in
PACKAGE = @PACKAGE@
cat <<EOF
-Base layer.
+Autoconf base layer.
EOF
-## ------- ##
-## m4_wrap ##
-## ------- ##
-
-AT_SETUP(m4_wrap)
-
-# m4_wrap is used to display the help strings. Also, check that
-# commas are not swallowed. This can easily happen because of
-# m4-listification.
-
-AT_DATA(configure.in,
-[[AC_PLAIN_SCRIPT()dnl
-m4_wrap([Short string */], [ ], [/* ], 20)
-
-m4_wrap([Much longer string */], [ ], [/* ], 20)
-
-m4_wrap([Short doc.], [ ], [ --short ], 30)
-
-m4_wrap([Short doc.], [ ], [ --too-wide], 30)
-
-m4_wrap([Super long documentation.], [ ], [ --too-wide], 30)
-
-m4_wrap([First, second , third, [,quoted]])
-]])
-
-AT_DATA(expout,
-[[/* Short string */
-
-/* Much longer
- string */
-
- --short Short doc.
-
- --too-wide
- Short doc.
-
- --too-wide
- Super long
- documentation.
-
-First, second , third, [,quoted]
-]])
-
-AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir -o-], 0, expout)
-
-AT_CLEANUP()
-
-
## ------------ ##
## AC_REQUIRE. ##
AT_CHECK([./configure], 0)
AT_CLEANUP(configure)
-
-
-## ------------------ ##
-## AC_SHELL_MKDIR_P. ##
-## ------------------ ##
-
-# Build nested dirs.
-
-AT_SETUP(AC_SHELL_MKDIR_P)
-
-AT_DATA(configure.in,
-[[AC_PLAIN_SCRIPT
-pwd=`pwd`
-set -e
-# Absolute
-AC_SHELL_MKDIR_P($pwd/1/2/3/4/5/6)
-test -d $pwd/1/2/3/4/5/6 || exit 1
-# Relative
-AC_SHELL_MKDIR_P(a/b/c/d/e/f)
-test -d a/b/c/d/e/f || exit 1
-exit 0
-]])
-
-AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
-AT_CHECK([./configure], 0)
-
-AT_CLEANUP(configure 1 a)
-
-
-
-## ----------------------------------------- ##
-## AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED. ##
-## ----------------------------------------- ##
-
-# Build nested dirs.
-
-AT_SETUP(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED)
-
-AT_DATA(configure.in,
-[[
-
-define([AC_SHELL_DIRNAME_TEST],
-[dir=`AC_SHELL_DIRNAME([$1])`
-test "$dir" = "$2" ||
- echo "dirname($1) = $dir instead of $2" >&2])
-define([AC_SHELL_DIRNAME_SED_TEST],
-[dir=`AC_SHELL_DIRNAME_SED([$1])`
-test "$dir" = "$2" ||
- echo "dirname_sed($1) = $dir instead of $2" >&2])
-
-AC_PLAIN_SCRIPT
-AC_SHELL_DIRNAME_TEST([//1], [//])
-AC_SHELL_DIRNAME_TEST([/1], [/])
-AC_SHELL_DIRNAME_TEST([./1], [.])
-AC_SHELL_DIRNAME_TEST([../../2], [../..])
-AC_SHELL_DIRNAME_TEST([//1/], [//])
-AC_SHELL_DIRNAME_TEST([/1/], [/])
-AC_SHELL_DIRNAME_TEST([./1/], [.])
-AC_SHELL_DIRNAME_TEST([../../2], [../..])
-AC_SHELL_DIRNAME_TEST([//1/3], [//1])
-AC_SHELL_DIRNAME_TEST([/1/3], [/1])
-AC_SHELL_DIRNAME_TEST([./1/3], [./1])
-AC_SHELL_DIRNAME_TEST([../../2/3], [../../2])
-AC_SHELL_DIRNAME_TEST([//1/3///], [//1])
-AC_SHELL_DIRNAME_TEST([/1/3///], [/1])
-AC_SHELL_DIRNAME_TEST([./1/3///], [./1])
-AC_SHELL_DIRNAME_TEST([../../2/3///], [../../2])
-AC_SHELL_DIRNAME_TEST([//1//3/], [//1])
-AC_SHELL_DIRNAME_TEST([/1//3/], [/1])
-AC_SHELL_DIRNAME_TEST([./1//3/], [./1])
-AC_SHELL_DIRNAME_TEST([../../2//3/], [../../2])
-
-AC_SHELL_DIRNAME_SED_TEST([//1], [//])
-AC_SHELL_DIRNAME_SED_TEST([/1], [/])
-AC_SHELL_DIRNAME_SED_TEST([./1], [.])
-AC_SHELL_DIRNAME_SED_TEST([../../2], [../..])
-AC_SHELL_DIRNAME_SED_TEST([//1/], [//])
-AC_SHELL_DIRNAME_SED_TEST([/1/], [/])
-AC_SHELL_DIRNAME_SED_TEST([./1/], [.])
-AC_SHELL_DIRNAME_SED_TEST([../../2], [../..])
-AC_SHELL_DIRNAME_SED_TEST([//1/3], [//1])
-AC_SHELL_DIRNAME_SED_TEST([/1/3], [/1])
-AC_SHELL_DIRNAME_SED_TEST([./1/3], [./1])
-AC_SHELL_DIRNAME_SED_TEST([../../2/3], [../../2])
-AC_SHELL_DIRNAME_SED_TEST([//1/3///], [//1])
-AC_SHELL_DIRNAME_SED_TEST([/1/3///], [/1])
-AC_SHELL_DIRNAME_SED_TEST([./1/3///], [./1])
-AC_SHELL_DIRNAME_SED_TEST([../../2/3///], [../../2])
-AC_SHELL_DIRNAME_SED_TEST([//1//3/], [//1])
-AC_SHELL_DIRNAME_SED_TEST([/1//3/], [/1])
-AC_SHELL_DIRNAME_SED_TEST([./1//3/], [./1])
-AC_SHELL_DIRNAME_SED_TEST([../../2//3/], [../../2])
-exit 0
-]])
-
-AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
-AT_CHECK([./configure], 0)
-
-AT_CLEANUP(configure)
--- /dev/null
+# -*- Autoconf -*-
+
+cat <<EOF
+
+M4sugar.
+
+EOF
+
+## ------- ##
+## m4_wrap ##
+## ------- ##
+
+AT_SETUP(m4_wrap)
+
+# m4_wrap is used to display the help strings. Also, check that
+# commas are not swallowed. This can easily happen because of
+# m4-listification.
+
+AT_DATA(configure.in,
+[[AC_PLAIN_SCRIPT()dnl
+m4_wrap([Short string */], [ ], [/* ], 20)
+
+m4_wrap([Much longer string */], [ ], [/* ], 20)
+
+m4_wrap([Short doc.], [ ], [ --short ], 30)
+
+m4_wrap([Short doc.], [ ], [ --too-wide], 30)
+
+m4_wrap([Super long documentation.], [ ], [ --too-wide], 30)
+
+m4_wrap([First, second , third, [,quoted]])
+]])
+
+AT_DATA(expout,
+[[/* Short string */
+
+/* Much longer
+ string */
+
+ --short Short doc.
+
+ --too-wide
+ Short doc.
+
+ --too-wide
+ Super long
+ documentation.
+
+First, second , third, [,quoted]
+]])
+
+AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir -o-], 0, expout)
+
+AT_CLEANUP()
--- /dev/null
+# -*- Autoconf -*-
+
+cat <<EOF
+
+Autoshell.
+
+EOF
+
+
+## ------------ ##
+## AS_MKDIR_P. ##
+## ------------ ##
+
+# Build nested dirs.
+
+AT_SETUP(AC_SHELL_MKDIR_P)
+
+AT_DATA(configure.in,
+[[AC_PLAIN_SCRIPT
+pwd=`pwd`
+set -e
+# Absolute
+AS_MKDIR_P($pwd/1/2/3/4/5/6)
+test -d $pwd/1/2/3/4/5/6 || exit 1
+# Relative
+AS_MKDIR_P(a/b/c/d/e/f)
+test -d a/b/c/d/e/f || exit 1
+exit 0
+]])
+
+AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
+AT_CHECK([./configure], 0)
+
+AT_CLEANUP(configure 1 a)
+
+
+
+## ----------------------------- ##
+## AS_DIRNAME & AS_DIRNAME_SED. ##
+## ----------------------------- ##
+
+# Build nested dirs.
+
+AT_SETUP(AS_DIRNAME & AS_DIRNAME_SED)
+
+AT_DATA(configure.in,
+[[
+
+define([AS_DIRNAME_TEST],
+[dir=`AS_DIRNAME([$1])`
+test "$dir" = "$2" ||
+ echo "dirname($1) = $dir instead of $2" >&2])
+define([AS_DIRNAME_SED_TEST],
+[dir=`AS_DIRNAME_SED([$1])`
+test "$dir" = "$2" ||
+ echo "dirname_sed($1) = $dir instead of $2" >&2])
+
+AC_PLAIN_SCRIPT
+AS_DIRNAME_TEST([//1], [//])
+AS_DIRNAME_TEST([/1], [/])
+AS_DIRNAME_TEST([./1], [.])
+AS_DIRNAME_TEST([../../2], [../..])
+AS_DIRNAME_TEST([//1/], [//])
+AS_DIRNAME_TEST([/1/], [/])
+AS_DIRNAME_TEST([./1/], [.])
+AS_DIRNAME_TEST([../../2], [../..])
+AS_DIRNAME_TEST([//1/3], [//1])
+AS_DIRNAME_TEST([/1/3], [/1])
+AS_DIRNAME_TEST([./1/3], [./1])
+AS_DIRNAME_TEST([../../2/3], [../../2])
+AS_DIRNAME_TEST([//1/3///], [//1])
+AS_DIRNAME_TEST([/1/3///], [/1])
+AS_DIRNAME_TEST([./1/3///], [./1])
+AS_DIRNAME_TEST([../../2/3///], [../../2])
+AS_DIRNAME_TEST([//1//3/], [//1])
+AS_DIRNAME_TEST([/1//3/], [/1])
+AS_DIRNAME_TEST([./1//3/], [./1])
+AS_DIRNAME_TEST([../../2//3/], [../../2])
+
+AS_DIRNAME_SED_TEST([//1], [//])
+AS_DIRNAME_SED_TEST([/1], [/])
+AS_DIRNAME_SED_TEST([./1], [.])
+AS_DIRNAME_SED_TEST([../../2], [../..])
+AS_DIRNAME_SED_TEST([//1/], [//])
+AS_DIRNAME_SED_TEST([/1/], [/])
+AS_DIRNAME_SED_TEST([./1/], [.])
+AS_DIRNAME_SED_TEST([../../2], [../..])
+AS_DIRNAME_SED_TEST([//1/3], [//1])
+AS_DIRNAME_SED_TEST([/1/3], [/1])
+AS_DIRNAME_SED_TEST([./1/3], [./1])
+AS_DIRNAME_SED_TEST([../../2/3], [../../2])
+AS_DIRNAME_SED_TEST([//1/3///], [//1])
+AS_DIRNAME_SED_TEST([/1/3///], [/1])
+AS_DIRNAME_SED_TEST([./1/3///], [./1])
+AS_DIRNAME_SED_TEST([../../2/3///], [../../2])
+AS_DIRNAME_SED_TEST([//1//3/], [//1])
+AS_DIRNAME_SED_TEST([/1//3/], [/1])
+AS_DIRNAME_SED_TEST([./1//3/], [./1])
+AS_DIRNAME_SED_TEST([../../2//3/], [../../2])
+exit 0
+]])
+
+AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
+AT_CHECK([./configure], 0)
+
+AT_CLEANUP(configure)
-#!/bin/sh
+#! /bin/sh
# Validation suite for Autoconf
# Copyright 2000 Free Software Foundation, Inc.
# Run the tests from the lowest level to the highest level, and from
# the most selective to the easiest.
-# m4sugar.
+# M4sugar.
+AT_INCLUDE(m4sugar.m4)
+
+# shell.m4.
+AT_INCLUDE(shell.m4)
+
+# Autoconf base macros.
AT_INCLUDE(base.m4)
# The executables.