Include aclocal
authorTom Tromey <tromey@redhat.com>
Sun, 28 Jul 1996 17:54:08 +0000 (17:54 +0000)
committerTom Tromey <tromey@redhat.com>
Sun, 28 Jul 1996 17:54:08 +0000 (17:54 +0000)
37 files changed:
ChangeLog
Makefile.am
Makefile.in
NEWS
README
TODO
aclocal.in [new file with mode: 0644]
aclocal.m4
configure
configure.in
lib/am/Makefile.am
m4/AM_C_PROTOTYPES.m4 [new file with mode: 0644]
m4/AM_FEATURE_CTYPE.m4 [new file with mode: 0644]
m4/AM_FEATURE_ERRNO.m4 [new file with mode: 0644]
m4/AM_FEATURE_EXIT.m4 [new file with mode: 0644]
m4/AM_FUNC_FNMATCH.m4 [new file with mode: 0644]
m4/AM_GNU_GETTEXT.m4 [new file with mode: 0644]
m4/AM_LC_MESSAGES.m4 [new file with mode: 0644]
m4/AM_MAINTAINER_MODE.m4 [new file with mode: 0644]
m4/AM_PATH_LISPDIR.m4 [new file with mode: 0644]
m4/AM_PROG_CC_STDC.m4 [new file with mode: 0644]
m4/AM_PROG_INSTALL.m4 [new file with mode: 0644]
m4/AM_PROG_LIBTOOL.m4 [new file with mode: 0644]
m4/AM_SYSTEM_HEADER.m4 [new file with mode: 0644]
m4/AM_TYPE_PTRDIFF_T.m4 [new file with mode: 0644]
m4/AM_WITH_DMALLOC.m4 [new file with mode: 0644]
m4/AM_WITH_NLS.m4 [new file with mode: 0644]
m4/AM_WITH_REGEX.m4 [new file with mode: 0644]
m4/Makefile.am [new file with mode: 0644]
m4/Makefile.in [new file with mode: 0644]
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/defs
tests/depacl.test [new file with mode: 0755]
tests/depacl2.test [new file with mode: 0755]
tests/error.test [new file with mode: 0755]

index 1fe2aa0..d995ee2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sun Jul 28 11:14:52 1996  Tom Tromey  <tromey@creche.cygnus.com>
+
+       * aclocal.in: New file.
+       * configure.in: Generate m4/Makefile, aclocal.
+       * Makefile.am (SUBDIRS): Include m4.
+       * m4/Makefile.am: New file.
+
 Fri Jul 19 10:12:27 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
        * automake.in (initialize_global_constants): Put ansi2knr.c and
index 7a29804..24cd40b 100644 (file)
@@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = gnits
 MAINT_CHARSET = latin1
 PERL = @PERL@
 
-SUBDIRS = tests
+SUBDIRS = tests m4
 
 bin_SCRIPTS = automake
 info_TEXINFOS = automake.texi
index 7f65aa6..f33aae8 100644 (file)
@@ -42,7 +42,7 @@ AUTOMAKE_OPTIONS = gnits
 MAINT_CHARSET = latin1
 PERL = @PERL@
 
-SUBDIRS = tests
+SUBDIRS = tests m4
 
 bin_SCRIPTS = automake
 info_TEXINFOS = automake.texi
@@ -82,9 +82,9 @@ TEXINFOS = automake.texi
 DATA = $(pkgdata_DATA)
 
 DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
-Makefile.in NEWS README THANKS TODO aclocal.m4 automake.in config.guess \
-config.sub configure configure.in install-sh mdate-sh mkinstalldirs \
-stamp-vti texinfo.tex version.texi
+Makefile.in NEWS README THANKS TODO aclocal.in aclocal.m4 automake.in \
+config.guess config.sub configure configure.in install-sh mdate-sh \
+mkinstalldirs stamp-vti texinfo.tex version.texi
 
 
 PACKAGE = @PACKAGE@
@@ -112,6 +112,8 @@ $(srcdir)/configure: configure.in $(ACLOCAL) $(CONFIGURE_DEPENDENCIES)
        cd $(srcdir) && autoconf
 automake: $(top_builddir)/config.status automake.in
        cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
+aclocal: $(top_builddir)/config.status aclocal.in
+       cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
 
 install-binSCRIPTS: $(bin_SCRIPTS)
        $(mkinstalldirs) $(bindir)
diff --git a/NEWS b/NEWS
index f7f0fab..6f81448 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ New in 1.1:
 * Added no-installinfo option
 * Added Emacs Lisp support
 * Added --no-force option
