You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by bl...@apache.org on 2003/09/08 13:30:42 UTC

cvs commit: xml-security/c/src configure configure.ac

blautenb    2003/09/08 04:30:42

  Modified:    c/src    configure configure.ac
  Log:
  Fix bug reported by Derek Atkins where OpenSSL library is not found
  
  Revision  Changes    Path
  1.21      +145 -3    xml-security/c/src/configure
  
  Index: configure
  ===================================================================
  RCS file: /home/cvs/xml-security/c/src/configure,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- configure	7 Sep 2003 00:52:26 -0000	1.20
  +++ configure	8 Sep 2003 11:30:42 -0000	1.21
  @@ -3775,6 +3775,10 @@
     echo "$as_me:$LINENO: result: yes" >&5
   echo "${ECHO_T}yes" >&6
   	cat >>confdefs.h <<\_ACEOF
  +#define XSEC_XERCES_REQUIRES_MEMMGR 1
  +_ACEOF
  +
  +	cat >>confdefs.h <<\_ACEOF
   #define XSEC_XERCES_FORMATTER_REQUIRES_VERSION 1
   _ACEOF
   
  @@ -3903,6 +3907,8 @@
   # Check for OpenSSL
   if test $OPENSSL ; then
   
  +# First check includes
  +
   echo "$as_me:$LINENO: checking for OpenSSL headers in OPENSSL" >&5
   echo $ECHO_N "checking for OpenSSL headers in OPENSSL... $ECHO_C" >&6
   
  @@ -3936,7 +3942,6 @@
   #define HAVE_OPENSSL 1
   _ACEOF
   
  -   LIBS="${LIBS} -L${OPENSSL} -lcrypto"
      echo "$as_me:$LINENO: result: found" >&5
   echo "${ECHO_T}found" >&6
   else
  @@ -3948,6 +3953,143 @@
   fi
   rm -f conftest.err conftest.$ac_ext;
   
  +# Now check libs
  +
  +OLD_LIBS=$LIBS
  +LIBS="${LIBS} -L${OPENSSL} -lcrypto"
  +
  +echo "$as_me:$LINENO: checking for EVP_EncryptInit in -lcrypto" >&5
  +echo $ECHO_N "checking for EVP_EncryptInit in -lcrypto... $ECHO_C" >&6
  +if test "${ac_cv_lib_crypto_EVP_EncryptInit+set}" = set; then
  +  echo $ECHO_N "(cached) $ECHO_C" >&6
  +else
  +  ac_check_lib_save_LIBS=$LIBS
  +LIBS="-lcrypto  $LIBS"
  +cat >conftest.$ac_ext <<_ACEOF
  +#line $LINENO "configure"
  +#include "confdefs.h"
  +
  +/* Override any gcc2 internal prototype to avoid an error.  */
  +#ifdef __cplusplus
  +extern "C"
  +#endif
  +/* We use char because int might match the return type of a gcc2
  +   builtin and then its argument prototype would still apply.  */
  +char EVP_EncryptInit ();
  +#ifdef F77_DUMMY_MAIN
  +#  ifdef __cplusplus
  +     extern "C"
  +#  endif
  +   int F77_DUMMY_MAIN() { return 1; }
  +#endif
  +int
  +main ()
  +{
  +EVP_EncryptInit ();
  +  ;
  +  return 0;
  +}
  +_ACEOF
  +rm -f conftest.$ac_objext conftest$ac_exeext
  +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  +  (eval $ac_link) 2>&5
  +  ac_status=$?
  +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  +  (exit $ac_status); } &&
  +         { ac_try='test -s conftest$ac_exeext'
  +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  +  (eval $ac_try) 2>&5
  +  ac_status=$?
  +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  +  (exit $ac_status); }; }; then
  +  ac_cv_lib_crypto_EVP_EncryptInit=yes
  +else
  +  echo "$as_me: failed program was:" >&5
  +cat conftest.$ac_ext >&5
  +ac_cv_lib_crypto_EVP_EncryptInit=no
  +fi
  +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
  +LIBS=$ac_check_lib_save_LIBS
  +fi
  +echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_EVP_EncryptInit" >&5
  +echo "${ECHO_T}$ac_cv_lib_crypto_EVP_EncryptInit" >&6
  +if test $ac_cv_lib_crypto_EVP_EncryptInit = yes; then
  +  openssllib_found=yes
  +else
  +  LIBS=$OLD_LIBS
  +fi
  +
  +
  +   if test -z $openssllib_found ; then
  +
  +   LIBS="${LIBS} -L${OPENSSL}/lib -lcrypto"
  +   echo "$as_me:$LINENO: checking for EVP_DecryptInit in -lcrypto" >&5
  +echo $ECHO_N "checking for EVP_DecryptInit in -lcrypto... $ECHO_C" >&6
  +if test "${ac_cv_lib_crypto_EVP_DecryptInit+set}" = set; then
  +  echo $ECHO_N "(cached) $ECHO_C" >&6
  +else
  +  ac_check_lib_save_LIBS=$LIBS
  +LIBS="-lcrypto  $LIBS"
  +cat >conftest.$ac_ext <<_ACEOF
  +#line $LINENO "configure"
  +#include "confdefs.h"
  +
  +/* Override any gcc2 internal prototype to avoid an error.  */
  +#ifdef __cplusplus
  +extern "C"
  +#endif
  +/* We use char because int might match the return type of a gcc2
  +   builtin and then its argument prototype would still apply.  */
  +char EVP_DecryptInit ();
  +#ifdef F77_DUMMY_MAIN
  +#  ifdef __cplusplus
  +     extern "C"
  +#  endif
  +   int F77_DUMMY_MAIN() { return 1; }
  +#endif
  +int
  +main ()
  +{
  +EVP_DecryptInit ();
  +  ;
  +  return 0;
  +}
  +_ACEOF
  +rm -f conftest.$ac_objext conftest$ac_exeext
  +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  +  (eval $ac_link) 2>&5
  +  ac_status=$?
  +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  +  (exit $ac_status); } &&
  +         { ac_try='test -s conftest$ac_exeext'
  +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  +  (eval $ac_try) 2>&5
  +  ac_status=$?
  +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  +  (exit $ac_status); }; }; then
  +  ac_cv_lib_crypto_EVP_DecryptInit=yes
  +else
  +  echo "$as_me: failed program was:" >&5
  +cat conftest.$ac_ext >&5
  +ac_cv_lib_crypto_EVP_DecryptInit=no
  +fi
  +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
  +LIBS=$ac_check_lib_save_LIBS
  +fi
  +echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_EVP_DecryptInit" >&5
  +echo "${ECHO_T}$ac_cv_lib_crypto_EVP_DecryptInit" >&6
  +if test $ac_cv_lib_crypto_EVP_DecryptInit = yes; then
  +  openssllib_found=yes
  +else
  +  LIBS=$OLD_LIBS
  +	  { { echo "$as_me:$LINENO: error: \"Unable to find libcrypto in OPENSSL\"" >&5
  +echo "$as_me: error: \"Unable to find libcrypto in OPENSSL\"" >&2;}
  +   { (exit 1); exit 1; }; }
  +fi
  +
  +
  +  fi
  +
   fi
   
   if test -z $openssl_found ; then
  @@ -3989,8 +4131,8 @@
     cat conftest.$ac_ext >&5
     echo "$as_me:$LINENO: result: no" >&5
   echo "${ECHO_T}no" >&6
  -   { { echo "$as_me:$LINENO: error: OpenSSL header files not find.  Please define OPENSSL" >&5
  -echo "$as_me: error: OpenSSL header files not find.  Please define OPENSSL" >&2;}
  +   { { echo "$as_me:$LINENO: error: OpenSSL header files not found.  Please define OPENSSL" >&5
  +echo "$as_me: error: OpenSSL header files not found.  Please define OPENSSL" >&2;}
      { (exit 1); exit 1; }; }
   fi
   rm -f conftest.err conftest.$ac_ext;
  
  
  
  1.21      +25 -3     xml-security/c/src/configure.ac
  
  Index: configure.ac
  ===================================================================
  RCS file: /home/cvs/xml-security/c/src/configure.ac,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- configure.ac	7 Sep 2003 00:52:26 -0000	1.20
  +++ configure.ac	8 Sep 2003 11:30:42 -0000	1.21
  @@ -374,7 +374,7 @@
   		XMLFormatter::UnRep_CharRef);
   	],
   	[AC_MSG_RESULT([yes])]
  -	[AC_DEFINE(XSEC_XERCES_REQUIRES_MEMMGR)],
  +	[AC_DEFINE(XSEC_XERCES_REQUIRES_MEMMGR)]
   	[AC_DEFINE(XSEC_XERCES_FORMATTER_REQUIRES_VERSION)],
   	[AC_MSG_RESULT([no])])
   	
  @@ -425,6 +425,8 @@
   # Check for OpenSSL
   if test $OPENSSL ; then
   
  +# First check includes
  +
   AC_MSG_CHECKING([for OpenSSL headers in OPENSSL])
   
   OLD_CPPFLAGS=$CPPFLAGS
  @@ -433,11 +435,31 @@
   AC_TRY_CPP([#include <openssl/opensslv.h>], 
      openssl_found=yes 
      AC_DEFINE(HAVE_OPENSSL)
  -   LIBS="${LIBS} -L${OPENSSL} -lcrypto"
      [AC_MSG_RESULT([found])], 
      CPPFLAGS=$OLD_CPPFLAGS
      [AC_MSG_RESULT([no])]);
   
  +# Now check libs
  +
  +OLD_LIBS=$LIBS
  +LIBS=["${LIBS} -L${OPENSSL} -lcrypto"]
  +
  +AC_CHECK_LIB([crypto], 
  +   [EVP_EncryptInit],
  +   openssllib_found=yes,
  +   [LIBS=$OLD_LIBS])
  +
  +   if test -z $openssllib_found ; then
  +
  +   LIBS=["${LIBS} -L${OPENSSL}/lib -lcrypto"]
  +   AC_CHECK_LIB([crypto],
  +      [EVP_DecryptInit],
  +      openssllib_found=yes,
  +      [LIBS=$OLD_LIBS]
  +	  [AC_MSG_ERROR(["Unable to find libcrypto in OPENSSL"])])
  +
  +  fi
  +
   fi
   
   if test -z $openssl_found ; then
  @@ -449,7 +471,7 @@
      LIBS="${LIBS} -lcrypto"
      [AC_MSG_RESULT([found])],
      [AC_MSG_RESULT([no])]
  -   [AC_MSG_ERROR([OpenSSL header files not find.  Please define OPENSSL])]);
  +   [AC_MSG_ERROR([OpenSSL header files not found.  Please define OPENSSL])]);
   
   fi