Re: [RFC] Update to current automake/autoconf/libtool versions

Nathanael Nerode
2002-12-06T00:56:27Z

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

>Going over it all again, I realize that we could probably just
>redefine AC_NO_EXECUTABLES to do what we want. We'd have to
>specialize its definition for every version of autoconf that we cared
>about, and check at every new release that it hadn't broken, but it
>would work. I guess it's not impossible after all.
>
>zw

*twisted half-grin*

For the top level, I'd been unable to avoid writing
complete replacements for AC_PROG_CC and AC_PROG_CXX, and it
was really nasty.

So this is actually better than I'd hoped.

Thanks! Writing a specialized implementation of AC_NO_EXECUTABLES will
make my life easier, probably. :-)

The real reason I want autoconf 2.5x is twofold:
* it handles AC_REQUIRES on AC_CANONICAL_* properly
* it allows the use of m4_include, so I can make a master macro file
(in top level config, for instance) and use it even in directories
without automake.

You might be amused by the most basic parts of my experimental
aclocal.m4 include file.

--Nathanael

[-- Attachment #2: aclocal.m4 --]
[-- Type: text/plain, Size: 2431 bytes --]

# Autoconf M4 include file defining valuable macros for complex Canadian
# cross builds.

####
# _NCN_TOOL_PREFIXES
# Get prefixes for cross-compilers to the host and the target.
# This requires that AC_CANONICAL_SYSTEM be called beforehand.
# Unfortunately, AC_REQUIRE doesn't work properly in this case under
# autoconf 2.13.
AC_DEFUN([_NCN_TOOL_PREFIXES],
[ncn_tool_prefix=
test -n "$host_alias" && ncn_tool_prefix=$host_alias-
ncn_target_tool_prefix=
test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
]) []dnl # _NCN_TOOL_PREFIXES

####
# NCN_CHECK_TARGET_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
# Like AC_CHECK_TOOL, but tries a prefix of the target, not the host.
# Code is pretty much lifted from autoconf2.53.

AC_DEFUN([NCN_CHECK_TARGET_TOOL],
[AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
if test -n "$ncn_target_tool_prefix"; then
AC_CHECK_PROG([$1], [${ncn_target_tool_prefix}$2],
[${ncn_target_tool_prefix}$2], , [$4])
fi
if test -z "$ac_cv_prog_$1" ; then
ncn_ct_$1=$$1
AC_CHECK_PROG([ncn_ct_$1], [$2], [$2], [$3], [$4])
$1=$ncn_ct_$1
else
$1="$ac_cv_prog_$1"
fi
]) []dnl # NCN_CHECK_TARGET_TOOL

####
# NCN_STRICT_CHECK_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
# Like AC_CHECK_TOOL, but requires the prefix if build!=host.

AC_DEFUN([NCN_STRICT_CHECK_TOOL],
[AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
if test -n "$ncn_tool_prefix"; then
AC_CHECK_PROG([$1], [${ncn_tool_prefix}$2],
[${ncn_tool_prefix}$2], , [$4])
fi
if test -z "$ac_cv_prog_$1" ; then
if test $build = $host ; then
ncn_ct_$1=$$1
AC_CHECK_PROG([ncn_ct_$1], [$2], [$2], [$3], [$4])
$1=$ncn_ct_$1
else
$1="$3"
fi
else
$1="$ac_cv_prog_$1"
fi
]) []dnl # NCN_STRICT_CHECK_TOOL

####
# NCN_STRICT_CHECK_TARGET_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
# Like NCN_CHECK_TARGET_TOOL, but requires the prefix if build!=target.

AC_DEFUN([NCN_STRICT_CHECK_TARGET_TOOL],
[AC_REQUIRE([_NCN_TOOL_PREFIXES]) []dnl
if test -n "$ncn_target_tool_prefix"; then
AC_CHECK_PROG([$1], [${ncn_target_tool_prefix}$2],
[${ncn_target_tool_prefix}$2], , [$4])
fi
if test -z "$ac_cv_prog_$1" ; then
if test $build = $target ; then
ncn_ct_$1=$$1
AC_CHECK_PROG([ncn_ct_$1], [$2], [$2], [$3], [$4])
$1=$ncn_ct_$1
else
$1="$3"
fi
else
$1="$ac_cv_prog_$1"
fi
]) []dnl # NCN_STRICT_CHECK_TARGET_TOOL