2000-10-09 13:46:02 -03:00
|
|
|
#!/bin/sh
|
1998-12-18 11:37:14 -04:00
|
|
|
#
|
2000-10-09 13:46:02 -03:00
|
|
|
# Truly fake ar, using a directory to store object files.
|
1998-12-18 11:37:14 -04:00
|
|
|
#
|
2000-10-09 13:46:02 -03:00
|
|
|
# Donn Cave, donn@oz.net
|
1998-12-18 11:37:14 -04:00
|
|
|
|
2000-10-09 13:46:02 -03:00
|
|
|
usage='Usage: ar-fake cr libpython.dir obj.o ...
|
|
|
|
ar-fake d libpython.dir obj.o ...
|
|
|
|
ar-fake so libpython.dir libpython.so'
|
1998-12-18 11:37:14 -04:00
|
|
|
|
2000-10-09 13:46:02 -03:00
|
|
|
case $# in
|
|
|
|
0|1|2)
|
|
|
|
echo "$usage" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
1998-12-18 11:37:14 -04:00
|
|
|
esac
|
|
|
|
|
2000-10-09 13:46:02 -03:00
|
|
|
command=$1
|
|
|
|
library=$2
|
|
|
|
shift 2
|
|
|
|
|
|
|
|
case $command in
|
|
|
|
cr)
|
|
|
|
if test -d $library
|
|
|
|
then :
|
|
|
|
else
|
|
|
|
mkdir $library
|
|
|
|
fi
|
|
|
|
if cp -p $* $library
|
|
|
|
then
|
|
|
|
# To force directory modify date, create or delete a file.
|
|
|
|
if test -e $library/.tch
|
|
|
|
then rm $library/.tch
|
|
|
|
else echo tch > $library/.tch
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
d)
|
|
|
|
if test -d $library
|
|
|
|
then
|
|
|
|
cd $library
|
|
|
|
rm -f $*
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
so)
|
|
|
|
case $BE_HOST_CPU in
|
|
|
|
ppc)
|
|
|
|
mwld -xms -export pragma -nodup -o $1 $library/*
|
|
|
|
;;
|
|
|
|
x86)
|
|
|
|
gcc -nostart -Wl,-soname=$(basename $1) -o $1 $library/*
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
status=$?
|
|
|
|
cd $(dirname $1)
|
|
|
|
ln -sf $PWD lib
|
|
|
|
exit $status
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "$usage" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|