diff options
author | Peter Iannucci <iannucci@mit.edu> | 2012-05-03 04:16:28 -0400 |
---|---|---|
committer | Keith Winstein <keithw@mit.edu> | 2012-10-29 15:08:14 -0400 |
commit | 93507a7195de13fbcb9dbe4befb463883e04d3d6 (patch) | |
tree | 6a1aa915cb6a15dfd9859d578d739fb2e9bf4da1 /macosx | |
parent | 3e3510d382466d01b4ee34a3d5cc437e631565bd (diff) |
macosx: builds a universal package for i386, x86_64.
Diffstat (limited to 'macosx')
-rwxr-xr-x | macosx/build.sh | 66 |
1 files changed, 61 insertions, 5 deletions
diff --git a/macosx/build.sh b/macosx/build.sh index 81f7467..2d08801 100755 --- a/macosx/build.sh +++ b/macosx/build.sh @@ -1,22 +1,78 @@ #!/bin/bash +set -e + echo "Building into prefix..." -mkdir -p prefix +PREFIX=`pwd`/prefix +PREFIX_i386=`pwd`/prefix_i386 +PREFIX_x86_64=`pwd`/prefix_x86_64 +#PREFIX_ppc=`pwd`/prefix_ppc +#PREFIX_ppc64=`pwd`/prefix_ppc64 + +mkdir -p "$PREFIX" +mkdir -p "$PREFIX_i386" +mkdir -p "$PREFIX_x86_64" +#mkdir -p "$PREFIX_ppc" +#mkdir -p "$PREFIX_ppc64" pushd .. > /dev/null if [ ! -f configure ]; then echo "Running autogen." - ./autogen.sh + PATH=/opt/local/bin:$PATH ./autogen.sh fi -./configure --prefix=`pwd`/macosx/prefix +echo "Building for x86_64..." +./configure --prefix="$PREFIX_x86_64" ac_cv_poll_pty=no \ + CC="clang -arch x86_64" CPP="clang -arch x86_64 -E" CXX="clang++ -arch x86_64" \ + TINFO_LIBS=-lncurses protobuf_LIBS=/opt/local/lib/libprotobuf.a +make clean +make install -j8 +echo "Building for i386..." +./configure --prefix="$PREFIX_i386" ac_cv_poll_pty=no \ + CC="clang -arch i386" CPP="clang -arch i386 -E" CXX="clang++ -arch i386" \ + TINFO_LIBS=-lncurses protobuf_LIBS=/opt/local/lib/libprotobuf.a +make clean make install -j8 -perl -wlpi -e 's{#!/usr/bin/env perl}{#!/usr/bin/perl}' `pwd`/macosx/prefix/bin/mosh +#echo "Building for ppc..." +#./configure --prefix="$PREFIX_ppc" ac_cv_poll_pty=no \ +# --target=ppc-apple-darwin --build=i686-apple-darwin --host=ppc-apple-darwin \ +# CC="clang -arch ppc -mmacosx-version-min=10.5" CPP="clang -arch ppc -mmacosx-version-min=10.5 -E" CXX="clang++ -arch ppc -mmacosx-version-min=10.5" \ +# TINFO_LIBS=-lncurses protobuf_LIBS=/opt/local/lib/libprotobuf.a +#make clean +#make install -j8 +# +#echo "Building for ppc64..." +#./configure --prefix="$PREFIX_ppc64" ac_cv_poll_pty=no \ +# --target=ppc-apple-darwin --build=i686-apple-darwin --host=ppc-apple-darwin \ +# CC="clang -arch ppc64 -mmacosx-version-min=10.5" CPP="clang -arch ppc64 -mmacosx-version-min=10.5 -E" CXX="clang++ -arch ppc64 -mmacosx-version-min=10.5" \ +# TINFO_LIBS=-lncurses protobuf_LIBS=/opt/local/lib/libprotobuf.a +#make clean +#make install -j8 + +echo "Building universal binaries..." + +cp -r "$PREFIX_x86_64/" "$PREFIX/" + +strip "$PREFIX_i386/bin/mosh-client" +strip "$PREFIX_i386/bin/mosh-server" +strip "$PREFIX_x86_64/bin/mosh-client" +strip "$PREFIX_x86_64/bin/mosh-server" +#strip "$PREFIX_ppc/bin/mosh-client" +#strip "$PREFIX_ppc/bin/mosh-server" +#strip "$PREFIX_ppc64/bin/mosh-client" +#strip "$PREFIX_ppc64/bin/mosh-server" + +#lipo -create "$PREFIX_ppc/bin/mosh-client" "$PREFIX_ppc64/bin/mosh-client" "$PREFIX_i386/bin/mosh-client" "$PREFIX_x86_64/bin/mosh-client" -output "$PREFIX/bin/mosh-client" +#lipo -create "$PREFIX_ppc/bin/mosh-server" "$PREFIX_ppc64/bin/mosh-server" "$PREFIX_i386/bin/mosh-server" "$PREFIX_x86_64/bin/mosh-server" -output "$PREFIX/bin/mosh-server" +lipo -create "$PREFIX_i386/bin/mosh-client" "$PREFIX_x86_64/bin/mosh-client" -output "$PREFIX/bin/mosh-client" +lipo -create "$PREFIX_i386/bin/mosh-server" "$PREFIX_x86_64/bin/mosh-server" -output "$PREFIX/bin/mosh-server" + +perl -wlpi -e 's{#!/usr/bin/env perl}{#!/usr/bin/perl}' "$PREFIX/bin/mosh" popd > /dev/null @@ -39,7 +95,7 @@ done popd > /dev/null echo "Running PackageMaker..." -PackageMaker -d mosh-package.pmdoc -o "$OUTFILE" +PATH=/Applications/PackageMaker.app/Contents/MacOS:$PATH PackageMaker -d mosh-package.pmdoc -o "$OUTFILE" echo "Cleaning up..." rm -r "$OUTDIR" |