X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=distrib%2FMacFrameworks%2Fbuild-framework-gmp.sh;fp=distrib%2FMacFrameworks%2Fbuild-framework-gmp.sh;h=e3d7beb461956554f2f7fbab66e83f7f135798b7;hp=0000000000000000000000000000000000000000;hb=b98bec54f4de33f8f60af5c8506b108f676b71ed;hpb=83153fae8bfe23af0bd0bd5a8ea3e2776536a5fe diff --git a/distrib/MacFrameworks/build-framework-gmp.sh b/distrib/MacFrameworks/build-framework-gmp.sh new file mode 100644 index 0000000..e3d7beb --- /dev/null +++ b/distrib/MacFrameworks/build-framework-gmp.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# This is the shell script used to create this framework +# from the sources available from the GMP web page at +# http://www.swox.com/gmp/ +# To build your own, copy this file next to a GMP source tree, +# update the SrcDir variable if necessary and execute +# sh build-framework.sh + +SrcDir=gmp-4.2.1 +FrameworkName=GMP +FrameworkVersion=A +LibraryName=libgmp.dylib +ExtraThings="$SrcDir/StagingAreaPPC/info $SrcDir/README $SrcDir/COPYING.LIB $SrcDir/ChangeLog build-framework.sh" + +pushd $SrcDir || exit 1 + +make distclean +CFLAGS='-arch ppc' ./configure --enable-cxx --host=powerpc-apple-darwin --disable-static --enable-shared --prefix=`pwd`/StagingAreaPPC || exit 1 +make CCLD='gcc -Wc,-arch -Wc,ppc' || exit 1 +make install || exit 1 + +make distclean +CFLAGS='-arch i386' ./configure --enable-cxx --host=none-apple-darwin --disable-static --enable-shared --prefix=`pwd`/StagingAreaIntel || exit 1 +make CCLD='gcc -Wc,-arch -Wc,i386' || exit 1 +make install || exit 1 + +popd + + +rm -rf $FrameworkName.framework + +FWVDir=$FrameworkName.framework/Versions/$FrameworkVersion +mkdir -p $FWVDir + +cp -R $SrcDir/StagingAreaPPC/include $FWVDir/Headers +# cp $SrcDir/StagingArea/lib/$LibraryName $FWVDir/$FrameworkName +lipo -arch ppc $SrcDir/StagingAreaPPC/lib/$LibraryName -arch i386 $SrcDir/StagingAreaIntel/lib/$LibraryName -create -output $FWVDir/$FrameworkName + +install_name_tool -id $FWVDir/$FrameworkName $FWVDir/$FrameworkName + +ln -sf Versions/$FrameworkVersion/$FrameworkName $FrameworkName.framework/$FrameworkName +ln -sf Versions/$FrameworkVersion/Headers $FrameworkName.framework/Headers + +for i in $ExtraThings; do + cp -R $i $FrameworkName.framework/ +done + +echo "Framework $FrameworkName.framework created."