3 # This is the shell script used to create this framework
4 # from the sources available from the bash site at
5 # ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz
6 # To build your own, copy this script and the above gzip file
7 # into an empty directory, and run the following commands:
9 # tar -xzf readline-5.2.tar.gz
10 # sh build-framework.sh
15 FrameworkName=GNUreadline
17 LibraryName=libreadline.dylib
18 ExtraThings="$SrcDir/StagingArea/info $SrcDir/README $SrcDir/COPYING $SrcDir/CHANGELOG build-framework-readline.sh readline-5.2.tar.gz"
20 pushd $SrcDir || exit 1
22 # for getting cross compiled universal binaries running on ppc and i386
23 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
24 LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
27 ./configure --disable-dependency-tracking --disable-static --enable-shared --prefix=`pwd`/StagingArea || exit 1
30 make install || exit 1
34 rm -rf $FrameworkName.framework
36 FWVDir=$FrameworkName.framework/Versions/$FrameworkVersion
39 # Copy the header files into our new framework.
40 # Change declarations of #include <readline/*.h> to <GNUreadline/readline/*.h>, so that they reference the
41 # header files inside of this framework.
42 OLDINCLUDEDIR=$SrcDir/StagingArea/include/readline
43 NEWINCLUDEDIR=$FWVDir/Headers/readline
44 mkdir -p $NEWINCLUDEDIR
45 for i in `ls $OLDINCLUDEDIR`; do
46 sed 's/include <readline/include <GNUreadline\/readline/' $OLDINCLUDEDIR/$i > $NEWINCLUDEDIR/$i
48 cp $SrcDir/StagingArea/lib/$LibraryName $FWVDir/$FrameworkName
50 chmod u+w $FWVDir/$FrameworkName
52 install_name_tool -id $FWVDir/$FrameworkName $FWVDir/$FrameworkName
54 ln -sf Versions/$FrameworkVersion/$FrameworkName $FrameworkName.framework/$FrameworkName
55 ln -sf Versions/$FrameworkVersion/Headers $FrameworkName.framework/Headers
57 for i in $ExtraThings; do
58 cp -R $i $FrameworkName.framework/
61 echo "Framework $FrameworkName.framework created."
62 zip -qyr "$FrameworkName-framework.zip" "$FrameworkName.framework"
63 echo "... and zipped as $FrameworkName-framework.zip"