]
)
+# Check whether the user wants GSI (Globus) support
+gsi_path="no"
+AC_ARG_WITH(gsi,
+ [ --with-gsi=PATH Enable GSI/Globus authentication support],
+ [
+ gsi_path="$withval"
+ ]
+)
+
+AC_ARG_WITH(globus,
+ [ --with-globus=PATH Enable GSI/Globus authentication support],
+ [
+ gsi_path="$withval"
+ ]
+)
+
+if test "x$gsi_path" != "xno" ; then
+ # Globus GSSAPI configuration
+ AC_DEFINE(GSSAPI)
+ AC_DEFINE(GSI)
+
+ # Find GLOBUS/GSI installation Directory
+ AC_MSG_CHECKING(for Globus/GSI installation directory)
+
+ globus_install_dir=$gsi_path
+
+ if test "x$globus_install_dir" = "xyes" ; then
+ if test -n "$GLOBUS_INSTALL_PATH" ; then
+ globus_install_dir=$GLOBUS_INSTALL_PATH
+ elif test -n "$GSI_INSTALL_PATH" ; then
+ globus_install_dir=$GSI_INSTALL_PATH
+ elif test -d /usr/local/globus ; then
+ globus_install_dir="/usr/local/globus"
+ elif test -d /usr/local/gsi ; then
+ globus_install_dir="/usr/local/gsi"
+ else
+ AC_MSG_ERROR(Cannot find Globus/GSI installation directory)
+ fi
+ fi
+ AC_MSG_RESULT($globus_install_dir)
+
+ # Find GLOBUS/GSI development directory
+ AC_MSG_CHECKING(for Globus/GSI development directory)
+
+ if test -d ${globus_install_dir}/lib ; then
+ # Looks like a flat directory structure from configure/make
+ # and not globus-install or gsi-install
+ globus_dev_dir=$globus_install_dir
+
+ else
+ # Assume a true globus installation with architecture
+ # directories and run globus-development-path to find
+ # the development directory
+
+ # Set GLOBUS_INSTALL_PATH
+ GLOBUS_INSTALL_PATH=$globus_install_dir
+ export GLOBUS_INSTALL_PATH
+
+ dev_path_program=${globus_install_dir}/bin/globus-development-path
+
+ if test ! -x ${dev_path_program} ; then
+ AC_MSG_ERROR(Cannot find Globus/GSI installation directory: program ${dev_path_program} does not exist or is not executable)
+ fi
+
+ globus_dev_dir=`${dev_path_program}`
+
+ if test -z "$globus_dev_dir" -o "X$globus_dev_dir" = "X<not found>" ; then
+ AC_MSG_ERROR(Cannot find Globus/GSI development directory)
+ fi
+
+ if test ! -d "$globus_dev_dir" ; then
+ AC_MSG_ERROR(Cannot find Globus/GSI development directory: $globus_dev_dir does not exist)
+ fi
+ fi
+ AC_MSG_RESULT($globus_dev_dir)
+
+ GSI_LIBS="-lglobus_gss_assist -lglobus_gss -lglobus_gaa -lssl -lcrypto"
+ GSI_LDFLAGS="-L${globus_dev_dir}/lib"
+ GSI_CFLAGS="-I${globus_dev_dir}/include"
+
+ LIBS="$LIBS $GSI_LIBS"
+ LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
+ CFLAGS="$CFLAGS $GSI_CFLAGS"
+# End Globus/GSI section
+fi
+
# Check whether user wants S/Key support
SKEY_MSG="no"
AC_ARG_WITH(skey,
fi
AC_CHECK_LIB(resolv, dn_expand, , )
+ AC_CHECK_LIB(gssapi,gss_init_sec_context,
+ [ AC_DEFINE(GSSAPI)
+ K5LIBS="-lgssapi $K5LIBS" ],
+ [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
+ [ AC_DEFINE(GSSAPI)
+ K5LIBS="-lgssapi_krb5 $K5LIBS" ],
+ AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
+ $K5LIBS)
+ ],
+ $K5LIBS)
+
+ AC_CHECK_HEADER(gssapi.h, ,
+ [ unset ac_cv_header_gssapi_h
+ CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
+ AC_CHECK_HEADERS(gssapi.h, ,
+ AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
+ )
+ ]
+ )
+
+ oldCPP="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
+ AC_CHECK_HEADER(gssapi_krb5.h, ,
+ [ CPPFLAGS="$oldCPP" ])
+
KRB5=yes
fi
]