On Sunday 24 November 2002 6:23 pm, Benjamin Reed wrote:
One of the problems we're running into getting KDE working on Darwin is
libtool's concept of a "module", and how it's mapped onto Darwin's
linker behavior.
This was talked about some time ago by Michael Matz and myself.
To get around issues with prebinding and speed of C++ code loading,
especially on linux, KDE creates many of it's executables as shared
libraries, linked twice, once as a module and once a binary. So the
"kbackgammon" program is kbackgammon.so and kbackgammon, with main()
existing in kbackgammon.so, and kbackgammon being linked against the
.so and an empty dummy.cpp file to make linkers happy as far as making
a program.
I have create patches to the KDE build system that solves a related problem
that affects NetBSD a.out platforms. I believe they should fix the Darwin
problem.
Unfortunately Michael never folded them back into KDE. I guess he is too busy.
:(
Nick
------------------------------------------------------------------------
$NetBSD: patch-aa,v 1.1 2002/05/31 14:02:54 skrll Exp $
--- kbackgammon/Makefile.am.orig Fri Oct 5 12:52:05 2001
+++ kbackgammon/Makefile.am
@@ -2,21 +2,22 @@
INCLUDES = -I$(top_srcdir)/libkdegames -I$(top_srcdir)/libkdegames/kgame/
-I$(srcdir)/engines $(all_includes)
bin_PROGRAMS = kbackgammon
-lib_LTLIBRARIES = kbackgammon.la
+lib_LTLIBRARIES = libkbackgammon_main.la kbackgammon.la
-CLEANFILES = dummy.cpp
-
-kbackgammon_la_LIBADD = $(LIB_KDEUI) $(LIB_KSYCOCA) -lkdeprint \
+libkbackgammon_main_la_LIBADD = $(LIB_KDEUI) $(LIB_KSYCOCA) -lkdeprint \
./engines/libkbgengines.la
-kbackgammon_la_SOURCES = main.cpp kbg.cpp kbgboard.cpp kbgtextview.cpp \
+libkbackgammon_main_la_SOURCES = main.cpp kbg.cpp kbgboard.cpp kbgtextview.cpp
\
kbgstatus.cpp
+kbackgammon_la_LIBADD = libkbackgammon_main.la
+kbackgammon_la_SOURCES = kbackgammon_main.cpp
+
kbackgammon_la_METASOURCES = AUTO
kbackgammon_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -avoid-version
-kbackgammon_LDADD = kbackgammon.la $(top_builddir)/libkdegames/libkdegames.la \
+kbackgammon_LDADD = libkbackgammon_main.la
$(top_builddir)/libkdegames/libkdegames.la \
$(LIB_KSYCOCA)
-kbackgammon_SOURCES = dummy.cpp
+kbackgammon_SOURCES = kbackgammon_main.cpp
kbackgammon_LDFLAGS = $(all_libraries) $(KDE_RPATH)
noinst_HEADERS = version.h kbg.h kbgboard.h kbgtextview.h kbgstatus.h
@@ -34,9 +35,6 @@
messages: rc.cpp
LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o
-name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o
-name \*.C`; \
$(XGETTEXT) $$LIST -o $(podir)/kbackgammon.pot
-
-dummy.cpp:
- echo > dummy.cpp
install-data-local:
rm -rf $(kde_appsdir)/Games/kbackgammon.desktop