You are here: Home Tech Building Python-2.7 on FreeBSD

Building Python-2.7 on FreeBSD

by Chris Shenton last modified Oct 27, 2010 11:43 AM
Building Plone failed because it couldn't find libraries, tweak build_ext.py to fix.

I had the issue identified on this python bugs message, also reported in FreeBSD ports list

/usr/libexec/elf/ld: cannot find -lpython2.5
The message also identified a fix that worked fine for me:
Index: build_ext.py
===================================================================
--- build_ext.py	(revision 77388)
+++ build_ext.py	(working copy)
@@ -280,7 +280,7 @@
         # Python's library directory must be appended to library_dirs
         sysconfig.get_config_var('Py_ENABLE_SHARED')
         if ((sys.platform.startswith('linux') or sys.platform.startswith('gnu')
-             or sys.platform.startswith('sunos'))
+             or sys.platform.startswith('sunos') or sys.platform.startswith('freebsd'))
             and sysconfig.get_config_var('Py_ENABLE_SHARED')):
             if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
                 # building third party extensions
 

Share this: