about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-02-23T22·12+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-02-23T22·12+0000
commitb4e6d98fc33df055c8230903bb7d9633042a6374 (patch)
treeb4bf61f9a936e80fe0d2af8808818e78821e509b
parent2b20318b0e968432438a7528b2d11d05585877c2 (diff)
* configure: flag --with-sqlite.
-rw-r--r--configure.ac20
-rw-r--r--src/libstore/Makefile.am5
2 files changed, 20 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index f726b1ae43ea..9d3d9f76eb37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -245,11 +245,25 @@ AC_SUBST(bzip2_include)
 AC_SUBST(bzip2_bin)
 AC_SUBST(bzip2_bin_test)
 
-
-AC_CHECK_LIB(pthread, pthread_mutex_init)
+AC_ARG_WITH(sqlite, AC_HELP_STRING([--with-sqlite=PATH],
+  [prefix of SQLite]),
+  sqlite=$withval, sqlite=)
+AM_CONDITIONAL(HAVE_SQLITE, test -n "$sqlite")
+if test -z "$sqlite"; then
+  sqlite_lib='-L${top_builddir}/externals/inst-sqlite/lib -lsqlite3'
+  sqlite_include='-I${top_builddir}/externals/inst-sqlite/include'
+  sqlite_bin='${top_builddir}/externals/inst-sqlite/bin'
+else
+  sqlite_lib="-L$sqlite/lib -lsqlite3"
+  sqlite_include="-I$sqlite/include"
+  sqlite_bin="$sqlite/bin"
+fi
+AC_SUBST(sqlite_lib)
+AC_SUBST(sqlite_include)
+AC_SUBST(sqlite_bin)
 
 
-LDFLAGS="-lsqlite3"
+AC_CHECK_LIB(pthread, pthread_mutex_init)
 
 
 AC_ARG_ENABLE(init-state, AC_HELP_STRING([--disable-init-state],
diff --git a/src/libstore/Makefile.am b/src/libstore/Makefile.am
index 0140857b8100..2f8bb72da37b 100644
--- a/src/libstore/Makefile.am
+++ b/src/libstore/Makefile.am
@@ -10,14 +10,15 @@ pkginclude_HEADERS = \
   globals.hh references.hh pathlocks.hh \
   worker-protocol.hh
 
-libstore_la_LIBADD = ../libutil/libutil.la ../boost/format/libformat.la @ADDITIONAL_NETWORK_LIBS@
+libstore_la_LIBADD = ../libutil/libutil.la ../boost/format/libformat.la \
+  ${sqlite_lib} @ADDITIONAL_NETWORK_LIBS@
 
 BUILT_SOURCES = derivations-ast.cc derivations-ast.hh
 
 EXTRA_DIST = derivations-ast.def derivations-ast.cc
 
 AM_CXXFLAGS = -Wall \
- -I$(srcdir)/.. ${aterm_include} -I$(srcdir)/../libutil
+ -I$(srcdir)/.. ${aterm_include} ${sqlite_include} -I$(srcdir)/../libutil
 
 local-store.lo: schema.sql.hh