glib r6823 - branches/glib-2-16



Author: tml
Date: Thu Apr  3 23:46:26 2008
New Revision: 6823
URL: http://svn.gnome.org/viewvc/glib?rev=6823&view=rev

Log:
2008-04-04  Tor Lillqvist  <tml novell com>

	* configure.in: Make sure we don't build both shared and static at
	the same time on Windows. Put a #define for
	GLIB_STATIC_COMPILATION into glibconfig.h in the static case, so
	that the use of variables from libglib gets the GLIB_VAR macro in
	gtypes.h automatically correct. This means that a shared and
	static build of GLib can't be installed in the same prefix on
	Windows, which sucks a bit. But with variables in the GLib API,
	there isn't much we can do otherwise. The alternative would be to
	force the developer who compiles against a statically built GLib
	to use -DGLIB_STATIC_COMPILATION.

	* glibconfig.h.win32.in: Define GLIB_STATIC_COMPILATION here also,
	if needed.



Modified:
   branches/glib-2-16/ChangeLog
   branches/glib-2-16/configure.in
   branches/glib-2-16/glibconfig.h.win32.in

Modified: branches/glib-2-16/configure.in
==============================================================================
--- branches/glib-2-16/configure.in	(original)
+++ branches/glib-2-16/configure.in	Thu Apr  3 23:46:26 2008
@@ -500,6 +500,17 @@
   esac
 fi
 
+if test "$glib_native_win32" = "yes"; then
+  if test x$enable_static = xyes -a x$enable_shared = xyes; then
+    AC_MSG_ERROR([Can not build both shared and static at the same time on Windows.])
+  fi
+  if test x$enable_static = xyes; then
+    glib_win32_static_compilation=yes
+    GLIB_WIN32_STATIC_COMPILATION_DEFINE="#define GLIB_STATIC_COMPILATION 1"
+    AC_SUBST(GLIB_WIN32_STATIC_COMPILATION_DEFINE)
+  fi
+fi
+
 dnl
 dnl DU4 native cc currently needs -std1 for ANSI mode (instead of K&R)
 dnl
@@ -2710,6 +2721,7 @@
 $glib_memmove
 $glib_defines
 $glib_os
+$glib_static_compilation
 
 $glib_vacopy
 
@@ -3188,6 +3200,10 @@
     glib_os="#define G_OS_UNIX"
     ;;
 esac
+glib_static_compilation=""
+if test x$glib_win32_static_compilation = xyes; then
+  glib_static_compilation="#define GLIB_STATIC_COMPILATION 1"
+fi
 ])
 
 AC_CONFIG_FILES([

Modified: branches/glib-2-16/glibconfig.h.win32.in
==============================================================================
--- branches/glib-2-16/glibconfig.h.win32.in	(original)
+++ branches/glib-2-16/glibconfig.h.win32.in	Thu Apr  3 23:46:26 2008
@@ -103,6 +103,7 @@
 
 #define G_OS_WIN32
 #define G_PLATFORM_WIN32
+ GLIB_WIN32_STATIC_COMPILATION_DEFINE@
 
 #ifndef _MSC_VER
 #define G_VA_COPY	va_copy



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]