+* Included `aclocal' program
 \f
 New in 1.0:
 * Bug fixes
diff --git a/README b/README
index 1adf9e8..8df99c8 100644 (file)
--- a/README
+++ b/README
@@ -13,4 +13,10 @@ little *.am files.
 To use Automake, replace your Makefile.in files with Makefile.am
 files.  Read the documentation to see what to do.
 
+This package also includes the "aclocal" program.  aclocal is a
+program to generate an `aclocal.m4' based on the contents of
+`configure.in'.  It is useful as an extensible, maintainable mechanism
+for augmenting autoconf.  It is intended that other package authors
+will write m4 macros which can be automatically used by aclocal.
+
 Mail suggestions and bug reports to tromey@cygnus.com.
diff --git a/TODO b/TODO
index 30737c8..7e4b25f 100644 (file)
--- a/TODO
+++ b/TODO
@@ -241,6 +241,22 @@ consider having no-gzip option that turns off gzip/GNU tar.
 
 ================================================================
 
+Stuff for aclocal:
+
+probably should put each group of m4 files into a subdir owned by the
+containing application.
+
+must fill in definitions for some of the AC_FEATURE macros
+
+dependency checking needs some work.  in particular scanning a .m4
+file should note all AC_DEFUNs contained therein, and avoid trying to
+add_file any such
+
+consider including autosystem; that is the only way the AC_FEATURE
+macros even make sense.
+
+================================================================
+
 Document:
 
 
@@ -306,6 +322,8 @@ document actual uses of PACKAGE and VERSION
 > 
 >     test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
 
+Must document aclocal program
+
 ================================================================
 
 Libraries:
diff --git a/aclocal.in b/aclocal.in
new file mode 100644 (file)
index 0000000..ff3dbc3
--- /dev/null
@@ -0,0 +1,234 @@
+#!@PERL@
+# -*- perl -*-
+# @configure_input@
+
+eval 'exec @PERL@ -S $0 ${1+"$@"}'
+    if 0;
+
+# aclocal - scan configure.in and generate aclocal.m4.
+
+# Some constants.
+$VERSION = "@VERSION@";
+$prefix = "@prefix@";
+$acdir = "@datadir@/@PACKAGE@";
+
+# Some globals.
+
+# Exit status.
+$exit_status = 0;
+
+# Output.
+$output = '';
+
+# Which files have been seen.
+%file_seen = ();
+
+# How much to say.
+$verbosity = 0;
+
+@obsolete_macros =
+    (
+     'AC_FEATURE_CTYPE',
+     'AC_FEATURE_ERRNO',
+     'AC_FEATURE_EXIT',
+     'AC_SYSTEM_HEADER',
+     'fp_C_PROTOTYPES',
+     'fp_FUNC_FNMATCH',
+     'fp_PROG_CC_STDC',
+     'fp_PROG_INSTALL',
+     'fp_WITH_DMALLOC',
+     'fp_WITH_REGEX',
+     'gm_PROG_LIBTOOL',
+     'jm_MAINTAINER_MODE',
+     'md_PATH_PROG',
+     'md_TYPE_PTRDIFF_T',
+     'ud_GNU_GETTEXT',
+     'ud_LC_MESSAGES',
+     'ud_PATH_LISPDIR',
+     'ud_WITH_NLS'
+     );
+
+$obsolete_rx = '(' . join ('|', @obsolete_macros) . ')';
+
+\f
+
+&parse_arguments (@ARGV);
+&scan_configure;
+if (! $exit_status)
+{
+    &write_aclocal;
+}
+
+exit $exit_status;
+
+################################################################
+
+# Print usage and exit.
+sub usage
+{
+    local ($status) = @_;
+
+    print "Usage: aclocal [OPTIONS] ...\n";
+    print "\
+  --acdir=DIR           directory holding config files
+  --help                print this help, then exit
+  --verbose             don't be silent
+  --version             print version number, then exit\n";
+
+    exit $status;
+}
+
+# Parse command line.
+sub parse_arguments
+{
+    local (@arglist) = @_;
+
+    while (@arglist)
+    {
+       if ($arglist[0] =~ /^--acdir=(.+)$/)
+       {
+           $acdir = $1;
+       }
+       elsif ($arglist[0] eq '--verbose')
+       {
+           ++$verbosity;
+       }
+       elsif ($arglist[0] eq '--version')
+       {
+           print "aclocal - Autosystem $VERSION\n";
+           exit 0;
+       }
+       elsif ($arglist[0] eq '--help')
+       {
+           &usage (0);
+       }
+       else
+       {
+           &usage (1);
+       }
+
+       shift (@arglist);
+    }
+}
+
+################################################################
+
+sub scan_configure
+{
+    # First, construct list of regexps to match the things we actually
+    # have.
+    opendir (DIR, $acdir)
+       || die "aclocal: couldn't open directory \`$acdir': $!\n";
+    local ($search, $elt);
+    foreach (sort grep (! /^\./, readdir (DIR)))
+    {
+       # Only examine .m4 files.
+       next unless s/\.m4$//;
+
+       # Skip some files when running out of srcdir.  Eg "aclocal.m4"
+       # must be skipped.
+       next unless /^[A-Za-z]+_[A-Z_]+$/;
+
+       print STDERR "Finding $_\n" if $verbosity;
+       ($elt = $_) =~ s/(\W)/\\$1/g;
+       $search .= "&add_file (\"$elt\") if /$elt/;\n";
+    }
+    closedir (DIR);
+
+    # Construct a new function that does the searching.  We use a
+    # function (instead of just evalling $search in the loop) so that
+    # "die" is correctly and easily propagated if run.
+    eval 'sub search { ' . $search . '};';
+
+    open (CONFIGURE, "configure.in")
+       || die "aclocal: couldn't open \`configure.in': $!\n";
+
+    while (<CONFIGURE>)
+    {
+       # Remove comments from current line.
+       s/\bdnl\b.*$//;
+       s/\#.*$//;
+
+       if (/$obsolete_rx/o)
+       {
+           chop;
+           warn "configure.in: $.: obsolete macro \`$_'\n";
+           $exit_status = 1;
+           next;
+       }
+
+       # Search for things we know about.  The "search" sub is
+       # constructed dynamically, above.
+       &search;
+    }
+
+    close (CONFIGURE);
+
+    # Include this file if it exists
+    if (-f 'acinclude.m4')
+    {
+       &add_file ('acinclude.m4');
+    }
+}
+
+################################################################
+
+# Add a file to output.
+sub add_file
+{
+    local ($file) = @_;
+    local ($fullfile) = $file;
+
+    return if ($file_seen{$file});
+    $file_seen{$file} = 1;
+
+    if (! -f $file)
+    {
+       $fullfile = $acdir . '/' . $file . '.m4';
+       if (! -f $fullfile)
+       {
+           # Maybe the file is an Autoconf built-in.  Check the only
+           # way we know how.  Suggestions on how to make this better
+           # are welcome.
+           return if $file =~ /^AC_[A-Z_]+$/;
+           die "aclocal: file \`$file' not found\n";
+       }
+    }
+
+    open (FILE, $fullfile)
+       || die "aclocal: couldn't open \`$fullfile': $!\n";
+
+    local (@rlist);
+    while (<FILE>)
+    {
+       $output .= $_;
+       # See if some other macro is required.
+       if (/AC_REQUIRE\(\[?([^])]*)\]?\)/)
+       {
+           push (@rlist, $1);
+       }
+    }
+    $output .= "\n";
+    close (FILE);
+
+    foreach $file (@rlist)
+    {
+       &add_file ($file);
+    }
+}
+
+################################################################
+
+# Write output.
+sub write_aclocal
+{
+    return if ! $output;
+
+    print STDERR "Writing aclocal.m4\n" if $verbosity;
+
+    open (ACLOCAL, "> aclocal.m4")
+       || die "aclocal: couldn't open \`aclocal.m4' for writing: $!\n";
+    print ACLOCAL "dnl aclocal.m4 generated automatically by aclocal $VERSION\n\n";
+    print ACLOCAL $output;
+    close (ACLOCAL);
+}
index 1b98e69..cf180ad 100644 (file)
@@ -1,77 +1,4 @@
-# Local additions to Autoconf macros.
-# Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-# François Pinard <pinard@iro.umontreal.ca>, 1992.
-
-## ------------------------------- ##
-## Check for function prototypes.  ##
-## ------------------------------- ##
-
-AC_DEFUN(fp_C_PROTOTYPES,
-[AC_REQUIRE([fp_PROG_CC_STDC])
-AC_MSG_CHECKING([for function prototypes])
-if test "$ac_cv_prog_cc_stdc" != no; then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(PROTOTYPES)
-  U= ANSI2KNR=
-else
-  AC_MSG_RESULT(no)
-  U=_ ANSI2KNR=./ansi2knr
-fi
-AC_SUBST(U)dnl
-AC_SUBST(ANSI2KNR)dnl
-])
-
-## ----------------------------------------- ##
-## ANSIfy the C compiler whenever possible.  ##
-## ----------------------------------------- ##
-
-# @defmac AC_PROG_CC_STDC
-# @maindex PROG_CC_STDC
-# @ovindex CC
-# If the C compiler in not in ANSI C mode by default, try to add an option
-# to output variable @code{CC} to make it so.  This macro tries various
-# options that select ANSI C on some system or another.  It considers the
-# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
-# handles function prototypes correctly.
-#
-# If you use this macro, you should check after calling it whether the C
-# compiler has been set to accept ANSI C; if not, the shell variable
-# @code{ac_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
-# code in ANSI C, you can make an un-ANSIfied copy of it by using the
-# program @code{ansi2knr}, which comes with Ghostscript.
-# @end defmac
-
-AC_DEFUN(fp_PROG_CC_STDC,
-[AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
-AC_CACHE_VAL(ac_cv_prog_cc_stdc,
-[ac_cv_prog_cc_stdc=no
-ac_save_CFLAGS="$CFLAGS"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX                  -qlanglvl=ansi
-# Ultrix and OSF/1     -std1
-# HP-UX                        -Aa -D_HPUX_SOURCE
-# SVR4                 -Xc
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
-do
-  CFLAGS="$ac_save_CFLAGS $ac_arg"
-  AC_TRY_COMPILE(
-[#if !defined(__STDC__) || __STDC__ != 1
-choke me
-#endif
-], [int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};],
-[ac_cv_prog_cc_stdc="$ac_arg"; break])
-done
-CFLAGS="$ac_save_CFLAGS"
-])
-AC_MSG_RESULT($ac_cv_prog_cc_stdc)
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno) ;;
-  *) CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-])
+dnl aclocal.m4 generated automatically by aclocal 0.1
 
 ## --------------------------------------------------------- ##
 ## Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
@@ -84,54 +11,3 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
 AC_SUBST(INSTALL_SCRIPT)dnl
 ])
 
-
-# Add --enable-maintainer-mode option to configure.
-AC_DEFUN(jm_MAINTAINER_MODE,
-[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
-  dnl maintainer-mode is disabled by default
-  AC_ARG_ENABLE(maintainer-mode,
-[  --enable-maintainer-mode enable make rules and dependencies not useful
-                          (and sometimes confusing) to the casual installer],
-      USE_MAINTAINER_MODE=$enableval,
-      USE_MAINTAINER_MODE=no)
-  AC_MSG_RESULT($USE_MAINTAINER_MODE)
-  if test $USE_MAINTAINER_MODE = yes; then
-    MAINT=
-  else
-    MAINT='#M#'
-  fi
-  AC_SUBST(MAINT)dnl
-]
-)
-
-## ------------------------
-## Emacs LISP file handling
-## ------------------------
-AC_DEFUN(ud_PATH_LISPDIR,
- [AC_PATH_PROG(EMACS, emacs, no)
-  if test $EMACS != "no"; then
-    AC_MSG_CHECKING([where .elc files should go])
-    dnl Set default value
-    lispdir="\$(datadir)/emacs/site-lisp"
-    if test "x$prefix" = "xNONE"; then
-      if test -d $ac_default_prefix/share/emacs/site-lisp; then
-       lispdir="\$(prefix)/share/emacs/site-lisp"
-      else
-       if test -d $ac_default_prefix/lib/emacs/site-lisp; then
-         lispdir="\$(prefix)/lib/emacs/site-lisp"
-       fi
-      fi
-    else
-      if test -d $prefix/share/emacs/site-lisp; then
-       lispdir="\$(prefix)/share/emacs/site-lisp"
-      else
-       if test -d $prefix/lib/emacs/site-lisp; then
-         lispdir="\$(prefix)/lib/emacs/site-lisp"
-       fi
-      fi
-    fi
-    AC_MSG_RESULT($lispdir)
-    ELCFILES="\$(ELCFILES)"
-  fi
-  AC_SUBST(lispdir)
-  AC_SUBST(ELCFILES)])
index 98d7e8b..88b29fb 100755 (executable)
--- a/configure
+++ b/configure
@@ -525,7 +525,6 @@ cat >> confdefs.h <<EOF
 #define VERSION "$VERSION"
 EOF
 
-ALL_LINGUAS=
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
 set dummy ${MAKE-make}; ac_make=`echo "$2" | tr './\055' '___'`
@@ -688,10 +687,6 @@ if test -z "$PERL"; then
    exit 1
 fi
 
-
-
-
-
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -791,7 +786,7 @@ done
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "Makefile automake tests/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile automake aclocal m4/Makefile tests/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -833,7 +828,7 @@ CEOF
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"Makefile automake tests/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile automake aclocal m4/Makefile tests/Makefile"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -890,7 +885,7 @@ fi; done
 rm -f conftest.subs
 
 
-chmod +x automake
+chmod +x automake aclocal
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
index 146fc7d..789b02f 100644 (file)
@@ -1,7 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(automake.in)
-dnl we use this for gettext
-dnl AC_CONFIG_HEADER(config.h)
 
 PACKAGE=automake
 AC_SUBST(PACKAGE)
@@ -9,7 +7,6 @@ AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
 VERSION=1.1a
 AC_SUBST(VERSION)
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
-ALL_LINGUAS=
 
 AC_PROG_MAKE_SET
 AC_ARG_PROGRAM
@@ -21,18 +18,5 @@ if test -z "$PERL"; then
    exit 1
 fi
 
-dnl
-dnl NLS configuration.
-dnl
-
-dnl ud_GNU_GETTEXT
-dnl AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
-
-dnl
-dnl End of NLS configuration.
-dnl
-
-
-AC_OUTPUT([Makefile automake tests/Makefile], [chmod +x automake])
-dnl intl/Makefile po/Makefile.in],
-dnl [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
+AC_OUTPUT([Makefile automake aclocal m4/Makefile tests/Makefile],
+[chmod +x automake aclocal])
index 7a29804..24cd40b 100644 (file)
@@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = gnits
 MAINT_CHARSET = latin1
 PERL = @PERL@
 
-SUBDIRS = tests
+SUBDIRS = tests m4
 
 bin_SCRIPTS = automake
 info_TEXINFOS = automake.texi
diff --git a/m4/AM_C_PROTOTYPES.m4 b/m4/AM_C_PROTOTYPES.m4
new file mode 100644 (file)
index 0000000..0d8961f
--- /dev/null
@@ -0,0 +1,19 @@
+## ------------------------------- ##
+## Check for function prototypes.  ##
+## From Franc,ois Pinard           ##
+## ------------------------------- ##
+
+AC_DEFUN(AM_C_PROTOTYPES,
+[AC_REQUIRE([AM_PROG_CC_STDC])
+AC_MSG_CHECKING([for function prototypes])
+if test "$ac_cv_prog_cc_stdc" != no; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(PROTOTYPES)
+  U= ANSI2KNR=
+else
+  AC_MSG_RESULT(no)
+  U=_ ANSI2KNR=./ansi2knr
+fi
+AC_SUBST(U)dnl
+AC_SUBST(ANSI2KNR)dnl
+])
diff --git a/m4/AM_FEATURE_CTYPE.m4 b/m4/AM_FEATURE_CTYPE.m4
new file mode 100644 (file)
index 0000000..1b80e93
--- /dev/null
@@ -0,0 +1 @@
+AC_DEFUN([AM_FEATURE_CTYPE])
diff --git a/m4/AM_FEATURE_ERRNO.m4 b/m4/AM_FEATURE_ERRNO.m4
new file mode 100644 (file)
index 0000000..6099bea
--- /dev/null
@@ -0,0 +1 @@
+AC_DEFUN([AM_FEATURE_ERRNO])
diff --git a/m4/AM_FEATURE_EXIT.m4 b/m4/AM_FEATURE_EXIT.m4
new file mode 100644 (file)
index 0000000..d8de60d
--- /dev/null
@@ -0,0 +1 @@
+AC_DEFUN([AM_FEATURE_EXIT])
diff --git a/m4/AM_FUNC_FNMATCH.m4 b/m4/AM_FUNC_FNMATCH.m4
new file mode 100644 (file)
index 0000000..d280b90
--- /dev/null
@@ -0,0 +1,22 @@
+## --------------------------- ##
+## Check for a working fnmatch ##
+## --------------------------- ##
+
+# @defmac AC_FUNC_FNMATCH
+# @maindex FUNC_FNMATCH
+# @ovindex LIBOBJS
+# If the @code{fnmatch} function is not available, or does not work
+# correctly (like the one on SunOS 5.4), add @samp{fnmatch.o} to output
+# variable @code{LIBOBJS}.
+# @end defmac
+
+AC_DEFUN(AM_FUNC_FNMATCH,
+[AC_MSG_CHECKING(for working fnmatch)
+AC_CACHE_VAL(am_cv_func_fnmatch,
+# Some versions of Solaris or SCO have broken fnmatch() functions!
+# So we run a test program.  If we're cross-compiling, take no chance.
+AC_TRY_RUN([main() { exit (fnmatch ("a*", "abc", 0) != 0); }],
+am_cv_func_fnmatch=yes, am_cv_func_fnmatch=no, am_cv_func_fnmatch=no))
+test $am_cv_func_fnmatch = yes || LIBOBJS="$LIBOBJS fnmatch.o"
+AC_MSG_RESULT($am_cv_func_fnmatch)
+])
diff --git a/m4/AM_GNU_GETTEXT.m4 b/m4/AM_GNU_GETTEXT.m4
new file mode 100644 (file)
index 0000000..ca12079
--- /dev/null
@@ -0,0 +1,79 @@
+# From Ulrich Drepper.
+
+AC_DEFUN(AM_GNU_GETTEXT,
+  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+   AC_REQUIRE([AC_PROG_CC])dnl
+   AC_REQUIRE([AC_ISC_POSIX])dnl
+   AC_REQUIRE([AC_PROG_RANLIB])dnl
+   AC_REQUIRE([AC_HEADER_STDC])dnl
+   AC_REQUIRE([AC_C_CONST])dnl
+   AC_REQUIRE([AC_C_INLINE])dnl
+   AC_REQUIRE([AC_TYPE_OFF_T])dnl
+   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+   AC_REQUIRE([AC_FUNC_MMAP])dnl
+
+   AC_CHECK_HEADERS([limits.h locale.h nl_types.h malloc.h string.h unistd.h values.h])
+   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp])
+
+   if test "${ac_cv_func_stpcpy+set}" != "set"; then
+     AC_CHECK_FUNCS(stpcpy)
+   fi
+   if test "${ac_cv_func_stpcpy}" = "yes"; then
+     AC_DEFINE(HAVE_STPCPY)
+   fi
+
+   AM_LC_MESSAGES
+   AM_WITH_NLS
+
+   if test "x$CATOBJEXT" != "x"; then
+     if test "x$ALL_LINGUAS" = "x"; then
+       LINGUAS=
+     else
+       AC_MSG_CHECKING(for catalogs to be installed)
+       NEW_LINGUAS=
+       for lang in ${LINGUAS=$ALL_LINGUAS}; do
+         case "$ALL_LINGUAS" in
+          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+         esac
+       done
+       LINGUAS=$NEW_LINGUAS
+       AC_MSG_RESULT($LINGUAS)
+     fi
+
+     dnl Construct list of names of catalog files to be constructed.
+     if test -n "$LINGUAS"; then
+       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+     fi
+   fi
+
+   dnl Determine which catalog format we have (if any is needed)
+   dnl For now we know about two different formats:
+   dnl   Linux and the normal X/Open format
+   test -d intl || mkdir intl
+   if test "$CATOBJEXT" = ".cat"; then
+     AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
+
+     dnl Transform the SED scripts while copying because some dumb SEDs
+     dnl cannot handle comments.
+     sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
+   fi
+   dnl po2tbl.sed is always needed.
+   sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
+     $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
+
+   dnl Generate list of files to be processed by xgettext which will
+   dnl be included in po/Makefile.
+   test -d po || mkdir po
+   if test "x$srcdir" != "x."; then
+     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+       posrcprefix="$srcdir/"
+     else
+       posrcprefix="../$srcdir/"
+     fi
+   else
+     posrcprefix="../"
+   fi
+   sed -e "/^#/d" -e "/^\$/d" -e "s,.*,        $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+       < $srcdir/po/POTFILES.in > po/POTFILES
+  ])
diff --git a/m4/AM_LC_MESSAGES.m4 b/m4/AM_LC_MESSAGES.m4
new file mode 100644 (file)
index 0000000..c41e819
--- /dev/null
@@ -0,0 +1,12 @@
+dnl Check NLS options
+dnl From Ulrich Drepper
+
+AC_DEFUN(AM_LC_MESSAGES,
+  [if test $ac_cv_header_locale_h = yes; then
+    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+    if test $am_cv_val_LC_MESSAGES = yes; then
+      AC_DEFINE(HAVE_LC_MESSAGES)
+    fi
+  fi])
diff --git a/m4/AM_MAINTAINER_MODE.m4 b/m4/AM_MAINTAINER_MODE.m4
new file mode 100644 (file)
index 0000000..4a9f191
--- /dev/null
@@ -0,0 +1,19 @@
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+AC_DEFUN(AM_MAINTAINER_MODE,
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode is disabled by default
+  AC_ARG_ENABLE(maintainer-mode,
+[  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer],
+      USE_MAINTAINER_MODE=$enableval,
+      USE_MAINTAINER_MODE=no)
+  AC_MSG_RESULT($USE_MAINTAINER_MODE)
+  if test $USE_MAINTAINER_MODE = yes; then
+    MAINT=
+  else
+    MAINT='#M#'
+  fi
+  AC_SUBST(MAINT)dnl
+]
+)
diff --git a/m4/AM_PATH_LISPDIR.m4 b/m4/AM_PATH_LISPDIR.m4
new file mode 100644 (file)
index 0000000..4fbe098
--- /dev/null
@@ -0,0 +1,32 @@
+## ------------------------
+## Emacs LISP file handling
+## From Ulrich Drepper
+## ------------------------
+AC_DEFUN(AM_PATH_LISPDIR,
+ [AC_PATH_PROG(EMACS, emacs xemacs, no)
+  if test $EMACS != "no"; then
+    AC_MSG_CHECKING([where .elc files should go])
+    dnl Set default value
+    LISPDIR="\$(datadir)/emacs/site-lisp"
+    if test "x$prefix" = "xNONE"; then
+      if test -d $ac_default_prefix/share/emacs/site-lisp; then
+       LISPDIR="\$(prefix)/share/emacs/site-lisp"
+      else
+       if test -d $ac_default_prefix/lib/emacs/site-lisp; then
+         LISPDIR="\$(prefix)/lib/emacs/site-lisp"
+       fi
+      fi
+    else
+      if test -d $prefix/share/emacs/site-lisp; then
+       LISPDIR="\$(prefix)/share/emacs/site-lisp"
+      else
+       if test -d $prefix/lib/emacs/site-lisp; then
+         LISPDIR="\$(prefix)/lib/emacs/site-lisp"
+       fi
+      fi
+    fi
+    AC_MSG_RESULT($LISPDIR)
+    ELCFILES="\$(ELCFILES)"
+  fi
+  AC_SUBST(LISPDIR)
+  AC_SUBST(ELCFILES)])
diff --git a/m4/AM_PROG_CC_STDC.m4 b/m4/AM_PROG_CC_STDC.m4
new file mode 100644 (file)
index 0000000..a834ea0
--- /dev/null
@@ -0,0 +1,52 @@
+## ----------------------------------------- ##
+## ANSIfy the C compiler whenever possible.  ##
+## From Franc,ois Pinard                     ##
+## ----------------------------------------- ##
+
+# @defmac AC_PROG_CC_STDC
+# @maindex PROG_CC_STDC
+# @ovindex CC
+# If the C compiler in not in ANSI C mode by default, try to add an option
+# to output variable @code{CC} to make it so.  This macro tries various
+# options that select ANSI C on some system or another.  It considers the
+# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
+# handles function prototypes correctly.
+#
+# If you use this macro, you should check after calling it whether the C
+# compiler has been set to accept ANSI C; if not, the shell variable
+# @code{ac_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
+# code in ANSI C, you can make an un-ANSIfied copy of it by using the
+# program @code{ansi2knr}, which comes with Ghostscript.
+# @end defmac
+
+AC_DEFUN(AM_PROG_CC_STDC,
+[AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
+AC_CACHE_VAL(ac_cv_prog_cc_stdc,
+[ac_cv_prog_cc_stdc=no
+ac_save_CFLAGS="$CFLAGS"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX                  -qlanglvl=ansi
+# Ultrix and OSF/1     -std1
+# HP-UX                        -Aa -D_HPUX_SOURCE
+# SVR4                 -Xc
+for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
+do
+  CFLAGS="$ac_save_CFLAGS $ac_arg"
+  AC_TRY_COMPILE(
+[#if !defined(__STDC__) || __STDC__ != 1
+choke me
+#endif
+], [int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};],
+[ac_cv_prog_cc_stdc="$ac_arg"; break])
+done
+CFLAGS="$ac_save_CFLAGS"
+])
+AC_MSG_RESULT($ac_cv_prog_cc_stdc)
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno) ;;
+  *) CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+])
diff --git a/m4/AM_PROG_INSTALL.m4 b/m4/AM_PROG_INSTALL.m4
new file mode 100644 (file)
index 0000000..b82b47e
--- /dev/null
@@ -0,0 +1,11 @@
+## --------------------------------------------------------- ##
+## Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
+## substitution.                                             ##
+## From Franc,ois Pinard                                     ##
+## --------------------------------------------------------- ##
+
+AC_DEFUN(AM_PROG_INSTALL,
+[AC_REQUIRE([AC_PROG_INSTALL])
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
+AC_SUBST(INSTALL_SCRIPT)dnl
+])
diff --git a/m4/AM_PROG_LIBTOOL.m4 b/m4/AM_PROG_LIBTOOL.m4
new file mode 100644 (file)
index 0000000..d52db6f
--- /dev/null
@@ -0,0 +1,90 @@
+## --------------------------------------------------------- ##
+## Configure the libtool script for this package             ##
+## From Gord Matzigkeit                                      ##
+## --------------------------------------------------------- ##
+
+AC_DEFUN(AM_PROG_LIBTOOL,
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_RANLIB])
+
+AC_MSG_CHECKING([libtool object types])
+
+# Default to static linking.
+AC_ARG_ENABLE(linktype,
+[  --enable-linktype=TYPE  link programs against TYPE libraries [default=static]],
+[libtool_linktype="$enableval"],
+libtool_linktype=static)
+
+AC_ARG_ENABLE(profile,
+[  --enable-profile        build profiled libraries [default=no]],
+libtool_enable_profile="$enableval",
+libtool_enable_profile=no)
+
+AC_ARG_ENABLE(shared,
+[  --enable-shared         build shared libraries [default=no]],
+libtool_enable_shared="$enableval",
+libtool_enable_shared=no)
+
+AC_ARG_ENABLE(static,
+[  --enable-static         build static libraries [default=yes]],
+libtool_enable_static="$enableval",
+libtool_enable_static=yes)
+
+libtool_objtypes=
+case "$libtool_linktype" in
+  profile) libtool_objtypes=doP ;;
+  shared) libtool_objtypes=dos ;;
+  static) libtool_objtypes=do ;;
+  *) AC_MSG_ERROR([invalid option to --enable-linktype]) ;;
+esac
+
+case "$libtool_enable_profile" in
+  yes) test "$libtool_linktype" != "profile" &&
+         libtool_objtypes="$libtool_objtypes:doP" ;;
+  no) ;;
+  *) AC_MSG_ERROR([invalid option to --enable-profile]) ;;
+esac
+case "$libtool_enable_shared" in
+  yes) test "$libtool_linktype" != "shared" &&
+         libtool_objtypes="$libtool_objtypes:dos" ;; # Yuck! It spells "DOS"!
+  no) ;;
+  *) AC_MSG_ERROR([invalid option to --enable-shared]) ;;
+esac
+case "$libtool_enable_static" in
+  yes) test "$libtool_linktype" != "static" &&
+         libtool_objtypes="$libtool_objtypes:do" ;;
+  no) ;;
+  *) AC_MSG_ERROR([invalid option to --enable-static]) ;;
+esac
+
+test -n "$OBJTYPES" || OBJTYPES="$libtool_objtypes"
+
+AC_MSG_RESULT([$OBJTYPES])
+
+# Propagate silent flags
+am_prog_libtool_flags=
+test "$silent" = yes && am_prog_libtool_flags="--silent"
+
+# Get the real value of libdir:
+am_prog_libtool_libdir=`eval echo $libdir`
+case "$am_prog_libtool_libdir" in
+  NONE/lib)
+  if test "$exec_prefix" = "NONE"; then
+    if test "$prefix" = NONE; then
+      am_prog_libtool_libdir="$ac_default_prefix/lib"
+    else
+      am_prog_libtool_libdir="$prefix/lib"
+    fi
+  else
+    am_prog_libtool_libdir="$exec_prefix/lib"
+  fi ;;
+esac
+      
+# Actually configure libtool.
+# Holy mackerel, what a command line!
+CC="$CC" LD="$LD" RANLIB="$RANLIB" OBJTYPES="$OBJTYPES" \
+$srcdir/libtool --host="$host" --libdir="$am_prog_libtool_libdir" --no-validate-host \
+--with-gcc="$ac_cv_prog_gcc" $am_prog_libtool_flags \
+configure || AC_MSG_ERROR([libtool configure failed])
+])
diff --git a/m4/AM_SYSTEM_HEADER.m4 b/m4/AM_SYSTEM_HEADER.m4
new file mode 100644 (file)
index 0000000..c4f20a5
--- /dev/null
@@ -0,0 +1 @@
+AC_DEFUN([AM_SYSTEM_HEADER])
diff --git a/m4/AM_TYPE_PTRDIFF_T.m4 b/m4/AM_TYPE_PTRDIFF_T.m4
new file mode 100644 (file)
index 0000000..ab633a1
--- /dev/null
@@ -0,0 +1,10 @@
+# From Ulrich Drepper.
+
+AC_DEFUN(AM_TYPE_PTRDIFF_T,
+  [AC_CACHE_CHECK([for ptrdiff_t], ac_cv_type_ptrdiff_t,
+     [AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
+                    ac_cv_type_ptrdiff_t=yes, ac_cv_type_ptrdiff_t=no)])
+   if test $ac_cv_type_ptrdiff_t = yes; then
+     AC_DEFINE(HAVE_PTRDIFF_T)
+   fi
+])
diff --git a/m4/AM_WITH_DMALLOC.m4 b/m4/AM_WITH_DMALLOC.m4
new file mode 100644 (file)
index 0000000..bfd064a
--- /dev/null
@@ -0,0 +1,19 @@
+## ----------------------------------- ##
+## Check if --with-dmalloc was given.  ##
+## From Franc,ois Pinard               ##
+## ----------------------------------- ##
+
+AC_DEFUN(AM_WITH_DMALLOC,
+[AC_MSG_CHECKING(if malloc debugging is wanted)
+AC_ARG_WITH(dmalloc,
+[  --with-dmalloc          use dmalloc, as in
+                          ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz],
+[if test "$withval" = yes; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(WITH_DMALLOC)
+  LIBS="$LIBS -ldmalloc"
+  LDFLAGS="$LDFLAGS -g"
+else
+  AC_MSG_RESULT(no)
+fi], [AC_MSG_RESULT(no)])
+])
diff --git a/m4/AM_WITH_NLS.m4 b/m4/AM_WITH_NLS.m4
new file mode 100644 (file)
index 0000000..02a0ddc
--- /dev/null
@@ -0,0 +1,142 @@
+# From Ulrich Drepper.
+
+AC_DEFUN(AM_WITH_NLS,
+  [AC_MSG_CHECKING([whether NLS is requested])
+    dnl Default is enabled NLS
+    AC_ARG_ENABLE(nls,
+      [  --disable-nls           do not use Native Language Support],
+      USE_NLS=$enableval, USE_NLS=yes)
+    AC_MSG_RESULT($USE_NLS)
+    AC_SUBST(USE_NLS)
+
+    dnl If we use NLS figure out what method
+    if test "$USE_NLS" = "yes"; then
+      AC_DEFINE(ENABLE_NLS)
+      AC_MSG_CHECKING([for explicitly using GNU gettext])
+      AC_ARG_WITH(gnu-gettext,
+        [  --with-gnu-gettext      use the GNU gettext library],
+        nls_cv_force_use_gnu_gettext=$withval,
+        nls_cv_force_use_gnu_gettext=no)
+      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+
+      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+        dnl User does not insist on using GNU NLS library.  Figure out what
+        dnl to use.  If gettext or catgets are available (in this order) we
+        dnl use this.  Else we have to fall back to GNU NLS library.
+       dnl catgets is only used if permitted by option --with-catgets.
+       nls_cv_header_intl=
+       nls_cv_header_libgt=
+       CATOBJEXT=NONE
+
+       AC_CHECK_HEADER(libintl.h,
+         [AC_CHECK_LIB(intl, main)
+          AC_CHECK_FUNC(gettext,
+            [AC_DEFINE(HAVE_GETTEXT)
+             md_PATH_PROG(MSGFMT, msgfmt, no)dnl
+             if test "$MSGFMT" != "no"; then
+               AC_CHECK_FUNCS(dcgettext)
+               md_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+               md_PATH_PROG(XGETTEXT, xgettext, :)
+               CATOBJEXT=.mo
+               INSTOBJEXT=.mo
+               DATADIRNAME=lib
+             fi])])
+
+        if test "$CATOBJEXT" = "NONE"; then
+         AC_MSG_CHECKING([whether catgets can be used])
+         AC_ARG_WITH(catgets,
+           [  --with-catgets          use catgets functions if available],
+           nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
+         AC_MSG_RESULT($nls_cv_use_catgets)
+
+         if test "$nls_cv_use_catgets" = "yes"; then
+           dnl No gettext in C library.  Try catgets next.
+           AC_CHECK_LIB(i, main)
+           AC_CHECK_FUNC(catgets,
+             [AC_DEFINE(HAVE_CATGETS)
+              INTLOBJS="\$(CATOBJS)"
+              AC_PATH_PROG(GENCAT, gencat, no)dnl
+              if test "$GENCAT" != "no"; then
+                AC_PATH_PROGS(GMSGFMT, [gmsgfmt msgfmt], msgfmt)
+                md_PATH_PROG(XGETTEXT, xgettext, :)
+                CATOBJEXT=.cat
+                INSTOBJEXT=.cat
+                DATADIRNAME=lib
+                INTLDEPS="../intl/libintl.a"
+                INTLLIBS=$INTLDEPS
+                INTLSUB=intl
+                LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+                nls_cv_header_intl=intl/libintl.h
+                nls_cv_header_libgt=intl/libgettext.h
+              fi])
+         fi
+        fi
+
+        if test "$CATOBJEXT" = "NONE"; then
+         dnl Neither gettext nor catgets in included in the C library.
+         dnl Fall back on GNU gettext library.
+         nls_cv_use_gnu_gettext=yes
+        fi
+      fi
+
+      if test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Mark actions used to generate GNU NLS library.
+        INTLOBJS="\$(GETTOBJS)"
+        md_PATH_PROG(MSGFMT, msgfmt, msgfmt)
+        md_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+        md_PATH_PROG(XGETTEXT, xgettext, :)
+        AC_SUBST(MSGFMT)
+        CATOBJEXT=.gmo
+        INSTOBJEXT=.mo
+        DATADIRNAME=share
+        INTLDEPS="../intl/libintl.a"
+        INTLLIBS=$INTLDEPS
+        INTLSUB=intl
+       LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+        nls_cv_header_intl=intl/libintl.h
+        nls_cv_header_libgt=intl/libgettext.h
+      fi
+
+      dnl Test whether we really found GNU xgettext.
+      if test "$XGETTEXT" != ":"; then
+       dnl If it is no GNU xgettext we define it as : so that the
+       dnl Makefiles still can work.
+       if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+         : ;
+       else
+         AC_MSG_RESULT(
+           [found xgettext programs is not GNU xgettext; ignore it])
+         XGETTEXT=":"
+       fi
+      fi
+
+      # We need to process the po/ directory.
+      POSUB=po
+    else
+      DATADIRNAME=share
+      nls_cv_header_intl=intl/libintl.h
+      nls_cv_header_libgt=intl/libgettext.h
+    fi
+
+    dnl These rules are solely for the distribution goal.  While doing this
+    dnl we only have to keep exactly one list of the available catalogs
+    dnl in configure.in.
+    for lang in $ALL_LINGUAS; do
+      GMOFILES="$GMOFILES $lang.gmo"
+      POFILES="$POFILES $lang.po"
+    done
+
+    dnl Make all variables we use known to autoconf.
+    AC_SUBST(CATALOGS)
+    AC_SUBST(CATOBJEXT)
+    AC_SUBST(DATADIRNAME)
+    AC_SUBST(GMOFILES)
+    AC_SUBST(INSTOBJEXT)
+    AC_SUBST(INTLDEPS)
+    AC_SUBST(INTLLIBS)
+    AC_SUBST(INTLOBJS)
+    AC_SUBST(INTLSUB)
+    AC_SUBST(POFILES)
+    AC_SUBST(POSUB)
+  ])
diff --git a/m4/AM_WITH_REGEX.m4 b/m4/AM_WITH_REGEX.m4
new file mode 100644 (file)
index 0000000..e1249e5
--- /dev/null
@@ -0,0 +1,31 @@
+## --------------------------------- ##
+## Check if --with-regex was given.  ##
+## From Franc,ois Pinard             ##
+## --------------------------------- ##
+
+# The idea is to distribute rx.[hc] and regex.[hc] together, for
+# a while.  The WITH_REGEX symbol (which should also be documented
+# in acconfig.h) is used to decide which of regex.h or rx.h should
+# be included in the application.  If `./configure --with-regex' is
+# given, the package will use the older regex.  Else, a check is
+# made to see if rx is already installed, as with newer Linux'es.
+# If not found, the package will use the rx from the distribution.
+# If found, the package will use the system's rx which, on Linux
+# at least, will result in a smaller executable file.
+
+AC_DEFUN(AM_WITH_REGEX,
+[AC_MSG_CHECKING(which of rx or regex is wanted)
+AC_ARG_WITH(regex,
+[  --with-regex            use older regex in lieu of GNU rx for matching],
+[if test "$withval" = yes; then
+  ac_with_regex=1
+  AC_MSG_RESULT(regex)
+  AC_DEFINE(WITH_REGEX)
+  LIBOBJS="$LIBOBJS regex.o"
+fi])
+if test -z "$ac_with_regex"; then
+  AC_MSG_RESULT(rx)
+  AC_CHECK_FUNC(re_rx_search, , [LIBOBJS="$LIBOBJS rx.o"])
+fi
+AC_SUBST(LIBOBJS)dnl
+])
diff --git a/m4/Makefile.am b/m4/Makefile.am
new file mode 100644 (file)
index 0000000..b7a44de
--- /dev/null
@@ -0,0 +1,11 @@
+## Process this file with automake to create Makefile.in
+
+AUTOMAKE_OPTIONS = gnits
+MAINT_CHARSET = latin1
+
+pkgdata_DATA = AM_C_PROTOTYPES.m4 AM_FEATURE_CTYPE.m4 \
+AM_FEATURE_ERRNO.m4 AM_FEATURE_EXIT.m4 AM_FUNC_FNMATCH.m4 \
+AM_GNU_GETTEXT.m4 AM_LC_MESSAGES.m4 AM_MAINTAINER_MODE.m4 \
+AM_PATH_LISPDIR.m4 AM_PROG_CC_STDC.m4 AM_PROG_INSTALL.m4 \
+AM_PROG_LIBTOOL.m4 AM_SYSTEM_HEADER.m4 AM_TYPE_PTRDIFF_T.m4 \
+AM_WITH_DMALLOC.m4 AM_WITH_NLS.m4 AM_WITH_REGEX.m4
diff --git a/m4/Makefile.in b/m4/Makefile.in
new file mode 100644 (file)
index 0000000..fe440d7
--- /dev/null
@@ -0,0 +1,158 @@
+# Makefile.in generated automatically by automake 1.1a from Makefile.am
+
+# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+
+SHELL = /bin/sh
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+AUTOMAKE_OPTIONS = gnits
+MAINT_CHARSET = latin1
+
+pkgdata_DATA = AM_C_PROTOTYPES.m4 AM_FEATURE_CTYPE.m4 \
+AM_FEATURE_ERRNO.m4 AM_FEATURE_EXIT.m4 AM_FUNC_FNMATCH.m4 \
+AM_GNU_GETTEXT.m4 AM_LC_MESSAGES.m4 AM_MAINTAINER_MODE.m4 \
+AM_PATH_LISPDIR.m4 AM_PROG_CC_STDC.m4 AM_PROG_INSTALL.m4 \
+AM_PROG_LIBTOOL.m4 AM_SYSTEM_HEADER.m4 AM_TYPE_PTRDIFF_T.m4 \
+AM_WITH_DMALLOC.m4 AM_WITH_NLS.m4 AM_WITH_REGEX.m4
+mkinstalldirs = $(top_srcdir)/mkinstalldirs
+DATA = $(pkgdata_DATA)
+
+DIST_COMMON = Makefile.am Makefile.in
+
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
+       $(TEXINFOS) $(INFOS) $(MANS) $(EXTRA_DIST) $(DATA)
+DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
+       $(TEXINFOS) $(INFO_DEPS) $(MANS) $(EXTRA_DIST) $(DATA)
+
+TAR = tar
+default: all
+
+
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in
+       cd $(top_srcdir) && automake $(subdir)/Makefile
+
+Makefile: $(top_builddir)/config.status Makefile.in
+       cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
+
+install-pkgdataDATA: $(pkgdata_DATA)
+       $(mkinstalldirs) $(pkgdatadir)
+       list="$(pkgdata_DATA)"; for p in $$list; do \
+         if test -f $(srcdir)/$$p; then \
+           $(INSTALL_DATA) $(srcdir)/$$p $(pkgdatadir)/$$p; \
+         else if test -f $$p; then \
+           $(INSTALL_DATA) $$p $(pkgdatadir)/$$p; \
+         fi; fi; \
+       done
+
+uninstall-pkgdataDATA:
+       list="$(pkgdata_DATA)"; for p in $$list; do \
+         rm -f $(pkgdatadir)/$$p; \
+       done
+tags: TAGS
+TAGS:
+
+
+subdir = m4
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+distdir: $(DEP_DISTFILES)
+       @for file in `cd $(srcdir) && echo $(DISTFILES)`; do \
+         test -f $(distdir)/$$file \
+         || ln $(srcdir)/$$file $(distdir)/$$file 2> /dev/null \
+         || cp -p $(srcdir)/$$file $(distdir)/$$file; \
+       done
+info:
+
+dvi:
+
+check: all
+
+installcheck:
+
+install-exec: 
+
+install-data: install-pkgdataDATA
+
+install: install-exec install-data all
+       @:
+
+uninstall: uninstall-pkgdataDATA
+
+all: $(DATA) Makefile
+
+install-strip:
+       $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
+installdirs:
+       $(mkinstalldirs)  $(pkgdatadir)
+
+
+mostlyclean-generic:
+       test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+       test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+       rm -f Makefile $(DISTCLEANFILES)
+       rm -f config.cache config.log $(CONFIG_HEADER) stamp-h
+
+maintainer-clean-generic:
+       test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+       test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean:  mostlyclean-generic
+
+clean:  clean-generic mostlyclean 
+
+distclean:  distclean-generic clean 
+       rm -f config.status
+
+maintainer-clean:  maintainer-clean-generic distclean 
+       @echo "This command is intended for maintainers to use;"
+       @echo "it deletes files that may require special tools to rebuild."
+
+.PHONY: default uninstall-pkgdataDATA install-pkgdataDATA tags distdir \
+info dvi check installcheck install-exec install-data install uninstall \
+all installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+.SUFFIXES:
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
index 08e9d05..9ce69e2 100644 (file)
@@ -1,3 +1,9 @@
+Sun Jul 28 11:43:00 1996  Tom Tromey  <tromey@creche.cygnus.com>
+
+       * defs (ACLOCAL): Added definition.
+
+       * depacl.test, depacl2.test, error.test: New tests for aclocal.
+
 Fri Jul 19 10:09:56 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
        * ansi.test: New file.
