XEmacs 21.4.13 "Rational FORTRAN".
[chise/xemacs-chise.git.1] / configure.in
index 7dbf2d9..e348ef6 100644 (file)
@@ -1120,12 +1120,12 @@ case "$canonical" in
   *-*-ultrix* )         opsys=ultrix4-3 ;;
 
   dnl AIX
   *-*-ultrix* )         opsys=ultrix4-3 ;;
 
   dnl AIX
-  *-*-aix3.1*  ) opsys=aix3-1  ;;
-  *-*-aix3.2.5 ) opsys=aix3-2-5        ;;
-  *-*-aix3*    ) opsys=aix3-2  ;;
-  *-*-aix4.0*  ) opsys=aix4    ;;
-  *-*-aix4.1*  ) opsys=aix4-1  ;;
-  *-*-aix4*    ) opsys=aix4-2  ;;
+  *-*-aix3.1*     ) opsys=aix3-1   ;;
+  *-*-aix3.2.5    ) opsys=aix3-2-5 ;;
+  *-*-aix3*       ) opsys=aix3-2   ;;
+  *-*-aix4.0*     ) opsys=aix4    ;;
+  *-*-aix4.1*     ) opsys=aix4-1   ;;
+  *-*-aix[[4-9]]* ) opsys=aix4-2   ;;
 
   dnl Other generic OSes
   *-gnu* )                     opsys=gnu    ;;
 
   dnl Other generic OSes
   *-gnu* )                     opsys=gnu    ;;
@@ -1579,9 +1579,9 @@ dnl --------------------------------------------------------------
 
 if test -z "$pdump"; then
   case "$opsys" in
 
 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
 
   esac
 fi
 
@@ -1595,6 +1595,7 @@ if test "$dynamic" = "yes"; then
   case "$opsys" in
     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
     decosf* ) ld_call_shared="-call_shared" ;;
   case "$opsys" in
     hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;;
     decosf* ) ld_call_shared="-call_shared" ;;
+    darwin ) AC_DEFINE(DLSYM_NEEDS_UNDERSCORE) ;;
   esac
 else dnl "$dynamic" = "no"
   case "$opsys" in
   esac
 else dnl "$dynamic" = "no"
   case "$opsys" in
@@ -2486,6 +2487,14 @@ AC_CHECK_SIZEOF(long)
 AC_CHECK_SIZEOF(long long)
 AC_CHECK_SIZEOF(void *)
 
 AC_CHECK_SIZEOF(long long)
 AC_CHECK_SIZEOF(void *)
 
+dnl Cygwin from 1003022 has intptr_t, uintptr_t in <cygwin/types.h>
+case $opsys in
+  cygwin* ) AC_EGREP_HEADER([typedef.*intptr_t;], [cygwin/types.h],
+                            [AC_MSG_RESULT(yes)
+                             AC_DEFINE(INTPTR_T_IN_CYGWIN_TYPES_H,1)],
+                            [AC_MSG_RESULT(no)]) ;;
+esac
+
 dnl check for long file names
 AC_SYS_LONG_FILE_NAMES
 
 dnl check for long file names
 AC_SYS_LONG_FILE_NAMES
 
@@ -2735,22 +2744,29 @@ if test "$with_x11" = "yes"; then
   XE_APPEND(lwlib, MAKE_SUBDIR)
   XE_APPEND(lwlib, SRC_SUBDIR_DEPS)
 
   XE_APPEND(lwlib, MAKE_SUBDIR)
   XE_APPEND(lwlib, SRC_SUBDIR_DEPS)
 
