Don't enforce shared library build only on Windows. It might well make
authorTor Lillqvist <tml@novell.com>
Thu, 3 Apr 2008 20:17:15 +0000 (20:17 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Thu, 3 Apr 2008 20:17:15 +0000 (20:17 +0000)
2008-04-03  Tor Lillqvist  <tml@novell.com>

* configure.in: Don't enforce shared library build only on
Windows. It might well make sense to build static libraries in
some use cases.

* glib/gutils.c: Don't compile the DllMain if building libglib
statically. Also in that case don't return NULL from
_glib_get_installation_directory(), but return the installation
directory of the program's .exe file.

svn path=/trunk/; revision=6818

ChangeLog
configure.in
glib/gutils.c

index b313317f1def1d7423d40e0cc02227174350ed48..ebba7a42276b8bcf1a58a7354401b7be2889337a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-04-03  Tor Lillqvist  <tml@novell.com>
+
+       * configure.in: Don't enforce shared library build only on
+       Windows. It might well make sense to build static libraries in
+       some use cases.
+
+       * glib/gutils.c: Don't compile the DllMain if building libglib
+       statically. Also in that case don't return NULL from
+       _glib_get_installation_directory(), but return the installation
+       directory of the program's .exe file.
+
 2008-04-03  Tor Lillqvist  <tml@novell.com>
 
        Bug 525972 - UCS-4 not in the new win_iconv implementation
index 90ac430f52db17844fc02bb1ae95fcb6a9777b47..03df95656cc74378d64181a409771bd166f755a0 100644 (file)
@@ -235,17 +235,6 @@ else
   AC_MSG_RESULT([yes])
 fi
 
-if test "$glib_native_win32" = "yes"; then
-  if test x$enable_static = xyes -o x$enable_static = x; then
-    AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.])
-    enable_static=no
-  fi
-  if test x$enable_shared = xno; then
-    AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.])
-  fi
-  enable_shared=yes
-fi
-
 dnl Checks for programs.
 AC_PROG_CC
 
index d7eb1699db9bb8d4ec0a6f820360ccbc75235c7d..03a8227664839c47bc7aeb3d85587c5903d51545 100644 (file)
@@ -134,6 +134,8 @@ const guint glib_binary_age = GLIB_BINARY_AGE;
 
 static HMODULE glib_dll = NULL;
 
+#ifdef DLL_EXPORT
+
 BOOL WINAPI
 DllMain (HINSTANCE hinstDLL,
         DWORD     fdwReason,
@@ -145,12 +147,18 @@ DllMain (HINSTANCE hinstDLL,
   return TRUE;
 }
 
+#endif
+
 gchar *
 _glib_get_installation_directory (void)
 {
+#ifdef DLL_EXPORT
   if (glib_dll == NULL)
     return NULL;
-
+#endif
+  /* In a static build of GLib just use the application's .exe file's
+   * installation directory...
+   */
   return g_win32_get_package_installation_directory_of_module (glib_dll);
 }