Is isysroot useful for non-universal?

Ryan Schmidt ryandesign at macports.org
Sun Mar 22 19:53:49 PDT 2009


On Mar 22, 2009, at 21:41, Daniel J. Luke wrote:

> On Mar 22, 2009, at 7:48 PM, Ryan Schmidt wrote:
>
>>> note that we'd need to use autoconf to check for the location of  
>>> the SDK (if we don't already) since it doesn't have to be  
>>> installed at /Developer/SDKs on 10.5.
>>
>> I've ignored this problem so far. I would be surprised if MacPorts  
>> would work if Xcode is installed in a different location. We  
>> should probably document somewhere that you should install Xcode  
>> in its standard location.
>
> Even if you install stuff not in /Developer gcc gets installed in  
> the 'normal' location, so things work fine (except for builds that  
> are looking for the sdk).

I believe there is a checkbox in the installer to not do that, so  
this is not necessarily so.


> It's probably reasonable to just add an autoconf check. Something  
> like:
>
> AC_PATH_PROG(XCODE_SELECT,xcode-select,no)
> if test $XCODE_SELECT = no; then
> 	SDKPATH="/Developer"
> else
> 	SDKPATH=`$XCODE_SELECT -print-path`
> fi
> SDK="$SDKPATH/SDKs/MacOSX10.4u.sdk"
> CFLAGS="$CFLAGS -isysroot $SDK -mmacosx-version-min=10.4"
> CXXFLAGS="$CXXFLAGS -isysroot $SDK -mmacosx-version-min=10.4"
> LDFLAGS="$LDFLAGS -isysroot $SDK -mmacosx-version-min=10.4"
>
> Although it would need to be modified to select the 10.5 sdk on  
> 10.5 or whatever the current policy is (I don't recall :) ).

Current policy is to use the SDK the user requested in macports.conf.


>>> Also, the last time I checked, with isysroot you only get the  
>>> stuff in the SDK so while it would fix looking in /usr/local, it  
>>> would also prevent looking in ${prefix} for headers and  
>>> libraries, which we don't want. There may be a way to work-around  
>>> that though.
>>
>> We currently build universal ports using isysroot, so this can't  
>> be a general problem, can it? Otherwise none of our universal  
>> ports would compile at all.
>
> I think there perhaps used to be some problem that no longer exists  
> that I was remembering (I added universal build support to a  
> project for work a while ago and I think I stumbled across the  
> problem at that time, see http://lists.apple.com/archives/Darwin- 
> dev/2006/Apr/msg00042.html).
>
> I guess isysroot doesn't work that way any more?

I believe that's the problem I described below:

>> There are some issues if you try to link with a library but don't  
>> use the appropriate -l flag. This happens often when software uses  
>> the -l flag for a library but doesn't include the -l flag for a  
>> library that library depends on. This causes an error message like
>>
>> can't open dynamic library: /Developer/SDKs/MacOSX10.4u.sdk/opt/ 
>> local/lib/libsomething.dylib
>>
>> on Tiger. See e.g.
>>
>> http://trac.macports.org/ticket/18035
>>
>> This does not appear to be a problem on Leopard.
>



More information about the macports-dev mailing list