Opened 4 years ago

Last modified 4 years ago

#1383 assigned defect

Use xcrun to find SDKROOT for Darwin-based systems

Reported by: eschaton Owned by: rme
Priority: normal Milestone:
Component: other Version: trunk
Keywords: Cc:

Description

In the Makefiles for Darwin-based systems, you can use the following to find the SDKROOT instead of hardcoding it to /:

SDKROOT = "$(shell xcrun --sdk macosx --show-sdk-path)"

That way people don’t have to have the Command Line Tools package installed to build CCL.

Change History (3)

comment:1 Changed 4 years ago by rme

  • Owner set to rme
  • Status changed from new to assigned

I have tried briefly in the past to make this work, but I ran into a couple of issues. One involved finding crt0.o, but I think if we link using the cc driver program rather than calling ld directly, that might solve that problem. Another issue might have been finding m4.

But I think I should be able to make it work, and I agree that it would be nice not to require the command-line tools package when Xcode is already installed.

comment:2 Changed 4 years ago by eschaton

Yeah, I think using cc instead of directly calling ld will work for that, the cc driver tries to be smart.

Also with a minimum OS of 10.8 or later, you don’t need to worry about crt1.o with ld either, I think requiring it for 10.7 and earlier was a matter of compatibility. Of course you may be intentionally keeping CCL runnable on 10.6, in which case that doesn’t help you…

comment:3 Changed 4 years ago by rme

(In [16792]) Use cc driver program to link. Get rid of SDKROOT, and just rely on whatever environment has been set up via xcode-select.

This enables the darwinx8664 lisp kernel to be built with or without the command-line tools being installed (provided that Xcode is installed, of course).

See ticket:1383.

Note: See TracTickets for help on using tickets.