*** AC_CHECK_DECL and AC_CHECK_DECLS will now detect missing declarations for
library functions that are also Clang compiler builtins.
+*** AC_PATH_X and AC_PATH_XTRA don’t search for X11 when cross-compiling.
+
+ Libraries and headers found by running xmkmf or searching /usr/X11,
+ /usr/X11R7, etc. are likely to belong to a native X11 installation
+ for the build machine and to be inappropriate for cross compilation.
+
+ To cross-compile programs that require X11, we recommend putting the
+ headers and libraries for the host system in your cross-compiler’s
+ default search paths. Alternatively, use configure’s --x-includes
+ and --x-libraries command line options to tell it where they are.
+
*** AC_PROG_CC is now defined via AC_DEFUN_ONCE.
This means configure scripts will no longer check repeatedly for the
# ----------
# Compute ac_cv_have_x.
AC_DEFUN([_AC_PATH_X],
+[AC_REQUIRE([AC_PROG_CC])]dnl To ensure that $cross_compiling is finalized.
[AC_CACHE_VAL(ac_cv_have_x,
[# One or both of the vars are not set, and there is no cached value.
-ac_x_includes=no ac_x_libraries=no
-_AC_PATH_X_XMKMF
-_AC_PATH_X_DIRECT
-case $ac_x_includes,$ac_x_libraries in #(
- no,* | *,no | *\'*)
- # Didn't find X, or a directory has "'" in its name.
- ac_cv_have_x="have_x=no";; #(
- *)
- # Record where we found X for the cache.
+ac_x_includes=no
+ac_x_libraries=no
+# Do we need to do anything special at all?
+ac_save_LIBS=$LIBS
+LIBS="-lX11 $LIBS"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@include <X11/Xlib.h>],
+ [XrmInitialize ()])],
+ [# We can compile and link X programs with no special options.
+ ac_x_includes=
+ ac_x_libraries=])
+LIBS="$ac_save_LIBS"
+# If that didn't work, only try xmkmf and filesystem searches
+# for native compilation.
+AS_IF([test x"$ac_x_includes" = xno && test "$cross_compiling" = no],
+ [_AC_PATH_X_XMKMF
+ _AC_PATH_X_DIRECT])
+# Record the results.
+AS_CASE([$ac_x_includes,$ac_x_libraries],
+ [no,* | *,no | *\'*],
+ [# Didn't find X, or a directory has "'" in its name.
+ ac_cv_have_x="have_x=no"],
+ [# Record where we found X for the cache.
ac_cv_have_x="have_x=yes\
ac_x_includes='$ac_x_includes'\
- ac_x_libraries='$ac_x_libraries'"
-esac])dnl
-])
+ ac_x_libraries='$ac_x_libraries'"])])])
# AC_PATH_X