-AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
-AC_TRY_RUN(
- [
-#include <sys/types.h>
-#include <dirent.h>
-int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
- ],
- [AC_MSG_RESULT(yes)],
- [
- AC_MSG_RESULT(no)
- AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
- ]
-)
-
-# Check whether the user wants GSSAPI mechglue support
-AC_ARG_WITH(mechglue,
- [ --with-mechglue=PATH Build with GSSAPI mechglue library],
- [
- AC_MSG_CHECKING(for mechglue library)
-
- if test -e ${withval}/libgssapi.a ; then
- mechglue_lib=${withval}/libgssapi.a
- elif test -e ${withval}/lib/libgssapi.a ; then
- mechglue_lib=${withval}/lib/libgssapi.a
- else
- AC_MSG_ERROR("Can't find libgssapi in ${withval}");
- fi
- LIBS="$LIBS ${mechglue_lib}"
- AC_MSG_RESULT(${mechglue_lib})
-
- AC_CHECK_LIB(dl, dlopen, , )
- if test $ac_cv_lib_dl_dlopen = yes; then
- LDFLAGS="$LDFLAGS -ldl -Wl,-Bsymbolic"
- fi
-
- AC_DEFINE(GSSAPI)
- AC_DEFINE(MECHGLUE)
- GSSAPI="mechglue"
-
- ]
-)
-
-
-# Check whether the user wants GSI (Globus) support
-gsi_path="no"
-AC_ARG_WITH(gsi,
- [ --with-gsi Enable Globus GSI authentication support],
- [
- gsi_path="$withval"
- ]
-)
-
-AC_ARG_WITH(globus,
- [ --with-globus Enable Globus GSI authentication support],
- [
- gsi_path="$withval"
- ]
-)
-
-AC_ARG_WITH(globus-static,
- [ --with-globus-static Link statically with Globus GSI libraries],
- [
- gsi_static="-static"
- if test "x$gsi_path" = "xno" ; then
- gsi_path="$withval"
- fi
- ]
-)
-
-# Check whether the user has a Globus flavor type
-globus_flavor_type="no"
-AC_ARG_WITH(globus-flavor,
- [ --with-globus-flavor=TYPE Specify Globus flavor type (ex: gcc32dbg)],
- [
- globus_flavor_type="$withval"
- if test "x$gsi_path" = "xno" ; then
- gsi_path="yes"
- fi
- ]
-)
-
-if test "x$gsi_path" != "xno" ; then
- # Globus GSSAPI configuration
- AC_MSG_CHECKING(for Globus GSI)
- AC_DEFINE(GSI)
-
- if test "$GSSAPI" -a "$GSSAPI" != "mechglue"; then
- AC_MSG_ERROR([Previously configured GSSAPI library conflicts with Globus GSI.])
- fi
- if test -z "$GSSAPI"; then
- AC_DEFINE(GSSAPI)
- GSSAPI="GSI"
- fi
-
- if test "x$gsi_path" = "xyes" ; then
- if test -z "$GLOBUS_LOCATION" ; then
- AC_MSG_ERROR(GLOBUS_LOCATION environment variable must be set.)
- else
- gsi_path="$GLOBUS_LOCATION"
- fi
- fi
- GLOBUS_LOCATION="$gsi_path"
- export GLOBUS_LOCATION
- if test ! -d "$GLOBUS_LOCATION" ; then
- AC_MSG_ERROR(Cannot find Globus installation. Set GLOBUS_LOCATION environment variable.)
- fi
-
- if test "x$globus_flavor_type" = "xno" ; then
- AC_MSG_ERROR(--with-globus-flavor=TYPE must be specified)
- fi
- if test "x$globus_flavor_type" = "xyes" ; then
- AC_MSG_ERROR(--with-globus-flavor=TYPE must specify a flavor type)
- fi
-
- GLOBUS_INCLUDE="${gsi_path}/include/${globus_flavor_type}"
- if test ! -d "$GLOBUS_INCLUDE" ; then
- AC_MSG_ERROR(Cannot find Globus flavor-specific include directory: ${GLOBUS_INCLUDE})
- fi
- GSI_CPPFLAGS="-I${GLOBUS_INCLUDE}"
-
- if test -x ${gsi_path}/bin/globus-makefile-header ; then
- GSI_LIBS=`${gsi_path}/bin/globus-makefile-header --flavor=${globus_flavor_type} ${gsi_static} globus_gss_assist | perl -n -e 'if (/GLOBUS_PKG_LIBS = (.*)/){print $1;}'`
- elif test -x ${gsi_path}/sbin/globus-makefile-header ; then
- GSI_LIBS=`${gsi_path}/sbin/globus-makefile-header --flavor=${globus_flavor_type} ${gsi_static} globus_gss_assist | perl -n -e 'if (/GLOBUS_PKG_LIBS = (.*)/){print $1;}'`
- else
- AC_MSG_ERROR(Cannot find globus-makefile-header: Globus installation is incomplete)
- fi
- if test -n "${need_dash_r}"; then
- GSI_LDFLAGS="-L${gsi_path}/lib -R{gsi_path}/lib"
- else
- GSI_LDFLAGS="-L${gsi_path}/lib"
- fi
- if test -z "$GSI_LIBS" ; then
- AC_MSG_ERROR(globus-makefile-header failed)
- fi
-
- AC_DEFINE(HAVE_GSSAPI_H)