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 the Python shared library properly; if we haven't
10 # already built the export list, we'll need to link twice (argh...) so we
11 # can eliminate some unwatnted global symbols from the system glue/init
14 # This is called by the Modules/Makefile as part of $(LINKCC):
16 # $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \
17 # -L.. -lpython$(VERSION) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST)
19 # In 1.5.1 this changed to:
21 # $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \
22 # $(LIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST)
24 # For BeOS we should set $(LINKCC) to this in configure (similar to the
27 # $(srcdir)../BeOS/linkcc $(LIBRARY) $(PURIFY) $(CC) $(OPT)
29 # -L.. -lpython$(VERSION) will automagically pick up the shared library.
31 # As of Python 1.5.2, this isn't strictly necessary, but it makes me
32 # feel safer. It makes sure we've got all the BeOS-specific libraries,
33 # and it creates the "lib" symlink that we'll need for chance of running
34 # "make test" successfully.
38 # What we want to end up with.
39 DYNAMIC
=${LIBRARY/.a/.so}
40 LINK_DYNAMIC
="-l$(basename ${DYNAMIC%.so} | sed -e s,lib,,)"
42 # Grab the rest of the args and build them into the command used to
43 # link the python binary. Make sure we link against the shared lib
44 # and not the static lib.
46 while [ "$#" != "0" ] ; do
49 LINK_CMD
="$LINK_CMD -L.. $LINK_DYNAMIC"
54 LINK_CMD
="$LINK_CMD $1"
60 # The shared libraries and glue objects we need to link against; this is
61 # a little overkill, but it'll be OK.
62 LIBS
="-lbe -lnet -lroot"
70 # We'll need this or the python binary won't load libpython.so... handy
72 ( cd ..
; ln -sf $
(pwd) lib
)
74 # Now build the python binary.
75 echo "Link command: $LINK_CMD $LIBS"