Index: configure
--- configure.orig	2008-09-07 21:19:04 +0200
+++ configure	2008-10-02 18:39:15 +0200
@@ -3098,9 +3098,9 @@
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
   if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
+    CFLAGS="-O2"
   else
-    CFLAGS="-g"
+    CFLAGS=""
   fi
 else
   if test "$GCC" = yes; then
@@ -4530,7 +4530,7 @@
 		# debug builds.
 		OPT="-g -Wall $STRICT_PROTO"
 	    else
-		OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
+		OPT="$WRAP -O3 -Wall $STRICT_PROTO"
 	    fi
 	    ;;
 	*)
@@ -13198,7 +13198,7 @@
 		then
 			LINKFORSHARED="-Wl,--export-dynamic"
 		fi;;
-	SunOS/5*) case $CC in
+	SunOS/5*) case gcc in
 		  *gcc*)
 		    if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
 		    then
Index: setup.py
--- setup.py.orig	2008-09-30 02:15:45 +0200
+++ setup.py	2008-10-02 18:44:21 +0200
@@ -310,8 +310,8 @@
 
     def detect_modules(self):
         # Ensure that /usr/local is always used
-        add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-        add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+        
+        
 
         # Add paths specified in the environment variables LDFLAGS and
         # CPPFLAGS for header and library files.
@@ -612,8 +612,6 @@
                                depends = ['socketmodule.h']) )
         # Detect SSL support for the socket module (via _ssl)
         search_for_ssl_incs_in = [
-                              '/usr/local/ssl/include',
-                              '/usr/contrib/ssl/include/'
                              ]
         ssl_incs = find_file('openssl/ssl.h', inc_dirs,
                              search_for_ssl_incs_in
@@ -624,8 +622,7 @@
             if krb5_h:
                 ssl_incs += krb5_h
         ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
-                                     ['/usr/local/ssl/lib',
-                                      '/usr/contrib/ssl/lib/'
+                                     [
                                      ] )
 
         if (ssl_incs is not None and
@@ -740,14 +737,8 @@
         # top of the normal inc_dirs.
         db_inc_paths = [
             '/usr/include/db4',
-            '/usr/local/include/db4',
             '/opt/sfw/include/db4',
-            '/usr/include/db3',
-            '/usr/local/include/db3',
-            '/opt/sfw/include/db3',
-            # Fink defaults (http://fink.sourceforge.net/)
             '/sw/include/db4',
-            '/sw/include/db3',
         ]
         # 4.x minor number specific paths
         for x in gen_db_minor_ver_nums(4):
@@ -1537,6 +1528,7 @@
                 dotversion = dotversion[:-1] + '.' + dotversion[-1]
             tcl_include_sub = []
             tk_include_sub = []
+            dotversion = ''
             for dir in inc_dirs:
                 tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
                 tk_include_sub += [dir + os.sep + "tk" + dotversion]
