]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Added checks for openssl/ec.h
authorAlan T. DeKok <aland@freeradius.org>
Tue, 13 Mar 2012 12:26:52 +0000 (08:26 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 13 Mar 2012 12:26:52 +0000 (08:26 -0400)
src/modules/rlm_eap/types/rlm_eap_pwd/configure
src/modules/rlm_eap/types/rlm_eap_pwd/configure.in

index 79ec1be75ac4022aa8061c78bbe037a9a950d6c8..52df111c564778205e240391465981db9dcc7812 100755 (executable)
@@ -1854,13 +1854,8 @@ fi
 
 
 
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL support" >&5
-$as_echo_n "checking for OpenSSL support... " >&6; }
-       if test "x$OPENSSL_LIBS" != "x"; then
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-               ac_ext=c
+       smart_try_dir=$rlm_eap_pwd_include_dir
+       ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -2651,54 +2646,142 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-as_ac_Lib=`$as_echo "ac_cv_lib_c $OPENSSL_LIBS''_EVP_sha256" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_sha256 in -lc $OPENSSL_LIBS" >&5
-$as_echo_n "checking for EVP_sha256 in -lc $OPENSSL_LIBS... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
-  $as_echo_n "(cached) " >&6
+
+
+ac_safe=`echo "openssl/ec.h" | sed 'y%./+-%__pm%'`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl/ec.h" >&5
+$as_echo_n "checking for openssl/ec.h... " >&6; }
+
+old_CFLAGS="$CFLAGS"
+smart_include=
+smart_include_dir=
+
+if test "x$smart_try_dir" != "x"; then
+  for try in $smart_try_dir; do
+    CFLAGS="$old_CFLAGS -I$try"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+                   #include <openssl/ec.h>
+int
+main ()
+{
+ int a = 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  smart_include="-I$try"
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc $OPENSSL_LIBS  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  smart_include=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test "x$smart_include" != "x"; then
+      break;
+    fi
+  done
+  CFLAGS="$old_CFLAGS"
+fi
+
+if test "x$smart_include" = "x"; then
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char EVP_sha256 ();
+                 #include <openssl/ec.h>
 int
 main ()
 {
-return EVP_sha256 ();
+ int a = 1;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+if ac_fn_c_try_compile "$LINENO"; then :
+  smart_include=" "
 else
-  eval "$as_ac_Lib=no"
+  smart_include=
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-eval ac_res=\$$as_ac_Lib
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
 
-$as_echo "#define HAVE_OPENSSL_EVP_SHA256 1" >>confdefs.h
+if test "x$smart_include" = "x"; then
 
 
+if test "x$LOCATE" != "x"; then
+        DIRS=
+  file=openssl/ec.h
+
+  for x in `${LOCATE} $file 2>/dev/null`; do
+                                        base=`echo $x | sed "s%/${file}%%"`
+    if test "x$x" = "x$base"; then
+      continue;
+    fi
+
+    dir=`${DIRNAME} $x 2>/dev/null`
+                exclude=`echo ${dir} | ${GREP} /home`
+    if test "x$exclude" != "x"; then
+      continue
+    fi
+
+                    already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}`
+    if test "x$already" = "x"; then
+      DIRS="$DIRS $dir"
+    fi
+  done
+fi
+
+eval "smart_include_dir=\"\$smart_include_dir $DIRS\""
+
+
+  for try in $smart_include_dir /usr/local/include /opt/include; do
+    CFLAGS="$old_CFLAGS -I$try"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+                   #include <openssl/ec.h>
+int
+main ()
+{
+ int a = 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  smart_include="-I$try"
+else
+  smart_include=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test "x$smart_include" != "x"; then
+      break;
+    fi
+  done
+  CFLAGS="$old_CFLAGS"
+fi
+
+if test "x$smart_include" != "x"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  eval "ac_cv_header_$ac_safe=yes"
+  CFLAGS="$old_CFLAGS $smart_include"
+  SMART_CFLAGS="$SMART_CFLAGS $smart_include"
 else
-   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: EVP_sha256 not found, may have issues wirh WiMAX certificates" >&5
-$as_echo "$as_me: WARNING: EVP_sha256 not found, may have issues wirh WiMAX certificates" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+       if test "$ac_cv_header_openssl_ec_h" != "yes"; then
+         fail="$fail openssl/ec.h"
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL support" >&5
+$as_echo_n "checking for OpenSSL support... " >&6; }
+       if test "x$OPENSSL_LIBS" != "x"; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
        else
                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
index 57d9b365fc2f399d5a1dee43edec5a91845403cb..6a26662c8e0607cb403a357d0197b72b76f5ab6e 100644 (file)
@@ -27,6 +27,16 @@ if test x$with_[]modname != xno; then
        [  --with-rlm-eap-pwd-include-dir   directory for eap-pwd includes],
        eap_pwd_cflags="-I$withval")
 
+       dnl ############################################################
+       dnl # Check for header files
+       dnl ############################################################
+
+       smart_try_dir=$rlm_eap_pwd_include_dir
+       FR_SMART_CHECK_INCLUDE(openssl/ec.h)
+       if test "$ac_cv_header_openssl_ec_h" != "yes"; then
+         fail="$fail openssl/ec.h"
+       fi
+
        dnl ############################################################
        dnl # Check for OpenSSL support
        dnl ############################################################