glib r6866 - in trunk: . gio glib gmodule gobject gthread



Author: tml
Date: Mon Apr 21 08:38:36 2008
New Revision: 6866
URL: http://svn.gnome.org/viewvc/glib?rev=6866&view=rev

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

	* configure.in
	* */Makefile.am: More work on enabling static building on
	Windows. When building statically: Also define
	GOBJECT_STATIC_COMPILATION in glibconfig.h so that also the
	variables in gparamspecs.h get declared without any
	dllimport/dllexport decorations. Don't install .def files which
	obviously have no meaning for static libraries. Don't create MS
	import libraries. Don't do any resource object files.



Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/gio/Makefile.am
   trunk/glib/Makefile.am
   trunk/gmodule/Makefile.am
   trunk/gobject/Makefile.am
   trunk/gthread/Makefile.am

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Mon Apr 21 08:38:36 2008
@@ -491,10 +491,12 @@
   fi
   if test x$enable_static = xyes; then
     glib_win32_static_compilation=yes
-    GLIB_WIN32_STATIC_COMPILATION_DEFINE="#define GLIB_STATIC_COMPILATION 1"
+    GLIB_WIN32_STATIC_COMPILATION_DEFINE="#define GLIB_STATIC_COMPILATION 1
+#define GOBJECT_STATIC_COMPILATION 1"
     AC_SUBST(GLIB_WIN32_STATIC_COMPILATION_DEFINE)
   fi
 fi
+AM_CONDITIONAL(OS_WIN32_AND_DLL_COMPILATION, [test x$glib_native_win32 = xyes -a x$glib_win32_static_compilation != xyes])
 
 dnl
 dnl DU4 native cc currently needs -std1 for ANSI mode (instead of K&R)
@@ -3203,7 +3205,8 @@
 esac
 glib_static_compilation=""
 if test x$glib_win32_static_compilation = xyes; then
-  glib_static_compilation="#define GLIB_STATIC_COMPILATION 1"
+  glib_static_compilation="#define GLIB_STATIC_COMPILATION 1
+#define GOBJECT_STATIC_COMPILATION 1"
 fi
 ])
 

Modified: trunk/gio/Makefile.am
==============================================================================
--- trunk/gio/Makefile.am	(original)
+++ trunk/gio/Makefile.am	Mon Apr 21 08:38:36 2008
@@ -8,18 +8,20 @@
 SUBDIRS += xdgmime
 endif
 
+if OS_WIN32_AND_DLL_COMPILATION
 if MS_LIB_AVAILABLE
 noinst_DATA = gio-2.0.lib
 
-install-ms-lib:
-	$(INSTALL) gio-2.0.lib $(DESTDIR)$(libdir)
+install_ms_lib_cmd = $(INSTALL) gio-2.0.lib $(DESTDIR)$(libdir)
+uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gio-2.0.lib
+endif
+endif
 
-uninstall-ms-lib:
-	-rm $(DESTDIR)$(libdir)/gio-2.0.lib
-else
 install-ms-lib:
+	$(install_ms_lib_cmd)
+
 uninstall-ms-lib:
