[SciPy-dev] Possible FreeBSD workaround

Robert Kern kern at caltech.edu
Wed Dec 11 12:46:51 CST 2002


If I understand the problem correctly, we need a way to replace 'cc'
with 'c++' or something similar on some systems. I propose checking for
the environment variable 'CXX' and using its contents to replace the
linker when it's defined. To compile on systems where gcc can't be
autodetected, simply define CXX appropriately in your shell.

A better solution might be to check .pydistutils.cfg for a [weave]
section or similar, but that's a little more involved.

Attached is a patch to build_tools.py . Please let me know if this
works. I don't have a FreeBSD machine to test on.

-- 
Robert Kern
Ruddock House President
kern at caltech.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter
-------------- next part --------------
Index: build_tools.py
===================================================================
RCS file: /home/cvsroot/world/scipy/weave/build_tools.py,v
retrieving revision 1.17
diff -c -r1.17 build_tools.py
*** build_tools.py	12 Oct 2002 01:43:39 -0000	1.17
--- build_tools.py	11 Dec 2002 18:41:46 -0000
***************
*** 38,44 ****
      # whatever.  This is a sane assumption, correct?
      # If the linker is gcc, set it to g++
      link_cmds = ld.split()    
!     if gcc_exists(link_cmds[0]):
          link_cmds[0] = 'g++'
          ld = ' '.join(link_cmds)
          distutils.sysconfig._config_vars['LDSHARED'] = ld   
--- 38,48 ----
      # whatever.  This is a sane assumption, correct?
      # If the linker is gcc, set it to g++
      link_cmds = ld.split()    
!     if os.getenv('CXX'):
!         link_cmds[0] = os.getenv('CXX')
!         ld = ' '.join(link_cmds)
!         distutils.sysconfig._config_vars['LDSHARED'] = ld
!     elif gcc_exists(link_cmds[0]):
          link_cmds[0] = 'g++'
          ld = ' '.join(link_cmds)
          distutils.sysconfig._config_vars['LDSHARED'] = ld   


More information about the Scipy-dev mailing list