3 # linkmodule for Python
4 # Chris Herborth (chrish@qnx.com)
6 # This is covered by the same copyright/licensing terms as the rest of
9 # Shell script to build shared library versions of the modules; since
10 # the change to the *ahem* "proper" import/export mechanism, this script
11 # is much simpler. It handles PowerPC and x86, too.
13 # This is called by the Modules/Makefile as $(LDSHARED):
15 # $(LDSHARED) foomodule.o -o foomodule$(SO)
17 # Could also be called as:
19 # $(LDSHARED) readline.o -L/boot/home/config/lib -lreadline -ltermcap \
22 # so we need to preserve the arguments, sort of.
24 # Make sure we got reasonable arguments.
28 while [ "$#" != "0" ]; do
30 -o) TARGET
="$2"; shift; shift;;
31 *) ARGS
="$ARGS $1"; shift;;
35 if [ "$TARGET" = "" ] ; then
38 echo " $0 [args] -o foomodule.so [args] foomodule.o [args]"
42 echo " [args] normal compiler arguments"
46 # The shared libraries and glue objects we need to link against; these
47 # libs are overkill for most of the standard modules, but it makes life
48 # in this shell script easier.
49 LIBS
="-lbe -lnet -lroot"
53 # Boy, do we need a lot of crap...
54 GLUE_LOC
=/boot
/develop
/lib
/ppc
55 GLUE
="${GLUE_LOC}/glue-noinit.a ${GLUE_LOC}/init_term_dyn.o"
57 4.0*) CC
="mwcc -xms -export pragma -nodup" ;;
58 *) CC
="mwcc -shared -export pragma -nodup" ;;
63 # We don't need as much crap here...
65 CC
="gcc -nostart -Wl,-soname=${TARGET}"
70 echo "$0 doesn't support $BE_HOST_CPU systems..."
71 echo "You're on your own... I'd be surprised if this works."
77 # Now link that shared lib...
78 $CC -o $TARGET $ARGS $GLUE $LIBS