Bug#233969: Fixes of AC_PATH_XTRA
The attached patch puts the corrected definitions of AC_PATH_XTRA and
related macros into acinclude.m4 and modifies configure.ac to use them
instead of broken ones. They really check the presence of libX11 and not
libXt. The original definitions were taken from /usr/share/autoconf/autoconf/libs.m4.
To regenerate the configure script, run aclocal and autoconf after
applying the patch. The resulting packages builds fine in pbuilder.
Jurij Smakov firstname.lastname@example.org
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC
diff -aurN xrender-0.8.3_orig/acinclude.m4 xrender-0.8.3/acinclude.m4
--- xrender-0.8.3_orig/acinclude.m4 1969-12-31 19:00:00.000000000 -0500
+++ xrender-0.8.3/acinclude.m4 2004-03-07 20:35:42.000000000 -0500
@@ -0,0 +1,272 @@
+# Internal subroutine of _AC_PATH_X.
+# Set ac_x_includes and/or ac_x_libraries.
+[# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+if test "$ac_x_includes" = no; then
+ # Guess where to find include files, by looking for Xlib.h.
+ # First, try using that file with no special directory specified.
+ AC_PREPROC_IFELSE([AC_LANG_SOURCE([@%:@include <X11/Xlib.h>])],
+[# We can compile using X headers with no special include directory.
+[for ac_dir in $ac_x_header_dirs; do
+ if test -r "$ac_dir/X11/Xlib.h"; then
+fi # $ac_x_includes = no
+if test "$ac_x_libraries" = no; then
+ # Check for the libraries.
+ # See if we find them without any special options.
+ # Don't add to $LIBS permanently.
+ LIBS="-lX11 $LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@include <X11/Xlib.h>],
+ [XrmInitialize ()])],
+# We can link X programs with no special library path.
+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+ # Don't even attempt the hair of trying to link an X program!
+ for ac_extension in a so sl; do
+ if test -r $ac_dir/libX11.$ac_extension; then
+ break 2
+fi # $ac_x_libraries = no
+# Compute ac_cv_have_x.
+[# One or both of the vars are not set, and there is no cached value.
+if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
+ # Didn't find X anywhere. Cache the known absence of X.
+ # 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"
+# If we find X, set shell vars x_includes and x_libraries to the
+# paths, otherwise set no_x=yes.
+# Uses ac_ vars as temps to allow command line to override cache and checks.
+# --without-x overrides everything else, but does not touch the cache.
+[dnl Document the X abnormal options inherited from history.
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR])dnl
+AC_ARG_WITH(x, [ --with-x use the X Window System])
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+ # The user explicitly disabled X.
+ if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+ # Both variables are already set.
+ eval "$ac_cv_have_x"
+fi # $with_x != no
+if test "$have_x" != yes; then
+ # If each of the values was on the command line, it overrides each guess.
+ test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+ # Update the cache value to reflect the command line values.
+ ac_cv_have_x="have_x=yes \
+ ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+ AC_MSG_RESULT([libraries $x_libraries, headers $x_includes])
+# Find additional X libraries, magic flags, etc.
+if test "$no_x" = yes; then
+ # Not all programs may use this symbol, but it does not hurt to define it.
+ AC_DEFINE([X_DISPLAY_MISSING], 1,
+ [Define to 1 if the X Window System is missing or not being used.])
+ X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+ if test -n "$x_includes"; then
+ X_CFLAGS="$X_CFLAGS -I$x_includes"
+ # It would also be nice to do this for all -L options, not just this one.
+ if test -n "$x_libraries"; then
+ X_LIBS="$X_LIBS -L$x_libraries"
+dnl FIXME: banish uname from this macro!
+ # For Solaris; some versions of Sun CC require a space after -R and
+ # others require no space. Words are not sufficient . . . .
+ case `(uname -sr) 2>/dev/null` in
+ "SunOS 5"*)
+ AC_MSG_CHECKING([whether -R must be followed by a space])
+ ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM()], ac_R_nospace=yes, ac_R_nospace=no)
+ if test $ac_R_nospace = yes; then
+ X_LIBS="$X_LIBS -R$x_libraries"
+ LIBS="$ac_xsave_LIBS -R $x_libraries"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM()], ac_R_space=yes, ac_R_space=no)
+ if test $ac_R_space = yes; then
+ X_LIBS="$X_LIBS -R $x_libraries"
+ AC_MSG_RESULT([neither works])
+ # Check for system-dependent libraries X programs must link with.
+ # Do this before checking for the system-independent R6 libraries
+ # (-lICE), since we may need -lsocket or whatever for X linking.
+ if test "$ISC" = yes; then
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+ # Martyn Johnson says this is needed for Ultrix, if the X
+ # libraries were built with DECnet support. And Karl Berry says
+ # the Alpha needs dnet_stub (dnet does not exist).
+ ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+ AC_LINK_IFELSE([AC_LANG_CALL(, [XOpenDisplay])],
+ [AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
+ if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+ AC_CHECK_LIB(dnet_stub, dnet_ntoa,
+ [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
+ # email@example.com says -lnsl (and -lsocket) are needed for his 386/AT,
+ # to get the SysV transport functions.
+ # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
+ # needs -lnsl.
+ # The nsl library prevents programs from opening the X display
+ # on Irix 5.2, according to T.E. Dickey.
+ # The functions gethostbyname, getservbyname, and inet_addr are
+ # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
+ if test $ac_cv_func_gethostbyname = no; then
+ AC_CHECK_LIB(nsl, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
+ if test $ac_cv_lib_nsl_gethostbyname = no; then
+ AC_CHECK_LIB(bsd, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd")
+ # firstname.lastname@example.org says without -lsocket,
+ # socket/setsockopt and other routines are undefined under SCO ODT
+ # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
+ # on later versions), says Simon Leinen: it contains gethostby*
+ # variants that don't use the name server (or something). -lsocket
+ # must be given before -lnsl if both are needed. We assume that
+ # if connect needs -lnsl, so does gethostbyname.
+ if test $ac_cv_func_connect = no; then
+ AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
+ # Guillermo Gomez says -lposix is necessary on A/UX.
+ if test $ac_cv_func_remove = no; then
+ AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
+ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+ if test $ac_cv_func_shmat = no; then
+ AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")
+ # Check for libraries that X11R6 Xt/Xaw programs need.
+ test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+ # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+ # check for ICE first), but we must link in the order -lSM -lICE or
+ # we get undefined symbols. So assume we have SM if we have ICE.
+ # These have to be linked with before -lX11, unlike the other
+ # libraries we check for below, so use a different variable.
+ # John Interrante, Karl Berry
+ AC_CHECK_LIB(ICE, IceConnectionNumber,
+ [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"], , $X_EXTRA_LIBS)
diff -aurN xrender-0.8.3_orig/configure.ac xrender-0.8.3/configure.ac
--- xrender-0.8.3_orig/configure.ac 2004-03-07 20:34:23.000000000 -0500
+++ xrender-0.8.3/configure.ac 2004-03-07 20:36:11.000000000 -0500
@@ -43,8 +43,8 @@
# Debian-maintained Xrender package sets AM_MAINTAINER_MODE
-# Check for X
+# Check for X (the definitions of corrected macros are in acinlude.m4)
if test "x$no_x" = "xyes"