Patch by Brian Gallew for DG/UX. I'm not quite sure what it does but

it seems harmless for other platforms.  It plays tricks with the name
of the library used to link with.  Apparently DG/UX really wants a
shared library to link with if it wants shared modules to use symbols
from the library.  I'm not sure why this wasn't an issue with 1.4;
DG/UX seems to be the only platform where moving to a single library
made things harder!

BTW This adds a target to create libpython$(VERSION).so; however this
target is *only* for DG/UX.
This commit is contained in:
Guido van Rossum 1997-12-18 23:55:32 +00:00
parent 8f4ceb168c
commit 3c4bb802d0
4 changed files with 238 additions and 198 deletions

View File

@ -170,6 +170,7 @@ python: $(LIBRARY) buildno
$(srcdir)/Modules/getbuildinfo.c $(srcdir)/Modules/getbuildinfo.c
$(AR) cr $(LIBRARY) getbuildinfo.o $(AR) cr $(LIBRARY) getbuildinfo.o
$(RANLIB) $(LIBRARY) $(RANLIB) $(LIBRARY)
@DGUX_IS_BROKEN@
cd Modules; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \ cd Modules; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \
prefix="$(prefix)" exec_prefix="$(exec_prefix)" \ prefix="$(prefix)" exec_prefix="$(exec_prefix)" \
LIBRARY=../$(LIBRARY) link LIBRARY=../$(LIBRARY) link
@ -191,6 +192,12 @@ $(LIBRARY): $(SUBDIRS)
for i in $(SUBDIRS); do \ for i in $(SUBDIRS); do \
(cd $$i; $(MAKE) VERSION="$(VERSION)" add2lib); done (cd $$i; $(MAKE) VERSION="$(VERSION)" add2lib); done
# This rule is only here for DG/UX!!!
libpython$(VERSION).so: $(LIBRARY)
test -d dgux || mkdir dgux
(cd dgux;ar x ../$^;ld -G -o ../$@ * )
/bin/rm -rf ./dgux
$(SUBDIRS): Makefiles $(SUBDIRS): Makefiles
Parser: Parser:
@ -245,6 +252,8 @@ altbininstall: python
fi; \ fi; \
done done
$(INSTALL_PROGRAM) python$(EXE) $(BINDIR)/python$(VERSION)$(EXE) $(INSTALL_PROGRAM) python$(EXE) $(BINDIR)/python$(VERSION)$(EXE)
@DGUX_IS_BROKEN@
test -f libpython$(VERSION).so && $(INSTALL_DATA) libpython$(VERSION).so $(LIBDIR)
# Install the manual page # Install the manual page
maninstall: maninstall:

View File

@ -100,6 +100,7 @@ MAINOBJ= python.o
SYSLIBS= $(LIBM) $(LIBC) SYSLIBS= $(LIBM) $(LIBC)
LIBRARY= ../libpython$(VERSION).a LIBRARY= ../libpython$(VERSION).a
REALLIBRARY= ../@REALLIBRARY@
# === Rules === # === Rules ===
@ -130,8 +131,8 @@ EXE=
# This target is used by the master Makefile to link the final binary. # This target is used by the master Makefile to link the final binary.
link: $(MAINOBJ) link: $(MAINOBJ)
$(LINKCC) $(LDFLAGS) $(OPT) $(LINKFORSHARED) $(MAINOBJ) \ $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \
$(LIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST) -L.. -lpython$(VERSION) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST)
mv python$(EXE) ../python$(EXE) mv python$(EXE) ../python$(EXE)
clean: clean:

408
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -135,6 +135,8 @@ then
case $ac_sys_system in case $ac_sys_system in
AIX*) AIX*)
LINKCC="\$(srcdir)/makexp_aix python.exp \"\" \$(LIBRARY); \$(PURIFY) \$(CC)";; LINKCC="\$(srcdir)/makexp_aix python.exp \"\" \$(LIBRARY); \$(PURIFY) \$(CC)";;
dgux*)
LINKCC="LD_RUN_PATH=$libdir \$(PURIFY) \$(CC)";;
*) LINKCC="\$(PURIFY) \$(CC)";; *) LINKCC="\$(PURIFY) \$(CC)";;
esac esac
fi fi
@ -146,6 +148,7 @@ AC_CHECK_PROGS(AR, ar aal, ar)
AC_SUBST(INSTALL) AC_SUBST(INSTALL)
AC_SUBST(INSTALL_PROGRAM) AC_SUBST(INSTALL_PROGRAM)
AC_SUBST(INSTALL_DATA) AC_SUBST(INSTALL_DATA)
AC_SUBST(REALLIBRARY)
# Install just never works :-( # Install just never works :-(
if test -z "$INSTALL" if test -z "$INSTALL"
then then
@ -180,6 +183,8 @@ fi
AC_AIX AC_AIX
AC_MINIX AC_MINIX
if test "$MACHDEP" != "dguxR4"
then
AC_MSG_CHECKING(whether $CC accepts -Olimit 1500) AC_MSG_CHECKING(whether $CC accepts -Olimit 1500)
AC_CACHE_VAL(ac_cv_olimit_ok, AC_CACHE_VAL(ac_cv_olimit_ok,
[ac_save_cc="$CC" [ac_save_cc="$CC"
@ -193,6 +198,7 @@ if test $ac_cv_olimit_ok = yes; then
OPT="$OPT -Olimit 1500" OPT="$OPT -Olimit 1500"
fi fi
AC_SUBST(DGUX_IS_BROKEN)
AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0) AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0)
AC_CACHE_VAL(ac_cv_opt_olimit_ok, AC_CACHE_VAL(ac_cv_opt_olimit_ok,
[ac_save_cc="$CC" [ac_save_cc="$CC"
@ -205,6 +211,13 @@ AC_MSG_RESULT($ac_cv_opt_olimit_ok)
if test $ac_cv_opt_olimit_ok = yes; then if test $ac_cv_opt_olimit_ok = yes; then
OPT="$OPT -OPT:Olimit=0" OPT="$OPT -OPT:Olimit=0"
fi fi
REALLIBRARY='libpython$(VERSION).a'
DGUX_IS_BROKEN="# dgux rule not included"
else
REALLIBRARY='libpython$(VERSION).so'
OPT="$OPT -pic"
DGUX_IS_BROKEN="make $REALLIBRARY"
fi
# check for ANSI or K&R ("traditional") preprocessor # check for ANSI or K&R ("traditional") preprocessor
AC_MSG_CHECKING(for C preprocessor type) AC_MSG_CHECKING(for C preprocessor type)
@ -279,6 +292,7 @@ then
DYNIX/ptx*) LDSHARED="ld -G";; DYNIX/ptx*) LDSHARED="ld -G";;
next/*) LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';; next/*) LDSHARED='$(CC) $(CFLAGS) -nostdlib -r';;
Linux*) LDSHARED="gcc -shared";; Linux*) LDSHARED="gcc -shared";;
dgux*) LDSHARED="ld -G";;
FreeBSD*|NetBSD*) LDSHARED="ld -Bshareable";; FreeBSD*|NetBSD*) LDSHARED="ld -Bshareable";;
SCO_SV*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";; SCO_SV*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";;
*) LDSHARED="ld";; *) LDSHARED="ld";;