Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d1fc34d

Browse files
committed
Build and install libpython3.so.
1 parent 0dbebc0 commit d1fc34d

4 files changed

Lines changed: 32 additions & 1 deletion

File tree

Makefile.pre.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ DIST= $(DISTFILES) $(DISTDIRS)
166166
LIBRARY= @LIBRARY@
167167
LDLIBRARY= @LDLIBRARY@
168168
BLDLIBRARY= @BLDLIBRARY@
169+
PY3LIBRARY= @PY3LIBRARY@
169170
DLLLIBRARY= @DLLLIBRARY@
170171
LDLIBRARYDIR= @LDLIBRARYDIR@
171172
INSTSONAME= @INSTSONAME@
@@ -420,7 +421,7 @@ coverage:
420421

421422

422423
# Build the interpreter
423-
$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
424+
$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
424425
$(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
425426

426427
platform: $(BUILDPYTHON)
@@ -454,6 +455,9 @@ libpython$(LDVERSION).so: $(LIBRARY_OBJS)
454455
$(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
455456
fi
456457

458+
libpython3.so: libpython$(LDVERSION).so
459+
$(BLDSHARED) -o $@ -Wl,-hl$@ $^
460+
457461
libpython$(VERSION).dylib: $(LIBRARY_OBJS)
458462
$(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
459463

@@ -851,6 +855,9 @@ altbininstall: $(BUILDPYTHON)
851855
(cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
852856
fi \
853857
fi; \
858+
if test -n "$(PY3LIBRARY)"; then \
859+
$(INSTALL_SHARED) $(PY3LIBRARY) $(DESTDIR)$(LIBDIR)/$(PY3LIBRARY); \
860+
fi; \
854861
else true; \
855862
fi
856863

configure

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ LDVERSION
647647
RUNSHARED
648648
INSTSONAME
649649
LDLIBRARYDIR
650+
PY3LIBRARY
650651
BLDLIBRARY
651652
DLLLIBRARY
652653
LDLIBRARY
@@ -4710,6 +4711,7 @@ $as_echo "$LIBRARY" >&6; }
47104711
47114712
47124713
4714+
47134715
LDLIBRARY="$LIBRARY"
47144716
BLDLIBRARY='$(LDLIBRARY)'
47154717
INSTSONAME='$(LDLIBRARY)'
@@ -4906,6 +4908,10 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h
49064908
BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
49074909
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
49084910
INSTSONAME="$LDLIBRARY".$SOVERSION
4911+
if test $with_pydebug == no
4912+
then
4913+
PY3LIBRARY=libpython3.so
4914+
fi
49094915
;;
49104916
Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
49114917
LDLIBRARY='libpython$(LDVERSION).so'
@@ -4917,6 +4923,11 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h
49174923
;;
49184924
esac
49194925
INSTSONAME="$LDLIBRARY".$SOVERSION
4926+
PY3LIBRARY=libpython3.so
4927+
if test $with_pydebug == no
4928+
then
4929+
PY3LIBRARY=libpython3.so
4930+
fi
49204931
;;
49214932
hp*|HP*)
49224933
case `uname -m` in

configure.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ AC_MSG_RESULT($LIBRARY)
608608
AC_SUBST(LDLIBRARY)
609609
AC_SUBST(DLLLIBRARY)
610610
AC_SUBST(BLDLIBRARY)
611+
AC_SUBST(PY3LIBRARY)
611612
AC_SUBST(LDLIBRARYDIR)
612613
AC_SUBST(INSTSONAME)
613614
AC_SUBST(RUNSHARED)
@@ -737,6 +738,10 @@ if test $enable_shared = "yes"; then
737738
BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)'
738739
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
739740
INSTSONAME="$LDLIBRARY".$SOVERSION
741+
if test $with_pydebug == no
742+
then
743+
PY3LIBRARY=libpython3.so
744+
fi
740745
;;
741746
Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
742747
LDLIBRARY='libpython$(LDVERSION).so'
@@ -748,6 +753,11 @@ if test $enable_shared = "yes"; then
748753
;;
749754
esac
750755
INSTSONAME="$LDLIBRARY".$SOVERSION
756+
PY3LIBRARY=libpython3.so
757+
if test $with_pydebug == no
758+
then
759+
PY3LIBRARY=libpython3.so
760+
fi
751761
;;
752762
hp*|HP*)
753763
case `uname -m` in

pyconfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@
497497
/* Define to 1 if you have the `pause' function. */
498498
#undef HAVE_PAUSE
499499

500+
/* Define if the OS supports pipe2() */
501+
#undef HAVE_PIPE2
502+
500503
/* Define to 1 if you have the `plock' function. */
501504
#undef HAVE_PLOCK
502505

0 commit comments

Comments
 (0)