Is isysroot useful for non-universal?
Daniel J. Luke
dluke at geeklair.net
Sun Mar 22 19:41:00 PDT 2009
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).
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 :) ).
>> 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?
> 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.
--
Daniel J. Luke
+========================================================+
| *---------------- dluke at geeklair.net ----------------* |
| *-------------- http://www.geeklair.net -------------* |
+========================================================+
| Opinions expressed are mine and do not necessarily |
| reflect the opinions of my employer. |
+========================================================+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20090322/8c471850/attachment.bin>
More information about the macports-dev
mailing list