Fixed some autoconf bit rot.

Autoconf 2.68 is more picky about correct macro usage and thus I need
to fix some wrong call conventions for AC_LANG_PROGRAM.  Also factor
out an m4 conditional construct from AC_INIT to avoid the "not a
literal" warning.
This commit is contained in:
Werner Koch 2011-08-04 11:36:52 +02:00
parent dea8ad4535
commit 60d8c901ce
6 changed files with 51 additions and 40 deletions

View File

@ -1,3 +1,7 @@
2011-08-04 Werner Koch <wk@g10code.com>
* configure.ac: Fix usage of AC_LANG_PROGRAM.
2011-02-04 Werner Koch <wk@g10code.com>
* autogen.sh: Ensure that the git pre-commit hoom has been

View File

@ -1,5 +1,5 @@
#! /bin/sh
# Run this to generate all the initial makefiles, etc.
# Run this to generate all the initial makefiles, etc.
#
# Copyright (C) 2003 g10 Code GmbH
#
@ -59,7 +59,7 @@ if test "$1" = "--build-w32"; then
[ -z "$w32root" ] && w32root="$HOME/w32root"
echo "Using $w32root as standard install directory" >&2
# Locate the cross compiler
crossbindir=
for host in i586-mingw32msvc i386-mingw32msvc mingw32; do
@ -72,11 +72,11 @@ if test "$1" = "--build-w32"; then
if [ -z "$crossbindir" ]; then
echo "Cross compiler kit not installed" >&2
echo "Under Debian GNU/Linux, you may install it using" >&2
echo " apt-get install mingw32 mingw32-runtime mingw32-binutils" >&2
echo " apt-get install mingw32 mingw32-runtime mingw32-binutils" >&2
echo "Stop." >&2
exit 1
fi
if [ -f "$tsdir/config.log" ]; then
if ! head $tsdir/config.log | grep "$host" >/dev/null; then
echo "Please run a 'make distclean' first" >&2
@ -114,7 +114,7 @@ if test "$1" = "--build-amd64"; then
[ -z "$amd64root" ] && amd64root="$HOME/amd64root"
echo "Using $amd64root as standard install directory" >&2
# Locate the cross compiler
crossbindir=
for host in x86_64-linux-gnu amd64-linux-gnu; do
@ -129,7 +129,7 @@ if test "$1" = "--build-amd64"; then
echo "Stop." >&2
exit 1
fi
if [ -f "$tsdir/config.log" ]; then
if ! head $tsdir/config.log | grep "$host" >/dev/null; then
echo "Please run a 'make distclean' first" >&2
@ -152,19 +152,19 @@ fi
# Grep the required versions from configure.ac
autoconf_vers=`sed -n '/^AC_PREREQ(/ {
autoconf_vers=`sed -n '/^AC_PREREQ(/ {
s/^.*(\(.*\))/\1/p
q
}' ${configure_ac}`
autoconf_vers_num=`echo "$autoconf_vers" | cvtver`
automake_vers=`sed -n '/^min_automake_version=/ {
automake_vers=`sed -n '/^min_automake_version=/ {
s/^.*="\(.*\)"/\1/p
q
}' ${configure_ac}`
automake_vers_num=`echo "$automake_vers" | cvtver`
gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ {
gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ {
s/^.*\[\(.*\)])/\1/p
q
}' ${configure_ac}`
@ -191,9 +191,9 @@ fi
if test "$DIE" = "yes"; then
cat <<EOF
Note that you may use alternative versions of the tools by setting
Note that you may use alternative versions of the tools by setting
the corresponding environment variables; see README.CVS for details.
EOF
exit 1
fi
@ -231,6 +231,6 @@ $AUTOMAKE --gnu;
echo "Running autoconf${FORCE} ..."
$AUTOCONF${FORCE}
echo "You may now run:
./configure --sysconfdir=/etc --enable-maintainer-mode --enable-symcryptrun --enable-mailto && make
echo "You may now run:
./configure --sysconfdir=/etc --enable-maintainer-mode --enable-symcryptrun --enable-mailto --enable-gpgtar && make
"