-endif
+	$(uninstall_ms_lib_cmd)
 
 gio.def: gio.symbols
 	(echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/	/' -e 's/G_GNUC_[^ ]*//g' | sort) > gio.def.tmp && \
@@ -228,7 +230,7 @@
 no_undefined = -no-undefined
 endif
 
-if OS_WIN32
+if OS_WIN32_AND_DLL_COMPILATION
 export_symbols = -export-symbols gio.def
 gio_def = gio.def
 

Modified: trunk/glib/Makefile.am
==============================================================================
--- trunk/glib/Makefile.am	(original)
+++ trunk/glib/Makefile.am	Mon Apr 21 08:38:36 2008
@@ -81,18 +81,20 @@
 
 lib_LTLIBRARIES = libglib-2.0.la
 
+if OS_WIN32_AND_DLL_COMPILATION
 if MS_LIB_AVAILABLE
 noinst_DATA = glib-2.0.lib
 
-install-ms-lib:
-	$(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
+install_ms_lib_cmd = $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
+uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/glib-2.0.lib
+endif
+endif
 
-uninstall-ms-lib:
-	-rm $(DESTDIR)$(libdir)/glib-2.0.lib
-else
 install-ms-lib:
+	$(install_ms_lib_cmd)
+
 uninstall-ms-lib:
-endif
+	$(uninstall_ms_lib_cmd)
 
 libglib_2_0_la_SOURCES = 	\
 	garray.c		\
@@ -251,8 +253,12 @@
 no_undefined = -no-undefined
 endif
 
-if OS_WIN32
+if OS_WIN32_AND_DLL_COMPILATION
 export_symbols = -export-symbols glib.def
+
+glib_win32_res = glib-win32-res.o
+glib_win32_res_ldflag = -Wl,$(glib_win32_res)
+
 glib_def = glib.def
 
 install-def-file:
@@ -267,11 +273,6 @@
 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
 endif
 
-if OS_WIN32
-glib_win32_res = glib-win32-res.o
-glib_win32_res_ldflag = -Wl,$(glib_win32_res)
-endif
-
 if ENABLE_REGEX
 if USE_SYSTEM_PCRE
 pcre_lib = $(PCRE_LIBS)
@@ -303,10 +304,10 @@
 gspawn_win32_helper_LDADD = libglib-2.0.la
 gspawn_win32_helper_LDFLAGS = -mwindows
 gspawn_win32_helper_console_LDADD = libglib-2.0.la
+endif
 
 glib-win32-res.o: glib.rc
 	$(WINDRES) glib.rc $@
-endif
 
 bin_PROGRAMS	 = ${INSTALL_PROGS}
 

Modified: trunk/gmodule/Makefile.am
==============================================================================
--- trunk/gmodule/Makefile.am	(original)
+++ trunk/gmodule/Makefile.am	Mon Apr 21 08:38:36 2008
@@ -40,27 +40,32 @@
 
 lib_LTLIBRARIES = libgmodule-2.0.la
 
+if OS_WIN32_AND_DLL_COMPILATION
 if MS_LIB_AVAILABLE
 noinst_DATA = gmodule-2.0.lib
 
-install-ms-lib:
-	$(INSTALL) gmodule-2.0.lib $(DESTDIR)$(libdir)
+install_ms_lib_cmd = $(INSTALL) gmodule-2.0.lib $(DESTDIR)$(libdir)
+uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gmodule-2.0.lib
+endif
+endif
 
-uninstall-ms-lib:
-	-rm $(DESTDIR)$(libdir)/gmodule-2.0.lib
-else
 install-ms-lib:
+	$(install_ms_lib_cmd)
+
 uninstall-ms-lib:
-endif
+	$(uninstall_ms_lib_cmd)
 
 if PLATFORM_WIN32
 no_undefined = -no-undefined
 endif
 
-if OS_WIN32
+if OS_WIN32_AND_DLL_COMPILATION
 export_symbols = -export-symbols $(srcdir)/gmodule.def
 gmodule_def = gmodule.def
 
+gmodule_win32_res = gmodule-win32-res.o
+gmodule_win32_res_ldflag = -Wl,$(gmodule_win32_res)
+
 install-def-file:
 	$(INSTALL) $(srcdir)/gmodule.def $(DESTDIR)$(libdir)/gmodule-2.0.def
 
@@ -71,11 +76,6 @@
 uninstall-def-file:
 endif
 
-if OS_WIN32
-gmodule_win32_res = gmodule-win32-res.o
-gmodule_win32_res_ldflag = -Wl,$(gmodule_win32_res)
-endif
-
 libgmodule_2_0_la_SOURCES = gmodule.c
 libgmodule_2_0_la_LDFLAGS = \
 	$(gmodule_win32_res_ldflag) \
@@ -87,10 +87,8 @@
 
 libgmodule_2_0_la_DEPENDENCIES = $(gmodule_win32_res) $(gmodule_def)
 
-if OS_WIN32
 gmodule-win32-res.o: gmodule.rc
 	$(WINDRES) gmodule.rc $@
-endif
 
 gmodule-2.0.lib: libgmodule-2.0.la gmodule.def
 	lib -name:libgmodule-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(srcdir)/gmodule.def -out:$@

Modified: trunk/gobject/Makefile.am
==============================================================================
--- trunk/gobject/Makefile.am	(original)
+++ trunk/gobject/Makefile.am	Mon Apr 21 08:38:36 2008
@@ -36,27 +36,32 @@
 # libraries to compile and install
 lib_LTLIBRARIES = libgobject-2.0.la
 
+if OS_WIN32_AND_DLL_COMPILATION
 if MS_LIB_AVAILABLE
 noinst_DATA = gobject-2.0.lib
 
-install-ms-lib:
-	$(INSTALL) gobject-2.0.lib $(DESTDIR)$(libdir)
+install_ms_lib_cmd = $(INSTALL) gobject-2.0.lib $(DESTDIR)$(libdir)
+uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gobject-2.0.lib
+endif
+endif
 
-uninstall-ms-lib:
-	-rm $(DESTDIR)$(libdir)/gobject-2.0.lib
-else
 install-ms-lib:
+	$(install_ms_lib_cmd)
+
 uninstall-ms-lib:
-endif
+	$(uninstall_ms_lib_cmd)
 
 if PLATFORM_WIN32
 no_undefined = -no-undefined
 endif
 
-if OS_WIN32
+if OS_WIN32_AND_DLL_COMPILATION
 export_symbols = -export-symbols gobject.def
 gobject_def = gobject.def
 
+gobject_win32_res = gobject-win32-res.o
+gobject_win32_res_ldflag = -Wl,$(gobject_win32_res)
+
 install-def-file:
 	$(INSTALL) gobject.def $(DESTDIR)$(libdir)/gobject-2.0.def
 
@@ -69,11 +74,6 @@
 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
 endif
 
-if OS_WIN32
-gobject_win32_res = gobject-win32-res.o
-gobject_win32_res_ldflag = -Wl,$(gobject_win32_res)
-endif
-
 # libtool stuff: set version and export symbols for resolving
 libgobjectincludedir = $(includedir)/glib-2.0/gobject
 libgobject_2_0_la_LDFLAGS = \
@@ -240,11 +240,8 @@
 	gobjectalias.h		\
 	gobjectaliasdef.c
 
-
-if OS_WIN32
 gobject-win32-res.o: gobject.rc
 	$(WINDRES) gobject.rc $@
-endif
 
 gobject-2.0.lib: libgobject-2.0.la gobject.def
 	lib -name:libgobject-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gobject.def -out:$@

Modified: trunk/gthread/Makefile.am
==============================================================================
--- trunk/gthread/Makefile.am	(original)
+++ trunk/gthread/Makefile.am	Mon Apr 21 08:38:36 2008
@@ -28,24 +28,26 @@
 
 lib_LTLIBRARIES = libgthread-2.0.la
 
+if OS_WIN32_AND_DLL_COMPILATION
 if MS_LIB_AVAILABLE
 noinst_DATA = gthread-2.0.lib
 
-install-ms-lib:
-	$(INSTALL) gthread-2.0.lib $(DESTDIR)$(libdir)
+install_ms_lib_cmd = $(INSTALL) gthread-2.0.lib $(DESTDIR)$(libdir)
+uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gthread-2.0.lib
+endif
+endif
 
-uninstall-ms-lib:
-	-rm $(DESTDIR)$(libdir)/gthread-2.0.lib
-else
 install-ms-lib:
+	$(install_ms_lib_cmd)
+
 uninstall-ms-lib:
-endif
+	$(uninstall_ms_lib_cmd)
 
 if PLATFORM_WIN32
 no_undefined = -no-undefined
 endif
 
-if OS_WIN32
+if OS_WIN32_AND_DLL_COMPILATION
 export_symbols = -export-symbols $(srcdir)/gthread.def
 gthread_def = gthread.def
 
@@ -59,7 +61,7 @@
 uninstall-def-file:
 endif
 
-if OS_WIN32
+if OS_WIN32_AND_DLL_COMPILATION
 gthread_win32_res = gthread-win32-res.o
 gthread_win32_res_ldflag = -Wl,$(gthread_win32_res)
 endif
@@ -74,10 +76,8 @@
 
 libgthread_2_0_la_DEPENDENCIES = $(gthread_win32_res) $(gthread_def)
 
-if OS_WIN32
 gthread-win32-res.o: gthread.rc
 	$(WINDRES) gthread.rc $@
-endif
 
 gthread-2.0.lib: libgthread-2.0.la gthread.def
 	lib -name:libgthread-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(srcdir)/gthread.def -out:$@



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