changeset 1442:5142be485095

[xemacs-hg @ 2003-05-02 06:15:54 by stephent] collect darwin kludges, find intptr_t on cygwin, Xmas-tree db hack <873cjxvptd.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Fri, 02 May 2003 06:15:54 +0000
parents 049c7092a496
children 4f98e7b44323
files ChangeLog configure.in
diffstat 2 files changed, 48 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 02 06:00:43 2003 +0000
+++ b/ChangeLog	Fri May 02 06:15:54 2003 +0000
@@ -1,3 +1,9 @@
+2003-05-02  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* configure.in (darwin): Collect random kludges in one place.
+	(cygwin): Check for intptr_t in <sys/types.h>.
+	(Berkeley db): Handle 4.1 functions decorated with version info.
+
 2003-04-28  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* PROBLEMS (Windows): New: auxiliary programs for Windows.
--- a/configure.in	Fri May 02 06:00:43 2003 +0000
+++ b/configure.in	Fri May 02 06:15:54 2003 +0000
@@ -1248,7 +1248,6 @@
   dnl Darwin, a.k.a. MacOS X (based on Mach and Freebsd)
   *-*-darwin*)
     opsys=darwin
-    RANLIB="ranlib -c" dnl Avoids a link error with lwlib-config.c
     ;;
 
   dnl Data General AViiON Machines
@@ -1609,9 +1608,9 @@
 
 if test -z "$pdump"; then
   case "$opsys" in
-    linux* )  pdump=yes ;;    dnl glibc 2.3.1 seems to hose unexec
-    darwin )  pdump=yes ;;    dnl No "native" working dumper available
-    *)        pdump=no ;;
+    linux* )  pdump=yes ;;          dnl glibc 2.3.1 seems to hose unexec
+    darwin )  pdump=yes ;;          dnl No "native" working dumper available
+    * )       pdump=no ;;
   esac
 fi
 
@@ -1638,8 +1637,11 @@
   esac
 fi
 
-dnl Use xlc by default on AIX
-case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
+dnl Tools configuration
+case "$opsys" in
+  aix* )   NON_GNU_CC=xlc ;;      dnl Use xlc by default on AIX
+  darwin ) RANLIB="ranlib -c" ;;  dnl Avoid link error in lwlib-config.c
+esac
 
 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
 AC_DEFINE_UNQUOTED(STACK_TRACE_EYE_CATCHER, $stack_trace_eye_catcher)
@@ -2525,6 +2527,16 @@
 AC_TYPE_OFF_T
 AC_CHECK_TYPE(ssize_t, int)
 
+dnl not AC_CHECK_TYPE; lisp.h does hairy conditional typedef
+if test "$ac_cv_header_inttypes_h" != "yes"; then
+AC_MSG_CHECKING(for intptr_t in sys/types.h)
+AC_TRY_COMPILE([#include <sys/types.h>
+intptr_t x;
+],[],[AC_MSG_RESULT(yes)
+      AC_DEFINE(HAVE_INTPTR_T_IN_SYS_TYPES_H,1)],
+     [AC_MSG_RESULT(no)])
+fi
+
 dnl check for Unix98 socklen_t
 AC_MSG_CHECKING(for socklen_t)
 AC_TRY_COMPILE([#include <sys/types.h>
@@ -4621,13 +4633,34 @@
 #if DB_VERSION_MAJOR > 2
 yes
 #endif
-], [AC_MSG_RESULT(3); dbfunc=db_create],[
-    AC_MSG_RESULT(2); dbfunc=db_open])],[
-    AC_MSG_RESULT(1); dbfunc=dbopen])
+], [AC_EGREP_CPP(yes,
+[#include <$db_h_file>
+#if DB_VERSION_MAJOR > 3
+yes
+#endif
+], [AC_MSG_RESULT(4); dbfunc=db_create; dbver=4],[
+    AC_MSG_RESULT(3); dbfunc=db_create; dbver=3])],[
+    AC_MSG_RESULT(2); dbfunc=db_open; dbver=2])],[
+    AC_MSG_RESULT(1); dbfunc=dbopen; dbver=1])
     AC_CHECK_FUNC($dbfunc,     with_database_berkdb=yes need_libdb=no, [
     AC_CHECK_LIB(db, $dbfunc,  with_database_berkdb=yes need_libdb=yes)])
   fi
 
+  dnl Berk db 4.1 decorates public functions with version information
+  if test "$with_database_berkdb" != "yes" -a "$dbver" = "4"; then
+    rm -f $tempcname
+    echo "#include <$db_h_file>" > $tempcname
+    echo "configure___ dbfunc=db_create" >> $tempcname
+    define(TAB, [	])dnl
+    changequote(, )dnl
+    eval `$CPP -Isrc $tempcname \
+	| sed -n -e "s/[ TAB]*=[ TAB\"]*/='/" -e "s/[ TAB\"]*\$/'/" -e "s/^configure___//p"`
+    changequote([, ])dnl
+    rm -f $tempcname
+    AC_MSG_WARN("db_create is really $dbfunc")
+    AC_CHECK_LIB(db, $dbfunc,  with_database_berkdb=yes need_libdb=yes)
+  fi
+
   if test "$with_database_berkdb" = "yes"; then
     AC_DEFINE_UNQUOTED(DB_H_FILE, "$db_h_file")
     AC_DEFINE(HAVE_BERKELEY_DB)