python's LINKFORSHARED

Rainer Müller raimue at macports.org
Sun Sep 18 09:12:31 PDT 2016


Hello pythonXY maintainers,

in python27, the LINKFORSHARED config variable is broken:

$ python2.7 -c "import distutils.sysconfig; \
  conf = distutils.sysconfig.get_config_var; \
  print (conf('LINKFORSHARED'))"
-u _PyMac_Error Python.framework/Versions/2.7/Python

This value cannot be used for linking. However, this is the exact
command that is used in the current macros in ax_python_devel.m4 from
autoconf-archive [1]. With this value, linking a test program with
python27 will always fail.

All other python ports (really all of python24-26 and python31-36,
except python27) fix the LINKFORSHARED variable with a reinplace in
post-destroot. The very same reinplace existed in the python27 port, but
was removed in r108762:

  * remove non-working attempt to change LINKFORSHARED. Any dependents
  relying on this are broken anyway and should  be fixed to get the
  required info from python2.7-config (#39223)

https://trac.macports.org/changeset/108762
https://trac.macports.org/ticket/39223

I don't know what the correct solution would be, but either all python
ports should use the same approach (and have a broken LINKFORSHARED), or
python27 should also do what apparently works for the other ports.

This issue complicates writing ports with +pythonXY variants, as
+python27 needs to be special.

If LINKFORSHARED should really not be used, I would suggest to submit a
patch to autoconf-archive to get it fixed upstream instead of applying
workarounds in individual ports.

Rainer

[1]
http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob;f=m4/ax_python_devel.m4;hb=35f52877a6c1c8568575c2456fb1004e92839a82


More information about the macports-dev mailing list