summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorjudah.jacobson@gmail.com <unknown>2007-12-17 23:57:35 +0000
committerjudah.jacobson@gmail.com <unknown>2007-12-17 23:57:35 +0000
commitb98bec54f4de33f8f60af5c8506b108f676b71ed (patch)
treec9ab105081d59e1eb24677c0797ca35f491f02f3 /distrib
parent83153fae8bfe23af0bd0bd5a8ea3e2776536a5fe (diff)
downloadhaskell-b98bec54f4de33f8f60af5c8506b108f676b71ed.tar.gz
Make MacFrameworks a subdirectory of distrib, since it isn't used in the normal building process.
Diffstat (limited to 'distrib')
-rw-r--r--distrib/MacFrameworks/Makefile31
-rw-r--r--distrib/MacFrameworks/README13
-rw-r--r--distrib/MacFrameworks/build-framework-gmp.sh48
-rw-r--r--distrib/MacFrameworks/build-framework-readline.sh63
4 files changed, 155 insertions, 0 deletions
diff --git a/distrib/MacFrameworks/Makefile b/distrib/MacFrameworks/Makefile
new file mode 100644
index 0000000000..9ebc118ad0
--- /dev/null
+++ b/distrib/MacFrameworks/Makefile
@@ -0,0 +1,31 @@
+READLINE_DIR = readline-5.2
+GMP_DIR = gmp-4.2.1
+
+all: GMP.framework GNUreadline.framework
+
+$(GMP_DIR).tar.gz:
+ cp ../../gmp/$(GMP_DIR).tar.gz .
+
+$(READLINE_DIR).tar.gz:
+ curl -O ftp://ftp.cwru.edu/pub/bash/$(READLINE_DIR).tar.gz
+
+$(GMP_DIR): $(GMP_DIR).tar.gz
+ tar -xzvf $(GMP_DIR).tar.gz
+
+$(READLINE_DIR): $(READLINE_DIR).tar.gz
+ tar -xzvf $(READLINE_DIR).tar.gz
+
+GMP.framework: $(GMP_DIR)
+ sh build-framework-gmp.sh
+
+GNUreadline.framework: $(READLINE_DIR)
+ sh build-framework-readline.sh
+
+clean:
+ rm -rf $(GMP_DIR) $(READLINE_DIR)
+ rm -rf GMP.framework GNUreadline.framework
+ rm -rf GMP-framework.zip GNUreadline-framework.zip
+
+cleanall: clean
+ rm -f $(GMP_DIR).tar.gz
+ rm -f $(READLINE_DIR).tar.gz
diff --git a/distrib/MacFrameworks/README b/distrib/MacFrameworks/README
new file mode 100644
index 0000000000..565b5da1b8
--- /dev/null
+++ b/distrib/MacFrameworks/README
@@ -0,0 +1,13 @@
+This directory is concerned with generating the following frameworks for use
+on OS X:
+
+GMP.framework
+GNUreadline.framework
+
+To make them, run 'make all' in this directory. (The first time that you
+run that command, the readline source file readline-5.2.tar.gz will be
+downloaded from the bash site ftp.cwru.edu into this directory.)
+
+Once you've built the frameworks, you should copy them into
+/Library/Frameworks. All subsequent builds of ghc will automatically use
+them as dependencies.
diff --git a/distrib/MacFrameworks/build-framework-gmp.sh b/distrib/MacFrameworks/build-framework-gmp.sh
new file mode 100644
index 0000000000..e3d7beb461
--- /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."
diff --git a/distrib/MacFrameworks/build-framework-readline.sh b/distrib/MacFrameworks/build-framework-readline.sh
new file mode 100644
index 0000000000..ef227cab45
--- /dev/null
+++ b/distrib/MacFrameworks/build-framework-readline.sh
@@ -0,0 +1,63 @@
+
+#!/bin/sh
+# This is the shell script used to create this framework
+# from the sources available from the bash site at
+# ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz
+# To build your own, copy this script and the above gzip file
+# into an empty directory, and run the following commands:
+#
+# tar -xzf readline-5.2.tar.gz
+# sh build-framework.sh
+
+ONLY_COPY=0
+
+SrcDir=readline-5.2
+FrameworkName=GNUreadline
+FrameworkVersion=A
+LibraryName=libreadline.dylib
+ExtraThings="$SrcDir/StagingArea/info $SrcDir/README $SrcDir/COPYING $SrcDir/CHANGELOG build-framework-readline.sh readline-5.2.tar.gz"
+
+pushd $SrcDir || exit 1
+
+# for getting cross compiled universal binaries running on ppc and i386
+CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
+LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
+export CFLAGS LDFLAGS
+
+./configure --disable-dependency-tracking --disable-static --enable-shared --prefix=`pwd`/StagingArea || exit 1
+make || exit 1
+make doc || exit 1
+make install || exit 1
+
+popd
+
+rm -rf $FrameworkName.framework
+
+FWVDir=$FrameworkName.framework/Versions/$FrameworkVersion
+mkdir -p $FWVDir
+
+# Copy the header files into our new framework.
+# Change declarations of #include <readline/*.h> to <GNUreadline/readline/*.h>, so that they reference the
+# header files inside of this framework.
+OLDINCLUDEDIR=$SrcDir/StagingArea/include/readline
+NEWINCLUDEDIR=$FWVDir/Headers/readline
+mkdir -p $NEWINCLUDEDIR
+for i in `ls $OLDINCLUDEDIR`; do
+ sed 's/include <readline/include <GNUreadline\/readline/' $OLDINCLUDEDIR/$i > $NEWINCLUDEDIR/$i
+done
+cp $SrcDir/StagingArea/lib/$LibraryName $FWVDir/$FrameworkName
+
+chmod u+w $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."
+zip -qyr "$FrameworkName-framework.zip" "$FrameworkName.framework"
+echo "... and zipped as $FrameworkName-framework.zip"