Commit Graph

557 Commits

Author SHA1 Message Date
Akim Demaille
93cabdd478 * acspecific.m4 (AC_PATH_XTRA): On LynxOS 3.0.1/i386,
gethostbyname(), getservbyname(), and inet_addr() are in -lbsd.
2000-03-01 12:25:02 +00:00
Akim Demaille
b6cf2777dd * src/acgeneral.texi (AC_INIT_NOTICE): Include inttypes.h in the
ac_includes_default.
* doc/autoconf.texi (Default Includes): Adjust.
2000-02-25 17:49:29 +00:00
Akim Demaille
ab73229498 2000-02-25 Akim Demaille <akim@epita.fr>
* doc/autoconf.texi (Default Includes):

	Export the knowledge on disabling echo's trailing new line.

	* acspecific.m4 (AC_PROG_ECHO_N): Renamed as...
	(_AC_PROG_ECHO): this.
	Set ECHO_N, ECHO_C, ECHO_T instead of ac_n, ac_c and ac_t.
	All dependencies changed.
	* doc/autoconf.texi (Preset Output Variables): Document ECHO_C,
	ECHO_N and ECHO_T.
	* m4/atconfig.m4 (fp_PROG_ECHO): Removed.
	(AT_CONFIG): Don't use it.
2000-02-25 13:19:35 +00:00
Akim Demaille
c34897ff86 Some `diff' refuse to diff with /dev/null, such as Tru64's.
Reported by Nicolas Joly.

* tests/atgeneral.m4 (empty): New dummy file.
Changed various `diff /dev/null' as `diff empty'.
2000-02-18 13:44:17 +00:00
Akim Demaille
1a31555694 * tests/atgeneral.m4 (at_diff): Don't use `cmp -s', on DOS it
makes the difference between Unix and DOS EOL. `diff' does not.
Reported by Eli Zaretski.
Also, be ready to use a diff that does not support `-u'.
2000-02-18 10:01:25 +00:00
Akim Demaille
7e4260dccb Define HAVE_DECL_FOO both to 1 if found and 0 otherwise.
* acgeneral.m4 (AC_CHECK_DECLS): Define HAVE_DECL_FOO to 1 instead
of NEED_FOO_DECL if found.  Define to 0 if not found.
* autoheader.m4 (AC_CHECK_DECLS): Template HAVE_DECL_FOO.
* tests/semantics.m4 (AC_CHECK_DECLS): Adjusted.
* doc/autoconf.texi (Generic Declarations): Adjusted.
2000-02-15 09:33:59 +00:00
Akim Demaille
8cb64f7ca8 * acgeneral.m4 (AC_OUTPUT): When dispatching your arguments, use
ifval, not ifset!
Dispatch actions to AC_CONFIG_COMMANDS not AC_OUTPUT_COMMANDS, to
avoid unneeded warnings for obsolete use of AC_OUTPUT_COMMANDS.
2000-02-10 16:25:47 +00:00
Akim Demaille
65766c32aa * acgeneral.m4 (AC_VERBOSE): This is a tab, not spaces. 2000-02-10 16:21:42 +00:00
Akim Demaille
28b439235b Changequote busters II.
They're back to save the world.

* acspecific.m4 (AC_PROG_CC_C_O, AC_PROG_F77_C_O,
AC_PROG_MAKE_SET, AC_TYPE_GETGROUPS, AC_FUNC_GETLOADAVG,
AC_FUNC_MKTIME, AC_STRUCT_TIMEZONE, AC_F77_LIBRARY_LDFLAGS): Blast
that jelly o' changequote.  Set the quotes free.
2000-02-10 13:14:58 +00:00
Akim Demaille
0ab00d61fd * acgeneral.m4 (AC_OUTPUT_MAKE_DEFS): This is a routine of
`configure', not `config.status', hence use `conftest' for tmp
files, not `$ac_cs_root'.
Removed forgotten developer comment.
Double quoting the whole body is nicer than just the part that
needs to be.
2000-02-10 13:08:33 +00:00
Akim Demaille
fda88556f2 Changequote-busters!
From Dan Ackroyd.

* acgeneral.m4 (AC_INIT_PARSE_ARGS, AC_INIT_PREPARE,
AC_CACHE_SAVE, AC_PREFIX_PROGRAM, AC_OUTPUT,
_AC_OUTPUT_CONFIG_STATUS, AC_OUTPUT_MAKE_DEFS, AC_OUTPUT_FILES,
_AC_OUTPUT_HEADERS, AC_OUTPUT_LINKS, AC_OUTPUT_SUBDIRS): Quit
playing with changequotes, @BKL@ and Co.!  Just quote properly.
2000-02-10 10:40:19 +00:00
Akim Demaille
08de8c9f93 Honor properly the `#define' config.h.in templates.
Test it.

