From 7c935373dcfcbd34ee455d0761ac2163785b745a Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 24 Nov 2006 19:26:12 +0000 Subject: Make this smarter when we dont have pkg-config git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5794 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/openssl_config.pl | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/openssl_config.pl b/src/modules/extra/openssl_config.pl index 79fdf832f..65c885e22 100644 --- a/src/modules/extra/openssl_config.pl +++ b/src/modules/extra/openssl_config.pl @@ -11,18 +11,30 @@ else if ($ARGV[0] eq "compile") { - $ret = `pkg-config --cflags openssl`; + $ret = `pkg-config --cflags openssl 2>/dev/null`; if ((undef $ret) || ($ret eq "")) { - $ret = ""; + $foo = `locate "openssl/ssl.h"`; + $foo =~ s/\/openssl\/ssl\.h//; + $ret = "-I$foo"; } } else { - $ret = `pkg-config --libs openssl`; + $ret = `pkg-config --libs openssl 2>/dev/null`; if ((undef $ret) || ($ret eq "")) { - $ret = "-lssl -lcrypto -ldl"; + $foo = `locate "/libssl.so" | head -n 1`; + $foo =~ /(.+)\/libssl\.so/; + if (defined $1) + { + $foo = "-L$1"; + } + else + { + $foo = ""; + } + $ret = "$foo -lssl -lcrypto\n"; } } -print "$ret\n"; +print "$ret"; -- cgit v1.2.3