View File

@ -31,10 +31,10 @@ m4_define([svn_revision], m4_esyscmd([printf "%d" $(svn info 2>/dev/null \
| sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)]))
m4_define([git_revision], m4_esyscmd([git branch -v 2>/dev/null \
| awk '/^\* / {printf "%s",$3}']))
AC_INIT([gnupg],
[my_version[]m4_if(my_issvn,[yes],
[m4_if(git_revision,[],[-svn[]svn_revision],[-git[]git_revision])])],
[http://bugs.gnupg.org])
m4_define([my_full_version], [my_version[]m4_if(my_issvn,[yes],
[m4_if(git_revision,[],[-svn[]svn_revision],[-git[]git_revision])])])
AC_INIT([gnupg],[my_full_version],[http://bugs.gnupg.org])
# Set development_version to yes if the minor number is odd or you
# feel that the default check for a development version is not
# sufficient.
@ -105,7 +105,6 @@ AC_DEFINE_UNQUOTED(NEED_KSBA_VERSION, "$NEED_KSBA_VERSION",
[Required version of Libksba])
# The default is to use the modules from this package and the few
# other packages in a standard place; i.e where this package gets
# installed. With these options it is possible to override these
@ -814,10 +813,10 @@ if test x"$use_dns_pka" = xyes || test x"$use_dns_srv" = xyes \
# it does not support v6.
AC_MSG_CHECKING([whether the resolver is usable])
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>],
#include <resolv.h>]],
[[unsigned char answer[PACKETSZ];
res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
dn_skipname(0,0);
@ -831,11 +830,11 @@ if test x"$use_dns_pka" = xyes || test x"$use_dns_srv" = xyes \
if test x"$have_resolver" != xyes ; then
AC_MSG_CHECKING(
[whether I can make the resolver usable with BIND_8_COMPAT])
AC_LINK_IFELSE([AC_LANG_PROGRAM([#define BIND_8_COMPAT
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define BIND_8_COMPAT
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>],
#include <resolv.h>]],
[[unsigned char answer[PACKETSZ];
res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
dn_skipname(0,0); dn_expand(0,0,0,0,0);
@ -1082,9 +1081,10 @@ AC_CHECK_SIZEOF(time_t,,[[
# Ensure that we have UINT64_C before we bother to check for uint64_t
# Fixme: really needed in gnupg? I think it is only useful in libcgrypt.
AC_CACHE_CHECK([for UINT64_C],[gnupg_cv_uint64_c_works],
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include <inttypes.h>
uint64_t foo=UINT64_C(42);]),
gnupg_cv_uint64_c_works=yes,gnupg_cv_uint64_c_works=no))
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <inttypes.h>]],
[[uint64_t foo=UINT64_C(42);]])],
[gnupg_cv_uint64_c_works=yes],
[gnupg_cv_uint64_c_works=no] ))
if test "$gnupg_cv_uint64_c_works" = "yes" ; then
AC_CHECK_SIZEOF(uint64_t)
fi
@ -1300,7 +1300,8 @@ if test "$GCC" = yes; then
AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
_gcc_cflags_save=$CFLAGS
CFLAGS="-Wno-missing-field-initializers"
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_wopt=yes,_gcc_wopt=no)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
[_gcc_wopt=yes],[_gcc_wopt=no])
AC_MSG_RESULT($_gcc_wopt)
CFLAGS=$_gcc_cflags_save;
if test x"$_gcc_wopt" = xyes ; then
@ -1309,7 +1310,8 @@ if test "$GCC" = yes; then
AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement])
_gcc_cflags_save=$CFLAGS
CFLAGS="-Wdeclaration-after-statement"
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_wopt=yes,_gcc_wopt=no)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
[_gcc_wopt=yes],[_gcc_wopt=no])
AC_MSG_RESULT($_gcc_wopt)
CFLAGS=$_gcc_cflags_save;
if test x"$_gcc_wopt" = xyes ; then
@ -1322,7 +1324,7 @@ if test "$GCC" = yes; then
AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
_gcc_cflags_save=$CFLAGS
CFLAGS="-Wno-pointer-sign"
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[_gcc_psign=yes],[_gcc_psign=no])
AC_MSG_RESULT($_gcc_psign)
CFLAGS=$_gcc_cflags_save;
if test x"$_gcc_psign" = xyes ; then
@ -1332,7 +1334,7 @@ if test "$GCC" = yes; then
AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
_gcc_cflags_save=$CFLAGS
CFLAGS="-Wpointer-arith"
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_psign=yes,_gcc_psign=no)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[_gcc_psign=yes],[_gcc_psign=no])
AC_MSG_RESULT($_gcc_psign)
CFLAGS=$_gcc_cflags_save;
if test x"$_gcc_psign" = xyes ; then

