1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

config: Update npth.m4.

* m4/npth.m4: Take from current npth master.
This commit is contained in:
Werner Koch 2012-12-10 09:40:40 +01:00
parent 1e1326aeb8
commit ceab60b59d

View File

@ -34,12 +34,12 @@ dnl Test for libnpth and define NPTH_CFLAGS and NPTH_LIBS.
dnl dnl
AC_DEFUN([AM_PATH_NPTH], AC_DEFUN([AM_PATH_NPTH],
[ AC_REQUIRE([_AM_PATH_NPTH_CONFIG])dnl [ AC_REQUIRE([_AM_PATH_NPTH_CONFIG])dnl
tmp=ifelse([$1], ,1:0.0,$1) tmp=ifelse([$1], ,1:0.91,$1)
if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
req_npth_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` req_npth_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
min_npth_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` min_npth_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
else else
req_npth_api=0 req_npth_api=1
min_npth_version="$tmp" min_npth_version="$tmp"
fi fi
@ -47,28 +47,40 @@ AC_DEFUN([AM_PATH_NPTH],
ok=no ok=no
if test "$NPTH_CONFIG" != "no" ; then if test "$NPTH_CONFIG" != "no" ; then
req_major=`echo $min_npth_version | \ req_major=`echo $min_npth_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
req_minor=`echo $min_npth_version | \ req_minor=`echo $min_npth_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
if test "$npth_version_major" -gt "$req_major"; then if test "$npth_version_major" -gt "$req_major"; then
ok=yes ok=yes
else else
if test "$npth_version_major" -eq "$req_major"; then if test "$npth_version_major" -eq "$req_major"; then
if test "$npth_version_minor" -ge "$req_minor"; then if test "$npth_version_minor" -gt "$req_minor"; then
ok=yes
else
if test "$npth_version_minor" -eq "$req_minor"; then
ok=yes ok=yes
fi fi
fi fi
fi fi
fi fi
fi
if test $ok = yes; then
AC_MSG_RESULT([yes ($npth_version)])
else
AC_MSG_RESULT(no)
fi
if test $ok = yes; then if test $ok = yes; then
# If we have a recent NPTH, we should also check that the # If we have a recent NPTH, we should also check that the
# API is compatible. # API is compatible.
if test "$req_npth_api" -gt 0 ; then if test "$req_npth_api" -gt 0 ; then
tmp=`$NPTH_CONFIG --api-version 2>/dev/null || echo 0` tmp=`$NPTH_CONFIG --api-version 2>/dev/null || echo 0`
if test "$tmp" -gt 0 ; then if test "$tmp" -gt 0 ; then
if test "$req_npth_api" -ne "$tmp" ; then AC_MSG_CHECKING([NPTH API version])
if test "$req_npth_api" -eq "$tmp" ; then
AC_MSG_RESULT([okay])
else
ok=no ok=no
AC_MSG_RESULT([does not match. want=$req_npth_api got=$tmp])
fi fi
fi fi
fi fi
@ -76,12 +88,23 @@ AC_DEFUN([AM_PATH_NPTH],
if test $ok = yes; then if test $ok = yes; then
NPTH_CFLAGS=`$NPTH_CONFIG --cflags` NPTH_CFLAGS=`$NPTH_CONFIG --cflags`
NPTH_LIBS=`$NPTH_CONFIG --libs` NPTH_LIBS=`$NPTH_CONFIG --libs`
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2]) ifelse([$2], , :, [$2])
npth_config_host=`$NPTH_CONFIG --host 2>/dev/null || echo none`
if test x"$npth_config_host" != xnone ; then
if test x"$npth_config_host" != x"$host" ; then
AC_MSG_WARN([[
***
*** The config script $NPTH_CONFIG was
*** built for $npth_config_host and thus may not match the
*** used host $host.
*** You may want to use the configure option --with-npth-prefix
*** to specify a matching config script.
***]])
fi
fi
else else
NPTH_CFLAGS="" NPTH_CFLAGS=""
NPTH_LIBS="" NPTH_LIBS=""
AC_MSG_RESULT(no)
ifelse([$3], , :, [$3]) ifelse([$3], , :, [$3])
fi fi
AC_SUBST(NPTH_CFLAGS) AC_SUBST(NPTH_CFLAGS)