Révision | 024349436cd0efbd1972455b48050cd6a541a913 (tree) |
---|---|
l'heure | 2022-04-18 20:35:47 |
Auteur | phabrics <phabrics@phab...> |
Commiter | phabrics |
Fix modules dependency issues in preparation for parallel builds.
@@ -25,3 +25,10 @@ pkgdata_DATA = tmeconfig.h tmememory.h | ||
25 | 25 | dist-hook: |
26 | 26 | rm -f ${distdir}/libtme/recode-host.c |
27 | 27 | find $(distdir)/edist -name CVS -a -exec rm -r {} ';' -a -prune |
28 | + | |
29 | +# The target to update the list of modules to preopen on platforms that don't support dlopen. | |
30 | +# This will update this list to be automatically included by automake | |
31 | +# so that future builds will track all module dependencies. | |
32 | +# If new modules are added, "make modules" must be run to update this list in the source. | |
33 | +modules-local: | |
34 | + echo -n LDADD = > $(top_srcdir)/tme-preopen.txt |
@@ -42,6 +42,7 @@ AC_CANONICAL_TARGET | ||
42 | 42 | #AC_CONFIG_MACRO_DIR([libltdl/m4]) |
43 | 43 | AC_CONFIG_LIBOBJ_DIR([lib]) |
44 | 44 | AM_INIT_AUTOMAKE([subdir-objects]) |
45 | +AM_EXTRA_RECURSIVE_TARGETS([modules]) | |
45 | 46 | AM_PROG_CC_C_O |
46 | 47 | AC_PREFIX_PROGRAM([tmesh]) |
47 | 48 |
@@ -1163,11 +1164,7 @@ LT_INIT([dlopen,win32-dll]) | ||
1163 | 1164 | LT_LANG([Windows Resource]) |
1164 | 1165 | LTDL_INIT([recursive installable]) |
1165 | 1166 | CPPFLAGS="${CPPFLAGS-} ${LTDLINCL}" |
1166 | -TME_PREOPEN= | |
1167 | -if test "x${enable_static}" = "xyes"; then | |
1168 | - TME_PREOPEN='`sort -u $(top_builddir)/tme-preopen.txt`' | |
1169 | -fi | |
1170 | -AC_SUBST(TME_PREOPEN) | |
1167 | +AM_CONDITIONAL([USING_PREOPEN], [test "x${enable_static}" = "xyes"]) | |
1171 | 1168 | |
1172 | 1169 | AC_ARG_VAR([IFCONFIG], [full path to ipconfig utility]) |
1173 | 1170 | AC_ARG_VAR([ROUTE], [full path to route utility]) |
@@ -561,8 +561,12 @@ TME_ELEMENT_SUB_NEW_DECL(tme_host_gtk,display) { | ||
561 | 561 | |
562 | 562 | gdk_monitor_get_workarea(display->tme_gdk_display_monitor, &workarea); |
563 | 563 | |
564 | - if(workarea.width) display->display.tme_screen_width = workarea.width; | |
565 | - if(workarea.height) display->display.tme_screen_height = workarea.height; | |
564 | + if(GDK_IS_MONITOR(display->tme_gdk_display_monitor) && | |
565 | + workarea.width && | |
566 | + workarea.height) { | |
567 | + display->display.tme_screen_width = workarea.width; | |
568 | + display->display.tme_screen_height = workarea.height; | |
569 | + } | |
566 | 570 | |
567 | 571 | /* set the display-specific functions: */ |
568 | 572 | display->display.tme_display_bell = _tme_gtk_display_bell; |
@@ -35,7 +35,7 @@ | ||
35 | 35 | # build modules. it updates the modules index that will be installed |
36 | 36 | # along with all of the modules, and also handles some static building |
37 | 37 | # details. this is done with an all-local target: |
38 | -all-local: | |
38 | + | |
39 | 39 | # |
40 | 40 | # first, all source files in the current directory are searched for |
41 | 41 | # element "new" function declarations. these declarations provide |
@@ -53,6 +53,7 @@ all-local: | ||
53 | 53 | # this is abuse of the $(top_builddir)/tme directory, yes, since |
54 | 54 | # this directory was originally just for include files and to make |
55 | 55 | # #include <tme/FOO.h> work right when building: |
56 | +install-exec-local: | |
56 | 57 | @echo updating tme modules list.. |
57 | 58 | @grep TME_ELEMENT_NEW_DECL $(srcdir)/*.c | \ |
58 | 59 | sed -e 's%.*TME_ELEMENT_NEW_DECL(\(.*\)).*%\1%' \ |
@@ -63,6 +64,7 @@ all-local: | ||
63 | 64 | @grep TME_ELEMENT_X_NEW_DECL $(srcdir)/*.c | \ |
64 | 65 | sed -e 's%.*TME_ELEMENT_X_NEW_DECL(\(.*\),\(.*\),\(.*\)).*%\1\3 \1\2 \3%' \ |
65 | 66 | >> $(top_builddir)/tme/tme-plugins.txt |
67 | + | |
66 | 68 | # |
67 | 69 | # next, when building statically, either for debugging purposes or |
68 | 70 | # because we're on a weak platform, we have to use libtool's "preopen" |
@@ -82,6 +84,16 @@ all-local: | ||
82 | 84 | # else it will substitute the empty string. when linking programs, |
83 | 85 | # @TME_PREOPEN@ is then used on the program's link command line. |
84 | 86 | # |
87 | +# Note: this works differently now - please see comment in top Makefile for modules target | |
88 | +modules-local: | |
89 | + @if test "x$(pkglib_LTLIBRARIES)" != x; then \ | |
90 | + for module in $(pkglib_LTLIBRARIES); do \ | |
91 | + echo $$module ; \ | |
92 | + echo " \\" >> $(top_srcdir)/tme-preopen.txt ; \ | |
93 | + echo -ne "\t-dlopen ../$(subdir)/$$module" >> $(top_srcdir)/tme-preopen.txt ; \ | |
94 | + done ; \ | |
95 | + fi | |
96 | + | |
85 | 97 | # additionally, libtool, at least through version 1.5, has a |
86 | 98 | # limitation in that the pseudo-library (the .la file) must be present |
87 | 99 | # even for a preloaded module. if we aren't debugging, everything is |
@@ -95,10 +107,10 @@ all-local: | ||
95 | 107 | # module.c can find the uninstalled tme-plugins.txt file, and libtool |
96 | 108 | # will want to look in this directory for .la files, so we simply copy |
97 | 109 | # all of the .la files into that same directory: |
110 | +all-local: | |
98 | 111 | @if test "x$(pkglib_LTLIBRARIES)" != x; then \ |
99 | 112 | for module in $(pkglib_LTLIBRARIES); do \ |
100 | 113 | echo $$module ; \ |
101 | - echo -dlopen ../$(subdir)/$$module >> $(top_builddir)/tme-preopen.txt ; \ | |
102 | 114 | cp $$module $(top_builddir)/tme ; \ |
103 | 115 | done ; \ |
104 | 116 | fi |
@@ -0,0 +1,33 @@ | ||
1 | +LDADD = \ | |
2 | + -dlopen ../generic/tme_generic.la \ | |
3 | + -dlopen ../ic/m68k/tme_ic_m68k.la \ | |
4 | + -dlopen ../ic/sparc/tme_ic_sparc.la \ | |
5 | + -dlopen ../ic/stp22xx/tme_ic_stp22xx.la \ | |
6 | + -dlopen ../ic/tme_ic_am9513.la \ | |
7 | + -dlopen ../ic/tme_ic_mm58167.la \ | |
8 | + -dlopen ../ic/tme_ic_z8530.la \ | |
9 | + -dlopen ../ic/tme_ic_i825x6.la \ | |
10 | + -dlopen ../ic/tme_ic_isil7170.la \ | |
11 | + -dlopen ../ic/tme_ic_ncr5380.la \ | |
12 | + -dlopen ../ic/tme_ic_am7930.la \ | |
13 | + -dlopen ../ic/tme_ic_am7990.la \ | |
14 | + -dlopen ../ic/tme_ic_ncr53c9x.la \ | |
15 | + -dlopen ../ic/tme_ic_mk48txx.la \ | |
16 | + -dlopen ../ic/tme_ic_lsi64854.la \ | |
17 | + -dlopen ../ic/tme_ic_nec765.la \ | |
18 | + -dlopen ../ic/tme_ic_ncr89c105.la \ | |
19 | + -dlopen ../ic/tme_ic_stp2024.la \ | |
20 | + -dlopen ../ic/tme_ic_ad184x.la \ | |
21 | + -dlopen ../machine/sun2/tme_machine_sun2.la \ | |
22 | + -dlopen ../machine/sun3/tme_machine_sun3.la \ | |
23 | + -dlopen ../machine/sun4/tme_machine_sun4.la \ | |
24 | + -dlopen ../host/posix/tme_host_posix.la \ | |
25 | + -dlopen ../host/bsd/tme_host_bsd.la \ | |
26 | + -dlopen ../host/tun/tme_host_tun.la \ | |
27 | + -dlopen ../host/openvpn/tme_host_openvpn.la \ | |
28 | + -dlopen ../host/rfb/tme_host_rfb.la \ | |
29 | + -dlopen ../host/gtk/tme_host_gtk.la \ | |
30 | + -dlopen ../bus/multibus/tme_bus_multibus.la \ | |
31 | + -dlopen ../bus/sbus/tme_bus_sbus.la \ | |
32 | + -dlopen ../serial/tme_serial_kb.la \ | |
33 | + -dlopen ../scsi/tme_scsi.la | |
\ No newline at end of file |
@@ -19,8 +19,9 @@ libtmesh_la_SOURCES = \ | ||
19 | 19 | libtmesh_la_LIBADD = $(top_builddir)/libtme/libtme.la |
20 | 20 | |
21 | 21 | bin_PROGRAMS = tmesh |
22 | -tmesh_LDADD = libtmesh.la | |
23 | -tmesh_LDFLAGS = -dlpreopen force -dlopen self @TME_PREOPEN@ | |
22 | +tmesh_LDADD = libtmesh.la $(LDADD) | |
23 | +tmesh_LDFLAGS = -dlpreopen force -dlopen self | |
24 | +include $(top_srcdir)/tme-preopen.txt | |
24 | 25 | |
25 | 26 | install-exec-hook: |
26 | 27 | $(SETCAP) $(DESTDIR)$(bindir)/$(TGTPFX)tmesh$(EXEEXT) |