diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-24 19:26:12 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-24 19:26:12 +0000 |
commit | 7c935373dcfcbd34ee455d0761ac2163785b745a (patch) | |
tree | 2441b2034bea40e22a604bd40772b56f50dfe1aa /src | |
parent | f9181e78805d46d32747735e38a2e0d597f80d6b (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/extra/openssl_config.pl | 22 |
1 files changed, 17 insertions, 5 deletions
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"; |