The lib verification of OpenSSL was added.
authorHiroshi Saito <hiroshi@winpg.jp>
Tue, 27 Mar 2007 01:49:23 +0000 (01:49 +0000)
committerHiroshi Saito <hiroshi@winpg.jp>
Tue, 27 Mar 2007 01:49:23 +0000 (01:49 +0000)
It was confirmed in Linux.
This might correspond to the problem report of Darwin.
from Sean Davis.
Thanks!

configure.ac

index 7b08422442df817808cc108f18191d25fe1447c3..12f9fd69d6976e7cbfade032f003bca7fcedc5a0 100644 (file)
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-AC_INIT(psqlodbc, 08.02.0200, [pgsql-odbc@postgresql.org])
+AC_INIT(psqlodbc, 08.02.0204, [pgsql-odbc@postgresql.org])
 AC_PREREQ(2.52)
 AM_INIT_AUTOMAKE
 AC_CONFIG_SRCDIR([bind.c])
@@ -85,6 +85,39 @@ PGAC_ARG_BOOL(enable, pthreads, no,
      PGAC_FUNC_STRERROR_R_INT
     ])
 
+# Need OpenSSL 
+AC_PATH_PROG(PKG_CONFIG, pkg-config)
+if test "x$PKG_CONFIG" = x || test "x$PKG_CONFIG" = "xno" ; then
+   AC_ARG_WITH(openssl, 
+   AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
+   [if test x_$with_openssl != x_/usr; then
+       SSLLIBS="-L${with_openssl}/lib"
+       SSLFLAGS="-I${with_openssl}/include"
+   fi])
+   SSLLIBS="$SSLLIBS -lssl -lcrypto"
+else
+   SSLLIBS="`$PKG_CONFIG --libs openssl`"
+   SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
+fi
+#AC_CHECKING(for OpenSSL libraries)
+AC_MSG_RESULT($SSLLIBS)
+LIBS="$LIBS $SSLLIBS"
+#AC_CHECKING(for OpenSSL cflags)
+AC_MSG_RESULT($SSLFLAGS)
+CPPFLAGS="$SSLFLAGS $CPPFLAGS"
+
+AC_CHECK_HEADER([openssl/ssl.h],,
+   AC_MSG_ERROR([unable to find openssl header files]))
+AC_MSG_CHECKING(for ERR_load_CRYPTO_string)
+AC_TRY_LINK_FUNC([ERR_load_CRYPTO_strings],,
+   AC_MSG_ERROR([unable to link with openssl libraries]))
+AC_MSG_RESULT(yes)
+AC_MSG_CHECKING(for SSL_library_init)
+AC_TRY_LINK_FUNC([SSL_library_init],, 
+   AC_MSG_ERROR([unable to link with openssl libraries]))
+AC_MSG_RESULT(yes)
+#
+
 AC_PROG_CC
 
 AC_LIBTOOL_WIN32_DLL