- if test "$with_gssapi" != "yes" -a -n "$with_gssapi"
- then
- CFLAGS="$CFLAGS -I$with_gssapi/include"
- LDFLAGS="$LDFLAGS -L$with_gssapi/lib"
- fi
- AC_CHECK_LIB(krb5, krb5_init_context,,
- AC_MSG_ERROR([could not find libkrb5 which is needed for GSSAPI support]))
- AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context,,
- AC_MSG_ERROR([could not find libgssapi_krb5 which is needed for GSSAPI support]), -lkrb5)
- AC_DEFINE(GSSAPI)
- LIBS="$LIBS -lgssapi_krb5 -lkrb5"
-fi])
+ # Path given
+ CEFLAGS="$CEFLAGS -DKERBEROS_V5 -I$with_kerberos5/include"
+ LDEFLAGS="$LDEFLAGS -L$with_kerberos5/lib"
+ if test -f "$with_kerberos5/include/roken.h"
+ then
+ AC_DEFINE(HEIMDAL)
+ LIBS="$LIBS -lkrb5 -lasn1 -ldes -lroken -lcom_err"
+ else
+ LIBS="$LIBS -lkrb5 -lcrypto -lcom_err"
+ fi
+elif test "$with_kerberos" != "no"; then
+ for dir in /usr/kerberos /usr/local/krb5 /usr/athena
+ do
+ if test -f "$dir/include/krb5.h"
+ then
+ CEFLAGS="$CEFLAGS -DKERBEROS_V5 -I$dir/include"
+ LDEFLAGS="$LDEFLAGS -L$dir/lib"
+ if test -f "$dir/include/roken.h"
+ then
+ AC_DEFINE(HEIMDAL)
+ LIBS="$LIBS -lkrb5 -lasn1 -ldes -lcom_err"
+ else
+ LIBS="$LIBS -lkrb5 -lcrypto -lcom_err"
+ fi
+ with_kerberos5=$dir
+ break
+ fi
+ done
+fi
+
+### use option --with-ssl to compile in the SSL support
+AC_ARG_WITH(ssl,
+ [ --with-ssl=[DIR] enable SSL support using libraries in DIR],
+ [with_ssl=$withval],
+ [with_ssl=no])
+test "$with_ssl" = "yes" && AC_DEFINE(SSL_ENABLE)
+
+if test "$with_ssl" = "yes"
+then
+# He didn't specify an SSL location. Let's look at some common
+# directories where SSL has been found in the past and try and auto
+# configure for SSL. OpenSSL determination will be made later.
+# This will screw up if an OpenSSL install is located in a later
+# directory than an older SSLeay install, but the user should fix that
+# anyways and he can override on the configure line.
+
+ for ac_dir in \
+ /usr/local/ssl \
+ /usr/ssl \
+ /local/ssl \
+ /opt/ssl \
+ ; \
+ do
+ if test -d "$ac_dir" ; then
+ with_ssl=$ac_dir
+ break;
+ fi
+ done
+fi
+
+if test -n "$with_ssl" -a "$with_ssl" != "no"
+then
+ # With the autoconfigure above, the only time this is going to be
+ # true is going to be when we could not find the headers. If they
+ # are not in system standard locations, we are going to be broken.
+ if test "$with_ssl" = "yes"
+ then
+# Let's just define the standard location for the SSLeay root
+ with_ssl="/usr/local/ssl"
+ fi
+ if test -r $with_ssl/include/openssl/ssl.h
+ then
+### ssl.h found under openssl. Use openssl configuration preferentially
+ echo "Enabling OpenSSL support in $with_ssl"
+ CEFLAGS="$CEFLAGS -I$with_ssl/include -I$with_ssl/include/openssl"
+### OpenBSD comes with ssl headers
+ elif test -r /usr/include/ssl/ssl.h
+ then
+ echo "Enabling SSLeay support in $with_ssl"
+ CEFLAGS="$CEFLAGS -I/usr/include/ssl"
+ else
+ echo "Enabling SSLeay support in $with_ssl"
+ CEFLAGS="$CEFLAGS -I$with_ssl/include"
+ fi
+ LDEFLAGS="$LDEFLAGS -L$with_ssl/lib"
+ LIBS="$LIBS -lssl -lcrypto"
+ AC_DEFINE(SSL_ENABLE)
+else
+ echo 'Disabling SSL support...'
+fi