aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-01-09 18:14:09 +0000
committerWerner Koch <[email protected]>2014-01-24 16:41:20 +0000
commitf209d163a8167caa6910cd367aba923f703ac69e (patch)
treeda4a07bdfa7648ce05c0165b68c53b83b577b555 /src
parentAllow using gpgrt_lock_init on an unitialized variable. (diff)
downloadlibgpg-error-f209d163a8167caa6910cd367aba923f703ac69e.tar.gz
libgpg-error-f209d163a8167caa6910cd367aba923f703ac69e.zip
Make multi-threading flags available via gpg-error-config.
* m4/threadlib.m4: Set THREADLIB_CPPFLAGS. * src/gpg-error-config.in: Add option --mt. * configure.ac: Add support for the --mt option. * src/gpg-error.m4: Add ac_subst GPG_ERROR_MT_CFLAGS and GPG_ERROR_MT_LIBS. -- Although, libgpg-error does not yet provide an API for multi-thread support, it is useful to add the already available detection to the config script. This allows the latest Libgcrypt to take advantage of this in its regression tests. In particular for the regression tests a gpgrt_thread functions would be useful and eventually added to libgpg-error. The new gpg-error.m4 script should already be used by other packages to be prepared for future updates.
Diffstat (limited to 'src')
-rw-r--r--src/gpg-error-config.in11
-rw-r--r--src/gpg-error.m416
2 files changed, 25 insertions, 2 deletions
diff --git a/src/gpg-error-config.in b/src/gpg-error-config.in
index b132314..bc1c583 100644
--- a/src/gpg-error-config.in
+++ b/src/gpg-error-config.in
@@ -17,12 +17,14 @@ libdir=@libdir@
isubdirafter="@GPG_ERROR_CONFIG_ISUBDIRAFTER@"
output=""
+mt=no
usage()
{
cat <<EOF
Usage: gpg-error-config [OPTIONS]
Options:
+ [--mt] (must be the first option)
[--prefix]
[--exec-prefix]
[--version]
@@ -47,6 +49,9 @@ while test $# -gt 0; do
esac
case $1 in
+ --mt)
+ mt=yes
+ ;;
--prefix)
output="$output $prefix"
;;
@@ -67,6 +72,9 @@ while test $# -gt 0; do
output="$output -idirafter ${includedir}/${i}"
done
output="$output @GPG_ERROR_CONFIG_CFLAGS@"
+ if test $mt = yes ; then
+ output="$output @GPG_ERROR_CONFIG_MT_CFLAGS@"
+ fi
;;
--libs)
case "$libdir" in
@@ -76,6 +84,9 @@ while test $# -gt 0; do
;;
esac
output="$output @GPG_ERROR_CONFIG_LIBS@"
+ if test $mt = yes ; then
+ output="$output @GPG_ERROR_CONFIG_MT_LIBS@"
+ fi
;;
--host)
echo "@GPG_ERROR_CONFIG_HOST@"
diff --git a/src/gpg-error.m4 b/src/gpg-error.m4
index feb963c..053eceb 100644
--- a/src/gpg-error.m4
+++ b/src/gpg-error.m4
@@ -1,5 +1,5 @@
# 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
# unlimited permission to copy and/or distribute it, with or without
@@ -8,10 +8,16 @@
# 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
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Last-changed: 2014-01-24
+
dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
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 requireding real multi thread support.
dnl
AC_DEFUN([AM_PATH_GPG_ERROR],
[ AC_REQUIRE([AC_CANONICAL_HOST])
@@ -64,6 +70,8 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
if test $ok = yes; then
GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
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)])
ifelse([$2], , :, [$2])
gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
@@ -82,9 +90,13 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
else
GPG_ERROR_CFLAGS=""
GPG_ERROR_LIBS=""
+ GPG_ERROR_MT_CFLAGS=""
+ GPG_ERROR_MT_LIBS=""
AC_MSG_RESULT(no)
ifelse([$3], , :, [$3])
fi
AC_SUBST(GPG_ERROR_CFLAGS)
AC_SUBST(GPG_ERROR_LIBS)
+ AC_SUBST(GPG_ERROR_MT_CFLAGS)
+ AC_SUBST(GPG_ERROR_MT_LIBS)
])