Wireshark-dev: Re: [Wireshark-dev] macosx-setup.sh fails now
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Sat, 24 Jan 2015 15:15:21 -0800
On Jan 24, 2015, at 5:10 AM, Luc Dandoy <luc.dandoy@xxxxxxxxx> wrote:

> For SDK path detection wouldn't it be possible to use the xcode-select
> command?
> 
> Something like this in the configure.ac file should do the trick,

It won't do the trick of making macosx-setup.sh work, as that must be run before you can, on newer versions of OS X, even *generate* the configure script from configure.ac, much less *run* the configure script.  Anders was having a problem with macosx-setup.sh building Qt.

So something needs to be done in macosx-setup.sh.

> even if you are using a " beta " version of Xcode.
> 
> SDKPATH=`xcode-select - -p`/Platforms/MacOSX.platform/Developer/SDKs/"MacOSX$deploy_target.sdk"

The "-p" flag is a later addition - Xcode 3 didn't have it:

	snowleopard.local$ xcodebuild -version
	Xcode 3.2.6
	Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0
	BuildVersion: 10M2518
	snowleopard.local$ xcode-select -p
	Usage: xcode-select -print-path
	   or: xcode-select -switch <xcode_folder_path>
	   or: xcode-select -version
	Arguments:
	   -print-path                     Prints the path of the current Xcode folder
	   -switch <xcode_folder_path>     Sets the path for the current Xcode folder
	   -version                        Prints xcode-select version information

so what should be used is --print-path, not -p - --print-path, with two leading "-"s, works in Xcode 3.2.6 (and -print-path, with only one leading -, works in Xcode 6.1.1, but I'm less tempted to assume that will continue to work in the future).

However, on Xcode 3.2.6 again:

	snowleopard.local$ ls `xcode-select --print-path`/Platforms/MacOSX.platform/Developer/SDKs
	ls: /Developer/Platforms/MacOSX.platform/Developer/SDKs: No such file or directory

so that's not enough:

	snowleopard.local$ ls /Developer/SDKs
	MacOSX10.5.sdk	MacOSX10.6.sdk

On Xcode 6.1.1 on Yosemite, we have:

	yosemite.local$ xcrun --show-sdk-platform-path
	/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform

but on 3.2.6 on Snow Leopard:

	snowleopard.local$ xcrun --show-sdk-platform-path
	xcrun: error: unrecognized option: --show-sdk-platform-path

	usage: 
	xcrun [-verbose] [-no-cache] [-kill-cache] [-sdk <sdkroot>] [-log] [-run] <utility> [utility argument(s) ...]
	xcrun [-verbose] [-no-cache] [-kill-cache] [-sdk <sdkroot>] -find <utility> <tool> [tool arguments ...]

And, if we also want to support installing just the command-line tools, you also have to look in /Library/Developer/CommandLineTools/SDKs; however, I think Qt refuses to install if you don't have Xcode installed - the command-line tools aren't sufficient.