+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.
+
2008-04-18 17:40:58 Tim Janik <timj@imendio.com>
* tests/testglib.c: fixed gstdio.h include.
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)
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
])
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 && \
no_undefined = -no-undefined
endif
-if OS_WIN32
+if OS_WIN32_AND_DLL_COMPILATION
export_symbols = -export-symbols gio.def
gio_def = gio.def
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 \
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:
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)
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}
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
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) \
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:$@
# 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
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 = \
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:$@
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
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
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:$@