autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Check XMKMF variable, export CC for xmkmf


From: Pavel Roskin
Subject: Check XMKMF variable, export CC for xmkmf
Date: Thu, 25 Aug 2005 17:25:33 -0400

Hello!

Multi-arch systems are becoming common now, and it's often needed to
compile software for the non-default architecture.  Typical example is a
x86_64 system with i386 libraries installed.  Users may want to compile
for i386 to make packages for other systems or because the code is not
64-bit clean or because some libraries are 32-bit only.

A problem I keep encountering is correct detection of X11 libraries.
Fedora puts 64-bit libraries to /usr/X11R6/lib64 and 32-bit libraries
to /usr/X11R6/lib.  Detection using xmkmf would always
find /usr/X11R6/lib64 because x hardcodes gcc flags that force it to
generate 64-bit code.

Eventually xmkmf or imake would have to be rewritten to adapt to the
current target.  There are two things Autoconf could do to make it
easier.

One is the ability to select xmkmf using XMKMF environment variable.
Users would be able to use a different path to xmkmf or to set it to
"false" to force direct search for the X11 libraries.

Another helpful change would be exporting CC when running xmkmf.  imake
already uses $CC to determine the libc version.  Eventually it could
check the target architecture of $CC to give correct path to the
libraries.  This change is needed if CC is modified in the configure
script rather than specified on the command line.

ChangeLog:

        * lib/autoconf/libs.m4 (_AC_PATH_X_XMKMF): Use shell variable
        XMKMF to locate xmkmf.  Make XMKMF precious.  Export CC when
        running xmkmf.


--- lib/autoconf/libs.m4
+++ lib/autoconf/libs.m4
@@ -180,7 +180,8 @@
 # Internal subroutine of _AC_PATH_X.
 # Set ac_x_includes and/or ac_x_libraries.
 m4_define([_AC_PATH_X_XMKMF],
-[rm -f -r conftest.dir
+[AC_ARG_VAR(XMKMF, [Path to xmkmf, Makefile generator for X Window System])dnl
+rm -f -r conftest.dir
 if mkdir conftest.dir; then
   cd conftest.dir
   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
@@ -188,7 +189,7 @@
 acfindx:
        @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; 
ac_im_libdir="${LIBDIR}"'
 _ACEOF
-  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; 
then
     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.


-- 
Regards,
Pavel Roskin







reply via email to

[Prev in Thread] Current Thread [Next in Thread]