]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acgeneral.m4 (AC_INCLUDE): New macro.
authoroliva <oliva>
Wed, 15 Sep 1999 02:39:28 +0000 (02:39 +0000)
committeroliva <oliva>
Wed, 15 Sep 1999 02:39:28 +0000 (02:39 +0000)
* autoconf.texi: Document it.

ChangeLog
acgeneral.m4
autoconf.texi
doc/autoconf.texi
lib/autoconf/general.m4

index 6d28d3ff636ec90edc0480f641da4fe847e41857..9857aaf64a33b1d15838f226102be0b4ac861c49 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 1999-09-14  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
 
+       * acgeneral.m4 (AC_INCLUDE): New macro.
+       * autoconf.texi: Document it.
+
        * acgeneral.m4 (AC_OUTPUT_SUBDIRS): Save INSTALL in
        ac_given_INSTALL, so that we can adjust relative pathnames for
        sub-configures.
index fd2d9cdf1ad0c7e29022a8e15bdd3c97716aa75e..3d3b1a43147efb88f1e2812361fb20d1479d76d0 100644 (file)
@@ -1046,6 +1046,12 @@ AC_INIT_PREPARE($1)dnl
 AC_DIVERT_POP()dnl to NORMAL
 ])
 
+dnl AC_INCLUDE
+AC_DEFUN(AC_INCLUDE,
+[ifelse($1, [], [], [dnl
+  esyscmd([for file in $1; do echo "builtin(include,$file)dnl"; done])dnl
+])])
+
 dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
 AC_DEFUN(AC_INIT_PREPARE,
 [trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
index 9ca573023ca50eef59069e9d9ebec385041bf486..0fb39dfbfeb76fc02460833d349a95ecc39b7c15 100644 (file)
@@ -799,6 +799,27 @@ with @samp{--srcdir}; this is a safety check.  @xref{Invoking configure},
 for more information.
 @end defmac
 
+Small packages may store all their macros in @code{aclocal.m4}.  As the
+set of macros grows, or for maintenance reasons, a maintainer may prefer 
+to split the macros in several files.  In this case, Autoconf must be
+told which files to load, and in which order.
+
+@defmac AC_INCLUDE (@var{file(s)})
+@maindex AC_INCLUDE
+Read the macro definitions that appear in the listed files.  A list of
+space-separated filenames or shell globbing patterns is expected.  The
+files will be read in the order they're listed.
+
+Because the order of definition of macros is important (only the last
+definition of a macro is used), beware that it is @code{AC_INIT} that
+loads @file{acsite.m4} and @file{aclocal.m4}.  Note that
+@code{AC_INCLUDE}ing a file before @code{AC_INIT} or within
+@file{aclocal.m4} is different from doing so after @code{AC_INIT}: in
+the latter case, non-macro lines from included files may end up in the
+@file{configure} script, whereas in the former case, they'd be discarded
+just like any text that appear before @code{AC_INIT}.
+@end defmac
+
 Packages that do manual configuration or use the @code{install} program
 might need to tell @code{configure} where to find some other shell
 scripts by calling @code{AC_CONFIG_AUX_DIR}, though the default places
index 9ca573023ca50eef59069e9d9ebec385041bf486..0fb39dfbfeb76fc02460833d349a95ecc39b7c15 100644 (file)
@@ -799,6 +799,27 @@ with @samp{--srcdir}; this is a safety check.  @xref{Invoking configure},
 for more information.
 @end defmac
 
+Small packages may store all their macros in @code{aclocal.m4}.  As the
+set of macros grows, or for maintenance reasons, a maintainer may prefer 
+to split the macros in several files.  In this case, Autoconf must be
+told which files to load, and in which order.
+
+@defmac AC_INCLUDE (@var{file(s)})
+@maindex AC_INCLUDE
+Read the macro definitions that appear in the listed files.  A list of
+space-separated filenames or shell globbing patterns is expected.  The
+files will be read in the order they're listed.
+
+Because the order of definition of macros is important (only the last
+definition of a macro is used), beware that it is @code{AC_INIT} that
+loads @file{acsite.m4} and @file{aclocal.m4}.  Note that
+@code{AC_INCLUDE}ing a file before @code{AC_INIT} or within
+@file{aclocal.m4} is different from doing so after @code{AC_INIT}: in
+the latter case, non-macro lines from included files may end up in the
+@file{configure} script, whereas in the former case, they'd be discarded
+just like any text that appear before @code{AC_INIT}.
+@end defmac
+
 Packages that do manual configuration or use the @code{install} program
 might need to tell @code{configure} where to find some other shell
 scripts by calling @code{AC_CONFIG_AUX_DIR}, though the default places
index fd2d9cdf1ad0c7e29022a8e15bdd3c97716aa75e..3d3b1a43147efb88f1e2812361fb20d1479d76d0 100644 (file)
@@ -1046,6 +1046,12 @@ AC_INIT_PREPARE($1)dnl
 AC_DIVERT_POP()dnl to NORMAL
 ])
 
+dnl AC_INCLUDE
+AC_DEFUN(AC_INCLUDE,
+[ifelse($1, [], [], [dnl
+  esyscmd([for file in $1; do echo "builtin(include,$file)dnl"; done])dnl
+])])
+
 dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
 AC_DEFUN(AC_INIT_PREPARE,
 [trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15