1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-08 23:37:47 +02:00

build: Update m4 scripts

* m4/gpg-error.m4: Update from Libgpg-error git master.
* m4/libgcrypt.m4: Update from Libgcrypt git master.
* configure.ac: Declare SYSROOT a precious variable.  Add extra error
message for library configuration mismatches.
This commit is contained in:
Werner Koch 2014-10-02 16:17:45 +02:00
parent dcb5fa8747
commit 39c5d991a8
3 changed files with 84 additions and 22 deletions

View File

@ -460,6 +460,7 @@ AH_BOTTOM([
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
AC_ARG_VAR(SYSROOT,[locate config scripts also below that directory])
# Checks for programs. # Checks for programs.
AC_MSG_NOTICE([checking for programs]) AC_MSG_NOTICE([checking for programs])
@ -1613,3 +1614,12 @@ echo "
gpg-check-pattern will not be build. gpg-check-pattern will not be build.
" "
fi fi
if test "x${gpg_config_script_warn}" != x; then
cat <<G10EOF
Warning: Mismatches between the target platform and the
to be used libraries have been detected for:
${gpg_config_script_warn}
Please check above for more warning messages.
G10EOF
fi

View File

@ -1,5 +1,5 @@
# gpg-error.m4 - autoconf macro to detect libgpg-error. # gpg-error.m4 - autoconf macro to detect libgpg-error.
# Copyright (C) 2002, 2003, 2004, 2011 g10 Code GmbH # Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH
# #
# This file is free software; as a special exception the author gives # This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without # unlimited permission to copy and/or distribute it, with or without
@ -8,10 +8,21 @@
# This file is distributed in the hope that it will be useful, but # This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Last-changed: 2014-10-02
dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION, dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl Test for libgpg-error and define GPG_ERROR_CFLAGS and GPG_ERROR_LIBS dnl
dnl Test for libgpg-error and define GPG_ERROR_CFLAGS, GPG_ERROR_LIBS,
dnl GPG_ERROR_MT_CFLAGS, and GPG_ERROR_MT_LIBS. The _MT_ variants are
dnl used for programs requireing real multi thread support.
dnl
dnl If a prefix option is not used, the config script is first
dnl searched in $SYSROOT/bin and then along $PATH. If the used
dnl config script does not match the host specification the script
dnl is added to the gpg_config_script_warn variable.
dnl dnl
AC_DEFUN([AM_PATH_GPG_ERROR], AC_DEFUN([AM_PATH_GPG_ERROR],
[ AC_REQUIRE([AC_CANONICAL_HOST]) [ AC_REQUIRE([AC_CANONICAL_HOST])
@ -30,13 +41,26 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
AC_ARG_WITH(gpg-error-prefix,, AC_ARG_WITH(gpg-error-prefix,,
[gpg_error_config_prefix="$withval"]) [gpg_error_config_prefix="$withval"])
if test x$gpg_error_config_prefix != x ; then if test x"${GPG_ERROR_CONFIG}" = x ; then
if test x${GPG_ERROR_CONFIG+set} != xset ; then if test x"${gpg_error_config_prefix}" != x ; then
GPG_ERROR_CONFIG=$gpg_error_config_prefix/bin/gpg-error-config GPG_ERROR_CONFIG="${gpg_error_config_prefix}/bin/gpg-error-config"
else
case "${SYSROOT}" in
/*)
if test -x "${SYSROOT}/bin/gpg-error-config" ; then
GPG_ERROR_CONFIG="${SYSROOT}/bin/gpg-error-config"
fi
;;
'')
;;
*)
AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
;;
esac
fi fi
fi fi
AC_PATH_TOOL(GPG_ERROR_CONFIG, gpg-error-config, no) AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
min_gpg_error_version=ifelse([$1], ,0.0,$1) min_gpg_error_version=ifelse([$1], ,0.0,$1)
AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version) AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
ok=no ok=no
@ -64,6 +88,8 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
if test $ok = yes; then if test $ok = yes; then
GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags` GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs` GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null`
GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null`
AC_MSG_RESULT([yes ($gpg_error_config_version)]) AC_MSG_RESULT([yes ($gpg_error_config_version)])
ifelse([$2], , :, [$2]) ifelse([$2], , :, [$2])
gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none` gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
@ -75,16 +101,21 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
*** built for $gpg_error_config_host and thus may not match the *** built for $gpg_error_config_host and thus may not match the
*** used host $host. *** used host $host.
*** You may want to use the configure option --with-gpg-error-prefix *** You may want to use the configure option --with-gpg-error-prefix
*** to specify a matching config script. *** to specify a matching config script or use \$SYSROOT.
***]]) ***]])
gpg_config_script_warn="$gpg_config_script_warn libgpg-error"
fi fi
fi fi
else else
GPG_ERROR_CFLAGS="" GPG_ERROR_CFLAGS=""
GPG_ERROR_LIBS="" GPG_ERROR_LIBS=""
GPG_ERROR_MT_CFLAGS=""
GPG_ERROR_MT_LIBS=""
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
ifelse([$3], , :, [$3]) ifelse([$3], , :, [$3])
fi fi
AC_SUBST(GPG_ERROR_CFLAGS) AC_SUBST(GPG_ERROR_CFLAGS)
AC_SUBST(GPG_ERROR_LIBS) AC_SUBST(GPG_ERROR_LIBS)
AC_SUBST(GPG_ERROR_MT_CFLAGS)
AC_SUBST(GPG_ERROR_MT_LIBS)
]) ])

View File

@ -1,13 +1,15 @@
dnl Autoconf macros for libgcrypt # libgcrypt.m4 - Autoconf macros to detect libgcrypt
dnl Copyright (C) 2002, 2004, 2011 Free Software Foundation, Inc. # Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH
dnl #
dnl This file is free software; as a special exception the author gives # This file is free software; as a special exception the author gives
dnl unlimited permission to copy and/or distribute it, with or without # unlimited permission to copy and/or distribute it, with or without
dnl modifications, as long as this notice is preserved. # modifications, as long as this notice is preserved.
dnl #
dnl This file is distributed in the hope that it will be useful, but # This file is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Last-changed: 2014-10-02
dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION, dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
@ -20,19 +22,37 @@ dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using
dnl this features allows to prevent build against newer versions of libgcrypt dnl this features allows to prevent build against newer versions of libgcrypt
dnl with a changed API. dnl with a changed API.
dnl dnl
dnl If a prefix option is not used, the config script is first
dnl searched in $SYSROOT/bin and then along $PATH. If the used
dnl config script does not match the host specification the script
dnl is added to the gpg_config_script_warn variable.
dnl
AC_DEFUN([AM_PATH_LIBGCRYPT], AC_DEFUN([AM_PATH_LIBGCRYPT],
[ AC_REQUIRE([AC_CANONICAL_HOST]) [ AC_REQUIRE([AC_CANONICAL_HOST])
AC_ARG_WITH(libgcrypt-prefix, AC_ARG_WITH(libgcrypt-prefix,
AC_HELP_STRING([--with-libgcrypt-prefix=PFX], AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
[prefix where LIBGCRYPT is installed (optional)]), [prefix where LIBGCRYPT is installed (optional)]),
libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="") libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
if test x$libgcrypt_config_prefix != x ; then if test x"${LIBGCRYPT_CONFIG}" = x ; then
if test x${LIBGCRYPT_CONFIG+set} != xset ; then if test x"${libgcrypt_config_prefix}" != x ; then
LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config LIBGCRYPT_CONFIG="${libgcrypt_config_prefix}/bin/libgcrypt-config"
else
case "${SYSROOT}" in
/*)
if test -x "${SYSROOT}/bin/libgcrypt-config" ; then
LIBGCRYPT_CONFIG="${SYSROOT}/bin/libgcrypt-config"
fi
;;
'')
;;
*)
AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
;;
esac
fi fi
fi fi
AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no) AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
tmp=ifelse([$1], ,1:1.2.0,$1) tmp=ifelse([$1], ,1:1.2.0,$1)
if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
@ -108,8 +128,9 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
*** built for $libgcrypt_config_host and thus may not match the *** built for $libgcrypt_config_host and thus may not match the
*** used host $host. *** used host $host.
*** You may want to use the configure option --with-libgcrypt-prefix *** You may want to use the configure option --with-libgcrypt-prefix
*** to specify a matching config script. *** to specify a matching config script or use \$SYSROOT.
***]]) ***]])
gpg_config_script_warn="$gpg_config_script_warn libgcrypt"
fi fi
fi fi
else else