Problem configuring with --with-specs

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

 



Building on macOS, where we *must* use an SDK, and there’s a choice of two: Xcode or Command Line Tools. The filesystem locations of the SDKs is different, but the effective content is the same.

I wish to support users who may have installed either (or both!) of the SDKs, without forcing them to specify which  (e.g. via —sysroot=$XCODE or —sysroot=$CLT).

What I’ve come up with is this configure line:

    --with-specs="%{!sysroot=*:--sysroot=%:if-exists-else($XCODE $CLT)}" 

the idea of which is that if the user doesn’t specify —sysroot, the compiler will select XCODE if found, CLT if not.

If the user *does* specify —sysroot=foo, the compiler sees

COLLECT_GCC_OPTIONS='-v' \
  '--sysroot=foo' \                                                             <<<<<<<<<<<<<
  '-mmacosx-version-min=15.0.0' \
  '-asm_macosx_version_min=15.0' \
  '-nodefaultexport' \
  '-mcpu=apple-m1' \
  '-mlittle-endian' \
  '-mabi=lp64' \
  '--sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' \     <<<<<<<<<<< (CLT)
  '-dumpdir' \
  'a-'

which means that the —sysroot setting from the command line is overridden by the later setting derived from the —with-specs configure option.

How can I make it so that if the user *does* specify —sysroot, their choice prevents the compiler selecting the one derived from the —with-specs setting?



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux