about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-04-11T10·13+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-04-11T10·13+0000
commit3cbf680f5d2bfb2ed4592dd24ff8ce2b7e5765bc (patch)
tree2b5a014fa7063d8b56fdcaa1e1defa2cc18caf8a
parent83252b4ca9cb9de45bf4a069b20d1c2d1412396e (diff)
* configure: detect whether DBD::SQLite is present. If necessary the
  location to DBI and DBD::SQLite can be passed with --with-dbi and
  --with-dbd-sqlite.

-rw-r--r--configure.ac28
-rw-r--r--[-rwxr-xr-x]scripts/GeneratePatches.pm.in2
-rw-r--r--scripts/download-using-manifests.pl.in2
-rw-r--r--scripts/nix-generate-patches.in2
-rw-r--r--scripts/nix-pull.in2
-rw-r--r--scripts/nix-push.in2
-rw-r--r--substitute.mk1
7 files changed, 33 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index deb011d1c7..2c1488a038 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,6 +171,7 @@ AC_PATH_PROG(openssl_prog, openssl, openssl) # if not found, call openssl in $PA
 AC_SUBST(openssl_prog)
 AC_DEFINE_UNQUOTED(OPENSSL_PATH, ["$openssl_prog"], [Path of the OpenSSL binary])
 
+
 # Test that Perl has the open/fork feature (Perl 5.8.0 and beyond).
 AC_MSG_CHECKING([whether Perl is recent enough])
 if ! $perl -e 'open(FOO, "-|", "true"); while (<FOO>) { print; }; close FOO or die;'; then
@@ -179,6 +180,7 @@ if ! $perl -e 'open(FOO, "-|", "true"); while (<FOO>) { print; }; close FOO or d
 fi
 AC_MSG_RESULT(yes)
 
+
 NEED_PROG(cat, cat)
 NEED_PROG(tr, tr)
 AC_ARG_WITH(coreutils-bin, AC_HELP_STRING([--with-coreutils-bin=PATH],
@@ -186,6 +188,7 @@ AC_ARG_WITH(coreutils-bin, AC_HELP_STRING([--with-coreutils-bin=PATH],
   coreutils=$withval, coreutils=$(dirname $cat))
 AC_SUBST(coreutils)
 
+
 AC_ARG_WITH(docbook-rng, AC_HELP_STRING([--with-docbook-rng=PATH],
   [path of the DocBook RelaxNG schema]),
   docbookrng=$withval, docbookrng=/docbook-rng-missing)
@@ -196,16 +199,19 @@ AC_ARG_WITH(docbook-xsl, AC_HELP_STRING([--with-docbook-xsl=PATH],
   docbookxsl=$withval, docbookxsl=/docbook-xsl-missing)
 AC_SUBST(docbookxsl)
 
+
 AC_ARG_WITH(xml-flags, AC_HELP_STRING([--with-xml-flags=FLAGS],
   [extra flags to be passed to xmllint and xsltproc]),
   xmlflags=$withval, xmlflags=)
 AC_SUBST(xmlflags)
 
+
 AC_ARG_WITH(store-dir, AC_HELP_STRING([--with-store-dir=PATH],
   [path of the Nix store]),
   storedir=$withval, storedir='/nix/store')
 AC_SUBST(storedir)
 
+
 AC_ARG_WITH(openssl, AC_HELP_STRING([--with-openssl=PATH],
   [prefix of the OpenSSL library]),
   openssl=$withval, openssl=)
@@ -217,6 +223,7 @@ if test -n "$openssl"; then
   AC_DEFINE(HAVE_OPENSSL, 1, [Whether to use OpenSSL.])
 fi
 
+
 AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2=PATH],
   [prefix of bzip2]),
   bzip2=$withval, bzip2=)
@@ -243,6 +250,7 @@ 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=)
@@ -262,6 +270,7 @@ AC_SUBST(sqlite_lib)
 AC_SUBST(sqlite_include)
 AC_SUBST(sqlite_bin)
 