View File

@ -1,3 +1,8 @@
2011-08-04 Werner Koch <wk@g10code.com>
* readline.m4, libcurl.m4: Fix use of AC_LANG_PROGRAM.
* libcurl.m4: s/ifelse/m4_if/.
2009-09-03 Werner Koch <wk@g10code.com>
* estream.m4: Update for libestream.
@ -82,7 +87,7 @@
2006-07-27 Werner Koch <wk@g10code.com>
* autobuild.m4: New.
* autobuild.m4: New.
2006-06-30 Werner Koch <wk@g10code.com>

View File

@ -58,7 +58,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
AC_ARG_WITH(libcurl,
AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
[_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
[_libcurl_with=$withval],[_libcurl_with=m4_if([$1],,[yes],[$1])])
if test "$_libcurl_with" != "no" ; then
@ -82,7 +82,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
[libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $[]2}'`])
_libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
_libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse`
_libcurl_wanted=`echo m4_if([$2],,[0],[$2]) | $_libcurl_version_parse`
if test $_libcurl_wanted -gt 0 ; then
AC_CACHE_CHECK([for libcurl >= version $2],
@ -141,9 +141,9 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
_libcurl_save_libs=$LIBS
LIBS="$LIBCURL $LIBS"
AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <curl/curl.h>],[
AC_LINK_IFELSE([AC_LANG_PROGRAM([[include <curl/curl.h>]],[[
/* Try and use a few common options to force a failure if we are
missing symbols or can't link. */
missing symbols or cannot link. */
int x;
curl_easy_setopt(NULL,CURLOPT_URL,NULL);
x=CURL_ERROR_SIZE;
@ -152,7 +152,7 @@ x=CURLOPT_FILE;
x=CURLOPT_ERRORBUFFER;
x=CURLOPT_STDERR;
x=CURLOPT_VERBOSE;
]),libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no)
]])],[libcurl_cv_lib_curl_usable=yes],[libcurl_cv_lib_curl_usable=no])
CPPFLAGS=$_libcurl_save_cppflags
LIBS=$_libcurl_save_libs
@ -229,10 +229,10 @@ x=CURLOPT_VERBOSE;
if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
# This is the IF-NO path
ifelse([$4],,:,[$4])
m4_if([$4],,:,[$4])
else
# This is the IF-YES path
ifelse([$3],,:,[$3])
m4_if([$3],,:,[$3])
fi
unset _libcurl_with

View File

@ -30,18 +30,18 @@ AC_DEFUN([GNUPG_CHECK_READLINE],
AC_MSG_CHECKING([whether readline via \"$_combo\" is present and sane])
AC_LINK_IFELSE(AC_LANG_PROGRAM([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>
],[
]],[[
rl_completion_func_t *completer;
add_history("foobar");
rl_catch_signals=0;
rl_inhibit_completion=0;
rl_attempted_completion_function=NULL;
rl_completion_matches(NULL,NULL);
]),_found_readline=yes,_found_readline=no)
]])],[_found_readline=yes],[_found_readline=no])
AC_MSG_RESULT([$_found_readline])