summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-11-18 14:22:04 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2010-11-18 14:22:04 -0500
commitfb86b2e0894c5c51a30dc38cf530e80ce68a710a (patch)
tree21d925508e3cebab2d7dc4092845a7538df70dac /configure.ac
parent15195cea4dff60d3b0d3355a96e99c81dc37a1aa (diff)
Karn Kallio's patch for static mhash linking
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac28
1 files changed, 21 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 9b7c02a9..fbb75892 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,8 +6,20 @@ AC_PROG_LIBTOOL()
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
-AC_CHECK_LIB(mhash, mhash_get_block_size, [], [echo "You must install libmhash."; exit 1])
-AC_CHECK_HEADER([mhash.h], [], [echo "You must install libmhash dev files."; exit 1])
+dnl Setting the search directory for mhash.
+AC_ARG_WITH(mhash-dir, AS_HELP_STRING([--with-mhash-dir=DIR], [mhash directory; default = /usr]),
+ with_mhash_dir="$withval", with_mhash_dir="/usr")
+
+dnl Check for libmhash
+LIBS_save="$LIBS"
+LIBS="-L${with_mhash_dir}/lib/ -lmhash"
+AC_CHECK_LIB(mhash, mhash_get_block_size,
+ [MHASH_LIB_DIR="${with_mhash_dir}/lib"], [echo "You must install libmhash."; exit 1])
+LIBS="${LIBS_save}"
+
+dnl Check for mhash.h
+AC_CHECK_HEADER(["${with_mhash_dir}/include/mhash.h"],
+ [CPPFLAGS="${CPPFLAGS} -I${with_mhash_dir}/include"], [echo "You must install libmhash dev files."; exit 1])
AC_CHECK_PROG(MLTON, mlton, yes, [])
@@ -55,6 +67,7 @@ AC_SUBST(LIB)
AC_SUBST(INCLUDE)
AC_SUBST(SITELISP)
AC_SUBST(GCCARGS)
+AC_SUBST(MHASH_LIB_DIR)
AC_CONFIG_FILES([
Makefile
@@ -67,9 +80,10 @@ AC_OUTPUT()
cat <<EOF
Ur/Web configuration:
- bin directory: BIN $BIN
- lib directory: LIB $LIB
- include directory: INCLUDE $INCLUDE
- site-lisp directory: SITELISP $SITELISP
- Extra GCC args: GCCARGS $GCCARGS
+ bin directory: BIN $BIN
+ lib directory: LIB $LIB
+ include directory: INCLUDE $INCLUDE
+ site-lisp directory: SITELISP $SITELISP
+ mhash lib directory: MHASH_LIB_DIR $MHASH_LIB_DIR
+ Extra GCC args: GCCARGS $GCCARGS
EOF