macosx: builds a universal package for i386, x86_64.
This commit is contained in:
committed by
Keith Winstein
parent
3e3510d382
commit
93507a7195
+62
-6
@@ -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
|
||||
|
||||
perl -wlpi -e 's{#!/usr/bin/env perl}{#!/usr/bin/perl}' `pwd`/macosx/prefix/bin/mosh
|
||||
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
|
||||
|
||||
#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"
|
||||
|
||||
Reference in New Issue
Block a user