Get flags for sqlite3.

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6304 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
peavey 2007-01-13 23:07:14 +00:00
parent 5adff9af1b
commit 568018bdbd

View File

@ -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";