From 568018bdbd1f35f494c3cbf5194bbb40394dcb4d Mon Sep 17 00:00:00 2001
From: peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>
Date: Sat, 13 Jan 2007 23:07:14 +0000
Subject: Get flags for sqlite3.

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6304 e03df62e-2008-0410-955e-edbf42e46eb7
---
 src/modules/extra/sqlite3_config.pl | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 src/modules/extra/sqlite3_config.pl

(limited to 'src/modules')

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";
-- 
cgit v1.2.3