An improved fork of NetBSD's OpenPGP implementation; maintained by the p≡p foundation.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

90 lines
2.9 KiB

AU_ALIAS([CHECK_SSL], [AX_CHECK_GSKSSL])
AC_DEFUN([AX_CHECK_GSKSSL], [
found=false
AC_ARG_WITH(gskssl,
AS_HELP_STRING([--with-gskssl=DIR],
[root of the GSK SSL directory]),
[
case "$withval" in
"" | y | ye | yes | n | no)
AC_MSG_ERROR([Invalid --with-gskssl value])
;;
*) ssldirs="$withval"
;;
esac
], [
# if pkg-config is installed and gskssl has installed a .pc file,
# then use that information and don't search ssldirs
AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test x"$PKG_CONFIG" != x""; then
GSKSSL_LDFLAGS=`$PKG_CONFIG gskssl --libs-only-L 2>/dev/null`
if test $? = 0; then
GSKSSL_LIBS=`$PKG_CONFIG gskssl --libs-only-l 2>/dev/null`
GSKSSL_INCLUDES=`$PKG_CONFIG gskssl --cflags-only-I 2>/dev/null`
found=true
fi
fi
# no such luck; use some default ssldirs
if ! $found; then
ssldirs="/usr/lpp/gskssl /usr"
fi
]
)
# note that we #include <gskssl/foo.h>, so the GSK SSL headers have to be in
# an 'gskssl' subdirectory
if ! $found; then
GSKSSL_INCLUDES=
for ssldir in $ssldirs; do
AC_MSG_CHECKING([for include/gskssl.h in $ssldir])
if test -f "$ssldir/include/gskssl.h"; then
if test -f "$ssldir/lib/GSKSSL.x"; then
GSKSSL_INCLUDES="-I$ssldir/include"
GSKSSL_LDFLAGS="-L$ssldir/lib"
GSKSSL_LIBS="$ssldir/lib/GSKSSL.x $ssldir/lib/GSKCMS64.x"
found=true
AC_MSG_RESULT([yes])
fi
break
else
AC_MSG_RESULT([no])
fi
done
# if the file wasn't found, well, go ahead and try the link anyway -- maybe
# it will just work!
fi
# try the preprocessor and linker with our new flags,
# being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
AC_MSG_CHECKING([whether compiling and linking against GSK SSL works])
echo "Trying link with GSKSSL_LDFLAGS=$GSKSSL_LDFLAGS;" \
"GSKSSL_LIBS=$GSKSSL_LIBS; GSKSSL_INCLUDES=$GSKSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
save_LIBS="$LIBS"
save_LDFLAGS="$LDFLAGS"
save_CPPFLAGS="$CPPFLAGS"
LDFLAGS="$LDFLAGS $GSKSSL_LDFLAGS"
LIBS="$GSKSSL_LIBS $LIBS"
CPPFLAGS="$GSKSSL_INCLUDES $CPPFLAGS"
AC_LINK_IFELSE(
AC_LANG_PROGRAM([#include <gskssl.h>], [gsk_handle env_handle;]),
[
AC_MSG_RESULT([yes])
$1
], [
AC_MSG_RESULT([no])
$2
])
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"
AC_SUBST([GSKSSL_INCLUDES])
AC_SUBST([GSKSSL_LIBS])
AC_SUBST([GSKSSL_LDFLAGS])
])