index c424c46..d226644 100644 (file)
@@ -9,6 +9,7 @@ canon.test installsh.test empty.test rulepat.test insh.test canon2.test \
 target.test extra.test noinst.test instman.test mkinstall.test auxdir.test \
 canon3.test mdate2.test subdir.test backsl.test package.test number.test \
 insh2.test outdir.test fpinstall.test fpinst2.test texinfo.test dejagnu.test \
-yacc.test mkinstall2.test texinfo2.test ansi.test
+yacc.test mkinstall2.test texinfo2.test ansi.test depacl.test depacl2.test \
+error.test
 
 EXTRA_DIST = defs $(TESTS)
index 64bd547..b931aeb 100644 (file)
@@ -47,7 +47,8 @@ canon.test installsh.test empty.test rulepat.test insh.test canon2.test \
 target.test extra.test noinst.test instman.test mkinstall.test auxdir.test \
 canon3.test mdate2.test subdir.test backsl.test package.test number.test \
 insh2.test outdir.test fpinstall.test fpinst2.test texinfo.test dejagnu.test \
-yacc.test mkinstall2.test texinfo2.test ansi.test
+yacc.test mkinstall2.test texinfo2.test ansi.test depacl.test depacl2.test \
+error.test
 
 EXTRA_DIST = defs $(TESTS)
 mkinstalldirs = $(top_srcdir)/mkinstalldirs
