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.

75 lines
2.2 KiB

  1. AU_ALIAS([CHECK_SSL], [AX_CHECK_GSKSSL])
  2. AC_DEFUN([AX_CHECK_GSKSSL], [
  3. found=false
  4. AC_ARG_WITH(gskssl,
  5. AS_HELP_STRING([--with-gskssl=DIR],
  6. [root of the GSK SSL directory]),
  7. [
  8. case "$withval" in
  9. "" | y | ye | yes | n | no)
  10. AC_MSG_ERROR([Invalid --with-gskssl value])
  11. ;;
  12. *) ssldirs="$withval"
  13. ;;
  14. esac
  15. ], [
  16. # no such luck; use some default ssldirs
  17. if ! $found; then
  18. ssldirs="/usr/lpp/gskssl /usr"
  19. fi
  20. ]
  21. )
  22. # note that we #include <gskssl/foo.h>, so the GSK SSL headers have to be in
  23. # an 'gskssl' subdirectory
  24. if ! $found; then
  25. GSKSSL_INCLUDES=
  26. for ssldir in $ssldirs; do
  27. AC_MSG_CHECKING([for include/gskssl.h in $ssldir])
  28. if test -f "$ssldir/include/gskssl.h"; then
  29. if test -f "$ssldir/lib/GSKSSL.x"; then
  30. GSKSSL_INCLUDES="-I$ssldir/include"
  31. GSKSSL_LIBS="$ssldir/lib/GSKSSL.x $ssldir/lib/GSKCMS64.x"
  32. found=true
  33. AC_MSG_RESULT([yes])
  34. fi
  35. break
  36. else
  37. AC_MSG_RESULT([no])
  38. fi
  39. done
  40. # if the file wasn't found, well, go ahead and try the link anyway -- maybe
  41. # it will just work!
  42. fi
  43. # try the preprocessor and linker with our new flags,
  44. # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
  45. AC_MSG_CHECKING([whether compiling and linking against GSK SSL works])
  46. echo "Trying link with " \
  47. "GSKSSL_LIBS=$GSKSSL_LIBS; GSKSSL_INCLUDES=$GSKSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
  48. save_LIBS="$LIBS"
  49. save_LDFLAGS="$LDFLAGS"
  50. save_CPPFLAGS="$CPPFLAGS"
  51. LIBS="$GSKSSL_LIBS $LIBS"
  52. CPPFLAGS="$GSKSSL_INCLUDES $CPPFLAGS"
  53. AC_LINK_IFELSE(
  54. AC_LANG_PROGRAM([#include <gskssl.h>], [gsk_handle env_handle;]),
  55. [
  56. AC_MSG_RESULT([yes])
  57. $1
  58. ], [
  59. AC_MSG_RESULT([no])
  60. $2
  61. ])
  62. CPPFLAGS="$save_CPPFLAGS"
  63. LDFLAGS="$save_LDFLAGS"
  64. LIBS="$save_LIBS"
  65. AC_SUBST([GSKSSL_INCLUDES])
  66. AC_SUBST([GSKSSL_LIBS])
  67. ])