about summary refs log tree commit diff
path: root/configure.ac
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-04-25T10·45+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-04-25T10·45+0000
commit03162f8f477fb7634edbf53ad4e9dfca433dd9d9 (patch)
tree88aaf58b6111f8a0cb8422c97697605e1f3dc4de /configure.ac
parentef2d4a2da9c14c15985bdd27c02d2d30093a3e56 (diff)
* Unless --with-bzip2 is specified, use a copy of bzip2 in the
  externals directory.  This is in particular useful because though
  most systems have bzip2/bunzip2, they don't always have libbz2,
  which we need for bsdiff/bspatch.

Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac26
1 files changed, 15 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index f6e548729c..11ce58e6d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,22 +160,26 @@ fi
 AC_ARG_WITH(bzip2, AC_HELP_STRING([--with-bzip2=PATH],
   [prefix of bzip2]),
   bzip2=$withval, bzip2=)
+AM_CONDITIONAL(HAVE_BZIP2, test -n "$bzip2")
 if test -z "$bzip2"; then
-   AC_CHECK_LIB(bz2, BZ2_bzWriteOpen,
-     [bzip2_lib="-lbz2"], [AC_MSG_ERROR([cannot find -lbz (bzip2)])])
-   AC_CHECK_HEADER(bzlib.h, 
-     [bzip2_include=""], [AC_MSG_ERROR([cannot find bzlib.h (bzip2)])])
-   AC_PATH_PROG(bzip2_prog, bzip2,
-     [AC_MSG_ERROR([cannot find bzip2])])
-   bzip2_bin=$(dirname $bzip2_prog)
+  # Headers and libraries will be used from the temporary installation
+  # in externals/inst-bzip2.
+  bzip2_lib='-L${top_builddir}/externals/inst-bzip2/lib -lbz2'
+  bzip2_include='-I${top_builddir}/externals/inst-bzip2/include'
+  # The binary will be copied to $libexecdir.
+  bzip2_bin='${libexecdir}'
+  # But for testing, we have to use the temporary copy :-(
+  bzip2_bin_test='${top_builddir}/externals/inst-bzip2/bin'
 else
-   bzip2_lib="-L$bzip2/lib -lbz2"
-   bzip2_include="-I$bzip2/include"
-   bzip2_bin="$bzip2/bin"
+  bzip2_lib="-L$bzip2/lib -lbz2"
+  bzip2_include="-I$bzip2/include"
+  bzip2_bin="$bzip2/bin"
+  bzip2_bin_test="$bzip2/bin"
 fi   
 AC_SUBST(bzip2_lib)
 AC_SUBST(bzip2_include)
 AC_SUBST(bzip2_bin)
+AC_SUBST(bzip2_bin_test)
 
 AC_CHECK_LIB(pthread, pthread_mutex_init)
 
@@ -212,7 +216,7 @@ AC_SUBST(NIX_GROUP)
 AC_DEFINE_UNQUOTED(NIX_GROUP, ["$NIX_GROUP"], [Nix group])
 
                                                                                                             
-# This is needed if either ATerm or Berkeley DB are static libraries,
+# This is needed if ATerm, Berkeley DB or bzip2 are static libraries,
 # and the Nix libraries are dynamic.
 if test "$(uname)" = "Darwin"; then
    LDFLAGS="-all_load $LDFLAGS"