Hoist OpenSSL checks from a number of different places into
[freeradius.git] / src / modules / rlm_eap / types / rlm_eap_ttls / configure.in
index 28e6996..36fba19 100644 (file)
@@ -9,85 +9,17 @@ if test x$with_[]modname != xno; then
 
        AC_PROG_CC
 
-       dnl extra argument: --with-rlm-eap-ttls-lib-dir
-       rlm_eap_ttls_lib_dir=
-       AC_ARG_WITH(rlm-eap-ttls-lib-dir,
-       [  --with-rlm-eap-ttls-lib-dir=DIR   Directory for EAPTTLS library files []],
-       [ case "$withval" in
-           no)
-               AC_MSG_ERROR(Need rlm-eap-ttls-lib-dir)
-               ;;
-           yes)
-               ;;
-           *)
-               rlm_eap_ttls_lib_dir="$withval"
-               ;;
-         esac ]
-       )
-
-       dnl extra argument: --with-rlm-eap-ttls-include-dir
-       rlm_eap_ttls_inc_dir=
-       AC_ARG_WITH(rlm-eap-ttls-include-dir,
-       [ --with-rlm-eap-ttls-include-dir=DIR Directory for EAPTTLS include files []],
-       [ case "$withval" in
-           no)
-               AC_MSG_ERROR(Need rlm-eap-ttls-include-dir)
-               ;;
-           yes)
-               ;;
-           *)
-               rlm_eap_ttls_inc_dir="$withval"
-               ;;
-         esac ]
-       )
-
-       dnl #
-       dnl # extra argument: --openssl-includes=dir
-       dnl #
-       AC_ARG_WITH(openssl-includes,
-       [  --with-openssl-includes=DIR       Directory to look for OpenSSL include files],
-       [ case "$withval" in
-           *)
-               rlm_eap_ttls_inc_dir="$rlm_eap_ttls_inc_dir $withval"
-               SMART_CFLAGS="$SMART_CFLAGS -I$withval"
-               ;;
-         esac ]
-       )
-
-       dnl #
-       dnl # extra argument: --openssl-libraries=dir
-       dnl #
-       AC_ARG_WITH(openssl-libraries,
-       [  --with-openssl-libraries=DIR      Directory to look for OpenSSL library files],
-       [ case "$withval" in
-           *)
-               rlm_eap_ttls_lib_dir="$rlm_eap_ttls_lib_dir $withval"
-               SMART_LIBS="$SMART_LIBS -L$withval"
-               ;;
-         esac ]
-       )
-
-       smart_try_dir=$rlm_eap_ttls_inc_dir
-       AC_SMART_CHECK_INCLUDE(openssl/ssl.h)
-       if test "x$ac_cv_header_openssl_ssl_h" != "xyes"; then
-               fail="$fail (openssl/ssl.h)"
+       if test "x$OPENSSL_INCLUDE" != "x"; then
+         SMART_CFLAGS="-I$OPENSSL_INCLUDE"
+       else
+         fail="$fail (openssl/ssl.h)"
        fi
 
-       smart_try_dir=$rlm_eap_ttls_lib_dir
-       AC_SMART_CHECK_LIB(crypto, DH_new)
-    if test "x$ac_cv_lib_crypto_DH_new" != "xyes"; then
-           fail="$fail libcrypto"
-    fi
-
-       AC_SMART_CHECK_LIB(ssl, SSL_new)
-    if test "x$ac_cv_lib_ssl_SSL_new" != "xyes"; then
-           fail="$fail libssl"
-    fi
-
-AC_CHECK_HEADERS( \
-       openssl/err.h \
-       openssl/engine.h
-       )
+       if test "x$OPENSSL_LIBS" != "x"; then
+         SMART_LIBS="-L$OPENSSL_LIBS -lcrypto -lssl"
+       else
+         fail="$fail libssl"
+        fi
 
        targetname=modname
 else