diff --git a/setup.py b/setup.py
index f764223..290fc53 100644
--- a/setup.py
+++ b/setup.py
@@ -19,6 +19,8 @@ from distutils.spawn import find_executable
 
 cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
 
+PATH_LINKS = os.getenv('PATH_LINKS')
+
 def get_platform():
     # cross build
     if "_PYTHON_HOST_PLATFORM" in os.environ:
@@ -105,7 +107,7 @@ def is_macosx_sdk_path(path):
     """
     Returns True if 'path' can be located in an OSX SDK
     """
-    return ( (path.startswith('/usr/') and not path.startswith('/usr/local'))
+    return ( (path.startswith('/usr/') and not path.startswith(PATH_LINKS + ''))
                 or path.startswith('/System/')
                 or path.startswith('/Library/') )
 
@@ -500,10 +502,10 @@ class PyBuildExt(build_ext):
             os.unlink(tmpfile)
 
     def detect_modules(self):
-        # Ensure that /usr/local is always used
+        # Ensure that /home/user/develop/tools/links is always used
         if not cross_compiling:
-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+            add_dir_to_list(self.compiler.library_dirs, PATH_LINKS + '/lib')
+            add_dir_to_list(self.compiler.include_dirs, PATH_LINKS + '/include')
         if cross_compiling:
             self.add_gcc_paths()
         self.add_multiarch_paths()
@@ -855,7 +857,7 @@ class PyBuildExt(build_ext):
                                libraries=math_libs) )
         # Detect SSL support for the socket module (via _ssl)
         search_for_ssl_incs_in = [
-                              '/usr/local/ssl/include',
+                              PATH_LINKS + '/include',
                               '/usr/contrib/ssl/include/'
                              ]
         ssl_incs = find_file('openssl/ssl.h', inc_dirs,
@@ -867,7 +869,7 @@ class PyBuildExt(build_ext):
             if krb5_h:
                 ssl_incs += krb5_h
         ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
-                                     ['/usr/local/ssl/lib',
+                                     [PATH_LINKS + '/lib',
                                       '/usr/contrib/ssl/lib/'
                                      ] )
 
@@ -992,10 +994,10 @@ class PyBuildExt(build_ext):
         # top of the normal inc_dirs.
         db_inc_paths = [
             '/usr/include/db4',
-            '/usr/local/include/db4',
+            PATH_LINKS + '/include/db4',
             '/opt/sfw/include/db4',
             '/usr/include/db3',
-            '/usr/local/include/db3',
+            PATH_LINKS + '/include/db3',
             '/opt/sfw/include/db3',
             # Fink defaults (http://fink.sourceforge.net/)
             '/sw/include/db4',
@@ -1005,8 +1007,8 @@ class PyBuildExt(build_ext):
         for x in gen_db_minor_ver_nums(4):
             db_inc_paths.append('/usr/include/db4%d' % x)
             db_inc_paths.append('/usr/include/db4.%d' % x)
-            db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
-            db_inc_paths.append('/usr/local/include/db4%d' % x)
+            db_inc_paths.append(PATH_LINKS + '/BerkeleyDB.4.%d/include' % x)
+            db_inc_paths.append(PATH_LINKS + '/include/db4%d' % x)
             db_inc_paths.append('/pkg/db-4.%d/include' % x)
             db_inc_paths.append('/opt/db-4.%d/include' % x)
             # MacPorts default (http://www.macports.org/)
@@ -1014,8 +1016,8 @@ class PyBuildExt(build_ext):
         # 3.x minor number specific paths
         for x in gen_db_minor_ver_nums(3):
             db_inc_paths.append('/usr/include/db3%d' % x)
-            db_inc_paths.append('/usr/local/BerkeleyDB.3.%d/include' % x)
-            db_inc_paths.append('/usr/local/include/db3%d' % x)
+            db_inc_paths.append(PATH_LINKS + '/BerkeleyDB.3.%d/include' % x)
+            db_inc_paths.append(PATH_LINKS + '/include/db3%d' % x)
             db_inc_paths.append('/pkg/db-3.%d/include' % x)
             db_inc_paths.append('/opt/db-3.%d/include' % x)
 
@@ -1166,9 +1168,9 @@ class PyBuildExt(build_ext):
         sqlite_inc_paths = [ '/usr/include',
                              '/usr/include/sqlite',
                              '/usr/include/sqlite3',
-                             '/usr/local/include',
-                             '/usr/local/include/sqlite',
-                             '/usr/local/include/sqlite3',
+                             PATH_LINKS + '/include',
+                             PATH_LINKS + '/include/sqlite',
+                             PATH_LINKS + '/include/sqlite3',
                            ]
         if cross_compiling:
             sqlite_inc_paths = []
