[evolution-patches] Patch to workaround problem with mutually dependent DLLs on Windows



This patch to Evolution works around the problem that some of the
shared libraries being built are mutually dependent. (I.e. shared
library A uses functions from shared library B, and shared library B
uses functions from shared library A.)

This kind of circular dependency is no problem with ELF, but on
platforms like Win32 where shared libraries can't have undefined
symbols, it is.

This patch works around this by constructing "bootstrapping" import
libraries that act as stand-ins for not yet built libraries when
building libraries that depend on these not yet built libraries.

The copy-pasted comment in all the .def files below probably should be
removed, and instead put into a README file in the win32 subdirectory.

--tml

Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/Makefile.am,v
retrieving revision 1.101
diff -u -r1.101 Makefile.am
--- Makefile.am	25 Feb 2005 18:02:09 -0000	1.101
+++ Makefile.am	7 Jun 2005 16:23:31 -0000
@@ -32,6 +32,7 @@
 endif
 
 SUBDIRS = 			\
+	win32			\
         data                    \
         e-util                  \
 	a11y			\
Index: win32/Makefile.am
===================================================================
RCS file: win32/Makefile.am
diff -N win32/Makefile.am
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ win32/Makefile.am	7 Jun 2005 16:23:31 -0000
@@ -0,0 +1,45 @@
+EXTRA_DIST =
+	dummy.la			\
+	libemiscwidgets.def		\
+	libevolution-addressbook.def	\
+	libevolution-calendar.def	\
+	libevolution-mail.def		\
+	libfilter.def
+
+if OS_WIN32
+BOOTSTRAP_LIBS =			\
+	libemiscwidgets.la		\
+	libevolution-addressbook.la	\
+	libevolution-calendar.la	\
+	libevolution-mail.la		\
+	libfilter.la
+endif
+
+noinst_DATA = $(BOOTSTRAP_LIBS)
+
+libemiscwidgets.la: dummy.la libemiscwidgets.def
+	sed -e s!%DLL%!libemiscwidgets-0! -e s!%LIB%!libemiscwidgets! -e s!%PFX%!$(prefix)! <dummy.la >$@
+	mkdir -p .libs
+	dlltool --output-lib=.libs/libemiscwidgets.dll.a --dllname=libemiscwidgets-0.dll --input-def=libemiscwidgets.def
+
+libevolution-addressbook.la: dummy.la libevolution-addressbook.def
+	sed -e s!%DLL%!libevolution-addressbook! -e s!%LIB%!libevolution-addressbook! -e s!%PFX%!$(prefix)! <dummy.la >$@
+	mkdir -p .libs
+	dlltool --output-lib=.libs/libevolution-addressbook.dll.a --dllname=libevolution-addressbook.dll --input-def=libevolution-addressbook.def
+
+libevolution-calendar.la: dummy.la libevolution-calendar.def
+	sed -e s!%DLL%!libevolution-calendar! -e s!%LIB%!libevolution-calendar! -e s!%PFX%!$(prefix)! <dummy.la >$@
+	mkdir -p .libs
+	dlltool --output-lib=.libs/libevolution-calendar.dll.a --dllname=libevolution-calendar.dll --input-def=libevolution-calendar.def
+
+libevolution-mail.la: dummy.la libevolution-mail.def
+	sed -e s!%DLL%!libevolution-mail! -e s!%LIB%!libevolution-mail! -e s!%PFX%!$(prefix)! <dummy.la >$@
+	mkdir -p .libs
+	dlltool --output-lib=.libs/libevolution-mail.dll.a --dllname=libevolution-mail.dll --input-def=libevolution-mail.def
+
+libfilter.la: dummy.la libfilter.def
+	sed -e s!%DLL%!libfilter-0! -e s!%LIB%!libfilter! -e s!%PFX%!$(prefix)! <dummy.la >$@
+	mkdir -p .libs
+	dlltool --output-lib=.libs/libfilter.dll.a --dllname=libfilter-0.dll --input-def=libfilter.def
+
+CLEANFILES = $(BOOTSTRAP_LIBS)
Index: win32/dummy.la
===================================================================
RCS file: win32/dummy.la
diff -N win32/dummy.la
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ win32/dummy.la	7 Jun 2005 16:23:31 -0000
@@ -0,0 +1,32 @@
+# %LIB%.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool - well, actually not, hacked manually
+
+# The name that we can dlopen(3).
+dlname='%DLL%.dll'
+
+# Names of this library.
+library_names='%LIB%.dll.a'
+
+# The name of the static archive.
+old_library=''
+
+# Libraries that this one depends upon.
+dependency_libs=''
+
+# Version information for %LIB%
+current=0
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=no
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='%PFX%/bin'
Index: win32/libemiscwidgets.def
===================================================================
RCS file: win32/libemiscwidgets.def
diff -N win32/libemiscwidgets.def
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ win32/libemiscwidgets.def	7 Jun 2005 16:23:31 -0000
@@ -0,0 +1,27 @@
+; Dummy .def file for a DLL libFOO, to enable linking of DLLs that
+; refer to functions from libFOO before libFOO has been built. This
+; file isn't used when building the actual libFOO DLL. This file is
+; just used to produce a bootstrap import library for it. Thus it
+; doesn't have to list all the actual entry points in the libFOO DLL,
+; just those used by the DLLs that are built before libFOO.
+
+EXPORTS
+	e_calendar_item_get_date_range
+	e_calendar_item_get_selection
+	e_calendar_item_get_type
+	e_calendar_item_get_week_number
+	e_calendar_item_normalize_date
+	e_calendar_item_set_selection
+	e_combo_button_get_label
+	e_combo_button_get_type
+	e_combo_button_popup_menu
+	e_map_add_point
+	e_map_get_closest_point
+	e_map_get_magnification
+	e_map_new
+	e_map_point_get_color_rgba
+	e_map_point_get_location
+	e_map_point_set_color_rgba
+	e_map_window_to_world
+	e_map_zoom_out
+	e_map_zoom_to_location
Index: win32/libevolution-addressbook.def
===================================================================
RCS file: win32/libevolution-addressbook.def
diff -N win32/libevolution-addressbook.def
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ win32/libevolution-addressbook.def	7 Jun 2005 16:23:31 -0000
@@ -0,0 +1,21 @@
+; Dummy .def file for a DLL libFOO, to enable linking of DLLs that
+; refer to functions from libFOO before libFOO has been built. This
+; file isn't used when building the actual libFOO DLL. This file is
+; just used to produce a bootstrap import library for it. Thus it
+; doesn't have to list all the actual entry points in the libFOO DLL,
+; just those used by the DLLs that are built before libFOO.
+
+EXPORTS
+	addressbook_load
+	addressbook_load_cancel
+	addressbook_load_default_book
+	e_minicard_activate_editor
+	e_minicard_get_type
+	e_minicard_view_get_type
+	eab_load_error_dialog
+	eab_merging_book_add_contact
+	eab_merging_book_commit_contact
+	eab_prompt_save_dialog
+	eab_show_contact_editor
+	eab_show_contact_list_editor
+	eab_view_get_type
Index: win32/libevolution-calendar.def
===================================================================
RCS file: win32/libevolution-calendar.def
diff -N win32/libevolution-calendar.def
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ win32/libevolution-calendar.def	7 Jun 2005 16:23:31 -0000
@@ -0,0 +1,37 @@
+; Dummy .def file for a DLL libFOO, to enable linking of DLLs that
+; refer to functions from libFOO before libFOO has been built. This
+; file isn't used when building the actual libFOO DLL. This file is
+; just used to produce a bootstrap import library for it. Thus it
+; doesn't have to list all the actual entry points in the libFOO DLL,
+; just those used by the DLLs that are built before libFOO.
+
+EXPORTS
+	e_calendar_view_get_calendar
+	e_calendar_view_get_selected_time_range
+	e_calendar_view_get_type
+	e_calendar_view_new_appointment
+	e_calendar_view_new_appointment_for
+	e_day_view_convert_time_to_display
+	e_day_view_ensure_rows_visible
+	e_day_view_find_event_from_item
+	e_day_view_get_event_position
+	e_day_view_get_long_event_position
+	e_day_view_get_type
+	e_day_view_main_item_get_type
+	e_day_view_top_item_get_day_label
+	e_day_view_update_calendar_selection_time
+	e_week_view_find_event_from_item
+	e_week_view_get_span_position
+	e_week_view_get_type
+	e_week_view_jump_to_button_item
+	e_week_view_main_item_get_type
+	gnome_calendar_get_current_view_widget
+	gnome_calendar_get_e_calendar_widget
+	gnome_calendar_get_search_bar_widget
+	gnome_calendar_get_task_pad
+	gnome_calendar_get_timezone
+	gnome_calendar_get_type
+	gnome_calendar_get_view
+	gnome_calendar_get_view_notebook_widget
+	gnome_calendar_get_visible_time_range
+	goto_dialog
Index: win32/libfilter.def
===================================================================
RCS file: win32/libfilter.def
diff -N win32/libfilter.def
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ win32/libfilter.def	7 Jun 2005 16:23:31 -0000
@@ -0,0 +1,22 @@
+; Dummy .def file for a DLL libFOO, to enable linking of DLLs that
+; refer to functions from libFOO before libFOO has been built. This
+; file isn't used when building the actual libFOO DLL. This file is
+; just used to produce a bootstrap import library for it. Thus it
+; doesn't have to list all the actual entry points in the libFOO DLL,
+; just those used by the DLLs that are built before libFOO.
+
+EXPORTS
+	filter_rule_build_code
+	filter_rule_clone
+	filter_rule_get_widget
+	filter_rule_new
+	filter_rule_set_name
+	filter_rule_set_source
+	filter_rule_validate
+	filter_rule_xml_decode
+	filter_rule_xml_encode
+	rule_context_add_rule
+	rule_context_find_rule
+	rule_context_next_rule
+	rule_context_save
+	rule_editor_new




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