minor updates from windows, getting gnu windows to compile slightly further
authorChris Koeritz <fred@gruntose.com>
Mon, 26 Sep 2016 20:22:42 +0000 (16:22 -0400)
committerChris Koeritz <fred@gruntose.com>
Mon, 26 Sep 2016 20:22:42 +0000 (16:22 -0400)
but we keep getting blocked by incompatibilities under cygwin.

nucleus/applications/bundler/makefile
nucleus/applications/bundler/makefile.stub
nucleus/applications/bundler/unpacker_stub.cpp
nucleus/applications/utilities/makefile
octopi/library/sockets/raw_socket.cpp
octopi/library/tests_sockets/makefile
scripts/clam/cpp/rules.def
scripts/clam/cpp/variables.def

index 1137f980e78ea3e92c0c9e51dd596df4f7904bb6..7904ea71ff892c4985c115c0ac21f7b05fa7b5ea 100644 (file)
@@ -11,12 +11,11 @@ endif
 DEFINITIONS += __BUILD_STATIC_APPLICATION__=t
 TARGETS = bundle_creator.exe
 LAST_TARGETS += make_stub
-ifeq "$(OP_SYSTEM)" "WIN32"
+ifeq "$(COMPILER)" "VISUAL_CPP"
   LOCAL_HEADERS += $(THIRD_PARTY_DIR)/zlib/include
   LOCAL_LIBRARIES += $(THIRD_PARTY_DIR)/zlib/lib
   LIBS_USED += zlib.lib
-endif
-ifeq "$(OP_SYSTEM)" "UNIX"
+else
   LIBS_USED += z
 endif
 
index 4ab4683e1f2ffdbe4ef2cdc3e4a901e63b320260..a949d0121ace79c165071bd0f99e469a9c7748f3 100644 (file)
@@ -10,7 +10,8 @@ ifeq "$(OMIT_VERSIONS)" ""
 endif
 DEFINITIONS += __BUILD_STATIC_APPLICATION__=t
 TARGETS = unpacker_stub.exe
-ifeq "$(OP_SYSTEM)" "WIN32"
+#ifeq "$(OP_SYSTEM)" "WIN32"
+ifeq "$(COMPILER)" "VISUAL_CPP"
   LIBS_USED += libcmt.lib shlwapi.lib zlib.lib
   LOAD_FLAG_PREFIX += -nodefaultlib:msvcrt.lib 
   COMPILER_FLAGS += -MT
index 8782e2d8ae656c38e9f7d17befa9649f54bd4970..858724764561723e4470c8906f5f927d150e502f 100644 (file)
@@ -43,7 +43,7 @@
 #ifdef __UNIX__
   #include <utime.h>
 #endif
-#ifdef __WIN32__
+#ifdef _MSC_VER
   #include <direct.h>
   #include <io.h>
   #include <shlobj.h>
index bb32d46935104ad8fa2dfd2e24082188317efd9d..c319984844f2ba6b22ca6036cb89b31bba13df1a 100644 (file)
@@ -7,7 +7,7 @@ TYPE = application
 ifeq "$(OMIT_VERSIONS)" ""
   SOURCE += util_version.rc 
 endif
-LOCAL_LIBS_USED = application basis configuration filesystem loggers mathematics nodes processes textual timely structure
+LOCAL_LIBS_USED = application configuration filesystem loggers mathematics nodes processes textual timely structures basi
 TARGETS = await_app_exit.exe bytedump.exe checker.exe dirtree.exe ini_edit.exe mdate.exe \
   splitter.exe time_set_effective_id.exe time_running_app.exe
 
index 97ad00abdddce0eeaca0c8a4c0cad410bddc639a..5bc2a87efac523fd7443040f1f16500e423117c0 100644 (file)
@@ -126,7 +126,7 @@ int raw_socket::ioctl(basis::un_int socket, int request, void *argp) const
   return ::ioctl(socket, request, argp);
 #endif
 #ifdef __WIN32__
-  return ioctlsocket(socket, request, (un_long *)argp);
+  return ioctlsocket(socket, request, (un_int *)argp);
 #endif
 }
 
