From b4e6d98fc33df055c8230903bb7d9633042a6374 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 23 Feb 2010 22:12:46 +0000 Subject: [PATCH] * configure: flag --with-sqlite. --- configure.ac | 20 +++++++++++++++++--- src/libstore/Makefile.am | 5 +++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index f726b1ae4..9d3d9f76e 100644 --- a/configure.ac +++ b/configure.ac @@ -245,13 +245,27 @@ AC_SUBST(bzip2_include) AC_SUBST(bzip2_bin) AC_SUBST(bzip2_bin_test) +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) + AC_CHECK_LIB(pthread, pthread_mutex_init) -LDFLAGS="-lsqlite3" - - AC_ARG_ENABLE(init-state, AC_HELP_STRING([--disable-init-state], [do not initialise DB etc. in `make install']), init_state=$enableval, init_state=yes) diff --git a/src/libstore/Makefile.am b/src/libstore/Makefile.am index 0140857b8..2f8bb72da 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