+
 # Whether to use the Boehm garbage collector.
 AC_ARG_ENABLE(gc, AC_HELP_STRING([--enable-gc],
   [enable garbage collection in the Nix expression evaluator (requires Boehm GC)]),
@@ -273,6 +282,25 @@ if test -n "$gc"; then
 fi
 
 
+# Check for the required Perl dependencies (DBI and DBD::SQLite).
+AC_ARG_WITH(dbi, AC_HELP_STRING([--with-dbi=PATH],
+  [prefix of the Perl DBI library]),
+  perlFlags="$perlFlags -I$withval")
+
+AC_ARG_WITH(dbd-sqlite, AC_HELP_STRING([--with-dbd-sqlite=PATH],
+  [prefix of the Perl DBD::SQLite library]),
+  perlFlags="$perlFlags -I$withval")
+
+AC_MSG_CHECKING([whether DBD::SQLite works])
+if ! $perl $perlFlags -e 'use DBI; use DBD::SQLite;' 2>&5; then
+    AC_MSG_RESULT(no)
+    AC_MSG_FAILURE([The Perl modules DBI and/or DBD::SQLite are missing.])
+fi
+AC_MSG_RESULT(yes)
+  
+AC_SUBST(perlFlags)
+
+
 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/scripts/GeneratePatches.pm.in b/scripts/GeneratePatches.pm.in
index 9d404e3400..4bb5b05a8c 100755..100644
--- a/scripts/GeneratePatches.pm.in
+++ b/scripts/GeneratePatches.pm.in
@@ -1,5 +1,3 @@
-#! @perl@ -w -I@libexecdir@/nix
-
 use strict;
 use File::Temp qw(tempdir);
 use File::stat;
diff --git a/scripts/download-using-manifests.pl.in b/scripts/download-using-manifests.pl.in
index 775df4ce86..a6588aa9ac 100644
--- a/scripts/download-using-manifests.pl.in
+++ b/scripts/download-using-manifests.pl.in
@@ -1,4 +1,4 @@
-#! @perl@ -w -I@libexecdir@/nix
+#! @perl@ -w -I@libexecdir@/nix @perlFlags@
 
 use strict;
 use NixManifest;
diff --git a/scripts/nix-generate-patches.in b/scripts/nix-generate-patches.in
index dc5c3bf68e..1f32ab4109 100644
--- a/scripts/nix-generate-patches.in
+++ b/scripts/nix-generate-patches.in
@@ -1,4 +1,4 @@
-#! @perl@ -w -I@libexecdir@/nix
+#! @perl@ -w -I@libexecdir@/nix @perlFlags@
 
 use strict;
 use File::Temp qw(tempdir);
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in
index 8ea78d10d3..d2979721aa 100644
--- a/scripts/nix-pull.in
+++ b/scripts/nix-pull.in
@@ -1,4 +1,4 @@
-#! @perl@ -w -I@libexecdir@/nix
+#! @perl@ -w -I@libexecdir@/nix @perlFlags@
 
 use strict;
 use File::Temp qw(tempdir);
diff --git a/scripts/nix-push.in b/scripts/nix-push.in
index 2d43031a47..fd1ec21485 100644
--- a/scripts/nix-push.in
+++ b/scripts/nix-push.in
@@ -1,4 +1,4 @@
-#! @perl@ -w -I@libexecdir@/nix
+#! @perl@ -w -I@libexecdir@/nix @perlFlags@
 
 use strict;
 use File::Temp qw(tempdir);
diff --git a/substitute.mk b/substitute.mk
index d83399cfde..7da60d0677 100644
--- a/substitute.mk
+++ b/substitute.mk
@@ -15,6 +15,7 @@
 	 -e "s^@bunzip2\@^$(bzip2_bin)/bunzip2^g" \
 	 -e "s^@bzip2_bin_test\@^$(bzip2_bin_test)^g" \
 	 -e "s^@perl\@^$(perl)^g" \
+	 -e "s^@perlFlags\@^$(perlFlags)^g" \
 	 -e "s^@coreutils\@^$(coreutils)^g" \
 	 -e "s^@sed\@^$(sed)^g" \
 	 -e "s^@tar\@^$(tar)^g" \