[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AM_TYPE_PTRDIFF_T
From: |
Akim Demaille |
Subject: |
Re: AM_TYPE_PTRDIFF_T |
Date: |
14 Jul 2001 19:34:13 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor) |
| Version: 1.4-p4
| autoconf-2.50 `actypes.m4' defines `AM_TYPE_PTRDIFF_T'. `aclocal'
| fails to detect this and includes `ptrdiff.m4' in `aclocal.m4'. This
| causes conflict of `AC_DEFUN''s during `autoconf' processing.
|
| Q&D solution is commenting out `AC_DEFUN' in `ptrdiff.m4'. It makes
| `aclocal' that macro defn is found, but resulting `aclocal.m4' does
| not conflicts with `actypes.m4'.
|
| --- ptrdiff.m4 2001/07/11 15:39:19 1.1
| +++ ptrdiff.m4 2001/07/11 15:49:41 1.2
| @@ -2,6 +2,7 @@
|
| # serial 1
|
| +ifelse([a],[b],[
| AC_DEFUN(AM_TYPE_PTRDIFF_T,
| [AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t,
| [AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
| @@ -9,4 +10,4 @@
| if test $am_cv_type_ptrdiff_t = yes; then
| AC_DEFINE(HAVE_PTRDIFF_T,1,[Define if system has ptrdiff_t type])
| fi
| -])
| +])])dnl
This must not be applied. Your proposal is just the same as removing
AM_TYPE_PTRDIFF_T, which is used for 2.13. If you use 2.50, then
don't use AM_TYPE_PTRDIFF_T.
New Macros
----------
Because Autoconf has been dormant for years, Automake provided
Autoconf-like macros for a while. Autoconf 2.50 now provides better
versions of these macros, integrated in the `AC_' namespace, instead of
`AM_'. But in order to ease the upgrading via `autoupdate', bindings
to such `AM_' macros are provided.
Unfortunately Automake did not quote the name of these macros!
Therefore, when `m4' find in `aclocal.m4' something like
`AC_DEFUN(AM_TYPE_PTRDIFF_T, ...)', `AM_TYPE_PTRDIFF_T' is expanded,
replaced with its Autoconf definition.
Fortunately Autoconf catches pre-`AC_INIT' expansions, and will
complain, in its own words:
$ cat configure.in
AC_INIT
AM_TYPE_PTRDIFF_T
$ aclocal-1.4
$ autoconf
./aclocal.m4:17: error: m4_defn: undefined macro: _m4_divert_diversion
actypes.m4:289: AM_TYPE_PTRDIFF_T is expanded from...
./aclocal.m4:17: the top level
$
Future versions of Automake will simply no longer define most of
these macros, and will properly quote the names of the remaining macros.
But you don't have to wait for it to happen to do the right thing right
now: do not depend upon macros from Automake as it is simply not its job
to provide macros (but the one it requires by itself):
$ cat configure.in
AC_INIT
AM_TYPE_PTRDIFF_T
$ rm aclocal.m4
$ autoupdate
autoupdate: `configure.in' is updated
$ cat configure.in
AC_INIT
AC_CHECK_TYPES([ptrdiff_t])
$ aclocal-1.4
$ autoconf
$