summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--acinclude.m4101
-rw-r--r--configure.ac4
-rw-r--r--output/sqlite3/Makefile.am6
3 files changed, 5 insertions, 106 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 6929e06..9a8e1ae 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -268,107 +268,6 @@ fi
])
-dnl @synopsis CT_CHECK_SQLITE3_DB
-dnl
-dnl This macro tries to find the headers and libraries for the
-dnl SQLITE3 database to build client applications.
-dnl
-dnl If includes are found, the variable SQLITE3_INC will be set. If
-dnl libraries are found, the variable SQLITE3_LIB will be set. if no check
-dnl was successful, the script exits with a error message.
-dnl
-dnl @category InstalledPackages
-dnl @author Harald Welte <laforge@gnumonks.org>
-dnl @version 2006-01-07
-dnl @license AllPermissive
-
-AC_DEFUN([CT_CHECK_SQLITE3_DB], [
-
-AC_ARG_WITH(sqlite3,
- [ --with-sqlite3=PREFIX Prefix of your SQLITE3 installation],
- [sqlite3_prefix=$withval], [sqlite3_prefix=])
-AC_ARG_WITH(sqlite3-inc,
- [ --with-sqlite3-inc=PATH Path to the include directory of SQLITE3],
- [sqlite3_inc=$withval], [sqlite3_inc=/usr/include])
-AC_ARG_WITH(sqlite3-lib,
- [ --with-sqlite3-lib=PATH Path to the libraries of SQLITE3],
- [sqlite3_lib=$withval], [sqlite3_lib=/usr/lib])
-
-
-AC_SUBST(SQLITE3_INC)
-AC_SUBST(SQLITE3_LIB)
-
-if test "$sqlite3_prefix" != "no"; then
-
-AC_MSG_CHECKING([for sqlite3 pkg-config program])
-for d in $sqlite3_prefix/bin /usr/bin /usr/local/bin /usr/local/sqlite3/bin /opt/sqlite3/bin /opt/packages/sqlite3/bin
-do
- if test -x $d/pkg-config
- then
- AC_MSG_RESULT(found pkg-config in $d)
- $d/pkg-config --exists sqlite3
- if test "$?" != "0"; then
- AC_MSG_RESULT(pkg-config doesn't know sqlite3)
- break
- fi
- SQLITE3_INC=`$d/pkg-config --cflags sqlite3`
- SQLITE3_LIB=`$d/pkg-config --libs sqlite3`
- break
- fi
-done
-
-if test "$SQLITE3_INC" = ""; then
-
-if test "$sqlite3_prefix" != ""; then
- AC_MSG_CHECKING([for SQLITE3 includes in $sqlite3_prefix/include])
- if test -f "$sqlite3_prefix/include/sqlite3.h" ; then
- SQLITE3_INC="-I$sqlite3_prefix/include"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_WARN(sqlite3.h not found)
- fi
- AC_MSG_CHECKING([for SQLITE3 libraries in $sqlite3_prefix/lib])
- if test -f "$sqlite3_prefix/lib/libsqlite3.so" ; then
- SQLITE3_LIB="-L$sqlite3_prefix/lib -lsqlite3"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_WARN(libsqlite3.so not found)
- fi
-else
- if test "$sqlite3_inc" != ""; then
- AC_MSG_CHECKING([for SQLITE3 includes in $sqlite3_inc])
- if test -f "$sqlite3_inc/sqlite3.h" ; then
- SQLITE3_INC="-I$sqlite3_inc"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_WARN(sqlite3.h not found)
- fi
- fi
- if test "$sqlite3_lib" != ""; then
- AC_MSG_CHECKING([for SQLITE3 libraries in $sqlite3_lib])
- if test -f "$sqlite3_lib/libsqlite3.so" ; then
- SQLITE3_LIB="-L$sqlite3_lib -lsqlite3"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_WARN(libsqlite3.so not found)
- fi
- fi
-fi
-
-fi
-
-if test "$SQLITE3_INC" = "" ; then
- AC_CHECK_HEADER([sqlite3.h], [], AC_MSG_WARN(sqlite3.h not found))
-fi
-if test "$SQLITE3_LIB" = "" ; then
- AC_CHECK_LIB(sqlite3, sqlite3_close, [], AC_MSG_WARN(libsqlite3.so not found))
-fi
-
-fi
-
-])
-
-
dnl @synopsis CT_CHECK_DBI
dnl
dnl This macro tries to find the headers and libraries for libdbi.
diff --git a/configure.ac b/configure.ac
index 8a92824..365f6b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,8 +47,8 @@ AM_CONDITIONAL(HAVE_PGSQL, test "x$PQLIBPATH" != "x")
CT_CHECK_MYSQL_DB()
AM_CONDITIONAL(HAVE_MYSQL, test "x$MYSQL_LIB" != "x")
-CT_CHECK_SQLITE3_DB()
-AM_CONDITIONAL(HAVE_SQLITE3, test "x$SQLITE3_LIB" != "x")
+PKG_CHECK_MODULES([libsqlite3], [sqlite3], [], [:])
+AM_CONDITIONAL([HAVE_SQLITE3], [test -n "$libsqlite3_LIBS"])
CT_CHECK_DBI()
AM_CONDITIONAL(HAVE_DBI, test "x$DBI_LIB" != "x")
diff --git a/output/sqlite3/Makefile.am b/output/sqlite3/Makefile.am
index 507dbfc..d1377b6 100644
--- a/output/sqlite3/Makefile.am
+++ b/output/sqlite3/Makefile.am
@@ -1,12 +1,12 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include $(SQLITE3_INC)
-AM_CFLAGS = ${regular_CFLAGS}
+AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CFLAGS = ${regular_CFLAGS} ${libsqlite3_CFLAGS}
if HAVE_SQLITE3
pkglibexec_LTLIBRARIES = ulogd_output_SQLITE3.la
ulogd_output_SQLITE3_la_SOURCES = ulogd_output_SQLITE3.c ../../util/db.c
-ulogd_output_SQLITE3_la_LIBADD = ${SQLITE3_LIBS}
+ulogd_output_SQLITE3_la_LIBADD = ${libsqlite3_LIBS}
ulogd_output_SQLITE3_la_LDFLAGS = -avoid-version -module
endif