perl 5.0 alpha 8
[p5sagit/p5-mst-13.2.git] / hints / 3b1cc
CommitLineData
b3634b01 1# To incorporate the 7300/3b1 shared library, run this script in place
2# of 'CC'.
3# First: Run 'Configure' through to the end and run 'make depend'.
4# Second: Edit 'makefile' ( not Makefile ) and set CC = 3b1cc.
5# Third: Edit 'x2p/makefile' and set CC = 3b1cc.
6#
7# Do not use '3b1cc' as the default compiler. The call to the default
8# compiler is used by 'perl' and will not be available when running
9# 'perl'.
10#
11# Note: This script omits libraries which are redundant in the shared
12# library. It is an excerpt from a grander version available upon
13# request from "zebra!vern" or "vern@zebra.alphacdc.com".
14
15CC="cc"
16LIBS=
17INCL=
18
19LD="ld"
20SHAREDLIB="/lib/crt0s.o /lib/shlib.ifile"
21
22# Local variables
23COBJS=
24LOBJS=
25TARG=
26FLAGS=
27CMD=
28
29# These are libraries which are incorporated in the shared library
30OMIT="-lmalloc"
31
32# These routines are in libc.a but not in the shared library
33if [ ! -f vsprintf.o -o ! -f doprnt.o ]
34then
35 echo "Extracting vsprintf.o from libc.a"
36 ar -x /lib/libc.a vsprintf.o doprnt.o
37fi
38
39CMD="$CC"
40while [ $# -gt 0 ]
41do
42 case $1 in
43 -c) CFLAG=$1;;
44 -o) CFLAG=$1
45 shift
46 TARG="$1";;
47 -l*) match=false
48 for i in $OMIT
49 do
50 [ "$i" = "$1" ] && match=true
51 done
52 [ "$match" != false ] || LIBS="$LIBS $1";;
53 -*) FLAGS="$FLAGS $1";;
54 *.c) COBJS="$COBJS $1";;
55 *.o) LOBJS="$LOBJS $1";;
56 *) TARG="$1";;
57 esac
58 shift
59done
60
61if [ -n "$COBJS" ]
62then
63 CMD="$CMD $FLAGS $INCL $LPATHS $LIBS $COBJS $CFLAG $TARG"
64elif [ -n "$LOBJS" ]
65then
66 LOBJS="$LOBJS vsprintf.o doprnt.o"
67 CMD="$LD -r $LOBJS $LPATHS $LIBS -o temp.o"
68 echo "\t$CMD"
69 $CMD
70 CMD="$LD -s temp.o $SHAREDLIB -o $TARG"
71 echo "\t$CMD"
72 $CMD
73 ccrslt=$?
74 if [ $ccrslt -ne 0 ]
75 then
76 exit $ccrslt
77 fi
78 CMD="rm -f temp.o"
79else
80 exit 1
81fi
82echo "\t$CMD"
83$CMD
84ccrslt=$?
85rm -f $$.c
86exit $ccrslt