Remove dependency on user32.dll import library from static libgc (Win32)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 5 Jul 2019 20:30:37 +0000 (23:30 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 5 Jul 2019 20:30:37 +0000 (23:30 +0300)
* CMakeLists.txt [!BUILD_SHARED_LIBS && WIN32] (DONT_USE_USER32_DLL):
Define C macro; add comment.
* configure.ac [($enable_static=yes || $enable_shared=no)
&& $host=*-*-cygwin*|*-*-mingw*|*-*-msys*] (DONT_USE_USER32_DLL):
Likewise.

CMakeLists.txt
configure.ac

index fe969f7..56a91e2 100644 (file)
@@ -253,6 +253,10 @@ if (BUILD_SHARED_LIBS)
   add_definitions("-DGC_DLL")
 else()
   add_definitions("-DGC_NOT_DLL")
+  if (WIN32)
+    # Do not require the clients to link with "user32" system library.
+    add_definitions("-DDONT_USE_USER32_DLL")
+  endif(WIN32)
 endif()
 
 add_library(gc ${SRC})
index 86fa00b..08a4dbc 100644 (file)
@@ -551,6 +551,16 @@ if test "${enable_shared}" = yes; then
   fi
 fi
 
+# Do not require the clients to link with "user32" system library.
+if test "${enable_static}" = yes -o "${enable_shared}" = no; then
+  case "$host" in
+    *-*-cygwin* | *-*-mingw* | *-*-msys*)
+      AC_DEFINE([DONT_USE_USER32_DLL], 1,
+                [Do not use user32.dll import library (Win32).])
+      ;;
+  esac
+fi
+
 # Configuration of machine-dependent code
 #
 AC_MSG_CHECKING(which machine-dependent code should be used)