-  dnl Try to find Motif/CDE/Tooltalk dirs
-  dnl These take precedence over other X libs/includes, so PRE-pend
-  for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
-    inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
-    if test -d "$lib_dir" -a -d "$inc_dir"; then
-      case "$x_libraries" in *"$lib_dir"* ) ;; *)
-        x_libraries="$lib_dir $x_libraries"
-        XE_PREPEND(-L${lib_dir}, X_LIBS) ;;
-      esac
-      case "$x_includes" in "$inc_dir"* ) ;; *)
-        x_includes="$inc_dir $x_includes"
-        XE_PREPEND(-I${inc_dir}, X_CFLAGS) ;;
-      esac
-      break; dnl only need ONE Motif implementation!
-      fi
-  done
+
+  dnl Look for Motif, but only if not found in $x_includes and $x_libraries
+  AC_CHECK_HEADER(Xm/Xm.h, [AC_CHECK_LIB(Xm, XmStringFree, got_motif=yes)])
+
+  if test "$got_motif" != "yes"; then
+    dnl Try to find Motif/CDE/Tooltalk dirs
+    dnl These take precedence over other X libs/includes, so PRE-pend
+    for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" \
+                   "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do
+      inc_dir=`echo $lib_dir | sed -e 's/lib/include/'`
+      if test -d "$lib_dir" -a -d "$inc_dir"; then
+       case "$x_libraries" in *"$lib_dir"* ) ;; *)
+         x_libraries="$lib_dir $x_libraries"
+         XE_PREPEND(-L${lib_dir}, X_LIBS) ;;
+       esac
+       case "$x_includes" in "$inc_dir"* ) ;; *)
+         x_includes="$inc_dir $x_includes"
+         XE_PREPEND(-I${inc_dir}, X_CFLAGS) ;;
+       esac
+       break; dnl only need ONE Motif implementation!
+       fi
+    done
+  fi
 
   dnl Contrib X libs/includes do NOT take precedence, so AP-pend
   for rel in "X11R6" "X11R5" "X11R4"; do
 
   dnl Contrib X libs/includes do NOT take precedence, so AP-pend
   for rel in "X11R6" "X11R5" "X11R4"; do
@@ -2909,13 +2925,24 @@ extern Bool XRegisterIMInstantiateCallback(
   if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
     dnl X11R6 requires thread-safe code on AIX for some reason
     if test "$GCC" = "yes"; then
   if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then
     dnl X11R6 requires thread-safe code on AIX for some reason
     if test "$GCC" = "yes"; then
-      XE_PREPEND(-mthreads, X_CFLAGS)
-      XE_PREPEND(-mthreads, libs_x)
+      dnl gcc changed the name of the `-mthreads' option to `-pthread'
+      dnl on 2000-06-12
+      AC_MSG_CHECKING(for name of AIX gcc threads option)
+      case `$CC -v --help 2>&1` in
+        *-mthreads*) aix_threads=-mthreads ;;
+                  *) aix_threads=-pthread  ;;
+      esac
+      AC_MSG_RESULT($aix_threads)
+      XE_PREPEND($aix_threads, X_CFLAGS)
+      XE_PREPEND($aix_threads, libs_x)
     else
     else
-      case "$CC" in
-        "xlc" ) CC="xlc_r" ;;
-        "xlC" ) CC="xlC_r" ;;
-        "cc"  ) CC="cc_r" ;;
+      dnl Try to use the thread-safe "_r" versions of xlc
+      case "$CC" in *_r) : ;;
+        *)
+         xe_save_CC="$CC"
+         CC="${CC}_r"
+         AC_CHECK_SIZEOF(short)
+         test "$ac_cv_sizeof_short" = 0 && CC="$xe_save_CC" ;;
       esac
     fi
   fi
       esac
     fi
   fi
@@ -3412,15 +3439,7 @@ if test "$with_x11" = "yes"; then
   AC_CHECKING(for X11 graphics libraries)
 fi
 
   AC_CHECKING(for X11 graphics libraries)
 fi
 
-dnl We don't automatically trigger widgets if athena is present
-dnl because of stability concerns.
-dnl But if the user wants widgets, still offer him autodetections
-case "$with_widgets" in
-  "yes" | "athena")            detect_athena=yes ;;
-   *)                          detect_athena=no ;;
-esac
-
-if test "$with_x11" = "yes" -a "$detect_athena" = "yes" ; then
+if test "$with_x11" = "yes"; then
   AC_CHECKING(for the Athena widgets)
 
   dnl What in heck did the user actually want?
   AC_CHECKING(for the Athena widgets)
 
   dnl What in heck did the user actually want?
@@ -3434,22 +3453,24 @@ if test "$with_x11" = "yes" -a "$detect_athena" = "yes" ; then
     *)         XE_DIE("Unknown Athena widget set \`$with_athena'. This should not happen.") ;;
   esac
 
     *)         XE_DIE("Unknown Athena widget set \`$with_athena'. This should not happen.") ;;
   esac
 
