summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-06-01 08:48:42 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-06-01 09:24:28 (GMT)
commit2812bddd81f8a1b804c7460f4e14cd0aa393d129 (patch)
treed46294f35150c4f0f43deaf2d31fceaf945ae715 /autoconf/ax_openssl.m4
downloadswift-2812bddd81f8a1b804c7460f4e14cd0aa393d129.zip
swift-2812bddd81f8a1b804c7460f4e14cd0aa393d129.tar.bz2
Import.
Diffstat (limited to 'autoconf/ax_openssl.m4')
-rw-r--r--autoconf/ax_openssl.m437
1 files changed, 37 insertions, 0 deletions
diff --git a/autoconf/ax_openssl.m4 b/autoconf/ax_openssl.m4
new file mode 100644
index 0000000..cdb3f12
--- /dev/null
+++ b/autoconf/ax_openssl.m4
@@ -0,0 +1,37 @@
+# Author: Remko Tronçon
+
+AC_DEFUN([AX_OPENSSL],
+[
+ AC_ARG_WITH(
+ [openssl],
+ AC_HELP_STRING([--with-openssl=@<:@ARG@:>@],[Path to OpenSSL installation]),
+ [
+ WITH_OPENSSL="$withval"
+ if test "$withval" != "no" -a "$withval" != "yes"; then
+ OPENSSL_CPPFLAGS="-I$withval/include"
+ case $host in
+ *-*-cygwin*|*-mingw32*)
+ OPENSSL_LIBS="-L$withval/lib/MinGW -leay32 $withval/lib/MinGW/ssleay32.a"
+ ;;
+ *)
+ OPENSSL_LIBS="-L$withval/lib -lssl -lcrypto"
+ esac
+ CPPFLAGS="$CPPFLAGS $OPENSSL_CPPFLAGS"
+ LDFLAGS="$LDFLAGS $OPENSSL_LIBS"
+ fi
+ ],
+ [
+ WITH_OPENSSL="yes"
+ case $host in
+ *-*-cygwin*|*-mingw32*)
+ AC_MSG_ERROR([--with-openssl parameter is required on Windows])
+ ;;
+ *)
+ OPENSSL_LIBS="-lssl -lcrypto"
+ esac
+ ])
+
+ if test "$WITH_OPENSSL" != "no"; then
+ AC_CHECK_HEADER(openssl/ssl.h, [HAVE_OPENSSL=yes], [])
+ fi
+])