update submodules for GHC.HetMet.GArrow -> Control.GArrow renaming
[ghc-hetmet.git] / distrib / MacFrameworks / build-framework-gmp.sh
1 #!/bin/sh
2 # This is the shell script used to create this framework
3 # from the sources available from the GMP web page at
4 # http://www.swox.com/gmp/
5 # To build your own, copy this file next to a GMP source tree,
6 # update the SrcDir variable if necessary and execute
7 # sh build-framework.sh
8
9 SrcDir=gmp-4.2.1
10 FrameworkName=GMP
11 FrameworkVersion=A
12 LibraryName=libgmp.dylib
13 ExtraThings="$SrcDir/StagingAreaPPC/info $SrcDir/README $SrcDir/COPYING.LIB $SrcDir/ChangeLog build-framework.sh"
14
15 pushd $SrcDir || exit 1
16
17 make distclean
18 CFLAGS='-arch ppc' ./configure --enable-cxx --host=powerpc-apple-darwin --disable-static --enable-shared --prefix=`pwd`/StagingAreaPPC || exit 1
19 make CCLD='gcc -Wc,-arch -Wc,ppc' || exit 1
20 make install || exit 1
21
22 make distclean
23 CFLAGS='-arch i386' ./configure --enable-cxx --host=none-apple-darwin --disable-static --enable-shared --prefix=`pwd`/StagingAreaIntel || exit 1
24 make CCLD='gcc -Wc,-arch -Wc,i386' || exit 1
25 make install || exit 1
26
27 popd
28
29
30 rm -rf $FrameworkName.framework
31
32 FWVDir=$FrameworkName.framework/Versions/$FrameworkVersion
33 mkdir -p $FWVDir
34
35 cp -R $SrcDir/StagingAreaPPC/include $FWVDir/Headers
36 # cp $SrcDir/StagingArea/lib/$LibraryName $FWVDir/$FrameworkName
37 lipo -arch ppc $SrcDir/StagingAreaPPC/lib/$LibraryName -arch i386 $SrcDir/StagingAreaIntel/lib/$LibraryName -create -output $FWVDir/$FrameworkName
38
39 install_name_tool -id $FWVDir/$FrameworkName $FWVDir/$FrameworkName
40
41 ln -sf Versions/$FrameworkVersion/$FrameworkName $FrameworkName.framework/$FrameworkName
42 ln -sf Versions/$FrameworkVersion/Headers $FrameworkName.framework/Headers
43
44 for i in $ExtraThings; do
45     cp -R $i $FrameworkName.framework/
46 done
47
48 echo "Framework $FrameworkName.framework created."