Install libpythonX.Y.a in /usr/lib instead of /usr/lib/pythonX.Y/config. https://bugs.gentoo.org/show_bug.cgi?id=252372 http://bugs.python.org/issue6103 --- Makefile.pre.in +++ Makefile.pre.in @@ -965,6 +965,19 @@ fi; \ else true; \ fi + @if test -f $(LIBRARY) && test $(LIBRARY) != $(LDLIBRARY); then \ + if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ + if test "$(SHLIB_SUFFIX)" = .dll; then \ + $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR); \ + else \ + $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBDIR); \ + $(RANLIB) $(DESTDIR)$(LIBDIR)/$(LIBRARY); \ + fi; \ + else \ + echo "Skipped install of $(LIBRARY) - use make frameworkinstall"; \ + fi; \ + else true; \ + fi bininstall: altbininstall -if test -f $(DESTDIR)$(BINDIR)/python3$(EXE) -o -h $(DESTDIR)$(BINDIR)/python3$(EXE); \ @@ -1199,18 +1212,6 @@ else true; \ fi; \ done - @if test -d $(LIBRARY); then :; else \ - if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ - if test "$(SHLIB_SUFFIX)" = .dll; then \ - $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ - else \ - $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ - $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ - fi; \ - else \ - echo Skip install of $(LIBRARY) - use make frameworkinstall; \ - fi; \ - fi $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in --- Misc/python-config.in +++ Misc/python-config.in @@ -47,11 +47,7 @@ elif opt in ('--libs', '--ldflags'): libs = getvar('LIBS').split() + getvar('SYSLIBS').split() libs.append('-lpython' + pyver + sys.abiflags) - # add the prefix/lib/pythonX.Y/config dir, but only if there is no - # shared library in prefix/lib/. if opt == '--ldflags': - if not getvar('Py_ENABLE_SHARED'): - libs.insert(0, '-L' + getvar('LIBPL')) if not getvar('PYTHONFRAMEWORK'): libs.extend(getvar('LINKFORSHARED').split()) print(' '.join(libs)) --- Modules/makesetup +++ Modules/makesetup @@ -89,7 +89,7 @@ then ExtraLibDir=. else - ExtraLibDir='$(LIBPL)' + ExtraLibDir='$(LIBDIR)' fi ExtraLibs="-L$ExtraLibDir -lpython\$(VERSION)";; esac