Need openssl test to get headers included.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Thu, 15 Nov 2007 18:37:11 +0000 (18:37 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Thu, 15 Nov 2007 18:37:11 +0000 (18:37 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2617 cb58f699-b61c-0410-a6fe-9272a202ed29

configure.ac

index f147428..87d8a06 100644 (file)
@@ -82,6 +82,31 @@ else
     CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
 fi
 
+# OpenSSL settings
+AC_ARG_WITH(openssl,
+    AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),
+    [if test x_$with_openssl != x_/usr; then
+        SSLFLAGS="-I${with_openssl}/include"
+    fi])
+
+if test "x$SSLFLAGS" = "x" ; then
+    AC_PATH_PROG(PKG_CONFIG, pkg-config)
+    if test "x$PKG_CONFIG" != x && test "x$PKG_CONFIG" != "xno" ; then
+        if pkg-config openssl ; then
+            SSLFLAGS="`$PKG_CONFIG --cflags openssl`"
+        else
+            AC_MSG_ERROR([OpenSSL not supported by pkg-config, try --with-openssl instead])
+        fi
+    fi
+fi
+
+AC_MSG_CHECKING(for OpenSSL cflags)
+AC_MSG_RESULT($SSLFLAGS)
+CPPFLAGS="$SSLFLAGS $CPPFLAGS"
+
+AC_CHECK_HEADER([openssl/x509.h],,
+                AC_MSG_ERROR([unable to find openssl header files]))
+
 AC_LANG(C++)
 
 # C++ requirements