summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-13 23:07:14 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-13 23:07:14 +0000
commit568018bdbd1f35f494c3cbf5194bbb40394dcb4d (patch)
tree0d8830a7f8290b6693fde7d26cc75447214201a1
parent5adff9af1b71adb9ebaaa09159821b1947f7f625 (diff)
Get flags for sqlite3.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6304 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/extra/sqlite3_config.pl30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/modules/extra/sqlite3_config.pl b/src/modules/extra/sqlite3_config.pl
new file mode 100644
index 000000000..33f7594ee
--- /dev/null
+++ b/src/modules/extra/sqlite3_config.pl
@@ -0,0 +1,30 @@
+#!/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";
+}
+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";