aboutsummaryrefslogtreecommitdiff
path: root/ports/libproxy/support-windows.patch
blob: fdbe801a0b79a2b04b0a2d3b14f68d4df1105289 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
diff --git a/cmake/paths.cmk b/cmake/paths.cmk
index 593ebc1..bbf8754 100644
--- a/cmake/paths.cmk
+++ b/cmake/paths.cmk
@@ -1,4 +1,4 @@
-if(WIN32 AND NOT MINGW)
+if(0)
   set(CMAKE_INSTALL_PREFIX ""               CACHE PATH "Install prefix")
   set(BIN_INSTALL_DIR      .                CACHE PATH "Binary install dir")
   set(LIB_INSTALL_DIR      .                CACHE PATH "Library install dir")
diff --git a/libproxy/cmake/devfiles.cmk b/libproxy/cmake/devfiles.cmk
index 0301dce..0eb5f83 100644
--- a/libproxy/cmake/devfiles.cmk
+++ b/libproxy/cmake/devfiles.cmk
@@ -1,4 +1,4 @@
-if(NOT WIN32 OR MINGW)
+if(1)
   # PkgConfig file
   set (PKGCONFIG_PREFIX ${CMAKE_INSTALL_PREFIX})
   
diff --git a/libproxy/cmake/libproxy.cmk b/libproxy/cmake/libproxy.cmk
index aab7593..465685f 100644
--- a/libproxy/cmake/libproxy.cmk
+++ b/libproxy/cmake/libproxy.cmk
@@ -21,5 +21,5 @@ set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/proxy.cpp
 set_target_properties(libproxy PROPERTIES PREFIX "" VERSION 1.0.0 SOVERSION 1)
 set_target_properties(libproxy PROPERTIES INTERFACE_LINK_LIBRARIES "")
 set_target_properties(libproxy PROPERTIES LINK_INTERFACE_LIBRARIES "")
-install(TARGETS libproxy DESTINATION ${LIB_INSTALL_DIR})
+install(TARGETS libproxy RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
 install(FILES   proxy.h  DESTINATION ${INCLUDE_INSTALL_DIR})
diff --git a/libproxy/modules/config_kde.cpp b/libproxy/modules/config_kde.cpp
index b9bd241..73b978e 100644
--- a/libproxy/modules/config_kde.cpp
+++ b/libproxy/modules/config_kde.cpp
@@ -19,7 +19,9 @@
  ******************************************************************************/
 
 #include <sys/stat.h>
+#if !defined(WIN32)
 #include <unistd.h>
+#endif
 
 #include <algorithm>
 #include <cstdlib>
@@ -137,7 +139,11 @@ private:
     string command_output(const string &cmdline) throw (runtime_error) {
         // Capture stderr as well
         const string command = "(" + cmdline + ")2>&1";
+#if !defined(WIN32)
         FILE *pipe = popen(command.c_str(), "r");
+#else
+        FILE *pipe = _popen(command.c_str(), "r");
+#endif
         if (!pipe)
             throw runtime_error("Unable to run command");
 
@@ -148,7 +154,11 @@ private:
                 result += buffer; // TODO: If this throws bad_alloc, pipe is leaked
         }
 
+#if !defined(WIN32)
         if(pclose(pipe) != 0)
+#else
+        if(_pclose(pipe) != 0)
+#endif
             throw runtime_error("Command failed");
 
         // Trim newlines and whitespace at end
diff --git a/libproxy/url.cpp b/libproxy/url.cpp
index b61a9bc..021763e 100644
--- a/libproxy/url.cpp
+++ b/libproxy/url.cpp
@@ -33,7 +33,9 @@
 #include <cstdlib>    // For atoi()
 #include <sys/stat.h> // For stat()
 #include <algorithm> // For transform()
+#if !defined(WIN32)
 #include <unistd.h>  // For read() close()
+#endif
 
 #ifdef WIN32
 #include <io.h>