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
|
|
], [
|
|
# 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_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_LIBS=$GSKSSL_LIBS; GSKSSL_INCLUDES=$GSKSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
|
|
|
|
save_LIBS="$LIBS"
|
|
save_LDFLAGS="$LDFLAGS"
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
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])
|
|
])
|