Re: fink doesn't build with new xcode 5

Daniel Johnson <[email protected]> Thu, 19 Sep 2013 16:47:10 -0400
Newsgroups gmane.os.apple.fink.core
Message-ID <[email protected]>
On Sep 19, 2013, at 3:10 PM, Alexander Hansen <[email protected]> wrote:

> On 9/19/13 11:27 AM, Martin Costabel wrote:
>> costabel% fink list xcode
>> []
>> Information about 7895 packages read in 4 seconds.
>>   i   xcode                     5.0.0.0.1.13776663  []
>>   i   xcode.app                 5.0-1               []
>> 
>> In Xcode5 on OSX 10.8, there is no gcc any more; /usr/bin/gcc is clang:
>> 
>>> costabel% /usr/bin/gcc -v
>>> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
>>> Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
>>> Target: x86_64-apple-darwin12.5.0
>>> Thread model: posix
>> 
>> `fink rebuild fink` errors out, after building successfully, with
>> 
>>> Preparing to replace fink 0.35.1-71 (using .../fink_0.35.1-71_darwin-x86_64.deb) ...
>>> Unpacking replacement fink ...
>>> Setting up fink (0.35.1-71) ...
>>> Checking system... i386-apple-darwin12.5.0
>>> Under Mac OS X 10.8.5, Fink must be bootstrapped or updated with gcc
>>> 4.2, however, you currently have gcc (unknown version) selected.
>>> This typically is due to alteration of symlinks which were
>>> installed by Xcode. To correct this problem, you will need
>>> to restore the compiler symlinks to the configuration that
>>> Apple provides.
>>> /sw/bin/dpkg: error processing fink (--install):
>>>  subprocess post-installation script returned error exit status 29
>>> Errors were encountered while processing:
>>>  fink
>> 
> 
> It comes from the following in Services.pm:
> 
> sub gcc_selected {
> 	# this should work anywhere we support, really
> 	if (-l '/usr/bin/gcc') {
> 		my $link = readlink('/usr/bin/gcc');
> 		if ($link =~ /gcc-(\d+\.\d+)/) {
> 			return $1;
> 		} else {
> 			print STDERR "WARNING: /usr/bin/gcc is not a symlink!";
> 		}
> 	}
> 	return 0;
> }
> 
> There are two problems here:
> 
> 1)  [minor] The "print STDERR ..." item seems to be the wrong scope. 
> The inner else block should only be reached if /usr/bin/gcc _is_ a 
> symlink but to something that doesn't match the pattern.  This function 
> got modified a lot after we stopped supporting 10.4--probably my fault here.
> 
> 2)  Xcode 5 introduces a change in behavior in that /usr/bin/gcc is no 
> longer a symlink.
> 
> I don't know how necessary this test actually is--it's a leftover from 
> the period when folks needed to use "gcc_select" to switch the default 
> compiler.

I add a pull request at https://github.com/fink/fink/pull/85 as a possible fix for this. It Works For Me with Xcode 5 on 10.8.5. The other option is to rip out the check altogether, but that'll touch a lot more code.

Daniel

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk

_______________________________________________
fink-core mailing list
[email protected]
List archive:
http://news.gmane.org/gmane.os.apple.fink.core
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-core
signature.asc (application/pgp-signature, 801 B)
-----BEGIN PGP SIGNATURE-----

iQIcBAEBAgAGBQJSO2LOAAoJEHIZ9WxpsAjhKEkQAJLXIoLCBGVfGMiw7XJql4Ke
/RXQ/AnB0uQQnF83VcBv28vQJ7dUOtMdoK8A2xcsN9mI9sOSbRFlk9x1E2b17eLY
HRBJ0vyJ4klhQ5X5nq93eua01uQvz7Ueo8N0/l+GW/wCP3VoMItmk3CcTdxPIx4d
758I3JdaWmfEqYq47WbXFsTiprbZ/gyQOKbz9H69Ase8Y1HGtokI+LzAv0IJIbyo
xSfju+W1SPi1WiGwOdUyXnnI5HKoVq36+6TC84BHJhMmQUBMro1ra3d0b1dTIMuY
NeYvQiwTLmq9siCuX+h1NrQ3GXMMYvWy6pFIezIwNx/P5HYtGxFCYoAO4VammuaE
87wYqbliQ86bK6zMjsU554gDbcX+mrHUeS5LXNMqd3LICfWfr9XZSYahUUKamSrH
+HJ22zhS0eEmfhrC//lGBT/e2+hsen2bmNySbIdxBFlQoPvd08OTa/indT7xuNVX
62hYs5JwAPwMd4aUxWO2bjNgbllROjyvtcl7YGaoKlEHGsKeuzhbu+anucD+rYs4
4+SFUrxY5zEwJKGUuYzktTzW1ExhGIHBF9qO+PrY1mGTVzdbXD8/FWdq33HKbheZ
Rtv0jw94ome4BF4yPA0H8YEpztzkIb43k18NkeSuM3WwYKBAaBvIWawhxvXhRIJM
XN2Mz/3dACxwC/MjtUXj
=iu6c
-----END PGP SIGNATURE-----