@@ -217,15 +217,23 @@ int raw_socket::inner_select(basis::un_int socket, int mode, int timeout,
   FD_ZERO(&write_list); FD_SET(socket, &write_list);
   FD_ZERO(&exceptions); FD_SET(socket, &exceptions);
 
-  timeval time_out;
-  time_stamp::fill_timeval_ms(time_out, timeout);
+  timeval base_time_out;
+  time_stamp::fill_timeval_ms(base_time_out, timeout);
     // timeval has tv_sec=seconds, tv_usec=microseconds.
+#if !defined(__GNU_WINDOWS__)
+  timeval *time_out = &base_time_out;
+#elif defined(__GNU_WINDOWS__)
+  __ms_timeval win_time_out;
+  win_time_out.tv_sec = base_time_out.tv_sec;
+  win_time_out.tv_usec = base_time_out.tv_usec;
+  __ms_timeval *time_out = &win_time_out;
+#endif
 
   // select will tell us about the socket.
   int ret = ::select(socket + 1,
       (mode & SELECTING_JUST_WRITE)? NIL : &read_list,
       (mode & SELECTING_JUST_READ)? NIL : &write_list,
-      &exceptions, &time_out);
+      &exceptions, time_out);
   int error = critical_events::system_error();
   if (!ret) return 0;  // nothing to report.
 
@@ -389,15 +397,23 @@ int raw_socket::select(int_array &read_sox, int_array &write_sox,
     FD_SET(sock, &write_list);
   }
 
-  timeval time_out;
-  time_stamp::fill_timeval_ms(time_out, timeout);
+  timeval base_time_out;
+  time_stamp::fill_timeval_ms(base_time_out, timeout);
     // timeval has tv_sec=seconds, tv_usec=microseconds.
+#if !defined(__GNU_WINDOWS__)
+  timeval *time_out = &base_time_out;
+#elif defined(__GNU_WINDOWS__)
+  __ms_timeval win_time_out;
+  win_time_out.tv_sec = base_time_out.tv_sec;
+  win_time_out.tv_usec = base_time_out.tv_usec;
+  __ms_timeval *time_out = &win_time_out;
+#endif
 
   // select will tell us about the socket.
   int ret = ::select(highest + 1,
       (read_sox.length())? &read_list : NIL,
       (write_sox.length())? &write_list : NIL,
-      &exceptions, &time_out);
+      &exceptions, time_out);
   int error = critical_events::system_error();
 
   if (ret == SOCKET_ERROR) {
index 1dad659dea8b028d40a36fa1b4e75894ec424b25..0d8a2cd225e842dec6c6f94935614974d7831454 100644 (file)
@@ -8,9 +8,9 @@ TARGETS = test_address.exe test_bcast_spocket.exe test_enum_adapters.exe \
 LOCAL_LIBS_USED = sockets unit_test application configuration loggers textual timely \
   processes filesystem structures basis 
 VCPP_USE_SOCK = t
-ifeq "$(OP_SYSTEM)" "WIN32"
-  LIBS_USED += ws2_32.lib
-endif
+#ifeq "$(COMPILER)" "VISUAL_CPP"
+#  LIBS_USED += ws2_32.lib
+#endif
 RUN_TARGETS = $(ACTUAL_TARGETS)
 
 include cpp/rules.def
index b9db8446457aef654d0f524dcc87b84c35c4ad03..1cfc607742057c9e1c7ac4060ffc4ac261bef3a6 100644 (file)
@@ -92,6 +92,8 @@ ifeq "$(COMPILER)" "GNU_WINDOWS"
     LOAD_FLAG_PREFIX += $(shell wx-config --libs $(UNICODE_FLAG_ADD) )
   endif
 
+LOAD_FLAG_PREFIX += -lwsock32 -lmswsock -shared
+
   ifneq "$(USE_CURL)" ""
     COMPILER_FLAGS += `curl-config --cflags`
     LOAD_FLAG_SUFFIX += `curl-config --libs`
@@ -208,7 +210,7 @@ ifeq "$(COMPILER)" "VISUAL_CPP"
 
   ifneq "$(USE_CURL)" ""
 #    # curl wants this win32 flag?
-#    DEFINITIONS += _WIN32
+    DEFINITIONS += WIN32
     LOCAL_HEADERS += $(THIRD_PARTY_DIR)/curl/include
     LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/curl/lib
 #    LIBS_USED += libcurl.dll.a
index fc161193e0a4108a947d81d8cb45c99cb3358140..baa42e1f7a0583b352362e9ab761cbcbf74c4740 100644 (file)
@@ -72,8 +72,8 @@ ifeq "$(COMPILER)" ""
     endif
   endif
   ifeq "$(OP_SYSTEM)" "WIN32"
-    COMPILER := GNU_WINDOWS
-#    COMPILER := VISUAL_CPP
+#    COMPILER := GNU_WINDOWS
+    COMPILER := VISUAL_CPP
   endif
   ifeq "$(COMPILER)" ""
     # if we get into this case, we have no idea how to set the default