summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2011-02-23 16:30:38 +0100
committerWerner Koch <wk@gnupg.org>2011-02-23 16:30:38 +0100
commite7f33df5e5b102f3c07a6dac1bfd1376f4f9267b (patch)
treeccc84bef5d4a479e652323a020846816dcb22424
parentb47b2f9c063d9a0bad7c33fb7ba158c23522b849 (diff)
downloadlibgcrypt-e7f33df5e5b102f3c07a6dac1bfd1376f4f9267b.tar.gz
Add option host to libgcrypt-config.
Also update libgcrypt.m4 for better user experience when cross-building.
-rw-r--r--ChangeLog2
-rw-r--r--configure.ac2
-rw-r--r--src/ChangeLog6
-rw-r--r--src/libgcrypt-config.in14
-rw-r--r--src/libgcrypt.m417
5 files changed, 39 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a9b0895d..e499f157 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2011-02-23 Werner Koch <wk@g10code.com>
+ * configure.ac (LIBGCRYPT_CONFIG_HOST): New.
+
* acinclude.m4 (AM_PATH_GPG_ERROR): Remove.
2011-02-21 Werner Koch <wk@g10code.com>
diff --git a/configure.ac b/configure.ac
index 013ff3af..618a5eee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -154,6 +154,7 @@ LT_LANG([Windows Resource])
# Used by libgcrypt-config
LIBGCRYPT_CONFIG_LIBS="-lgcrypt"
LIBGCRYPT_CONFIG_CFLAGS=""
+LIBGCRYPT_CONFIG_HOST="$host"
# Definitions for symmetric ciphers.
available_ciphers="arcfour blowfish cast5 des aes twofish serpent rfc2268 seed"
@@ -963,6 +964,7 @@ CL_AS_NOEXECSTACK
AC_SUBST(LIBGCRYPT_CONFIG_API_VERSION)
AC_SUBST(LIBGCRYPT_CONFIG_LIBS)
AC_SUBST(LIBGCRYPT_CONFIG_CFLAGS)
+AC_SUBST(LIBGCRYPT_CONFIG_HOST)
AC_SUBST(LIBGCRYPT_THREAD_MODULES)
AC_CONFIG_COMMANDS([gcrypt-conf],[[
diff --git a/src/ChangeLog b/src/ChangeLog
index a9523ccb..98f38dbd 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-23 Werner Koch <wk@g10code.com>
+
+ * libgcrypt-config.in: Add option --host.
+ * libgcrypt.m4: Use AC_PROG_TOOL to find the config script. Print
+ a warning is the config scripts does not match the configure host.
+
2011-02-21 Werner Koch <wk@g10code.com>
* global.c (gcry_check_version): Do not take the patchlevel in
diff --git a/src/libgcrypt-config.in b/src/libgcrypt-config.in
index be6df8ac..c052638c 100644
--- a/src/libgcrypt-config.in
+++ b/src/libgcrypt-config.in
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2002, 2003, 2004, 2011 Free Software Foundation, Inc.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@@ -27,6 +27,9 @@ cflags="@LIBGCRYPT_CONFIG_CFLAGS@"
# API info
api_version="@LIBGCRYPT_CONFIG_API_VERSION@"
+# Configured for host
+my_host="@LIBGCRYPT_CONFIG_HOST@"
+
# Misc information.
symmetric_ciphers="@LIBGCRYPT_CIPHERS@"
asymmetric_ciphers="@LIBGCRYPT_PUBKEY_CIPHERS@"
@@ -40,6 +43,7 @@ echo_algorithms=no
echo_exec_prefix=no
echo_version=no
echo_api_version=no
+echo_host=no
# Prints usage information.
usage()
@@ -54,6 +58,7 @@ Options:
[--libs]
[--cflags]
[--algorithms]
+ [--host]
EOF
exit $1
}
@@ -106,6 +111,9 @@ while test $# -gt 0; do
--algorithms)
echo_algorithms=yes
;;
+ --host)
+ echo_host=yes
+ ;;
*)
usage 1 1>&2
;;
@@ -170,6 +178,10 @@ if test "$echo_api_version" = "yes"; then
echo "$api_version"
fi
+if test "$echo_host" = "yes"; then
+ echo "$my_host"
+fi
+
if test "$echo_algorithms" = "yes"; then
echo "Symmetric cipher algorithms: $symmetric_ciphers"
echo "Public-key cipher algorithms: $asymmetric_ciphers"
diff --git a/src/libgcrypt.m4 b/src/libgcrypt.m4
index 0f60165a..831dc0c6 100644
--- a/src/libgcrypt.m4
+++ b/src/libgcrypt.m4
@@ -31,7 +31,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
fi
fi
- AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
+ AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no)
tmp=ifelse([$1], ,1:1.2.0,$1)
if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
@@ -98,6 +98,21 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
ifelse([$2], , :, [$2])
+ if test x"$host" != x ; then
+ libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
+ if test x"$libgcrypt_config_host" != xnone ; then
+ if test x"$libgcrypt_config_host" != x"$host" ; then
+ AC_MSG_WARN([[
+***
+*** The config script $LIBGCRYPT_CONFIG was
+*** built for $libgcrypt_config_host and thus may not match the
+*** used host $host.
+*** You may want to use the configure option --with-libgcrypt-prefix
+*** to specify a matching config script.
+***]])
+ fi
+ fi
+ fi
else
LIBGCRYPT_CFLAGS=""
LIBGCRYPT_LIBS=""