Ticket #1931: build-framework-R.sh

File build-framework-R.sh, 2.1 KB (added by judah, 6 years ago)

A new version of the script that generates GNUreadline.framework.

Line 
1
2#!/bin/sh
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:
8#
9# tar -xzf readline-5.2.tar.gz
10# sh build-framework.sh
11
12ONLY_COPY=0
13
14SrcDir=readline-5.2
15FrameworkName=GNUreadline
16FrameworkVersion=A
17LibraryName=libreadline.dylib
18ExtraThings="$SrcDir/StagingArea/info $SrcDir/README $SrcDir/COPYING $SrcDir/CHANGELOG build-framework-R.sh readline-5.2.tar.gz"
19
20pushd $SrcDir || exit 1
21
22# for getting cross compiled universal binaries running on ppc and i386
23CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
24LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
25export CFLAGS LDFLAGS
26
27./configure --disable-dependency-tracking --disable-static --enable-shared --prefix=`pwd`/StagingArea || exit 1
28make || exit 1
29make doc || exit 1
30make install || exit 1
31
32popd
33
34rm -rf $FrameworkName.framework
35
36FWVDir=$FrameworkName.framework/Versions/$FrameworkVersion
37mkdir -p $FWVDir
38
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.
42OLDINCLUDEDIR=$SrcDir/StagingArea/include/readline
43NEWINCLUDEDIR=$FWVDir/Headers/readline
44mkdir -p $NEWINCLUDEDIR
45for i in `ls $OLDINCLUDEDIR`; do
46    sed 's/include <readline/include <GNUreadline\/readline/' $OLDINCLUDEDIR/$i > $NEWINCLUDEDIR/$i
47done
48cp $SrcDir/StagingArea/lib/$LibraryName $FWVDir/$FrameworkName
49
50chmod u+w $FWVDir/$FrameworkName
51
52install_name_tool -id $FWVDir/$FrameworkName $FWVDir/$FrameworkName
53
54ln -sf Versions/$FrameworkVersion/$FrameworkName $FrameworkName.framework/$FrameworkName
55ln -sf Versions/$FrameworkVersion/Headers $FrameworkName.framework/Headers
56
57for i in $ExtraThings; do
58    cp -R $i $FrameworkName.framework/
59done
60
61echo "Framework $FrameworkName.framework created."
62zip -qyr "$FrameworkName-framework.zip" "$FrameworkName.framework"
63echo "... and zipped as $FrameworkName-framework.zip"