-WANT_SUBDIRS="doc shib schemas configs shib-target shar siterefresh test"
-AC_CONFIG_FILES([Makefile doc/Makefile shib/Makefile schemas/Makefile \
- configs/Makefile oncrpc/Makefile oncrpc/rpc/Makefile \
- shib-target/Makefile shar/Makefile siterefresh/Makefile \
- test/Makefile])
-
-# now deal with the rpc library, to see if we need to build our own
-if test $rpctest = "no"; then
- WANT_SUBDIRS="oncrpc $WANT_SUBDIRS"
- AC_DEFINE(USE_OUR_ONCRPC,1,[Define if using embedded version of ONC RPC.])
-fi
-AM_CONDITIONAL(USE_OUR_ONCRPC,test "$rpctest" = "no")
-
-# Much of this is taken from mod_dav.
-# The basic idea is to use configure options to control whether/which types
-# of web server modules get built. We assume there may eventually be multiple
-# types (Apache 1/2, iPlanet, others).
-
-# Apache 1.3 (mod_shire/mod_shibrm)
-# --with-apache-13 (static build, no idea how to do this yet, so not supported)
+WANT_SUBDIRS="doc schemas configs shibsp shibd util"
+AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
+ configs/Makefile shibsp/Makefile shibd/Makefile \
+ util/Makefile selinux/Makefile])
+
+## ADFS?
+AC_CONFIG_FILES([adfs/Makefile])
+AC_ARG_ENABLE([adfs],
+ AC_HELP_STRING([--disable-adfs], [don't build the ADFS module]),
+ [adfs_enabled=$enableval], [adfs_enabled=yes])
+if test "x$adfs_enabled" = "x" ; then
+ adfs_enabled=yes
+fi
+AC_MSG_CHECKING(whether to build the ADFS module)
+if test "$adfs_enabled" = "no" ; then
+ AC_MSG_RESULT(no)
+else
+ AC_MSG_RESULT(yes)
+ WANT_SUBDIRS="$WANT_SUBDIRS adfs"
+fi
+
+
+#
+# Build NSAPI module?
+#
+AC_MSG_CHECKING(for NSAPI module option)
+AC_ARG_WITH(nsapi,
+ AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
+ [WANT_NSAPI=$withval],[WANT_NSAPI=no])
+AC_MSG_RESULT($WANT_NSAPI)
+
+if test "$WANT_NSAPI" != "no"; then
+ if test ! -d $WANT_NSAPI/bin ; then
+ AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
+ fi
+ AC_MSG_CHECKING(for NSAPI include files)
+ if test -d $WANT_NSAPI/include ; then
+ NSAPI_INCLUDE=$WANT_NSAPI/include
+ AC_MSG_RESULT(Netscape-Enterprise 3.x style)
+ AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
+ NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
+ fi
+ if test -d $WANT_NSAPI/plugins/include ; then
+ test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
+ NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
+ AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
+ AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h],,,[#define XP_UNIX])
+ NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
+ fi
+ if test "$NSAPI_INCLUDE" = ""; then
+ AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
+ fi
+fi
+
+AC_SUBST(NSAPI_INCLUDE)
+
+# always output the Makefile, even if you don't use it
+AC_CONFIG_FILES([nsapi_shib/Makefile])
+AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
+
+# add the NSAPI module to the list of wanted subdirs..
+if test ! "$WANT_NSAPI" = "no" ; then
+ WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
+fi
+
+
+#
+# Build FastCGI support?
+#
+AC_MSG_CHECKING(for FastCGI support)
+AC_ARG_WITH(fastcgi,
+ AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]),
+ [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
+AC_MSG_RESULT($WANT_FASTCGI)
+
+if test "$WANT_FASTCGI" != "no"; then
+ if test "$WANT_FASTCGI" != "yes"; then
+ if test x_$WANT_FASTCGI != x_/usr; then
+ FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
+ FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
+ fi
+ fi
+ AC_CHECK_HEADER([fcgio.h],,
+ AC_MSG_ERROR([unable to find FastCGI header files]))
+ FASTCGI_LIBS="-lfcgi -lfcgi++"
+fi
+
+AC_SUBST(FASTCGI_INCLUDE)
+AC_SUBST(FASTCGI_LDFLAGS)
+AC_SUBST(FASTCGI_LIBS)
+
+# always output the Makefile, even if you don't use it
+AC_CONFIG_FILES([fastcgi/Makefile])
+AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
+
+if test ! "$WANT_FASTCGI" = "no" ; then
+ WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
+fi
+
+
+#
+# If no --enable-apache-xx specified
+# find a default and fake the specific parameters
+#
+
+# simple macro to peek at an enable or a with
+AC_DEFUN([Peek],
+if test "[${[$1]_][$2]+set}" = set; then
+ peekval="${[$1]_[$2]}"
+ $3
+fi; dnl
+)
+
+AC_MSG_CHECKING(if default apache needed)
+need_default=yes
+Peek(enable,apache_13,need_default=no)
+Peek(enable,apache_20,need_default=no)
+Peek(enable,apache_22,need_default=no)
+AC_MSG_RESULT($need_default)
+
+if test "$need_default" = "yes"; then
+ # find an apxs, then the httpd
+ xs=
+ Peek(with,apxs,xs="$peekval")
+ Peek(with,apxs2,xs="$peekval")
+ Peek(with,apxs22,xs="$peekval")
+ if test "x$xs" = "x"; then
+ AC_PATH_PROGS(xs, apxs2 apxs,
+ AC_MSG_ERROR(No apxs, no apache found. Try --with-apxs),
+ [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
+ fi
+ # ask the daemon for the version and set parameters
+ AC_MSG_CHECKING(default apache version)
+ httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
+ if test "x$httpd" != "x" && test -f $httpd ; then
+ v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
+ case $v in
+ 1.3*) [enable_apache_13]=yes
+ [with_apxs]=$xs
+ AC_MSG_RESULT(1.3)
+ ;;
+ 2.0*) [enable_apache_20]=yes
+ [with_apxs2]=$xs
+ AC_MSG_RESULT(2.0)
+ ;;
+ 2.2*) [enable_apache_22]=yes
+ [with_apxs22]=$xs
+ AC_MSG_RESULT(2.2)
+ ;;
+ *) AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
+ esac
+ else
+ AC_MSG_RESULT(cannot determine version. Try setting --with-apxs)
+ fi
+fi
+
+# Apache 1.3 (mod_shib_13)
+# --enable-apache-13