+  athena_3d_function=Xaw3dComputeBottomShadowRGB
+
   dnl Search for the Athena library...
   if test "$athena_3d" = "no"; then
     AC_CHECK_LIB($athena_variant, XawScrollbarSetThumb,
       [
         dnl Must not be a 3d library...
   dnl Search for the Athena library...
   if test "$athena_3d" = "no"; then
     AC_CHECK_LIB($athena_variant, XawScrollbarSetThumb,
       [
         dnl Must not be a 3d library...
-        AC_CHECK_LIB($athena_variant, threeDClassRec,
+        AC_CHECK_LIB($athena_variant, $athena_3d_function,
           AC_MSG_WARN("Could not find a non-3d Athena widget library."),
           athena_lib=$athena_variant)
       ],
       AC_MSG_WARN("Could not find an Athena widget library."))
   else
     dnl The real configuration, need 3d library
           AC_MSG_WARN("Could not find a non-3d Athena widget library."),
           athena_lib=$athena_variant)
       ],
       AC_MSG_WARN("Could not find an Athena widget library."))
   else
     dnl The real configuration, need 3d library
-    AC_CHECK_LIB($athena_variant, threeDClassRec, athena_lib=$athena_variant,
+    AC_CHECK_LIB($athena_variant, $athena_3d_function, athena_lib=$athena_variant,
       dnl OK, couldn't find it with a proper name, try the standard Athena lib
       dnl If that is 3d, presume the user asked for what they have installed.
       dnl OK, couldn't find it with a proper name, try the standard Athena lib
       dnl If that is 3d, presume the user asked for what they have installed.
-      AC_CHECK_LIB(Xaw, threeDClassRec,
+      AC_CHECK_LIB(Xaw, $athena_3d_function,
         [
           athena_lib=Xaw;
           AC_MSG_WARN("Assuming that libXaw is actually $athena_variant.");
         [
           athena_lib=Xaw;
           AC_MSG_WARN("Assuming that libXaw is actually $athena_variant.");
@@ -3519,7 +3540,7 @@ if test "$with_x11" = "yes" -a "$detect_athena" = "yes" ; then
 
 else
   have_xaw=no
 
 else
   have_xaw=no
-fi dnl "$with_x11" = "yes" -a "detect_athena" = "yes"
+fi dnl "$with_x11" = "yes"
 
 if test "$with_x11" = "yes"; then
   dnl autodetect Motif - but only add to libs_x later (if necessary)
 
 if test "$with_x11" = "yes"; then
   dnl autodetect Motif - but only add to libs_x later (if necessary)
@@ -4372,6 +4393,20 @@ dnl Check for Berkeley DB.
 if test "$with_database_berkdb" != "no"; then
   AC_MSG_CHECKING(for Berkeley db.h)
   for header in "db/db.h" "db.h"; do
 if test "$with_database_berkdb" != "no"; then
   AC_MSG_CHECKING(for Berkeley db.h)
   for header in "db/db.h" "db.h"; do
+    case "$opsys" in
+        *freebsd*)
+    AC_TRY_COMPILE([
+#include <stdlib.h>
+#if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1)
+#ifdef HAVE_INTTYPES_H
+#define __BIT_TYPES_DEFINED__
+#include <inttypes.h>
+#endif
+#endif
+#include <$header>
+],[], db_h_file="$header"; break)
+        ;;
+        *)
     AC_TRY_COMPILE([
 #include <stdlib.h>
 #if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1)
     AC_TRY_COMPILE([
 #include <stdlib.h>
 #if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1)
@@ -4388,6 +4423,8 @@ typedef uint64_t u_int64_t;
 #endif
 #include <$header>
 ],[], db_h_file="$header"; break)
 #endif
 #include <$header>
 ],[], db_h_file="$header"; break)
+        ;;
+        esac
   done
   if test -z "$db_h_file"
   then AC_MSG_RESULT(no); with_database_berkdb=no
   done
   if test -z "$db_h_file"
   then AC_MSG_RESULT(no); with_database_berkdb=no