From: Werner Koch Date: Wed, 19 Nov 2003 15:15:11 +0000 (+0000) Subject: * acinclude.m4: Add AM_PATH_GPG_ERROR. X-Git-Tag: gpgme-0-4-4~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9cf95d61eb524b73f1ad6a28678c292a404eac1d;p=gpgme.git * acinclude.m4: Add AM_PATH_GPG_ERROR. * configure.ac: Check for timegm. Made warning messages more prominent. --- diff --git a/ChangeLog b/ChangeLog index d88dc48..576c222 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-11-19 Werner Koch + + * acinclude.m4: Add AM_PATH_GPG_ERROR. + * configure.ac: Check for timegm. Made warning messages more + prominent. + 2003-10-06 Marcus Brinkmann Released 0.4.3. diff --git a/TODO b/TODO index e5841a8..aab0da9 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,7 @@ Hey Emacs, this is -*- outline -*- mode! * Before release: -** currently nothing +** Some gpg tests fail with gpg 1.3.4-cvs (gpg/t-keylist-sig) * ABI's to break: ** I/O and User Data could be made extensible. But this can be done @@ -27,6 +27,7 @@ Hey Emacs, this is -*- outline -*- mode! * Thread support: ** When GNU Pth supports sendmsg/recvmsg, wrap them properly. ** Without timegm (3) support our ISO time parser is not thread safe. + There is a configure time warning, though. * New features: ** notification system diff --git a/acinclude.m4 b/acinclude.m4 index 30ee8ca..57f9005 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -499,3 +499,62 @@ AC_DEFUN([jm_GLIBC21], GLIBC21="$ac_cv_gnu_library_2_1" ] ) + + +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 taken from libgpg-error 0.6 +dnl +AC_DEFUN(AM_PATH_GPG_ERROR, +[ AC_ARG_WITH(gpg-error-prefix, + AC_HELP_STRING([--with-gpg-error-prefix=PFX], + [prefix where GPG Error is installed (optional)]), + gpg_error_config_prefix="$withval", gpg_error_config_prefix="") + if test x$gpg_error_config_prefix != x ; then + if test x${GPG_ERROR_CONFIG+set} != xset ; then + GPG_ERROR_CONFIG=$gpg_error_config_prefix/bin/gpg-error-config + fi + fi + + AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no) + min_gpg_error_version=ifelse([$1], ,0.0,$1) + AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version) + ok=no + if test "$GPG_ERROR_CONFIG" != "no" ; then + req_major=`echo $min_gpg_error_version | \ + sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` + req_minor=`echo $min_gpg_error_version | \ + sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` + gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version` + major=`echo $gpg_error_config_version | \ + sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` + minor=`echo $gpg_error_config_version | \ + sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` + if test "$major" -gt "$req_major"; then + ok=yes + else + if test "$major" -eq "$req_major"; then + if test "$minor" -ge "$req_minor"; then + ok=yes + fi + fi + fi + fi + 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` + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + GPG_ERROR_CFLAGS="" + GPG_ERROR_LIBS="" + AC_MSG_RESULT(no) + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GPG_ERROR_CFLAGS) + AC_SUBST(GPG_ERROR_LIBS) +]) + + diff --git a/configure.ac b/configure.ac index babd714..acc52a3 100644 --- a/configure.ac +++ b/configure.ac @@ -169,7 +169,21 @@ fi have_getenv_r=no AC_CHECK_FUNCS(getenv_r, have_getenv_r=yes) if test $have_getenv_r = no && test $have_thread_safe_getenv = no; then - AC_MSG_WARN([getenv() is not thread-safe and getenv_r() does not exist]) + AC_MSG_WARN([ +*** +*** getenv() is not thread-safe and getenv_r() does not exist +***]) +fi + +# For converting time strings to seconds since Epoch, we need the timegm +# function. +AC_CHECK_FUNCS(timegm) +if test "$ac_cv_func_timegm" != yes; then + AC_MSG_WARN([ +*** +*** timegm() not available - a non-thread-safe kludge will be used +*** and the TZ variable might be changed at runtime. +***]) fi # Checking for libgpg-error. @@ -197,9 +211,15 @@ fi if test "$GPG" = no; then if test "$NO_OVERRIDE" = "yes"; then if test "$cross_compiling" != "yes"; then - AC_MSG_WARN([Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it]) + AC_MSG_WARN([ +*** +*** Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it +***]) else - AC_MSG_ERROR([Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH]) + AC_MSG_ERROR([ +*** +*** Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH +***]) fi fi else @@ -227,9 +247,15 @@ fi if test "$GPGSM" = no; then if test "$NO_OVERRIDE" = "yes"; then if test "$cross_compiling" != "yes"; then - AC_MSG_WARN([Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it]) + AC_MSG_WARN([ +*** +*** Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it +***]) else - AC_MSG_ERROR([Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH]) + AC_MSG_ERROR([ +*** +*** Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH +***]) fi fi else