mainAutoconf - Support: sr #110345, AC_PATH_X and friends should not...

 
 

sr #110345: AC_PATH_X and friends should not look in /usr/lib/<various>/include when cross compiling

Submitter:  Zack Weinberg <zackw>
Submitted:  Fri 30 Oct 2020 08:46:29 PM UTC
   
 
Priority:  * 5 - Unprioritized Severity:  3 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 02 Nov 2020 01:21:24 AM UTC, comment #1: 

Should be fixed in 33c3a47c04ab70a4dd54963fe433a171bc03747f.

Zack Weinberg <zackw>
Group administrator
Fri 30 Oct 2020 08:46:29 PM UTC, original submission:  

Reported by Ross Burton on the mailing list:

[Ross:]
AC_PATH_X and friends are unusual in autoconf in that they
explicitly look into /usr/ for files (see _AC_PATH_X_DIRECT).
Notable this is the only macro in autoconf that explicitly looks
into /usr.

To write the logic out in English: iterate through a long list of
paths in /usr for a X11/Xlib.h file, and if that exists try a compile
test.  Then iterate through the same set of paths after s/include/lib/
looking for anything with a library extension (.a .so .sl .dynlib .dll
.la) and if one is found try a link test.

The big failure case is in cross compilation situations using a
sysroot where the target is binary compatible with the host.  In this
case AC_PATH_X will happily look at /usr and say that yes, X is
available, even if the sysroot doesn't have X.

My preferred solution would be to delete AC_PATH_X and friends and get
everyone to use PKG_CHECK_MODULES(x11), but I can see that isn't a
realistic solution.  Because the failure case above is a real problem
for us, we just delete all of that code.  Does anyone have a better
solution that would continue to work but not be so dramatically
dependent on host assumptions?

[Zack:]
The thing that comes immediately to mind, and which would be feasible
for 2.70, is to not run _AC_PATH_X_DIRECT when cross-compiling.  I
don't think it's unreasonable to require people who want to
cross-compile X11 programs to either have the headers and libraries on
the cross-compiler's default search path, or use the --x-includes and
--x-libraries command line switches.  It might also make sense for
_AC_PATH_X_XMKMF to look for ${ac_tool_prefix}-xmkmf rather than plain
xmkmf, except I don't know if that would break existing cross compile
build farms.

Zack Weinberg <zackw>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by zackw (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-11-02 zackw StatusConfirmed Done
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code