]> granicus.if.org Git - apache/commitdiff
add --with-dbm switch to configure, allowing the user to set the type of DBM
authorGreg Stein <gstein@apache.org>
Tue, 28 Nov 2000 12:09:50 +0000 (12:09 +0000)
committerGreg Stein <gstein@apache.org>
Tue, 28 Nov 2000 12:09:50 +0000 (12:09 +0000)
  that apu_dbm will use (defaults to builtin sdbm). first pass at gdbm
  config support (seems to work fine in my simple test).

- added src/lib/aputil/apu_private.h.in to hold aputil config info
- apu_dbm.c now uses #if for the config values (rather than #ifdef)
- cleared out temp hack in configure.in to force sdbm usage

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87100 13f79535-47bb-0310-9956-ffa450edef68

acinclude.m4
configure.in

index 63d40ec3aa9d6e99c54add17fa8fa418ca3ad2c4..8468961ccb3df3ed3fd35982ea2d520be16fc2ed 100644 (file)
@@ -394,3 +394,44 @@ AC_DEFUN(APACHE_REQUIRE_CXX,[
     apache_cxx_done=yes
   fi
 ])
+
+dnl
+dnl APACHE_CHECK_DBM
+dnl
+AC_DEFUN(APACHE_CHECK_DBM,[
+
+apu_use_sdbm=0
+apu_use_gdbm=0
+AC_MSG_CHECKING(for chosen DBM type)
+AC_ARG_WITH(dbm,
+  [  --with-dbm=DBM          Choose the DBM type to use. DBM={sdbm,gdbm}],[
+  if test "$withval" = "yes"; then
+    AC_MSG_ERROR([You need to specify a DBM type to use. One of: sdbm, gdbm])
+  fi
+  case "$withval" in
+    sdbm)
+      apache_need_sdbm=yes
+      apu_use_sdbm=1
+      AC_MSG_RESULT(sdbm)
+      ;;
+    gdbm)
+      apu_use_gdbm=1
+      AC_MSG_RESULT(gdbm)
+
+      dnl ### probably need more work in here to locate GDBM
+      AC_ADD_LIBRARY(gdbm)
+      ;;
+    *)
+      AC_MSG_ERROR([$withval is an unknown DBM type. Use one of: sdbm, gdbm])
+      ;;
+  esac
+],[
+  apache_need_sdbm=yes
+  apu_use_sdbm=1
+  AC_MSG_RESULT([sdbm (default)])
+])
+APACHE_SUBST(apu_use_sdbm)
+APACHE_SUBST(apu_use_gdbm)
+APACHE_OUTPUT(lib/aputil/apu_private.h)
+
+])
index 9446f602c90e4e5ac03b3308dd56e53a4fa2e93a..f8ab13dc4e750def35f57464da5d1ad0be746ce0 100644 (file)
@@ -36,6 +36,12 @@ dnl
 dnl ## Preload our OS configuration
 APR_PRELOAD
 
+dnl
+dnl Process command line arguments. This is done early in the process so the
+dnl user can get feedback quickly in case of an error.
+dnl
+APACHE_CHECK_DBM
+
 dnl ## Check for programs
 
 AC_PROG_AWK
@@ -175,9 +181,6 @@ if test "$apache_need_sdbm" = "yes"; then
   AP_LIB_DIRS="$AP_LIB_DIRS sdbm"
   AP_LIBS="$AP_LIBS lib/sdbm/libsdbm.la"
   INCLUDES="$INCLUDES -I\$(top_srcdir)/lib/sdbm"
-else
-  echo "Adding sdbm to the include list anyway until aputil configuration works..."
-  INCLUDES="$INCLUDES -I\$(top_srcdir)/lib/sdbm"
 fi
 if test "$apache_need_expat" = "yes"; then
   AP_LIB_DIRS="$AP_LIB_DIRS expat-lite"