From 0c86ba0f22cba59dcafbbf2e31e86cd8576b37b1 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 24 Nov 2006 19:06:02 +0000 Subject: Smarter openssl detection git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5791 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ssl_openssl.cpp | 4 ++-- src/modules/extra/openssl_config.pl | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/modules/extra/openssl_config.pl diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 578ffce00..37f0e1ad8 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -17,8 +17,8 @@ #include "ssl_cert.h" /* $ModDesc: Provides SSL support for clients */ -/* $CompileFlags: `pkg-config --cflags openssl` */ -/* $LinkerFlags: `pkg-config --libs openssl` */ +/* $CompileFlags: `perl extra/openssl_config.pl compile` */ +/* $LinkerFlags: `perl extra/openssl_config.pl link` */ diff --git a/src/modules/extra/openssl_config.pl b/src/modules/extra/openssl_config.pl new file mode 100644 index 000000000..fb36f2f5e --- /dev/null +++ b/src/modules/extra/openssl_config.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl + +$ENV{PKG_CONFIG_PATH} = "/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/libdata/pkgconfig:/usr/X11R6/libdata/pkgconfig"; + +if ($ARGV[1] eq "compile") +{ + $ret = `pkg-config --cflags openssl`; + if ((undef $ret) || ($ret eq "")) + { + $ret = ""; + } +} +else +{ + $ret = `pkg-config --libs openssl`; + if ((undef $ret) || ($ret eq "")) + { + $ret = "-lssl -lcrypto -ldl"; + } +} -- cgit v1.2.3