mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@78880 d073be05-634f-4543-b044-5fe20cf6d1d6
36 lines
733 B
Bash
Executable File
36 lines
733 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# http://archives.postgresql.org/pgsql-hackers/2006-04/msg00285.php
|
|
|
|
OFILES=""
|
|
RELOPT=""
|
|
OUTPUT=""
|
|
OTHERS=""
|
|
ARCHS="@UNIVERSAL_ARCHS@"
|
|
|
|
while [ "$#" != "0" ];
|
|
do
|
|
case "$1" in
|
|
-r) RELOPT="-r";;
|
|
-o) OUTPUT=`basename -s .o "$2"`; shift;;
|
|
*.o) OFILES="$OFILES $1";;
|
|
*) OTHERS="$OTHERS $1";;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
if [ "$RELOPT" == "-r" ];
|
|
then
|
|
echo ldfat $RELOPT -o $OUTPUT $OFILES $OTHERS
|
|
THIN_OBJS=""
|
|
for ARCH in $ARCHS; do
|
|
/usr/bin/ld -r -arch $ARCH -o ${OUTPUT}_${ARCH}.o $OFILES $OTHERS
|
|
THIN_OBJS+=" ${OUTPUT}_${ARCH}.o"
|
|
done
|
|
lipo -create -output ${OUTPUT}.o $THIN_OBJS
|
|
else
|
|
echo ld -o $OUTPUT $OFILES $OTHERS
|
|
/usr/bin/ld -o $OUTPUT $OFILES $OTHERS
|
|
fi
|
|
exit $?
|