$NetBSD$

--- setupext.py.orig	2010-07-07 01:41:55.000000000 +0000
+++ setupext.py
@@ -201,12 +201,8 @@ else:
     print_status = print_message = print_raw = print_line
 
 def run_child_process(cmd):
-    p = subprocess.Popen(cmd, shell=True,
-                         stdin=subprocess.PIPE,
-                         stdout=subprocess.PIPE,
-                         stderr=subprocess.STDOUT,
-                         close_fds=(sys.platform != 'win32'))
-    return p.stdin, p.stdout
+    import os
+    return None, os.popen(cmd + " 2>&1")
 
 class CleanUpFile:
     """CleanUpFile deletes the specified filename when self is destroyed."""
@@ -344,11 +340,8 @@ def check_for_libpng():
     return True
 
 def add_base_flags(module):
-    incdirs = filter(os.path.exists,
-                     [os.path.join(p, 'include') for p in basedirlist ])
-    libdirs = filter(os.path.exists,
-                     [os.path.join(p, 'lib')     for p in basedirlist ]+
-                     [os.path.join(p, 'lib64')     for p in basedirlist ] )
+    incdirs = [os.path.join(os.environ['LOCALBASE'], 'include')]
+    libdirs = [os.path.join(os.environ['LOCALBASE'], 'lib')]
 
     module.include_dirs.extend(incdirs)
     module.include_dirs.append('.')
