--- libproxy-0.4.7/libmodman/test/CMakeLists.txt-orig	2012-06-13 07:53:10.665392052 -0500
+++ libproxy-0.4.7/libmodman/test/CMakeLists.txt	2012-06-13 07:54:08.232674949 -0500
@@ -56,11 +56,6 @@ mm_create_program(condition condition)
 mm_create_program(singleton singleton)
 mm_create_program(sorted    sorted)
 mm_create_program(symbol    symbol)
-if (WIN32)
-  mm_create_program(symbollnk symbol ws2_32)
-else()
-  mm_create_program(symbollnk symbol z)
-endif()
 add_executable(builtin
                builtin.cpp
                ${CMAKE_CURRENT_BINARY_DIR}/builtin_one.cpp)
--- libproxy-0.4.7/libmodman/CMakeLists.txt-orig	2012-06-13 07:38:26.003797983 -0500
+++ libproxy-0.4.7/libmodman/CMakeLists.txt	2012-06-13 07:39:19.220607293 -0500
@@ -3,7 +3,7 @@
 if (WIN32)
   add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
 else(WIN32)
-  set(CMAKE_CXX_FLAGS "-fvisibility=hidden -fPIC ${CMAKE_CXX_FLAGS}")
+  set(CMAKE_CXX_FLAGS "-fPIC ${CMAKE_CXX_FLAGS}")
 endif(WIN32)
 include_directories(${CMAKE_SOURCE_DIR})
 
--- libproxy-0.4.7/libmodman/module.hpp-orig	2012-06-13 07:33:28.479264730 -0500
+++ libproxy-0.4.7/libmodman/module.hpp	2012-06-13 07:40:45.717700214 -0500
@@ -26,11 +26,16 @@
 #define MM_MODULE_BUILTIN
 #endif
 
+#ifdef __sun
+#define __MM_DLL_EXPORT
+#define __PRETTY_FUNCTION__ ""
+#else
 #ifdef _MSC_VER
 #define __MM_DLL_EXPORT __declspec(dllexport)
 #else
 #define __MM_DLL_EXPORT __attribute__ ((visibility("default")))
 #endif
+#endif
 
 #define __MM_MODULE_VERSION 2
 #define __MM_MODULE_VARNAME__(suffix, name) mm_ ## name ## _ ## suffix
--- libproxy-0.4.7/libproxy/proxy.cpp-orig	2012-06-13 07:55:21.066582099 -0500
+++ libproxy-0.4.7/libproxy/proxy.cpp	2012-06-13 07:57:20.061182803 -0500
@@ -17,6 +17,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
  ******************************************************************************/
 
+#define __EXTENSIONS__
+
 #include <vector>
 #include <cstring>   // For strdup()
 #include <iostream>  // For cerr
--- libproxy-0.4.7/libproxy/url.cpp-orig	2012-06-13 07:57:44.386937151 -0500
+++ libproxy-0.4.7/libproxy/url.cpp	2012-06-13 07:58:26.460469913 -0500
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
  *
  ******************************************************************************/
+
 #ifdef WIN32
 #include <io.h>
 #define open _open
@@ -33,6 +34,7 @@
 #include <cstdlib>    // For atoi()
 #include <sys/stat.h> // For stat()
 #include <algorithm> // For transform()
+#include <unistd.h>
 
 #ifdef WIN32
 #include <io.h>
--- libproxy-0.4.7/libproxy/modules/config_gnome3.cpp-orig	2012-06-13 08:47:50.981762532 -0500
+++ libproxy-0.4.7/libproxy/modules/config_gnome3.cpp	2012-06-13 08:48:10.533828713 -0500
@@ -17,6 +17,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
  ******************************************************************************/
 
+#define __EXTENSIONS__
+
 #include <cstdio>         // For fileno(), fread(), pclose(), popen(), sscanf()
 #include <sys/select.h>   // For select()
 #include <fcntl.h>        // For fcntl()
--- libproxy-0.4.7/libproxy/CMakeLists.txt-orig	2012-06-13 08:52:00.679126757 -0500
+++ libproxy-0.4.7/libproxy/CMakeLists.txt	2012-06-13 08:52:06.215743001 -0500
@@ -7,7 +7,6 @@ if (WIN32)
   add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
 else(WIN32)
   add_definitions(-D_POSIX_C_SOURCE=1)
-  set(CMAKE_CXX_FLAGS "-fvisibility=hidden ${CMAKE_CXX_FLAGS}")
 endif(WIN32)
 
 ### Modules
--- libproxy-0.4.7/libproxy/modules/pacrunner_mozjs.cpp-orig	2012-06-14 11:29:47.077964067 -0500
+++ libproxy-0.4.7/libproxy/modules/pacrunner_mozjs.cpp	2012-06-14 11:33:12.375089092 -0500
@@ -17,6 +17,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
  ******************************************************************************/
 
+#define __EXTENSIONS__
+
 #include <cstring> // ?
 
 #include "../extension_pacrunner.hpp"
@@ -32,6 +34,7 @@ using namespace libproxy;
 #endif
 #endif
 #include <jsapi.h>
+#include <unistd.h>
 #include "pacutils.h"
 
 #ifndef INET_ADDRSTRLEN
@@ -85,7 +88,8 @@ static JSBool myIpAddress(JSContext *cx,
 	if (!gethostname(hostname, 1023)) {
 		JSString *myhost = JS_NewStringCopyN(cx, hostname, strlen(hostname));
 		jsval arg = STRING_TO_JSVAL(myhost);
-		return dnsResolve_(cx, 1, &arg);
+                jsval onearg = INT_TO_JSVAL(1);
+		return dnsResolve_(cx, onearg, &arg);
 	}
 	JS_free(cx, hostname);
 	JS_SET_RVAL(cx, vp, JSVAL_NULL);
