diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/mysql_rpath.pl | 9 | ||||
-rw-r--r-- | src/modules/extra/openssl_config.pl | 44 | ||||
-rw-r--r-- | src/modules/extra/pcre_rpath.pl | 10 | ||||
-rw-r--r-- | src/modules/extra/sqlite3_config.pl | 39 |
4 files changed, 26 insertions, 76 deletions
diff --git a/src/modules/extra/mysql_rpath.pl b/src/modules/extra/mysql_rpath.pl index befa45a82..b1ac57b5a 100644 --- a/src/modules/extra/mysql_rpath.pl +++ b/src/modules/extra/mysql_rpath.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl -$data = `mysql_config --libs_r`; -$data =~ /-L(\S+)\s/; -$libpath = $1; -print "-Wl,--rpath -Wl,$libpath"; + +use lib "../.."; +use make::utilities; + +print make_rpath("mysql_config --libs_r"); diff --git a/src/modules/extra/openssl_config.pl b/src/modules/extra/openssl_config.pl index 61d8f2902..7fa03dc89 100644 --- a/src/modules/extra/openssl_config.pl +++ b/src/modules/extra/openssl_config.pl @@ -1,48 +1,14 @@ #!/usr/bin/perl -if (!exists $ENV{PKG_CONFIG_PATH}) -{ - $ENV{PKG_CONFIG_PATH} = "/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/libdata/pkgconfig:/usr/X11R6/libdata/pkgconfig"; -} -else -{ - $ENV{PKG_CONFIG_PATH} .= ":/usr/local/lib/pkgconfig:/usr/local/libdata/pkgconfig:/usr/X11R6/libdata/pkgconfig"; -} +use lib "../.."; +use make::utilities; if ($ARGV[0] eq "compile") { - $ret = `pkg-config --cflags openssl 2>/dev/null`; - if ((!defined $ret) || ($ret eq "")) - { - $foo = `locate "/openssl/ssl.h" | head -n 1`; - $foo =~ /(.+)\/openssl\/ssl\.h/; - if (defined $1) - { - $foo = "-I$1"; - } - else - { - $foo = ""; - } - $ret = "$foo\n"; - } + print pkgconfig_get_include_dirs("openssl", "/openssl/ssl.h", ""); } else { - $ret = `pkg-config --libs openssl 2>/dev/null`; - if ((!defined $ret) || ($ret eq "")) - { - $foo = `locate "/libssl.so" | head -n 1`; - $foo =~ /(.+)\/libssl\.so/; - if (defined $1) - { - $foo = "-L$1"; - } - else - { - $foo = ""; - } - $ret = "$foo -lssl -lcrypto\n"; - } + print pkgconfig_get_lib_dirs("openssl", "/libssl.so", "-lssl -lcrypto"); } -print "$ret"; + diff --git a/src/modules/extra/pcre_rpath.pl b/src/modules/extra/pcre_rpath.pl index 4699b7f87..00677895e 100644 --- a/src/modules/extra/pcre_rpath.pl +++ b/src/modules/extra/pcre_rpath.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -# Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--cflags] [--cflags-posix] -$data = `pcre-config --libs`; -$data =~ /-L(\S+)\s/; -$libpath = $1; -print "-Wl,--rpath -Wl,$libpath"; + +use lib "../.."; +use make::utilities; + +print make_rpath("pcre-config --libs"); diff --git a/src/modules/extra/sqlite3_config.pl b/src/modules/extra/sqlite3_config.pl index 33f7594ee..ddede3a3c 100644 --- a/src/modules/extra/sqlite3_config.pl +++ b/src/modules/extra/sqlite3_config.pl @@ -1,30 +1,13 @@ #!/usr/bin/perl -if (!exists $ENV{PKG_CONFIG_PATH}) { - $ENV{PKG_CONFIG_PATH} = "/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/libdata/pkgconfig:/usr/X11R6/libdata/pkgconfig"; + +use lib "../.."; +use make::utilities; + +if ($ARGV[0] eq "compile") +{ + print pkgconfig_get_include_dirs("sqlite", "/sqlite3.h", ""); +} +else +{ + print pkgconfig_get_lib_dirs("sqlite", "/libsqlite3.so", "-lsqlite3"); } -else { - $ENV{PKG_CONFIG_PATH} .= ":/usr/local/lib/pkgconfig:/usr/local/libdata/pkgconfig:/usr/X11R6/libdata/pkgconfig"; -} -if ($ARGV[0] eq "compile") { - $ret = `pkg-config --cflags sqlite 2>/dev/null`; if ((!defined $ret) || ($ret eq "")) { - $foo = `locate "/sqlite3.h" | head -n 1`; $foo =~ /(.+)\/sqlite3\.h/; if (defined $1) { - $foo = "-I$1"; - } - else { - $foo = ""; - } - $ret = "$foo\n"; - } -} -else { - $ret = `pkg-config --libs sqlite3 2>/dev/null`; if ((!defined $ret) || ($ret eq "")) { - $foo = `locate "/libsqlite3.so" | head -n 1`; $foo =~ /(.+)\/libsqlite3\.so/; if (defined $1) { - $foo = "-L$1"; - } - else { - $foo = ""; - } - $ret = "$foo -lsqlite3\n"; - } -} -print "$ret"; |