diff configure.in @ 306:9ea74add5d37 r21-0b51

Import from CVS: tag r21-0b51
author cvs
date Mon, 13 Aug 2007 10:41:58 +0200
parents 3cc9f0ebfbd1
children 33bdb3d4b97f
line wrap: on
line diff
--- a/configure.in	Mon Aug 13 10:41:13 2007 +0200
+++ b/configure.in	Mon Aug 13 10:41:58 2007 +0200
@@ -79,11 +79,12 @@
 #include "confdefs.h"
 [$1]
 EOF
-if AC_TRY_EVAL(ac_link) && test -s conftest && (./conftest; exit) 2>&AC_FD_CC
+if AC_TRY_EVAL(ac_link) && test -s conftest && (./conftest; exit $?) 2>&AC_FD_CC
 then
 dnl Do not remove the temporary files here, so they can be examined.
   ifelse([$2], , :, [$2])
 else
+  conftest_rc="$?"
   echo "configure: failed program was:" >&AC_FD_CC
   cat conftest.$ac_ext >&AC_FD_CC
 ifelse([$3], , , [  rm -fr conftest*
@@ -936,7 +937,7 @@
 AC_DEFINE_UNQUOTED(EMACS_VERSION, "$version")
 
 if test "$with_infodock" = "yes"; then
-  if test ! -f ../ID-INSTALL; then
+  if test ! -f ../../ID-INSTALL; then
     echo "Cannot build InfoDock without InfoDock sources"
     with_infodock=no
   fi
@@ -1019,7 +1020,7 @@
 dnl Straightforward machine determination
 case "$canonical" in
   sparc-*-*        ) machine=sparc ;;
-  alpha-*-*        ) machine=alpha ;;
+  alpha*-*-*       ) machine=alpha ;;
   vax-*-*          ) machine=vax ;;
   mips-dec-*       ) machine=pmax ;;
   mips-sgi-*       ) machine=iris4d ;;
@@ -1594,13 +1595,24 @@
 dnl Well. then why not fix fucking pop?
 test "$have_glibc" = "yes" && AC_DEFINE(_GNU_SOURCE)
 
-AC_MSG_CHECKING(whether we are using SunPro C)
-AC_TRY_COMPILE([],[#ifndef __SUNPRO_C
-#error Not a  SunPro compiler :-(
-******* ======= ******** &&&&&&&&
+
+dnl Identify compilers to enable compiler-specific hacks.
+dnl Add support for other compilers HERE!
+dnl GCC is already identified elsewhere.
+AC_TRY_RUN([int main () {
+#if defined __SUNPRO_C
+return 11;
+#elif defined __DECC
+return 12;
+#else
+return 0;
 #endif
-], __sunpro_c=yes, __sunpro_c=no)
-AC_MSG_RESULT($__sunpro_c)
+}], [],
+[case "$conftest_rc" in
+  11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
+  12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
+esac])
+
 
 dnl case "$canonical" in
 dnl   *-sun-sunos* ) test "$CPP" = "acc -E" && CPP="acc -E -Xs" ;;
@@ -1726,6 +1738,10 @@
 dnl Non-ordinary link usually requires -lc
 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
 
+dnl Compiler-specific hacks
+dnl DEC C requires -std
+test "$__DECC" = "yes" && XE_APPEND(-std, c_switch_site)
+
 dnl Calculalate value of CFLAGS:
 dnl Use either command line flag, environment var, or autodetection
 if test "$cflags_specified" = "no"; then
@@ -1739,15 +1755,17 @@
     dnl cygwin can't cope with -O3
     test "$opsys $machine" = "cygwin32 intel386" && \
       CFLAGS="-g -O2 -Wall -Wno-switch"
-  elif test "$__sunpro_c" = "yes"; then
+  elif test "$__SUNPRO_C" = "yes"; then
     case "$opsys" in
       sol2    ) CFLAGS="-v -xO4" ;;
       sunos4* ) CFLAGS="-xO2";;
     esac
+  elif test "$__DECC" = "yes"; then
+    CFLAGS="-O3"
   elif test "$CC" = "xlc"; then
     CFLAGS="-O3 -qstrict -qnoansialias -qlibansi -qinfo -qro -qmaxmem=20000"
+  dnl ### Add optimal CFLAGS support for other compilers HERE!
   else
-    dnl ### Add tests for other compilers here...
     CFLAGS="-O" ;dnl The only POSIX-approved flag
   fi
 fi
@@ -1889,7 +1907,7 @@
 if   test "$dynamic" = "no"; then add_runtime_path=no
 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes
 else case "$opsys" in
-       sol2 | irix* | *bsd* ) add_runtime_path=yes ;;
+       sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;;
        * ) add_runtime_path=no ;;
      esac
 fi
@@ -1898,14 +1916,19 @@
   dnl Try to autodetect runtime library flag (usually -R),
   dnl and whether it works (or at least does no harm)
   AC_MSG_CHECKING("for runtime libraries flag")
-  dash_r=""
-  for try_dash_r in "-R" "-R " "-rpath "; do
-    xe_check_libs="${try_dash_r}/no/such/file-or-directory"
-    XE_PROTECT_LINKER_FLAGS(xe_check_libs)
-    AC_TRY_LINK(, , dash_r="$try_dash_r")
-    xe_check_libs=""
-    test -n "$dash_r" && break
-  done
+  case "$opsys" in
+    sol2 ) dash_r="-R" ;;
+    decosf* | linux* ) dash_r="-rpath" ;;
+    *)
+      dash_r=""
+      for try_dash_r in "-R" "-R " "-rpath "; do
+        xe_check_libs="${try_dash_r}/no/such/file-or-directory"
+        XE_PROTECT_LINKER_FLAGS(xe_check_libs)
+        AC_TRY_LINK(, , dash_r="$try_dash_r")
+        xe_check_libs=""
+        test -n "$dash_r" && break
+      done ;;
+  esac
   if test -n "$dash_r";
     then AC_MSG_RESULT("\"${dash_r}\"")
     else AC_MSG_RESULT(NONE)
@@ -2281,6 +2304,9 @@
     fi
   done
 
+  dnl Avoid version mismatch for shared library libXm.so on osf4
+  if test "$GCC" = yes -a -d /usr/shlib; then XE_APPEND(-L/usr/shlib, X_LIBS); fi
+
   ld_switch_x_site="$X_LIBS"
 
   XE_COMPUTE_RUNPATH()
@@ -3467,7 +3493,7 @@
 #include <$path>
 ],[], db_h_path="$path"; break)
   done
-  if test -z "$db_h_path" 
+  if test -z "$db_h_path"
   then AC_MSG_RESULT(no); with_database_berkdb=no
   else AC_MSG_RESULT($db_h_path)
   fi
@@ -3623,7 +3649,7 @@
 fi
 
 dnl Create top level .sbinit for Sun compilers
-if test "$__sunpro_c" = "yes"; then
+if test "$__SUNPRO_C" = "yes"; then
   echo "creating .sbinit"; echo ""
   ( echo "# For use with Sun WorkShop's Source browser."
     echo "# See sbquery(1) and sbinit(4) for more information"