[pypy-svn] r74648 - in pypy/trunk/pypy: rlib translator/platform

wildchild at codespeak.net wildchild at codespeak.net
Fri May 21 20:10:53 CEST 2010


Author: wildchild
Date: Fri May 21 20:10:51 2010
New Revision: 74648

Modified:
   pypy/trunk/pypy/rlib/rlocale.py
   pypy/trunk/pypy/translator/platform/__init__.py
   pypy/trunk/pypy/translator/platform/darwin.py
   pypy/trunk/pypy/translator/platform/freebsd7.py
Log:
Removing a Darwin hardcoded include path.
Adding a more "general" way of adding platform related includes/libraries path.
For FreeBSD, all ports are always installed in /usr/local, /usr is for the base system.
For MacOS /opt/local is the default installation path for MacPorts and /usr/local for Homebrew and self-compiled packages.

In a not so far future, user provided CFLAGS and LDFLAGS should be used to provide non-standard paths.


Modified: pypy/trunk/pypy/rlib/rlocale.py
==============================================================================
--- pypy/trunk/pypy/rlib/rlocale.py	(original)
+++ pypy/trunk/pypy/rlib/rlocale.py	Fri May 21 20:10:51 2010
@@ -17,7 +17,6 @@
 
 class CConfig:
     includes = ['locale.h', 'limits.h']
-    include_dirs = []
 
     if HAVE_LANGINFO:
         includes += ['langinfo.h']
@@ -25,11 +24,8 @@
         includes += ['libintl.h']
     if sys.platform == 'win32':
         includes += ['windows.h']
-    if sys.platform == 'darwin':
-        include_dirs += ['/opt/local/include']
     _compilation_info_ = ExternalCompilationInfo(
-        includes=includes,
-        include_dirs=include_dirs
+        includes=includes
     )
     HAVE_BIND_TEXTDOMAIN_CODESET = platform.Has('bind_textdomain_codeset')
     lconv = platform.Struct("struct lconv", [

Modified: pypy/trunk/pypy/translator/platform/__init__.py
==============================================================================
--- pypy/trunk/pypy/translator/platform/__init__.py	(original)
+++ pypy/trunk/pypy/translator/platform/__init__.py	Fri May 21 20:10:51 2010
@@ -113,7 +113,6 @@
                 log.WARNING(line)
 
     def _preprocess_include_dirs(self, include_dirs):
-        # hook for maemo
         return include_dirs
 
     def _compile_args_from_eci(self, eci, standalone):
@@ -125,9 +124,13 @@
             extra = self.shared_only
         cflags = self.cflags + extra
         return (cflags + list(eci.compile_extra) + args)
+    
+    def _preprocess_library_dirs(self, library_dirs):
+        return library_dirs
 
     def _link_args_from_eci(self, eci, standalone):
-        library_dirs = self._libdirs(eci.library_dirs)
+        library_dirs = self._preprocess_library_dirs(eci.library_dirs)
+        library_dirs = self._libdirs(library_dirs)
         libraries = self._libs(eci.libraries)
         link_files = self._linkfiles(eci.link_files)
         return (library_dirs + self.link_flags +

Modified: pypy/trunk/pypy/translator/platform/darwin.py
==============================================================================
--- pypy/trunk/pypy/translator/platform/darwin.py	(original)
+++ pypy/trunk/pypy/translator/platform/darwin.py	Fri May 21 20:10:51 2010
@@ -20,6 +20,18 @@
     def _args_for_shared(self, args):
         return (self.shared_only + ['-dynamiclib', '-undefined', 'dynamic_lookup']
                                  + args)
+    
+    def _preprocess_include_dirs(self, include_dirs):
+        res_incl_dirs = [dir for dir in include_dirs]
+        res_incl_dirs.append('/usr/local/include') # Homebrew
+        res_incl_dirs.append('/opt/local/include') # MacPorts
+        return res_incl_dirs
+
+    def _preprocess_library_dirs(self, library_dirs):
+        res_lib_dirs = [dir for dir in library_dirs]
+        res_lib_dirs.append('/usr/local/lib') # Homebrew
+        res_lib_dirs.append('/opt/local/lib') # MacPorts
+        return res_lib_dirs
 
     def include_dirs_for_libffi(self):
         return ['/usr/include/ffi']

Modified: pypy/trunk/pypy/translator/platform/freebsd7.py
==============================================================================
--- pypy/trunk/pypy/translator/platform/freebsd7.py	(original)
+++ pypy/trunk/pypy/translator/platform/freebsd7.py	Fri May 21 20:10:51 2010
@@ -15,6 +15,16 @@
     def _args_for_shared(self, args):
         return ['-shared'] + args
 
+    def _preprocess_include_dirs(self, include_dirs):
+        res_incl_dirs = [dir for dir in include_dirs]
+        res_incl_dirs.append('/usr/local/include')
+        return res_incl_dirs
+
+    def _preprocess_library_dirs(self, library_dirs):
+        res_lib_dirs = [dir for dir in library_dirs]
+        res_lib_dirs.append('/usr/local/lib')
+        return res_lib_dirs
+
     def include_dirs_for_libffi(self):
         return ['/usr/local/include']
 



More information about the Pypy-commit mailing list