Fix build of ocaml 3.12.1 on darwin

svn path=/nixpkgs/trunk/; revision=34373
This commit is contained in:
Marco Maggesi 2012-06-06 20:44:11 +00:00
parent 4b2c3d52de
commit cadc02cb2b
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,32 @@
diff -Nuar ocaml-3.12.1/configure ocaml-3.12.1-fix-configure/configure
--- ocaml-3.12.1/configure 2011-07-04 23:15:01.000000000 +0200
+++ ocaml-3.12.1-fix-configure/configure 2012-06-06 22:20:40.000000000 +0200
@@ -259,7 +259,7 @@
bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC"
mathlib="";;
*,*-*-darwin*)
- bytecccompopts="-fno-defer-pop -no-cpp-precomp $gcc_warnings"
+ bytecccompopts="-fno-defer-pop $gcc_warnings"
mathlib=""
# Tell gcc that we can use 32-bit code addresses for threaded code
# unless we are compiled for a shared library (-fPIC option)
@@ -739,7 +739,7 @@
*,*,rhapsody,*) nativecccompopts="$gcc_warnings -DDARWIN_VERSION_6 $dl_defs"
if $arch64; then partialld="ld -r -arch ppc64"; fi;;
*,gcc*,cygwin,*) nativecccompopts="$gcc_warnings -U_WIN32";;
- amd64,gcc*,macosx,*) partialld="ld -r -arch x86_64";;
+ amd64,gcc*,macosx,*) partialld="ld -r";;
amd64,gcc*,solaris,*) partialld="ld -r -m elf_x86_64";;
*,gcc*,*,*) nativecccompopts="$gcc_warnings";;
esac
@@ -752,8 +752,8 @@
asppprofflags='-pg -DPROFILING';;
alpha,*,*) as='as'
aspp='gcc -c';;
- amd64,*,macosx) as='as -arch x86_64'
- aspp='gcc -arch x86_64 -c';;
+ amd64,*,macosx) as='as'
+ aspp='gcc -c';;
amd64,*,solaris) as='as --64'
aspp='gcc -m64 -c';;
amd64,*,*) as='as'

View File

@ -20,7 +20,8 @@ stdenv.mkDerivation rec {
buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";
buildInputs = [ncurses] ++ optionals useX11 [ x11 ];
installTargets = "install" + optionalString useNativeCompilers " installopt";
patchPhase = ''
patches = optionals stdenv.isDarwin [ ./3.12.1-darwin-fix-configure.patch ];
preConfigure = ''
CAT=$(type -tp cat)
sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
'';