changeset 12319:b9adf75f0b29

Test whether XFree86 needs -b i486-linuxaout to link. Use this -b option only if it really improves matters. Report more clearly when there is no special dir to search for X includes or libraries.
author Richard M. Stallman <rms@gnu.org>
date Mon, 19 Jun 1995 18:50:13 +0000
parents 960d7332adc5
children 979836b1a1a9
files configure.in
diffstat 1 files changed, 51 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Mon Jun 19 18:44:44 1995 +0000
+++ b/configure.in	Mon Jun 19 18:50:13 1995 +0000
@@ -1143,13 +1143,49 @@
 fi
 AC_MSG_RESULT($HAVE_XFREE386)
 
-# We change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
-# for the tests that follow.
+# Change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
+# for the tests that follow.  We set it back to REAL_CFLAGS later on.
 
 if test "${HAVE_X11}" = "yes"; then
   DEFS="$C_SWITCH_X_SITE $DEFS"
   LIBS="$LD_SWITCH_X_SITE $LIBX $LIBS"
   CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
+
+  if test "${HAVE_XFREE386}" = "yes" && test "${opsys}" = "linux"; then
+    AC_MSG_CHECKING(whether XFree86 needs -b to link)
+    AC_TRY_LINK([],
+     [XOpenDisplay ("foo");],
+     [xfree86_first_failure=no],
+     [xfree86_first_failure=yes])
+    if test "${xfree86_first_failure}" = "yes"; then
+      OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
+      OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
+      OLD_CPPFLAGS="$CPPFLAGS"
+      OLD_LIBS="$LIBS"
+      LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
+      C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
+      CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
+      LIBS="$LIBS -b i486-linuxaout"
+      AC_TRY_LINK([],
+       [XOpenDisplay ("foo");],
+       [xfree86_second_failure=no],
+       [xfree86_second_failure=yes])
+      if test "${xfree86_second_failure}" = "yes"; then
+	# If we get the same failure with -b, there is no use adding -b.
+	# So take it out.  This plays safe.
+	LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE"
+	C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
+	CPPFLAGS="$OLD_CPPFLAGS"
+	LIBS="$OLD_LIBS"
+        AC_MSG_RESULT(no)
+      else
+        AC_MSG_RESULT(yes)
+      fi
+    else
+      AC_MSG_RESULT(no)
+    fi
+  fi
+
   AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
 XScreenNumberOfScreen XSetWMProtocols)
 fi
@@ -1278,7 +1314,6 @@
 
 #### Report on what we decided to do.
 echo "
-
 Configured for \`${canonical}'.
 
   Where should the build process find the source code?    ${srcdir}
@@ -1288,11 +1323,20 @@
   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
   Should Emacs use the relocating allocator for buffers?  ${REL_ALLOC}
   What window system should Emacs use?                    ${window_system}
-  What toolkit should Emacs use?                          ${USE_X_TOOLKIT}${x_includes+
-  Where do we find X Windows header files?                }${x_includes}${x_libraries+
-  Where do we find X Windows libraries?                   }${x_libraries}
+  What toolkit should Emacs use?                          ${USE_X_TOOLKIT}"
 
-"
+if test -n "${x_includes}"; then
+echo "  Where do we find X Windows header files?                ${x_includes}"
+else
+echo "  Where do we find X Windows header files?                Standard dirs"
+fi
+if test -n "${x_libraries}"; then
+echo "  Where do we find X Windows libraries?                   ${x_libraries}"
+else
+echo "  Where do we find X Windows libraries?                   Standard dirs"
+fi
+
+echo
 
 # Remove any trailing slashes in these variables.
 changequote(, )dnl