annotate BeOS/linkmodule @ 9383:2b34461ba4a3 legacy-trunk

PyMapping_SetItemString() returns int, not an object.
author Guido van Rossum <guido@python.org>
date Fri, 16 Oct 1998 17:43:53 +0000
parents 0edd38db2288
children c2ec21c65d05
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8817
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 #! /bin/sh
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 #
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
3 # linkmodule for Python
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
4 # Chris Herborth (chrish@qnx.com)
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
5 #
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 # This is covered by the same copyright/licensing terms as the rest of
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 # Python
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 #
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
9 # Shell script to build shared library versions of the modules; the
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 # idea is to build an export list containing only the init*() function
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 # for the module. We _could_ assume for foomodule.o it was initfoo, but
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 # that's asking for trouble... this is a little less efficient but correct.
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 #
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 # This is called by the Modules/Makefile as $(LDSHARED):
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 #
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
16 # $(LDSHARED) foomodule.o -o foomodule$(SO)
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 #
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 # Could also be called as:
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 #
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 # $(LDSHARED) readline.o -L/boot/home/config/lib -lreadline -ltermcap \
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
21 # -o readline$(SO)
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
22
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 # Check to make sure we know what we're doing.
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
24 system="`uname -m`"
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
25 if [ "$system" != "BeMac" ] && [ "$system" != "BeBox" ] ; then
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 echo "Sorry, BeOS Python doesn't support x86 yet."
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 exit 1
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 fi
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
29
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 # Make sure we got reasonable arguments.
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 TARGET=""
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 ARGS=""
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
33
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 while [ "$#" != "0" ]; do
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 case "$1" in
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 -o) TARGET="$2"; shift; shift;;
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
37 *) ARGS="$ARGS $1"; shift;;
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
38 esac
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
39 done
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
40
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
41 if [ "$TARGET" = "" ] ; then
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
42 echo "Usage:"
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
43 echo
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
44 echo " $0 [args] -o foomodule.so [args] foomodule.o [args]"
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
45 echo
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
46 echo "Where:"
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
47 echo
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
48 echo " [args] normal mwcc arguments"
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
49 exit 1
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
50 fi
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
51
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
52 EXPORTS=${TARGET%.so}.exp
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
53
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
54 # The shared libraries and glue objects we need to link against; these
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
55 # libs are overkill for most of the standard modules, but it makes life
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
56 # in this shell script easier.
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
57 LIBS="-L.. -lpython1.5 -lbe -lnet -lroot"
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
58 GLUE="/boot/develop/lib/ppc/glue-noinit.a /boot/develop/lib/ppc/init_term_dyn.o"
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
59
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
60 # Check to see if we've already got an exports file; we don't need to
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
61 # update this once we've got it because we only ever want to export
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
62 # one symbol.
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
63 if [ ! -e $EXPORTS ] ; then
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
64 # The init*() function has to be related to the module's .so name
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
65 # for importdl to work.
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
66 echo init${TARGET%.so} | sed -e s/module// > $EXPORTS
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
67 fi
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
68
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
69 # Now link against the clean exports file.
0edd38db2288 Adding the BeOS port. More checkins to follow.
Guido van Rossum <guido@python.org>
parents:
diff changeset
70 mwcc -xms -f $EXPORTS -o $TARGET $ARGS $GLUE $LIBS -nodup