index 321fa7b..72a4963 100644 (file)
@@ -46,3 +46,6 @@ echo "=== Running test $0"
 # strictness to avoid having to create lots and lots of files.  A test
 # can override this by specifying a different strictness.
 AUTOMAKE="../../automake --amdir=$srcdir/.. --foreign"
+
+# See how aclocal should be run.
+ACLOCAL="../../aclocal --acdir=$srcdir/../m4"
diff --git a/tests/depacl.test b/tests/depacl.test
new file mode 100755 (executable)
index 0000000..7b04b82
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+# Test to make sure dependency tracking works.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AM_C_PROTOTYPES
+END
+
+$ACLOCAL || exit 1
+
+grep '^AC_DEFUN.AM_PROG_CC_STDC,$' aclocal.m4
diff --git a/tests/depacl2.test b/tests/depacl2.test
new file mode 100755 (executable)
index 0000000..26e99b2
--- /dev/null
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+# Test to make sure dependencies work when require'd macro is part of
+# autoconf.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AM_C_PROTOTYPES
+END
+
+cat > AM_C_PROTOTYPES.m4 << 'END'
+AC_REQUIRE([AC_HEADER_STDC])
+END
+
+# Our --acdir overrides the one in $ACLOCAL.
+$ACLOCAL --acdir=.
diff --git a/tests/error.test b/tests/error.test
new file mode 100755 (executable)
index 0000000..9e63091
--- /dev/null
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+# Test to make sure error handling in add_file works.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+fp_C_PROTOTYPES
+END
+
+# Set up a strange environment, where fp_C_PROTOTYPES exists but its
+# dependency does not.
+cat > fp_C_PROTOTYPES.m4 << 'END'
+AC_REQUIRE([fp_PROG_CC_STDC])
+END
+
+# Our --acdir overrides the one in $ACLOCAL.
+$ACLOCAL --acdir=. && exit 1
+exit 0