* acgeneral.m4 (AC_OUTPUT_HEADERS): Renamed as...
(_AC_OUTPUT_HEADERS): this.  All callers changed.
Don't mess with changequote, just quote properly.
Bug 1.  Because of the `#' in `ac_dA', the quotes <<>> were not
removed, and therefore the sed script contained `<<define>>'
instead of `define'.  Now that the block is properly quoted, there
is no need to quote `define'.
Bug 2.  Once a `#define' substitution performed, we were branching
to the top of the sed script (`t top').  This resulted in an
endless substitution of `#define foo 1' to `#define foo 1'.
Branching is not enough: you also have to fetch the next input
line, i.e., use `t' instead of `t t' in ac_dD, and don't output
`: top' in `config.defines'.
Though it was correct for `#undef' templates, just apply the same
transformation to `ac_uD' and `config.undefs'.
Bug 3.  Don't try to preserve what was behind the value in the
template, since on
	#define NAME "bar baz"
it leads to
	#define NAME 1 baz"
Now `ac_dB' catches everything behind the NAME (making sure there
is at least a space) and `ac_dC' only outputs a space.
* tests/torture.m4: Check that various forms of `#define' header
templates are properly handled.
2000-02-10 10:38:59 +00:00
Akim Demaille
14930dcc79 Avoid calling `rm' without arguments.
* acgeneral.m4 (_AC_OUTPUT_CONFIG_STATUS): It is smarter to use a
quoted here doc to output the section providing defaults for
CONFIG_*.
Don't rm the CONFIG_FILES here but in..
(AC_OUTPUT_FILES) [test -n "$CONFIG_FILES"]: here.
Hm, actually, no, just don't remove them at all, let the newly
created files replace the old ones, exactly as in
AC_OUTPUT_HEADERS.
From Graham Jenkins.
2000-02-10 10:37:03 +00:00
Akim Demaille
529087d2d7 * acgeneral.m4 (AC_LIST_MEMBER_OF): s/ac_$exists/$ac_exists/! 2000-02-10 10:36:13 +00:00
Akim Demaille
0eecbaadac * acgeneral.m4: Formatting changes.
* acspecific.m4: Likewise.
2000-02-10 10:35:18 +00:00
Akim Demaille
2d177917ef * acgeneral.m4 (_AC_OUTPUT_CONFIG_STATUS): Don't
: ${FOO="$foo"}
but
  : ${FOO=$foo}
Since Ultrix will also assign the quotes to FOO.
Reported by Harlan Stenn.
2000-02-10 10:25:23 +00:00
Akim Demaille
c7bd04fb16 Keep `AC_CHECK_TYPE' backward compatibility and provide a proper
`AC_CHECK_TYPE',
Based on ideas from Paul Eggert and Alexandre Oliva.

* acgeneral.m4 (AC_CHECK_TYPE_INTERNAL): Renamed as
(_AC_CHECK_TYPE_NEW): this.
(AC_CHECK_TYPES): Adjusted.
(AC_CHECK_TYPE): Renamed as
(_AC_CHECK_TYPE_OLD): This.  Adjusted to _AC_CHECK_TYPE_NEW.
No longer support extra includes, stick to 2.13's interface.
(_AC_CHECK_TYPE_BUILTIN_P): New macro.
(AC_CHECK_TYPE): New macro.
* autoheader.m4 (autoheader::AC_CHECK_TYPE): Renamed as...
(autoheader::_AC_CHECK_TYPE_OLD): this.
* tests/atspecific.m4 (TEST_MACRO): Skip /^_AC_/ macros.
* tests/semantics.m4: Test the choices of AC_CHECK_TYPE (wrt _NEW
or _OLD implemenation).
* doc/autoconf.texi (Generic Types): Reorganized.  Explain
everything about AC_CHECK_TYPE and Co.
2000-02-10 10:24:10 +00:00
Akim Demaille
dc6fcad969 The AU-glue code for AC_LINK_FILES was not fully compatible: in
AC_LINK_FILES($from, $to)
`$from' and `$to' can be lists, hence `AC_CONFIG_LINKS($to:$from)'
is wrong.
Reported by H.J. Lu.

* acgeneral.m4 (AC_LINK_FILES): Replace the m4-glue code from
AC_LINK_FILES to AC_CONFIG_LINKS, with sh-glue code.
Give a detailed update message.
(_AC_LINK_FILES_CNT): New variable.  Initialize.
* tests/tools.m4 (autoupdate): No longer exercise `autoupdate'
with AC_LINK_FILES.
2000-02-10 09:45:25 +00:00
Akim Demaille
3dbe69988a * acspecific.m4 (AC_PROG_SED): Removed. 2000-02-10 09:42:36 +00:00
Akim Demaille
d6ef78697d AC_CHECK_FILES has never worked properly.
* acgeneral.m4 (AC_CHECK_FILE): Use AC_CACHE_CHECK.
* autoheader.m4 (AC_CHECK_FILES): AH-define.
* tests/semantics.m4: Test AC_CHECK_FILES.
* tests/atspecific.m4 (TEST_MACRO): Don't.
2000-02-10 09:40:55 +00:00
Akim Demaille
abe94c7473 No longer use a diversion to store the sed program implementing
AC_SUBST.

* acgeneral.m4 (_AC_SUBST): New macro.
(_AC_SUBST_SED_PROGRAM): Initialize.
(AC_SUBST): Use _AC_SUBST.
(AC_SUBST_FILE): Likewise.
(AC_DIVERSION_SED): Removed.  Renumber the AC_DIVERSIONs.
(AC_OUTPUT_FILES): Instead on undiverting AC_DIVERSION_SED, output
_AC_SUBST_SED_PROGRAM.
2000-02-10 09:40:09 +00:00
Akim Demaille
fe71f613f1 Standardize the error messages in the options handling of
`configure' and `config.status'.

* acgeneral.m4 (AC_OUTPUT_CONFIG_STATUS): Renamed as...
(_AC_OUTPUT_CONFIG_STATUS): this.
Change the error messages from
  value: invalid feature name
to
  invalid feature: value
Invite the user to try --help for invalid options.
(AC_INIT_PARSE_ARGS): Likewise.
2000-02-10 09:37:37 +00:00
Akim Demaille
8bf7d7ef60 * acgeneral.m4 (AC_OUTPUT_COMMANDS_COMMANDS): Renamed as...
(_AC_OUTPUT_COMMANDS): This.  All callers changed.
Disable the verbose message until Automake uses the new features
of `config.status'.
Reported by Jim Meyering.
2000-02-10 09:35:00 +00:00
Akim Demaille
c4e67f0abd Clean up a few changequotes.
* acgeneral.m4 (AC_INIT_PARSE_ARGS): Instead of using changequote
to protect a few `[ ]', double quote the constant sections.
2000-02-10 08:52:56 +00:00
Akim Demaille
c979e7622f Restore AC_HAVE_LIBRARY.
* acgeneral.m4 (AC_HAVE_LIBRARY): AU_DEFUNed in terms of
AC_CHECK_LIB.
* doc/autoconf.texi (Libraries): Document.
2000-02-10 08:42:26 +00:00
Akim Demaille
e1b31f306e Fix the handling of `./configure foo=bar' and test it.
* acgeneral.m4 (AC_INIT_PARSE_ARGS, getopt loop): Always define
ac_optarg as the rhs of the first `=', not only on `-.*=', so that
`configure var=val' defines ac_optarg=val.
Improve the robustness to shell special characters:
 - Use grep when checking that shell variable names are valid.
 - Quote the quotes in ac_optarg before `eval var='$ac_optarg''.
 - Quote the quotes when building ac_configure_args.

* tests/torture.m4: Test that `./configure foo=bar' works properly.
2000-02-09 18:24:24 +00:00
Akim Demaille
c60a188814 Resynchronize INSTALL' with the current configure', and
conversely...

* acgeneral.m4 (AC_INIT_PARSE_ARGS): Let `configure' support `-h =
--help' and `-n = --no-create'.
Document -h, -n and -q in configure's help message.
* install.texi (Operation Controls): Formatting changes.
Document `configure -h'.
2000-02-09 18:19:58 +00:00
Akim Demaille
0586da3a49 AU_ glue code for AC_OUTPUT with arguments.
* acgeneral.m4 (AU_DEFINE): New macros, pulled out from AU_DEFUN.
Defines a macro in `autoupdate::' with all the required wrapping
for `autoupdate'.
(AU_DEFUN): Use it.
(AC_OUTPUT): When dispatching your arguments, use ifval, not
ifset!
Dispath actions to AC_CONFIG_COMMANDS not AC_OUTPUT_COMMANDS, to
avoid unneeded warnings for obsolete use of AC_OUTPUT_COMMANDS.
(autoupdate::AC_OUTPUT): New macro.
* doc/autoconf.texi (Writing configure.in, the example): Don't
advocate AC_OUTPUT with args.
(Output, AC_OUTPUT with args): Simplify the documentation, and
provide the translation into the new scheme.
Propagate what remained into the proper sections.
2000-02-09 17:47:47 +00:00
Akim Demaille
367368c916 AU_ glue code for AC_OUTPUT_COMMANDS.
* acgeneral.m4 (AC_OUTPUT_COMMANDS): AU_DEFUNed in terms of
AC_CONFIG_COMMANDS.
(AC_OUTPUT_COMMANDS_CNT): New variable, declared both in
`autoconf::' and `autoupdate::'.
(AC_OUTPUT): Register your arguments to AC_OUTPUT_COMMANDS only if
there are to avoid spurious `run autoupdate' messages.
* doc/autoconf.texi (Libraries): Document the changes.
2000-02-09 17:42:53 +00:00
Akim Demaille
a3df6b1558 Avoid outputting config_files' code in config.status' if there
are none.

* acgeneral.m4 (AC_OUTPUT): Don't register $1 to `AC_CONFIG_FILES'
if $1 is empty.
Normalize the names of the sections in `config.status --help'.
2000-02-09 17:36:03 +00:00
Akim Demaille
c0bc015e7b Extend the concept of `INIT-CMDS' to the AC_CONFIG_FOOS.
* acgeneral.m4 (_AC_CONFIG_COMMANDS_INIT): New macro which will
collect the `INIT-CMDS'.
(AC_CONFIG_COMMANDS, AC_CONFIG_LINKS, AC_CONFIG_HEADERS,
AC_CONFIG_FILES): Use it, and also temporarily divert to -1
instead of spamming dnl everywhere.
(AC_OUTPUT_CONFIG_STATUS): Make sure to output the INIT-CMDS
before the other sections, it'd be a pity to initialize after the
use :).

* doc/autoconf.texi (Configuration Actions): New section,
documenting the common behavior of AC_CONFIG_FILES,
AC_CONFIG_HEADERS, macro AC_CONFIG_COMMANDS, and AC_CONFIG_LINKS.
(Configuration Files): Document $2 and $3 of AC_CONFIG_FILES.
(Configuration Headers): Document $2 and $3 of AC_CONFIG_HEADERS.
(Configuration Commands): Document $2 and $3 of AC_CONFIG_COMMANDS.
(Configuration Links): Document $2 and $3 of AC_CONFIG_FILES.
2000-02-09 17:01:44 +00:00
Akim Demaille
ba05e82224 * libm4.m4 (m4_sign, m4_cmp, m4_list_cmp): New macros.
* acgeneral.m4 (AC_UNGNITS): Renamed as...
(_AC_VERSION_UNLETTER): this.  All callers changed.
Implement the scheme proposed by Alexandre Oliva:
	Nl -> (N+1).-1.(l#)
(_AC_VERSION_COMPARE): New macro.
(AC_PREREQ): Use it.
2000-02-09 11:59:24 +00:00
Akim Demaille
60c3912450 * acgeneral.m4 (AC_COMPILE_CHECK): Use AU_DEFUN, remove the call
to AC_OBSOLETE.
2000-02-08 13:58:13 +00:00
Akim Demaille
3986defac7 * acgeneral.m4 (AC_PROVIDE): Use m4_define', not define'.
Because of the namespace machinery this change makes `autoconf'
about four times faster on complex `configure.in's.
2000-02-08 13:55:52 +00:00
Akim Demaille
b39821a30a * acgeneral.m4 (AC_CONFIG_UNIQUE): Strip the `:foo.in' part
yourself, in order to give better error messages.
(AC_CONFIG_IF_MEMBER): Adapted to the above change.
Quote some regexp active characters ([+.*]).
Suggested by Alexandre Oliva.
2000-02-08 13:51:55 +00:00
Akim Demaille
ecf746f564 * acgeneral.m4 (AC_INCLUDES_DEFAULT): Make it more robust to
the fact it is used non quoted.
Reported by Jim Meyering.
2000-02-08 13:50:52 +00:00
Akim Demaille
90cea7798f * acgeneral.m4 (AC_OUTPUT_FILES): Simplify some excess in
changequote.
(AC_OUTPUT_SUBDIRS): Likewise.
2000-02-08 13:47:29 +00:00
Akim Demaille
11eaab70bd Let the doc catch up.
* doc/autoconf.texi (Common Behavior): New section, to document
the common behavior of the macros.
(Standard Symbols): New subsection.  Describes the transformation
of the AC_DEFINEd names.
(Default Includes): New subsection.  Obvious content.
All the ``callers'' updated.
2000-02-08 13:42:51 +00:00
Akim Demaille
738595fda3 * acgeneral.m4 (AC_OUTPUT_HEADERS): Don't use `break' to exit the
while loops which are breaking conftest.defines and
conftest.undefs into smaller snippets: just use the proper
condition for the while.
Suggested by Alexandre Oliva.
2000-02-08 13:41:51 +00:00
Akim Demaille
eb835e21d2 Introduce a concept index, and update a bit the documentation.
* doc/autoconf.texi (Concept Index): New section.
Various entries added.
(Typedefs): Renamed as...
(Types): this.  Pay attention to not limiting the documentation to
the typedefs.
(Particular Types): Mention the equivalent generic test.
Promote the GNU coding style at various places.
2000-02-08 13:38:45 +00:00
Akim Demaille
c7eb9bd99e Revamp the autoupdate/AC_OBSOLETE chain. All the details are
given in the prologue of acobsolete.m4.

* acgeneral.m4 (Prologue): Enter the `autoconf' name space.
(AU_DEFUN): New macro.

* autoupdate.m4: New file.
Disable the name spaces `autoconf', and `libm4'.  Disable libm4.
* Makefile.am: Tuned to support the changes above.

* autoupdate.sh: Model after autoconf.sh.
Can run on several files at once (for instance m4/*.m4).
Don't touch files that are up to date.
Run m4 on autoupdate.m4f instead of playing with sed.


Use AU_DEFUN.

* acgeneral.m4 (AC_LINK_FILES, AC_ENABLE, AC_WITH): Use AU_DEFUN,
remove the call to AC_OBSOLETE.
* acspecific.m4 (AC_CYGWIN32): Likewise.
* acoldnames.m4: Replaced all the definitions via `define' or
`AC_DEFUN' to use `AU_DEFUN'.
2000-02-08 13:25:49 +00:00
Akim Demaille
5ea4b5387a Clean up some m4 files.
* acoldnames.m4: Use `#', not `dnl'.
Don't spread `dnl' everywhere, anyway, we are in a divert(-1).
* autoconf.m4: Likewise.
* autoheader.m4: Likewise.
2000-02-08 13:16:01 +00:00
Akim Demaille
47f9aa62a1 Output really nothing if AC_INIT was not given. Unconditional
output can be problematic with autoupdate.

* acgeneral.m4 (AC_INIT_NOTICE): Output ac_includes_default.
(Default includes section): No longer dump ac_includes_default in
AC_DIVERSION_INIT.
2000-02-08 13:06:17 +00:00
Akim Demaille
a443a89e84 Clean up a bit the user interface.
* autoconf.sh: Give your name while reporting errors.
Don't spit --help for errors on arguments.
* autoreconf.sh: Likewise.
* autoheader.sh: Likewise.
More temporary files that one can browse when debugging.
Don't ${var}, just $var.
Don't dump --help when the arguments are invalid.
(config_h): Use the empty value instead of `undefined' to check
that it is defined.
* acspecific.m4: Formatting changes.
2000-02-08 11:39:46 +00:00
Akim Demaille
5a9da0e05e Introduce name spaces in libm4.
* libm4.m4 (m4_namespace_push, m4_namespace_pop,
m4_namespace_define, define, m4_disable, m4_enable, m4_rename):
New macros.
(_m4_foreach, _m4_for, m4_wrap): Use m4_define for temporaries.
(m4_split): Don't mess with the quotes.

* acgeneral.m4 (AC_OUTPUT_MAKE_DEFS, AC_OUTPUT_HEADERS): Quote
`define'.
2000-02-08 11:20:57 +00:00
Akim Demaille
4bed138997 * acgeneral.m4 (AC_PRO): Use AC_PROVIDE instead of defining
yourself.  This allows to see everything that is AC_PROVIDEd via
autoconf --trace.
(AC_SPECIALIZE): define'd, not AC_DEFUN'd.
(AC_PROVIDE): Use define with a single arg, instead of an empty $2.
2000-02-08 11:06:23 +00:00
Akim Demaille
6372ab2eec * acgeneral.m4 (ac_includes_default): Don't use simple quotes, but
doubles quotes if you want to use -continuation lines: this is
not recognized by MIPS' sh.
2000-02-08 10:59:38 +00:00
Akim Demaille
9965880fe8 * acgeneral.m4. Formatting changes.
* acspecific.m4: Likewise.
2000-02-08 10:46:43 +00:00
Akim Demaille
f624b6d754 * acgeneral.m4 (AC_CONFIG_HEADERS, AC_CONFIG_LINKS,
AC_CONFIG_SUBDIRS): A space was missing to separate the arguments
of m4_append.
2000-02-08 10:31:47 +00:00
Akim Demaille
0c5cd97cc3 Arrange that config.status creates the file with the AC_SUBSTing
engine only if needed.

* acgeneral.m4 (AC_OUTPUT_FILES): Create the sed code only if test
-n "$CONFIG_FILES".
2000-02-08 10:03:26 +00:00
Akim Demaille
13110f0768 Promote AC_LANG_CASE.
* acgeneral.m4 (AC_TRY_COMPILER, AC_TRY_LINK_FUNC, AC_CHECK_LIB,
AC_TRY_COMPILE, AC_TRY_LINK, AC_TRY_RUN_NATIVE, AC_CHECK_FUNC):
Use AC_LANG_CASE instead of ifelse (AC_LANG, ...).
(AC_TRY_LINK_FUNC): Quote the body the the AC_DEFUN (whoa, how
could this survive so long?!?).
2000-02-08 09:54:19 +00:00
Akim Demaille
c809277bf9 * acgeneral.m4: Formatting changes.
* acspecific.m4: Likewise.
2000-02-08 09:45:21 +00:00
Akim Demaille
bfe8456484 Use the style we promote.
* doc/autoconf.texi (Header Templates): Promote #if over #ifdef;
and #undef over #define in templates.
* acspecific.m4 (AC_DECL_SYS_SIGLIST, AC_FUNC_MMAP,
AC_FUNC_SETPGRP, AC_FUNC_VFORK, AC_FUNC_SELECT_ARGTYPES): Use #if,
not #ifdef and #ifndef, indent CPP directives.
2000-02-08 09:34:19 +00:00
Akim Demaille
6a609fe4b1 Quote properly AC_SHELL_IFELSE and callers.
* acgeneral.m4 (AC_SHELL_IFELSE): Don't overquote $1.
(AC_VAR_IF_SET, AC_CHECK_MEMBER, AC_CHECK_LIB, AC_CHECK_HEADER,
AC_CHECK_DECL, AC_CHECK_FUNC, AC_CHECK_TYPE_INTERNAL): Quote the
first argument of AC_SHELL_IFELSE.
2000-02-08 09:23:54 +00:00
Akim Demaille
c4d2980dbd It seems quite delicate to have AC_INCLUDES_DEFAULT insert the
default headers in the INIT section of configure: the reason is
that AC_INCLUDES_DEFAULT is called unquoted, and this results in
an un expected behavior.  Thanks to Roman V. Shaposhnick for the
details.

The current implementation is not satisfying: the default headers
are defined in the INIT section even if they are not used.

* acgeneral.m4 (Prologue of AC_INCLUDES_DEFAULTS): Dump the
definition of ac_includes_default in the INIT section of
configure.
(AC_INCLUDES_DEFAULTS): Use it.
2000-02-08 09:19:18 +00:00
Akim Demaille
9729954f66 Stay in Autoconf's name space.
* acspecific.m4 (AC_F77_LIBRARY_LDFLAGS): Prefixed with 'ac_':
arg, save_arg, i, seen, previous_arg, ld_run_path.
Renamed f77_link_output as ac_link_output.
* tests/actest.m4 (AC_ENV_SAVE): Don't note F77, FFLAGS, FLIBS,
G77, f77_case, f77_underscore.
2000-02-07 18:09:54 +00:00
Akim Demaille
9a9baf80c6 Use #' for comments instead of dnl'.
Better highlighting of the sections in the sources.

* acgeneral.m4: Formatting changes.
* acspecific.m4: Likewise.
* autoheader.m4: Likewise.
* acoldnames.m4: Likewise.
2000-02-07 18:03:54 +00:00
Akim Demaille
6b8dfc89ca Create libm4.m4.
* Makefile.am: Adjusted for libm4.m4.

* acgeneral.m4 (m4_errprint, m4_warn, m4_fatal, m4_prefix,
m4_eval, m4_shift, m4_format, m4_include_unique, m4_include,
m4_sinclude, m4_quote, m4_split, m4_join, m4_strip, m4_append,
m4_list_append, ifval, ifset, m4_default, m4_case, m4_match,
m4_foreach): Moved from here, to...
* libm4.m4: here.
* acgeneral.m4 (AC_WRAP): Moved from here, to...
* libm4.m4 (m4_wrap): here.  All callers changed.

* acgeneral.m4: Don't include acversion.m4.
* autoconf.m4: Include libm4.m4 and acversion.m4.
* autoheader.m4: Likewise.
2000-02-07 17:42:03 +00:00
Akim Demaille
b519547b61 AC_CHECK_SIZEOF: Fix a bug, use standard default headers, and
test.

* acgeneral.m4 (AC_CHECK_SIZEOF): Don't over quote $1, some []
were left in the C code, and had the macro fail.
Use AC_INCLUDES_DEFAULT.
* doc/autoconf.texi: Mention default includes.  Explain stdio.h
must always be given.

* tests/atspecific.m4 (TEST_MACRO): Updated the list of
exceptions.
(AT_CHECK_DEFINES): New macro, to check the content of config.h.
* tests/semantics.m4: All the tests are updated to use
AT_CHECK_DEFINES.
Test AC_CHECK_SIZEOF, AC_CHECK_HEADERS, and AC_CHECK_FUNCS.
2000-02-07 17:28:43 +00:00
Akim Demaille
fb4e32afa3 Give explicit diagnostics when an input file (for config headers;
config files etc.) does not exist.
From Jim Meyering.

* acgeneral.m4 (AC_OUTPUT_FILES, AC_OUTPUT_HEADERS): Check for the
existence of source files.
2000-02-07 17:23:07 +00:00
Akim Demaille
a604d916a0 * tests/atspecific.m4 (m4_for, m4_foreach): New macros. 2000-02-07 17:02:37 +00:00
Akim Demaille
a2dec8cec2 * acgeneral.m4 (AC_CHECK_TYPE_INTERNAL): Instead of defining an
unused pointer to the type $1, use
if (($1 *) 0) return 0;
to avoid warnings from the compiler.
From Paul Eggert.
2000-02-07 16:52:09 +00:00
Akim Demaille
293dd2c41d * acgeneral.m4 (AC_INCLUDES_DEFAULT): Include sys/types.h
Reported by Jim Meyering.
2000-02-07 16:46:56 +00:00
Akim Demaille
304ecacb35 * acgeneral.m4 (m4_case): Fixed a typo and a bug: one shift was
missing.
(m4_match): New macro.
* tests/atgeneral.m4 (AT_CASE): Fixed.
2000-02-07 16:28:06 +00:00
Akim Demaille
db2e9d0892 * acgeneral.m4: Formatting changes.
* acspecific.m4: Likewise.
2000-02-07 16:17:51 +00:00
Akim Demaille
b49b3a3107 * acspecific.m4 (AC_F77_LIBRARY_LDFLAGS): Don't use FFLAGS_SAVE
but ac_save_FFLAGS.
(AC_F77_NAME_MANGLING): Don't use foo_bar but ac_foo_bar.
2000-02-07 16:00:02 +00:00
Akim Demaille
00f447ee06 * acspecific.m4 (AC_C_INLINE): Proceed as for AC_C_CONST:
condition out the test case if __cpluscplus.
Don't document the autoheader template twice, one is enough.
* autoheader.m4 (AC_CONFIG_HEADER): don't hook on this guy, but
on...
(AC_CONFIG_HEADERS), since the former is defined on the latter.
2000-02-07 15:39:16 +00:00
Akim Demaille
635d167e35 * acgeneral.m4 (AC_CHECK_TYPE_INTERNAL): Use the scheme proposed
by Alexandre Oliva for testing the definition of TYPE:
TYPE *foo;
sizeof (TYPE);
2000-02-07 15:06:35 +00:00
Akim Demaille
6bc62513f5 * acspecific.m4 (AC_C_CONST): Don't changequote, there is no need
for it.  Just quote properly!
condition out the test case if __cpluscplus.
AC_REQUIRE AC_PROG_CC_STDC.
Fix slightly the display of the result (formerly the first run
says `none needed', and later, because of the cache `no').
(AC_C_INLINE, AC_C_VOLATILE): AC_REQUIRE AC_PROG_CC_STDC.
* doc/autoconf.texi (AC_C_CONST): Give a few hints on the
motivation for trusting the C++ compilers.
2000-02-07 14:53:49 +00:00
Akim Demaille
78a1aa6fc3 * tests/atgeneral.m4: Updated.
(AT_CASE): new macro.
(AT_CHECK): Use it.  Don't changequote for patsubst, there is no
need.
* tests/syntax.m4 (TEST_MACRO): Don't run AC_ARG_VAR.
Reported by Jim Meyering.
Use AT_CASE.
2000-02-07 14:22:37 +00:00
Akim Demaille
466fd1b23f Test that the macros respect the user variable name space.
* acgeneral.m4 (AC_CANONICAL_THING): define, not AC_DEFUN.
Don't AC_PROVIDE, there is no need.
When calling `config.sub`, also || exit 1, to catch failures from
config.sub.
* acspecific.m4 (AC_SYS_LONG_FILE_NAMES): Use ac_val, not val.
(AC_EXEEXT): Use ac_file, not file.
* tests/actest.m4: New file, holding extra Autoconf macros used
during the testing.
(AC_ENV_SAVE): New macro, save the sh variables in a file.
* tests/suite.m4 (AT_TEST_MACRO, Generation of configure.in):
include actest.m4, and call twice AC_ENV_SAVE to compare the
variables before and after the macro.
* tests/Makefile.am (macro.m4): Don't test macros that are
required: they will be tested somewhere else.
2000-02-07 13:25:35 +00:00
Akim Demaille
ec364610f6 * acgeneral.m4(AC_CONFIG_PRE_COMMANDS, AC_CONFIG_POST_COMMANDS):
Renamed AC_CONFIG_COMMANDS_PRE, AC_CONFIG_COMMANDS_POST.  All
dependencies changed.
From Jim Meyering.
2000-02-07 12:10:37 +00:00
Akim Demaille
63aaea568f * acgeneral.m4: Formatting changes.
* acspecific.m4: Likewise.
2000-02-07 12:04:39 +00:00
Akim Demaille
3c2a8f9b09 Start a new series of tests which check the semantics.
* acgeneral.m4 (AC_CHECK_MEMBER): It is not smart to define
ac_Foo, and use AC_Foo.  Got rid of AC_Member_Aggregate and
AC_Member_Member which were complicating more than simplifying.
(AC_CHECK_DECLS): Use m4 lists.
(AC_CHECK_TYPES): A comma was missing.
* autoheader.m4: (AC_CHECK_DECLS): Use m4 lists.
* doc/autoconf.texi (Generic Declarations): AC_CHECK_DELCS uses m4
lists.
* tests/semantics.m4: New file.  Collection of semantical tests:
verify that the tests are positive and negative when appropriate.
Test AC_CHECK_MEMBERS, AC_CHECK_DECLS and AC_CHECK_TYPES.
2000-02-07 11:54:29 +00:00
Akim Demaille
ea044949a5 Hide AH_HOOK behind AH_DEFUN.
* autoheader.m4 (AH_DEFUN): New macro.  Combination of define and
AH_HOOK.
(AC_TRY_RUN, AC_DEFINE, AC_DEFINE_UNQUOTED, AC_CHECK_LIB,
AC_CHECK_HEADERS, AC_CHECK_HEADERS_DIRENT, AC_CHECK_DECLS,
AC_CHECK_FUNCS, AC_CHECK_SIZEOF, AC_PROG_LEX, AC_CHECK_MEMBERS,
AC_CHECK_TYPE, AC_FUNC_ALLOCA, AC_CHECK_TYPES, AC_C_CHAR_UNSIGNED,
AC_AIX, AC_F77_WRAPPERS, AC_CONFIG_HEADER): All the former calls
to define and AH_HOOK in autoheader.m4 are replaced by AH_DEFUN.
2000-02-04 13:37:47 +00:00
Akim Demaille
8ef18f1d04 * acspecific.m4 (AC_RSH, AC_ARG_ARRAY, AC_HAVE_POUNDBANG): No use
to hide, you are DEFUNCT.
2000-02-04 13:20:19 +00:00
Akim Demaille
4f7835e642 Run the `syntax' test on acgeneral macros too.
Fix the bugs discovered.

* acgeneral.m4 (AC_CANONICAL_THING): Quote the
AC_REQUIRE([AC_CANONICAL_HOST]).  Bug triggered by the use of
AC_CANONICAL_BUILD alone in configure.in.  Also, quote the
arguments of macros (eg, ifelse([$1]...), not ifelse($1...)).
(m4_case): New macro.
(AC_LINKER_OPTION): Don't clash with user's name space
(s/i/ac_link_opt).
(AC_LIST_MEMBER_OF).  You mean AC_FATAL, not AC_MSG_ERROR.
Quote properly the argument.
dnl out the empty lines that result from m4 pure code.
Don't pollute the user name space.
Use AC_SHELL_IFELSE.
(AC_F77_NAME_MANGLING): Don't use `test -o'.  There are still
name space problems.
* tests/Makefile.am (macros.m4): Also fetch the macros from
acgeneral.m4.
2000-02-04 12:44:56 +00:00
Akim Demaille
682572c9b1 Really install this patch.
* acgeneral.m4 (AC_MSG_ERROR, AC_MSG_ERROR_UNQUOTED): Allow an
optional $2: exit status.
2000-02-04 11:27:50 +00:00
Akim Demaille
b9b4dc14d8 Check that the AC_DEFINEs from acspecific.m4 do have a template.
Fix the discovered bugs.

* tests/atgeneral.m4 (AT_CHECK): Don't just exit 1 when you want
to propagate the failure of a test: exit with the same exit
status, at least to preserve 77 (=ignore).
* tests/syntax.m4 (TEST_MACRO): Run also autoheader.  Don't run
this test on all the macros, some just cannot run without
arguments.
* acgeneral.m4 (AC_OUTPUT_CONFIG_STATUS): In the if egrep/fi for
#define templates, add a `:' to prevent syntax errors in
config.status when there are no AC_DEFINE performed.
* autoheader.m4 (AH_TEMPLATE): Don't use _AC_SH_QUOTE here, use it
in...
(AH_VERBATIM): here.  Now AH_C_UNSIGNED_CHAR is no longer failing
(formerly it would produce a non backslashed backquote, which
made sh choke).
2000-02-04 10:23:15 +00:00
Akim Demaille
89b1b4e90b Formatting changes. 2000-02-04 09:23:29 +00:00
Akim Demaille
34804a9d13 Introduce a means to distinguish failures of `configure' due to
extern software (so that the test suite doesn't fail on them).

* acgeneral.m4 (AC_MSG_ERROR, AC_MSG_ERROR_UNQUOTED): Allow an
optional $2: exit status.
* doc/autoconf.texi: Document.
* acspecific.m4 (AC_PROG_CC_WORKS, PROG_CXX_WORKS,
AC_PROG_F77_WORKS): Exit 77 if the compiler does not work.
2000-02-04 09:15:26 +00:00
Akim Demaille
7f8a47f153 Clean up a bit the handling of the LANG stack. More is needed.
* acgeneral.m4 (AC_LANG_CASE): New macro.
(AC_LANG_RESTORE): Use m4_case.
(AC_LINKER_OPTION): Use AC_LANG_CASE.
2000-02-04 08:41:39 +00:00
Akim Demaille
f6dd7456f3 1999-11-11 Akim Demaille <akim@epita.fr>
Introduce a new style of testing, independent from DejaGNU.


	Introduce the logistics.

	* configure.in: Initialize AT, and output tests/atconfig, and
	tests/Makefile.
	* m4/atconfig.m4: New file.
	* m4/Makefile.am: Adjusted.
	* aclocal.m4: Include atconfig.m4.
	* Makefile.am: Adjusted.
	* tests/Makefile.am: New file.
	* tests/atgeneral.m4: Likewise.
	* tests/atconfig.in: Likewise.


	Write tests.

	* tests/syntax.m4: New file, in charge of checking the validity of
	the sh code produced by the macros defined in acspecific.m4.
	acgeneral.m4 is not checked here, because these macros require
	arguments.
	* tests/suite.m4: New file.  Run syntax.m4.
2000-01-29 12:18:40 +00:00
Akim Demaille
91a9a99d16 1999-11-10 Akim Demaille <akim@epita.fr>
A test suite will be introduced which tries to run all the
	specific macros, but hasbeen'd macro make configure die with bad
	exit status.  So we wish to distinguish live macros from defunct
	macros at the moment they are AC_DEFUN'd, not in their body.  Hm,
	defunct, defunct... Hey!  That's a good name!

	* acgeneral.m4 (AC_DEFUNCT): New macro, comparable to AC_DEFUN,
	but for macros which are no longer defined.  Replaces AC_HASBEEN.
	(AC_HASBEEN): Defunct.  Well, removed in fact.
	(AC_HAVE_LIBRARY): Don't use AC_DEFUN and AC_HASBEEN, just
	AC_DEFUNCT.
	* acspecific.m4 (AC_UNISTD_H, AC_USG, AC_MEMORY_H, AC_DIR_HEADER,
	AC_INT_16_BITS, AC_LONG_64_BITS): Likewise.
	(AC_XENIX_DIR): It was defunct even before I declared it was: was
	depending upon AC_DIR_HEADER which is defunct.  So AC_DEFUNCT'ed
	now.
	(AC_DYNIX_SEQ, AC_IRIX_SUN, AC_SCO_INTL): While we're here, you
	too are defunct now.
	* autoconf.texi (Obsolete Macros): Replace the documentation of
	AC_HASBEEN with that of AC_DEFUNCT.
2000-01-29 11:46:21 +00:00
Akim Demaille
ddfcae90fa 1999-11-10 Akim Demaille <akim@epita.fr>
* autoconf.sh: Formatting changes.
	Removed development junk.
	* acspecific.m4: Formatting changes.
	* autoconf.m4: Likewise.
	* autoheader.m4: Likewise.
2000-01-29 11:37:48 +00:00
Akim Demaille
a47826499c 1999-11-10 Akim Demaille <akim@epita.fr>
Require GNU m4 1.4 (well 1.3 in fact).

	Because we are ready to handle the case where there are no frozen
	files, we *have* to pass a -I, which is dangerous in conjunction
	with the silent including of `aclocal.m4': you may include things
	that were not expected.  Since anyway handling pre 1.3 complicates
	the task, just require an m4 which supports reloading of frozen
	files.

	* acspecific.m4 (AC_PROG_GNU_M4): Check for --reload.
	* autoconf.sh: Likewise
	* autoheader.sh: Likewise.
	* configure.in: Explicitly state the m4 version you want.
2000-01-29 09:51:17 +00:00
Akim Demaille
394a96e50d 1999-11-10 Akim Demaille <akim@epita.fr>
No need for foo="`bar`", foo=`bar` is fine.
	Simplify ${foo} and ${1} into $foo and $1.

	* acgeneral.m4 (ac_LF_and_DOT): Remove the double quotes.
	* acspecific.m4 (AC_PROG_CC_C_O, AC_PROG_F77_C_O): Likewise.
	* autoconf.sh: Likewise.
	* autoheader.sh: Likewise.
	* autoreconf.sh: Likewise.
	* autoupdate.sh: Likewise.
	* ifnames.sh: Remove all the code and messages related to
	AC_MACRODIR, since ifnames is not related to macros in anyway.
2000-01-29 09:46:28 +00:00
Akim Demaille
f9abb7ad1d 1999-11-10 Akim Demaille <akim@epita.fr>
New version of AC_INCLUDE, which does not glob, nor rely upon the
	shell.  Add AC_INCLUDES too.  Help tracking multiple inclusions.

	* acgeneral.m4 (m4_errprint, m4_warn, m4_fatal): New macros,
	variations around errprint.
	(m4_include_unique): New macro which registers what are the files
	already included, and warns if some are included several times.
	(m4_include, m4_sinclude): New macro, using m4_include_unique.
	(AC_INCLUDE): Is now just a wrapper of m4_include.
	(AC_INIT): Use m4_sinclude, not sinclude.
	(_AC_ERRPRINT): Removed, m4_errprint is here!
	(AC_WARNING, AC_FATAL): Wrappers of m4_warn and m4_fatal.
2000-01-29 09:34:26 +00:00
Akim Demaille
3c6c0f1477 1999-11-01 Akim Demaille <akim@epita.fr>
Clean up the macros for testing members of aggregates.

	* acgeneral.m4 (AC_CHECK_MEMBER): FATAL if $1 has no dot in it.
	Use AC_INCLUDE_DEFAULTS.
	(AC_C_STRUCT_MEMBER): Removed.
	* acspecific.m4 (AC_STRUCT_TIMEZONE): Adapted to AC_CHECK_MEMBERS.
	(AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV): Adapted to
 	AC_CHECK_MEMBERS and obsoleted.
	(AC_STRUCT_ST_BLOCKS): Adapted to AC_CHECK_MEMBERS.
	* autoconf.texi (AC_STRUCT_ST_BLKSIZE, HAVE_STRUCT_STAT_ST_RDEV):
	Explain they are obsoleted, and how to migrate.
	(AC_STRUCT_ST_BLOCKS, AC_STRUCT_TIMEZONE): Explain that the
 	AC_DEFINE changed (but the former #defines remain defined
 	currently).
	(AC_C_STRUCT_MEMBER): Removed, replaced by the definitions of
	AC_CHECK_MEMBER and AC_CHECK_MEMBERS.
2000-01-28 16:05:48 +00:00
Akim Demaille
097b84fd1c 1999-11-01 Akim Demaille <akim@epita.fr>
Install a uniform set of default includes.

	* acgeneral.m4 (AC_INCLUDES_DEFAULT): New macro.  Expands in its
	argument if non empty, otherwise a default list of includes.
	(AC_CHECK_DECL, AC_CHECK_TYPE_INTERNAL): Use AC_INCLUDES_DEFAULT.
	* autoconf.texi: Adjusted.
2000-01-28 15:23:37 +00:00
Akim Demaille
39413fef29 Formatting changes. 2000-01-28 10:44:30 +00:00
Akim Demaille
13527a7b56 1999-11-01 Akim Demaille <akim@epita.fr>
Fix a bit of the brokenness of AC_CHECK_TYPE.

	* acgeneral.m4 (AC_CHECK_TYPE_INTERNAL): New macro, inspired from
 	the former AC_CHECK_TYPE.  This macro is exactly the one that
 	ought to be named AC_CHECK_TYPE: it just checks, and executes user
 	actions.  In the future, this macro ought to be renamed
 	AC_CHECK_TYPE.
	There is a big difference with the former AC_CHECK_TYPE: instead
 	of grepping in the headers, it tries to compile a variable
 	declaration.  This is both safer, slower, and better, since now we
 	can check for compiler types (e.g., unsigned long long).
	(AC_CHECK_TYPES): The looping and AC_DEFINEing version of the
 	previous macro.  Uses m4 loops.
	(AC_CHECK_TYPE): Reimplemented on top of AC_CHECK_TYPE_INTERNAL.
  	* autoheader.m4 (AH_CHECK_TYPE, AH_CHECK_TYPES): New macros,
 	hooked.
	* autoconf.texi (@ovar): New macro, for optional variables.
	(Generic Typedefs): Document AC_CHECK_TYPES.
	* autoheader.texi: (AH_CHECK_TYPE, AH_CHECK_TYPES): New macros.
	(Epilogue): Hooks them.
2000-01-28 10:41:47 +00:00
Akim Demaille
cc1f3c1bca 1999-11-01 Akim Demaille <akim@epita.fr>
Update autoupdate.

	* acoldnames.m4:  Sort the two sections.
	* acoldnames.m4 (AM_CYGWIN32, AM_EXEEXT, AM_FUNC_FNMATCH,
 	AM_FUNC_MKTIME, AM_PROG_LIBTOOL, AM_MINGW32, AM_PROG_INSTALL,
 	fp_FUNC_FNMATCH): Added their new names.
2000-01-26 12:38:31 +00:00
Akim Demaille
3c45adf66c 1999-10-31 Akim Demaille <akim@epita.fr>
* acgeneral.m4 (AC_INIT_PARSE_ARGS): Reformating of configure and
	config.status --help.
2000-01-14 18:15:57 +00:00
Akim Demaille
6bae95ed08 1999-10-31 Akim Demaille <akim@epita.fr>
* acgeneral.m4 (AC_OUTPUT_CONFIG_STATUS): Implement `config.status
	--file' and `--header'.
2000-01-14 18:10:44 +00:00
Akim Demaille
553eefdb5f 1999-10-31 Akim Demaille <akim@epita.fr>
* acgeneral.m4: Formatting changes.
	* acspecific.m4: Likewise.
2000-01-14 18:06:22 +00:00
Akim Demaille
19a9e0d8d5 1999-10-31 Akim Demaille <akim@epita.fr>
* acgeneral.m4 (AC_CONFIG_LINKS): Allow a second argument,
	commands to run, as AC_CONFIG_FILES and HEADERS.
	(AC_LIST_LINKS_COMMANDS): New growing string.  Initialize.
	(AC_OUTPUT_LINKS): Use it.
	(AC_OUTPUT_FILES, AC_OUTPUT_HEADERS, AC_OUTPUT_LINKS): Don't
	pretend to have arguments: you don't depend upon it.
	(AC_OUTPUT): Call the previous macros without arguments.
2000-01-14 17:57:52 +00:00
Akim Demaille
8ccd9f93f7 1999-10-31 Akim Demaille <akim@epita.fr>
* acgeneral.m4 (AC_PREFIX_PROGRAM): Don't use define/undefine, but
	pushdef/podef.  AC_UPCASE_NAME no longer exist.
2000-01-14 17:53:47 +00:00
Akim Demaille
73ec5d2f18 1999-10-31 Akim Demaille <akim@epita.fr>
* acgeneral.m4: Formatting changes.
2000-01-14 17:51:12 +00:00
Akim Demaille
8833720a01 1999-10-31 Akim Demaille <akim@epita.fr>
Clean up dead comments/code.  Clean up the incompatibilities
	between quoted and non quoted _AC_ECHO and the like.

	* acgeneral.m4: Remove the comments on the no longer defined AC_TR.
	(_AC_SH_QUOTE): Be robust to active symbols.
	(_AC_ECHO): Quote properly the argument.
	(AC_TRY_RUN): Don't quote [AC_TRY_RUN] in the warning.
2000-01-14 17:38:31 +00:00