diff -uNbwr kdebase-3.5.9/applnk/Makefile.am kdebase-3.5.9-new/applnk/Makefile.am
--- kdebase-3.5.9/applnk/Makefile.am	2007-01-15 06:32:11.000000000 -0500
+++ kdebase-3.5.9-new/applnk/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -3,7 +3,7 @@
 xdg_menu_DATA = kde-settings.menu kde-information.menu kde-screensavers.menu
 
 xdg_mergedmenu_DATA = kde-essential.menu
-xdg_mergedmenudir = $(xdg_menudir)/applications-merged
+xdg_mergedmenudir = $(xdg_menudir)/kde-applications-merged
 
 xdg_directory_DATA = \
 kde-main.directory \
diff -uNbwr kdebase-3.5.9/doc/userguide/kde-for-admins.docbook kdebase-3.5.9-new/doc/userguide/kde-for-admins.docbook
--- kdebase-3.5.9/doc/userguide/kde-for-admins.docbook	2006-07-22 04:15:40.000000000 -0400
+++ kdebase-3.5.9-new/doc/userguide/kde-for-admins.docbook	2008-02-13 21:05:55.000000000 -0500
@@ -1669,7 +1669,7 @@
 </para>
 
 <informalexample>
-<para>Example from <filename>applications.menu</filename>:
+<para>Example from <filename>kde-applications.menu</filename>:
 <programlisting>
 <markup>
 	&lt;Menu&gt;
@@ -1743,7 +1743,7 @@
 information, see <ulink url="http://www.freedesktop.org/Standards/basedir-spec">http://www.freedesktop.org/Standards/basedir-spec</ulink></para>
 
 <informalexample>
-<para>Example from <filename>applications.menu</filename>:
+<para>Example from <filename>kde-applications.menu</filename>:
 <programlisting>
 <markup>
              &lt;Menu&gt;
@@ -1795,7 +1795,7 @@
 <title>Essential Menus</title>
 
 <para><filename
-class="directory">$<envar>KDEDIR</envar>/etc/xdg/menus/applications-merged/</filename>
+class="directory">$<envar>KDEDIR</envar>/etc/xdg/menus/kde-applications-merged/</filename>
 contains <filename>kde-essential.menu</filename> which includes some
 essential menus that are normally not shown in the &kde; menu itself:
 <itemizedlist>
diff -uNbwr kdebase-3.5.9/drkonqi/Makefile.am kdebase-3.5.9-new/drkonqi/Makefile.am
--- kdebase-3.5.9/drkonqi/Makefile.am	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.9-new/drkonqi/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -8,15 +8,17 @@
 
 EXTRA_DIST = LICENSE
 
-bin_PROGRAMS = drkonqi
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = drkonqi.la
 
 # Libraries:
-AM_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-LDADD  = $(LIB_KDEUI) $(LIB_KIO)
+drkonqi_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+drkonqi_la_LIBADD  = $(LIB_KDEUI) $(LIB_KIO)
 
 # toplevel.cpp must be last in row due to X-headers being included. (--enable-final)
 # Did I mention already that X header files really suck?
-drkonqi_SOURCES = krashdcopinterface.skel main.cpp debugger.cpp krashconf.cpp drbugreport.cpp backtrace.cpp toplevel.cpp
+drkonqi_la_SOURCES = krashdcopinterface.skel main.cpp debugger.cpp krashconf.cpp drbugreport.cpp backtrace.cpp toplevel.cpp
 
 
 check_PROGRAMS = crashtest
diff -uNbwr kdebase-3.5.9/drkonqi/main.cpp kdebase-3.5.9-new/drkonqi/main.cpp
--- kdebase-3.5.9/drkonqi/main.cpp	2006-07-22 04:15:52.000000000 -0400
+++ kdebase-3.5.9-new/drkonqi/main.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -57,7 +57,7 @@
   KCmdLineLastOption
 };
 
-int main( int argc, char* argv[] )
+extern "C" KDE_EXPORT int kdemain( int argc, char* argv[] )
 {
   // Drop privs.
   setgid(getgid());
diff -uNbwr kdebase-3.5.9/kappfinder/Makefile.am kdebase-3.5.9-new/kappfinder/Makefile.am
--- kdebase-3.5.9/kappfinder/Makefile.am	2005-09-10 04:25:41.000000000 -0400
+++ kdebase-3.5.9-new/kappfinder/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -1,9 +1,17 @@
 SUBDIRS = apps
 
-bin_PROGRAMS = kappfinder
-kappfinder_SOURCES = main.cpp toplevel.cpp common.cpp
-kappfinder_LDADD = $(LIB_KDEUI) $(LIB_KIO)
-kappfinder_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kappfinder.la
+
+kappfinder_la_SOURCES = main.cpp toplevel.cpp kacommon.cpp
+kappfinder_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO)
+kappfinder_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+
+$(srcdir)/kacommon.cpp: $(srcdir)/common.cpp
+	cat $(srcdir)/common.cpp > $(srcdir)/kacommon.cpp
+
+DISTCLEANFILES = kacommon.cpp
 
 noinst_PROGRAMS = kappfinder_install
 kappfinder_install_SOURCES = main_install.cpp common.cpp
diff -uNbwr kdebase-3.5.9/kappfinder/main.cpp kdebase-3.5.9-new/kappfinder/main.cpp
--- kdebase-3.5.9/kappfinder/main.cpp	2007-10-08 05:51:26.000000000 -0400
+++ kdebase-3.5.9-new/kappfinder/main.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -31,7 +31,7 @@
   KCmdLineLastOption
 };
 
-int main( int argc, char *argv[] )
+extern "C" KDE_EXPORT int kdemain( int argc, char *argv[] )
 {
   KAboutData aboutData( "kappfinder", I18N_NOOP( "KAppfinder" ),
                         "1.0", description, KAboutData::License_GPL,
diff -uNbwr kdebase-3.5.9/kcontrol/filetypes/Makefile.am kdebase-3.5.9-new/kcontrol/filetypes/Makefile.am
--- kdebase-3.5.9/kcontrol/filetypes/Makefile.am	2005-09-10 04:25:08.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/filetypes/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -12,16 +12,18 @@
 	kservicelistwidget.h typeslistitem.h newtypedlg.h \
 	kserviceselectdlg.h
 
-bin_PROGRAMS = keditfiletype
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = keditfiletype.la
 
 noinst_LTLIBRARIES = libfiletypes.la
 libfiletypes_la_SOURCES = filetypesview.cpp filetypedetails.cpp filegroupdetails.cpp \
 		 kservicelistwidget.cpp typeslistitem.cpp newtypedlg.cpp \
 		 kserviceselectdlg.cpp
 
-keditfiletype_SOURCES = keditfiletype.cpp
-keditfiletype_LDADD = libfiletypes.la $(LIB_KIO)
-keditfiletype_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+keditfiletype_la_SOURCES = keditfiletype.cpp
+keditfiletype_la_LIBADD = libfiletypes.la $(LIB_KIO)
+keditfiletype_la_LDFLAGS = $(KDE_PLUGIN) $(all_libraries) -module
 
 messages:
 	$(XGETTEXT) *.cpp -o $(podir)/filetypes.pot
diff -uNbwr kdebase-3.5.9/kcontrol/filetypes/keditfiletype.cpp kdebase-3.5.9-new/kcontrol/filetypes/keditfiletype.cpp
--- kdebase-3.5.9/kcontrol/filetypes/keditfiletype.cpp	2007-05-14 03:55:38.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/filetypes/keditfiletype.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -108,7 +108,7 @@
   KCmdLineLastOption
 };
 
-int main(int argc, char ** argv)
+extern "C" KDE_EXPORT int kdemain(int argc, char ** argv)
 {
   KLocale::setMainCatalogue("filetypes");
   KAboutData aboutData( "keditfiletype", I18N_NOOP("KEditFileType"), "1.0",
diff -uNbwr kdebase-3.5.9/kcontrol/fonts/Makefile.am kdebase-3.5.9-new/kcontrol/fonts/Makefile.am
--- kdebase-3.5.9/kcontrol/fonts/Makefile.am	2007-05-14 03:55:34.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/fonts/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -4,13 +4,13 @@
 libkxftconfig_la_LIBADD = $(LIBFONTCONFIG_LIBS)
 libkxftconfig_la_LDFLAGS = $(LIBFONTCONFIG_RPATH)
 
-AM_CPPFLAGS  = $(all_includes) $(LIBFONTCONFIG_CFLAGS) $(FREETYPE2_CFLAGS) -D_LARGEFILE64_SOURCE
+AM_CPPFLAGS  = $(LIBFONTCONFIG_CFLAGS) $(FREETYPE2_CFLAGS) -D_LARGEFILE64_SOURCE $(all_includes)
 
 kde_module_LTLIBRARIES = kcm_fonts.la
 
 kcm_fonts_la_SOURCES = fonts.cpp
 kcm_fonts_la_LDFLAGS = $(KDE_RPATH) $(LIBFONTCONFIG_RPATH) $(FREETYPE2_LDFLAGS) -module -avoid-version $(all_libraries) -no-undefined
-kcm_fonts_la_LIBADD = libkxftconfig.la $(top_builddir)/kcontrol/krdb/libkrdb.la $(LIB_KDEUI) $(LIBFONTCONFIG_LIBS)
+kcm_fonts_la_LIBADD = $(LIBFONTCONFIG_LIBS) libkxftconfig.la $(top_builddir)/kcontrol/krdb/libkrdb.la $(LIB_KDEUI)
 METASOURCES = AUTO
 
 noinst_HEADERS = fonts.h kxftconfig.h
diff -uNbwr kdebase-3.5.9/kcontrol/fonts/configure.in.in kdebase-3.5.9-new/kcontrol/fonts/configure.in.in
--- kdebase-3.5.9/kcontrol/fonts/configure.in.in	2007-05-14 03:55:34.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/fonts/configure.in.in	2008-02-13 21:05:55.000000000 -0500
@@ -1,8 +1,6 @@
-KDE_FIND_PATH(fontconfig-config, FONTCONFIG_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
         KDE_FIND_PATH(pkg-config, PKGCONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
             AC_MSG_WARN([Could not find neither pkg-config nor fontconfig-config, check http://www.fontconfig.org/ ])
         ])
-])
 
 if test -n "$PKGCONFIG"; then
   vers=`$PKGCONFIG fontconfig --modversion 2>/dev/null | sed -e 's/libfontconfig //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
diff -uNbwr kdebase-3.5.9/kcontrol/kfontinst/configure.in.in kdebase-3.5.9-new/kcontrol/kfontinst/configure.in.in
--- kdebase-3.5.9/kcontrol/kfontinst/configure.in.in	2006-01-19 12:00:50.000000000 -0500
+++ kdebase-3.5.9-new/kcontrol/kfontinst/configure.in.in	2008-02-13 21:05:55.000000000 -0500
@@ -36,11 +36,9 @@
 
     KFI_FOUND_FONTCONFIG=0
     # check for fontconfig...
-    KDE_FIND_PATH(fontconfig-config, FONTCONFIG_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
             KDE_FIND_PATH(pkg-config, PKGCONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/bin /usr/local/bin /opt/local/bin], [
                 AC_MSG_WARN([Could not find neither pkg-config nor fontconfig-config, check http://www.fontconfig.org/ ])
             ])
-    ])
 
     if test -n "$PKGCONFIG"; then
         vers=`$PKGCONFIG fontconfig --modversion 2>/dev/null | sed -e 's/libfontconfig //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
diff -uNbwr kdebase-3.5.9/kcontrol/kfontinst/kcmfontinst/Makefile.am kdebase-3.5.9-new/kcontrol/kfontinst/kcmfontinst/Makefile.am
--- kdebase-3.5.9/kcontrol/kfontinst/kcmfontinst/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/kfontinst/kcmfontinst/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -4,10 +4,10 @@
 endif
 
 kde_module_LTLIBRARIES = kcm_fontinst.la
-kcm_fontinst_la_LIBADD  = $(LIB_KIO) $(FONTINST_PRINT_LIB) $(LIBFREETYPE_LIBS) $(LIBFONTCONFIG_LIBS) ../lib/libkfontinst.la
+kcm_fontinst_la_LIBADD  = $(LIBFREETYPE_LIBS) $(LIBFONTCONFIG_LIBS) $(LIB_KIO) $(FONTINST_PRINT_LIB) ../lib/libkfontinst.la
 METASOURCES = AUTO
 kcm_fontinst_la_LDFLAGS = $(KDE_PLUGIN) $(all_libraries) $(KDE_RPATH) -module -avoid-version -no-undefined
-AM_CPPFLAGS = -I$(srcdir)/../lib $(FONTINST_PRINT_INC) -I$(srcdir)/../../fonts $(all_includes) $(LIBFREETYPE_CFLAGS) $(LIBFONTCONFIG_CFLAGS)
+AM_CPPFLAGS = -I$(srcdir)/../lib $(FONTINST_PRINT_INC) -I$(srcdir)/../../fonts $(LIBFREETYPE_CFLAGS) $(LIBFONTCONFIG_CFLAGS) $(all_includes)
  
 xdg_apps_DATA = kcmfontinst.desktop
  
diff -uNbwr kdebase-3.5.9/kcontrol/kfontinst/kfile-plugin/Makefile.am kdebase-3.5.9-new/kcontrol/kfontinst/kfile-plugin/Makefile.am
--- kdebase-3.5.9/kcontrol/kfontinst/kfile-plugin/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/kfontinst/kfile-plugin/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -1,13 +1,13 @@
 kde_module_LTLIBRARIES = kfile_font.la
 
 kfile_font_la_SOURCES = KFileFont.cpp
-kfile_font_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIBFREETYPE_RPATH) -module $(KDE_PLUGIN)
-kfile_font_la_LIBADD = $(LIB_KIO) $(LIBFREETYPE_LIBS) ../lib/libkfontinst.la
+kfile_font_la_LDFLAGS = $(LIBFREETYPE_RPATH) $(all_libraries) $(KDE_RPATH) -module $(KDE_PLUGIN)
+kfile_font_la_LIBADD = $(LIBFREETYPE_LIBS) $(LIB_KIO) ../lib/libkfontinst.la
 
 kdelnkdir = $(kde_servicesdir)
 kde_services_DATA = kfile_font.desktop
 
-AM_CPPFLAGS = -I$(srcdir)/../lib -I$(srcdir)/../../fonts $(all_includes) $(LIBFREETYPE_CFLAGS)
+AM_CPPFLAGS = -I$(srcdir)/../lib -I$(srcdir)/../../fonts $(LIBFREETYPE_CFLAGS) $(all_includes)
 
 METASOURCES = AUTO
 noinst_HEADERS = KFileFont.h
diff -uNbwr kdebase-3.5.9/kcontrol/kfontinst/kfontinst/Main.cpp kdebase-3.5.9-new/kcontrol/kfontinst/kfontinst/Main.cpp
--- kdebase-3.5.9/kcontrol/kfontinst/kfontinst/Main.cpp	2007-05-14 03:55:38.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/kfontinst/kfontinst/Main.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -190,7 +190,7 @@
         KFI::CXConfig::refreshPaths(true);
 }
 
-int main(int argc, char *argv[])
+extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
 {
 #ifdef HAVE_GETOPT_H
     static struct option options[]=
diff -uNbwr kdebase-3.5.9/kcontrol/kfontinst/kfontinst/Makefile.am kdebase-3.5.9-new/kcontrol/kfontinst/kfontinst/Makefile.am
--- kdebase-3.5.9/kcontrol/kfontinst/kfontinst/Makefile.am	2007-05-14 03:55:38.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/kfontinst/kfontinst/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -1,5 +1,8 @@
-bin_PROGRAMS = kfontinst
-kfontinst_SOURCES = \
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kfontinst.la
+
+kfontinst_la_SOURCES = \
 Main.cpp \
 FontEngine.cpp \
 Fontmap.cpp \
@@ -11,6 +14,6 @@
 Fontmap.h \
 XConfig.h
 
-kfontinst_LDADD = ../../fonts/libkxftconfig.la $(LIBFONTCONFIG_LIBS) $(LIBFREETYPE_LIBS) $(LIBZ) $(LIB_KIO) ../lib/libkfontinst.la
-kfontinst_LDFLAGS = $(all_libraries) $(LIBFONTCONFIG_RPATH) $(LIBFREETYPE_RPATH) $(KDE_RPATH)
-AM_CPPFLAGS= -DOS_$(UNAME) -I$(srcdir)/../lib -I$(srcdir)/../../fonts $(all_includes) $(LIBFREETYPE_CFLAGS) $(LIBFONTCONFIG_CFLAGS)
+kfontinst_LDADD = $(LIBFONTCONFIG_LIBS) $(LIBFREETYPE_LIBS) ../../fonts/libkxftconfig.la $(LIBZ) $(LIB_KIO) ../lib/libkfontinst.la
+kfontinst_LDFLAGS = $(LIBFONTCONFIG_RPATH) $(LIBFREETYPE_RPATH) $(all_libraries) $(KDE_RPATH)
+AM_CPPFLAGS= -DOS_$(UNAME) -I$(srcdir)/../lib -I$(srcdir)/../../fonts $(LIBFREETYPE_CFLAGS) $(LIBFONTCONFIG_CFLAGS) $(all_includes)
diff -uNbwr kdebase-3.5.9/kcontrol/kfontinst/kio/Makefile.am kdebase-3.5.9-new/kcontrol/kfontinst/kio/Makefile.am
--- kdebase-3.5.9/kcontrol/kfontinst/kio/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/kfontinst/kio/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -2,9 +2,9 @@
 kio_fonts_la_SOURCES = \
 KioFonts.cpp
 
-kio_fonts_la_LIBADD = ../../fonts/libkxftconfig.la $(LIBFONTCONFIG_LIBS) $(LIBFREETYPE_LIBS) $(LIB_KIO) -lkdesu ../lib/libkfontinst.la
-kio_fonts_la_LDFLAGS = $(KDE_PLUGIN) $(all_libraries) $(KDE_RPATH) $(LIBFONTCONFIG_RPATH) $(LIBFREETYPE_RPATH) -module -avoid-version -no-undefined
-AM_CPPFLAGS= -I$(srcdir)/../lib -I$(srcdir)/../../fonts $(all_includes) $(LIBFREETYPE_CFLAGS) $(LIBFONTCONFIG_CFLAGS) -D_LARGEFILE64_SOURCE
+kio_fonts_la_LIBADD = $(LIBFONTCONFIG_LIBS) $(LIBFREETYPE_LIBS) ../../fonts/libkxftconfig.la $(LIB_KIO) -lkdesu ../lib/libkfontinst.la
+kio_fonts_la_LDFLAGS = $(LIBFONTCONFIG_RPATH) $(LIBFREETYPE_RPATH) $(KDE_PLUGIN) $(all_libraries) $(KDE_RPATH) -module -avoid-version -no-undefined
+AM_CPPFLAGS= -I$(srcdir)/../lib -I$(srcdir)/../../fonts $(LIBFREETYPE_CFLAGS) $(LIBFONTCONFIG_CFLAGS) -D_LARGEFILE64_SOURCE $(all_includes)
 
 # The kxftconfig stuf really belongs to kdebase/kcontrol/fonts - here only so that can distribute this as an archive.
 noinst_HEADERS = \
diff -uNbwr kdebase-3.5.9/kcontrol/kfontinst/lib/FcEngine.h kdebase-3.5.9-new/kcontrol/kfontinst/lib/FcEngine.h
--- kdebase-3.5.9/kcontrol/kfontinst/lib/FcEngine.h	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/kfontinst/lib/FcEngine.h	2008-02-13 21:05:55.000000000 -0500
@@ -5,6 +5,8 @@
 #include "config.h"
 #endif
 
+#define KFI_FC_NO_WIDTHS 1
+
 #include <qstring.h>
 #include <qvaluevector.h>
 #include <qfont.h>
diff -uNbwr kdebase-3.5.9/kcontrol/kfontinst/lib/Makefile.am kdebase-3.5.9-new/kcontrol/kfontinst/lib/Makefile.am
--- kdebase-3.5.9/kcontrol/kfontinst/lib/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/kfontinst/lib/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -9,6 +9,6 @@
 FcEngine.h \
 KfiConstants.h
 
-libkfontinst_la_LIBADD = $(LIB_KDECORE) $(LIBFONTCONFIG_LIBS) $(LIBFREETYPE_LIBS) $(LIB_KIO) $(LIBXFT_LIB)
-libkfontinst_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIBFONTCONFIG_RPATH) $(LIBFREETYPE_RPATH) -no-undefined
-AM_CPPFLAGS= $(all_includes) $(LIBFREETYPE_CFLAGS) $(LIBFONTCONFIG_CFLAGS) -D_LARGEFILE64_SOURCE
+libkfontinst_la_LIBADD = $(LIBFONTCONFIG_LIBS) $(LIBFREETYPE_LIBS) $(LIB_KDECORE) $(LIB_KIO) $(LIBXFT_LIB)
+libkfontinst_la_LDFLAGS = $(LIBFONTCONFIG_RPATH) $(LIBFREETYPE_RPATH) $(all_libraries) $(KDE_RPATH) -no-undefined
+AM_CPPFLAGS= $(LIBFREETYPE_CFLAGS) $(LIBFONTCONFIG_CFLAGS) -D_LARGEFILE64_SOURCE $(all_includes)
diff -uNbwr kdebase-3.5.9/kcontrol/kfontinst/thumbnail/Makefile.am kdebase-3.5.9-new/kcontrol/kfontinst/thumbnail/Makefile.am
--- kdebase-3.5.9/kcontrol/kfontinst/thumbnail/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/kfontinst/thumbnail/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -2,7 +2,7 @@
 
 fontthumbnail_la_SOURCES = FontThumbnail.cpp
 fontthumbnail_la_LIBADD = $(LIBFREETYPE_LIBS) $(LIB_KDECORE) $(LIB_KIO) ../lib/libkfontinst.la
-fontthumbnail_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIBFREETYPE_RPATH) -module $(KDE_PLUGIN)
+fontthumbnail_la_LDFLAGS = $(KDE_RPATH) $(LIBFREETYPE_RPATH) -module $(KDE_PLUGIN) $(all_libraries)
 METASOURCES = AUTO
 
 noinst_HEADERS = FontThumbnail.h
@@ -11,4 +11,4 @@
 
 kde_services_DATA = fontthumbnail.desktop
 
-AM_CPPFLAGS= -I$(srcdir)/../lib -I$(srcdir)/../../fonts $(all_includes) $(LIBFREETYPE_CFLAGS)
+AM_CPPFLAGS= -I$(srcdir)/../lib -I$(srcdir)/../../fonts $(LIBFREETYPE_CFLAGS) $(all_includes)
diff -uNbwr kdebase-3.5.9/kcontrol/kfontinst/viewpart/FontViewerApp.cpp kdebase-3.5.9-new/kcontrol/kfontinst/viewpart/FontViewerApp.cpp
--- kdebase-3.5.9/kcontrol/kfontinst/viewpart/FontViewerApp.cpp	2005-10-10 11:03:47.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/kfontinst/viewpart/FontViewerApp.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -116,7 +116,7 @@
                             KAboutData::License_GPL,
                             I18N_NOOP("(c) Craig Drummond, 2004"));
 
-int main(int argc, char **argv)
+extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
 {
     KCmdLineArgs::init(argc, argv, &aboutData);
     KCmdLineArgs::addCmdLineOptions(options);
diff -uNbwr kdebase-3.5.9/kcontrol/kfontinst/viewpart/Makefile.am kdebase-3.5.9-new/kcontrol/kfontinst/viewpart/Makefile.am
--- kdebase-3.5.9/kcontrol/kfontinst/viewpart/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.9-new/kcontrol/kfontinst/viewpart/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -13,18 +13,21 @@
 
 kde_services_DATA = kfontviewpart.desktop
 
-AM_CPPFLAGS = -I$(srcdir)/../lib -I$(srcdir)/../../fonts $(all_includes) $(LIBFREETYPE_CFLAGS) $(LIBFONTCONFIG_CFLAGS)
+AM_CPPFLAGS = -I$(srcdir)/../lib -I$(srcdir)/../../fonts $(LIBFREETYPE_CFLAGS) $(LIBFONTCONFIG_CFLAGS) $(all_includes)
 METASOURCES = AUTO
 
-kfontview_LDADD = $(LIB_KPARTS)
-kfontview_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kfontview_la_LIBADD = $(LIB_KPARTS)
+kfontview_la_LDFLAGS = $(KDE_PLUGIN) -module $(all_libraries)
+
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kfontview.la
 
-bin_PROGRAMS = kfontview
 xdg_apps_DATA = kfontview.desktop
 
 appdata_DATA = kfontviewpart.rc kfontviewui.rc
 appdatadir = $(kde_datadir)/kfontview
 
-kfontview_SOURCES = FontViewerApp.cpp
+kfontview_la_SOURCES = FontViewerApp.cpp
 
 
diff -uNbwr kdebase-3.5.9/kdcop/Makefile.am kdebase-3.5.9-new/kdcop/Makefile.am
--- kdebase-3.5.9/kdcop/Makefile.am	2005-09-10 04:25:53.000000000 -0400
+++ kdebase-3.5.9-new/kdcop/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -7,10 +7,13 @@
 
 INCLUDES = $(all_includes)
 
-bin_PROGRAMS = kdcop
-
-kdcop_SOURCES = kdcop.cpp kdcopwindow.cpp kdcoplistview.cpp kdcopview.ui
-kdcop_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_KIO) -lDCOP $(LIB_QT)
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kdcop.la
+
+kdcop_la_SOURCES = kdcop.cpp kdcopwindow.cpp kdcoplistview.cpp kdcopview.ui
+kdcop_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kdcop_la_LIBADD  = $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_KIO) -lDCOP $(LIB_QT)
 
 noinst_HEADERS = kdcopwindow.h
 METASOURCES =	AUTO
diff -uNbwr kdebase-3.5.9/kdcop/kdcop.cpp kdebase-3.5.9-new/kdcop/kdcop.cpp
--- kdebase-3.5.9/kdcop/kdcop.cpp	2005-09-10 04:25:53.000000000 -0400
+++ kdebase-3.5.9-new/kdcop/kdcop.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -15,7 +15,7 @@
     KCmdLineLastOption
 };
 
-int main( int argc, char ** argv )
+extern "C" KDE_EXPORT int kdemain( int argc, char ** argv )
 {
   KAboutData aboutData( "kdcop", I18N_NOOP("KDCOP"),
 			"0.1", I18N_NOOP( "A graphical DCOP browser/client" ),
diff -uNbwr kdebase-3.5.9/kdebugdialog/Makefile.am kdebase-3.5.9-new/kdebugdialog/Makefile.am
--- kdebase-3.5.9/kdebugdialog/Makefile.am	2005-09-10 04:24:57.000000000 -0400
+++ kdebase-3.5.9-new/kdebugdialog/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -4,12 +4,14 @@
 
 ####### Files
 
-bin_PROGRAMS = kdebugdialog
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kdebugdialog.la
 
-kdebugdialog_SOURCES = main.cpp kabstractdebugdialog.cpp kdebugdialog.cpp klistdebugdialog.cpp
-kdebugdialog_METASOURCES = AUTO
-kdebugdialog_LDFLAGS =       $(all_libraries) $(KDE_RPATH)
-kdebugdialog_LDADD   =       $(LIB_KDEUI)
+kdebugdialog_la_SOURCES = main.cpp kabstractdebugdialog.cpp kdebugdialog.cpp klistdebugdialog.cpp
+kdebugdialog_la_METASOURCES = AUTO
+kdebugdialog_la_LDFLAGS =       $(all_libraries) $(KDE_PLUGIN) -module
+kdebugdialog_la_LIBADD   =       $(LIB_KDEUI)
 
 messages:
 	$(XGETTEXT) *.cpp -o $(podir)/kdebugdialog.pot	
diff -uNbwr kdebase-3.5.9/kdebugdialog/main.cpp kdebase-3.5.9-new/kdebugdialog/main.cpp
--- kdebase-3.5.9/kdebugdialog/main.cpp	2005-10-10 11:03:40.000000000 -0400
+++ kdebase-3.5.9-new/kdebugdialog/main.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -75,7 +75,7 @@
   KCmdLineLastOption
 };
 
-int main(int argc, char ** argv)
+extern "C" KDE_EXPORT int kdemain(int argc, char ** argv)
 {
   KAboutData data( "kdebugdialog", I18N_NOOP( "KDebugDialog"),
     "1.0", I18N_NOOP("A dialog box for setting preferences for debug output"),
diff -uNbwr kdebase-3.5.9/kdepasswd/Makefile.am kdebase-3.5.9-new/kdepasswd/Makefile.am
--- kdebase-3.5.9/kdepasswd/Makefile.am	2005-09-10 04:24:59.000000000 -0400
+++ kdebase-3.5.9-new/kdepasswd/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -1,10 +1,13 @@
 
 SUBDIRS = kcm
 
-bin_PROGRAMS = kdepasswd
-kdepasswd_SOURCES = kdepasswd.cpp passwd.cpp passwddlg.cpp
-kdepasswd_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-kdepasswd_LDADD = $(LIB_KIO)
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kdepasswd.la
+
+kdepasswd_la_SOURCES = kdepasswd.cpp passwd.cpp passwddlg.cpp
+kdepasswd_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kdepasswd_la_LIBADD = $(LIB_KIO)
 
 METASOURCES =  AUTO
 AM_CPPFLAGS= -I$(top_srcdir)/libkonq $(all_includes)
diff -uNbwr kdebase-3.5.9/kdepasswd/kdepasswd.cpp kdebase-3.5.9-new/kdepasswd/kdepasswd.cpp
--- kdebase-3.5.9/kdepasswd/kdepasswd.cpp	2005-09-10 04:24:59.000000000 -0400
+++ kdebase-3.5.9-new/kdepasswd/kdepasswd.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -26,7 +26,7 @@
 };
 
 
-int main(int argc, char **argv)
+extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
 {
     KAboutData aboutData("kdepasswd", I18N_NOOP("KDE passwd"),
             VERSION, I18N_NOOP("Changes a UNIX password."),
diff -uNbwr kdebase-3.5.9/kdeprint/kdeprintfax/Makefile.am kdebase-3.5.9-new/kdeprint/kdeprintfax/Makefile.am
--- kdebase-3.5.9/kdeprint/kdeprintfax/Makefile.am	2005-09-10 04:25:38.000000000 -0400
+++ kdebase-3.5.9-new/kdeprint/kdeprintfax/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -1,11 +1,14 @@
 INCLUDES= $(all_includes)
 
-bin_PROGRAMS = kdeprintfax
-kdeprintfax_SOURCES = main.cpp kdeprintfax.cpp faxab.cpp faxctrl.cpp confgeneral.cpp configdlg.cpp \
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kdeprintfax.la
+
+kdeprintfax_la_SOURCES = main.cpp kdeprintfax.cpp faxab.cpp faxctrl.cpp confgeneral.cpp configdlg.cpp \
 		      conffax.cpp confsystem.cpp conffilters.cpp filterdlg.cpp defcmds.cpp
-kdeprintfax_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-kdeprintfax_LDADD   = $(LIB_KDEUI) $(LIB_KIO) $(LIB_KDEPRINT) -lkabc
-kdeprintfax_METASOURCES = AUTO
+kdeprintfax_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kdeprintfax_la_LIBADD  = $(LIB_KDEUI) $(LIB_KIO) $(LIB_KDEPRINT) -lkabc
+kdeprintfax_la_METASOURCES = AUTO
 
 xdg_apps_DATA = kdeprintfax.desktop
 
diff -uNbwr kdebase-3.5.9/kdeprint/kdeprintfax/main.cpp kdebase-3.5.9-new/kdeprint/kdeprintfax/main.cpp
--- kdebase-3.5.9/kdeprint/kdeprintfax/main.cpp	2005-10-10 11:04:02.000000000 -0400
+++ kdebase-3.5.9-new/kdeprint/kdeprintfax/main.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -44,7 +44,7 @@
   // INSERT YOUR COMMANDLINE OPTIONS HERE
 };
 
-int main(int argc, char *argv[])
+extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
 {
 
   KAboutData aboutData( "kdeprintfax", I18N_NOOP("KdeprintFax"),
diff -uNbwr kdebase-3.5.9/kdeprint/kprinter/printwrapper.cpp kdebase-3.5.9-new/kdeprint/kprinter/printwrapper.cpp
--- kdebase-3.5.9/kdeprint/kprinter/printwrapper.cpp	2007-01-15 06:32:07.000000000 -0500
+++ kdebase-3.5.9-new/kdeprint/kprinter/printwrapper.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -137,10 +137,6 @@
 {
 	KCmdLineArgs	*args = KCmdLineArgs::parsedArgs();
 
-#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
-	struct sigaction action;
-#endif /* HAVE_SIGACTION && !HAVE_SIGSET*/
-
 	// read variables from command line
 	QString	printer = args->getOption("d");
 	QString	title = args->getOption("t");
@@ -325,6 +321,10 @@
 
 		// print from stdin
 
+#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
+	struct sigaction action;
+#endif /* HAVE_SIGACTION && !HAVE_SIGSET*/
+
 #  if defined(HAVE_SIGSET)
 		sigset(SIGHUP, signal_handler);
 		sigset(SIGINT, signal_handler);
diff -uNbwr kdebase-3.5.9/kdesktop/Makefile.am kdebase-3.5.9-new/kdesktop/Makefile.am
--- kdebase-3.5.9/kdesktop/Makefile.am	2006-05-22 14:12:51.000000000 -0400
+++ kdebase-3.5.9-new/kdesktop/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -8,9 +8,9 @@
 
 ####### Files
 
-bin_PROGRAMS = kcheckrunning
+bin_PROGRAMS = 
 lib_LTLIBRARIES =
-kdeinit_LTLIBRARIES = kdesktop.la
+kdeinit_LTLIBRARIES = kdesktop.la kcheckrunning.la
 noinst_LTLIBRARIES = libkdesktopsettings.la
 
 libkdesktopsettings_la_LDFLAGS = $(all_libraries) -no-undefined
@@ -31,9 +31,9 @@
 	xautolock.h lockeng.h init.h minicli.h \
 	pixmapserver.h startupid.h xautolock_c.h
 
-kcheckrunning_SOURCES = kcheckrunning.cpp
-kcheckrunning_LDFLAGS = $(all_libraries)
-kcheckrunning_LDADD = $(LIB_X11)
+kcheckrunning_la_SOURCES = kcheckrunning.cpp
+kcheckrunning_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kcheckrunning_la_LIBADD = $(LIB_X11)
 
 METASOURCES = AUTO
 
diff -uNbwr kdebase-3.5.9/kdesktop/kcheckrunning.cpp kdebase-3.5.9-new/kdesktop/kcheckrunning.cpp
--- kdebase-3.5.9/kdesktop/kcheckrunning.cpp	2005-10-10 11:04:11.000000000 -0400
+++ kdebase-3.5.9-new/kdesktop/kcheckrunning.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -18,8 +18,9 @@
 */
 
 #include <X11/Xlib.h>
+#include <kdemacros.h>
 
-int main()
+extern "C" KDE_EXPORT int kdemain()
     {
     Display* dpy = XOpenDisplay( NULL );
     if( dpy == NULL )
diff -uNbwr kdebase-3.5.9/kdesktop/kwebdesktop/Makefile.am kdebase-3.5.9-new/kdesktop/kwebdesktop/Makefile.am
--- kdebase-3.5.9/kdesktop/kwebdesktop/Makefile.am	2005-09-10 04:25:45.000000000 -0400
+++ kdebase-3.5.9-new/kdesktop/kwebdesktop/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -2,12 +2,15 @@
 INCLUDES= $(all_includes)
 LDADD = $(LIB_KHTML)
 
-bin_PROGRAMS = 	kwebdesktop
+bin_PROGRAMS =
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kwebdesktop.la
 
 METASOURCES = AUTO
 
-kwebdesktop_SOURCES = kwebdesktop.cpp kwebdesktopsettings.kcfgc 
-kwebdesktop_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kwebdesktop_la_SOURCES = kwebdesktop.cpp kwebdesktopsettings.kcfgc 
+kwebdesktop_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwebdesktop_la_LIBADD  = $(LIB_KHTML)
 
 kdesktop_kwebdesktop_data_DATA = kwebdesktop.desktop
 kdesktop_kwebdesktop_datadir = $(kde_datadir)/kdesktop/programs
diff -uNbwr kdebase-3.5.9/kdesktop/kwebdesktop/kwebdesktop.cpp kdebase-3.5.9-new/kdesktop/kwebdesktop/kwebdesktop.cpp
--- kdebase-3.5.9/kdesktop/kwebdesktop/kwebdesktop.cpp	2007-01-15 06:32:10.000000000 -0500
+++ kdebase-3.5.9-new/kdesktop/kwebdesktop/kwebdesktop.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -84,7 +84,7 @@
 }
 
 
-int main( int argc, char **argv )
+extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
 {
     KAboutData data( "kwebdesktop", I18N_NOOP("KDE Web Desktop"),
                      VERSION,
diff -uNbwr kdebase-3.5.9/kdesktop/lock/Makefile.am kdebase-3.5.9-new/kdesktop/lock/Makefile.am
--- kdebase-3.5.9/kdesktop/lock/Makefile.am	2005-09-10 04:25:41.000000000 -0400
+++ kdebase-3.5.9-new/kdesktop/lock/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -1,14 +1,16 @@
 ## Makefile.am of kdebase/kdesktop/lock
 
 INCLUDES = -I.. -I$(top_srcdir)/kcheckpass -I$(top_srcdir)/kdmlib $(GLINC) $(all_includes)
-kdesktop_lock_LDFLAGS  = $(all_libraries) $(KDE_RPATH)
-kdesktop_lock_LDADD    = ../libkdesktopsettings.la ../../kdmlib/libdmctl.la $(LIB_KIO) $(LIB_XF86MISC) $(GLLIB)
+kdesktop_lock_la_LDFLAGS  = $(all_libraries) $(KDE_RPATH) -module -avoid-version
+kdesktop_lock_la_LIBADD    = ../libkdesktopsettings.la ../../kdmlib/libdmctl.la $(LIB_KIO) $(LIB_XF86MISC) $(GLLIB)
 
 ####### Files
 
-bin_PROGRAMS = kdesktop_lock
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kdesktop_lock.la
 
-kdesktop_lock_SOURCES = lockprocess.cc lockdlg.cc autologout.cc main.cc
+kdesktop_lock_la_SOURCES = lockprocess.cc lockdlg.cc autologout.cc main.cc
 
 noinst_HEADERS = lockprocess.h lockdlg.h autologout.h main.h
 
diff -uNbwr kdebase-3.5.9/kdesktop/lock/main.cc kdebase-3.5.9-new/kdesktop/lock/main.cc
--- kdebase-3.5.9/kdesktop/lock/main.cc	2006-03-17 05:17:37.000000000 -0500
+++ kdebase-3.5.9-new/kdesktop/lock/main.cc	2008-02-13 21:05:55.000000000 -0500
@@ -59,7 +59,7 @@
 
 // -----------------------------------------------------------------------------
 
-int main( int argc, char **argv )
+extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
 {
     KLocale::setMainCatalogue("kdesktop");
 
diff -uNbwr kdebase-3.5.9/kdesu/kdesu/Makefile.am kdebase-3.5.9-new/kdesu/kdesu/Makefile.am
--- kdebase-3.5.9/kdesu/kdesu/Makefile.am	2005-09-10 04:26:14.000000000 -0400
+++ kdebase-3.5.9-new/kdesu/kdesu/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -3,11 +3,14 @@
 INCLUDES= $(all_includes)
 
 ## kdesu
-bin_PROGRAMS = 	kdesu
-kdesu_SOURCES = kdesu.cpp sudlg.cpp
-kdesu_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-kdesu_LDADD   = $(LIB_KIO) -lkdesu
-kdesu_METASOURCES =  AUTO
+bin_PROGRAMS =
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kdesu.la
+
+kdesu_la_SOURCES = kdesu.cpp sudlg.cpp
+kdesu_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kdesu_la_LIBADD  = $(LIB_KIO) -lkdesu
+kdesu_la_METASOURCES =  AUTO
 noinst_HEADERS = sudlg.h
 
 ## Messages
diff -uNbwr kdebase-3.5.9/kdesu/kdesu/kdesu.cpp kdebase-3.5.9-new/kdesu/kdesu/kdesu.cpp
--- kdebase-3.5.9/kdesu/kdesu/kdesu.cpp	2008-02-13 04:40:49.000000000 -0500
+++ kdebase-3.5.9-new/kdesu/kdesu/kdesu.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -86,7 +86,7 @@
 
 static int startApp();
 
-int main(int argc, char *argv[])
+extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
 {
     // FIXME: this can be considered a poor man's solution, as it's not
     // directly obvious to a gui user. :)
diff -uNbwr kdebase-3.5.9/kdesu/kdesud/Makefile.am kdebase-3.5.9-new/kdesu/kdesud/Makefile.am
--- kdebase-3.5.9/kdesu/kdesud/Makefile.am	2005-09-10 04:26:13.000000000 -0400
+++ kdebase-3.5.9-new/kdesu/kdesud/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -4,10 +4,13 @@
 
 KDE_CXXFLAGS = $(KDE_USE_FPIE)
 
-bin_PROGRAMS = kdesud
-kdesud_SOURCES = kdesud.cpp repo.cpp lexer.cpp handler.cpp secure.cpp 
-kdesud_LDFLAGS = $(KDE_USE_PIE) $(all_libraries) $(KDE_RPATH)
-kdesud_LDADD = $(LIB_KDECORE) -lkdesu $(LIBSOCKET)
+bin_PROGRAMS = 
+lib_LTLIBRARIES = 
+kdeinit_LTLIBRARIES = kdesud.la
+
+kdesud_la_SOURCES = kdesud.cpp repo.cpp lexer.cpp handler.cpp secure.cpp 
+kdesud_la_LDFLAGS = $(KDE_USE_PIE) $(all_libraries) $(KDE_PLUGIN) -module
+kdesud_la_LIBADD = $(LIB_KDECORE) -lkdesu $(LIBSOCKET)
 noinst_HEADERS = repo.h handler.h lexer.h secure.h
 
 ## kdesud needs to be suid or sgid something
diff -uNbwr kdebase-3.5.9/kdesu/kdesud/kdesud.cpp kdebase-3.5.9-new/kdesu/kdesud/kdesud.cpp
--- kdebase-3.5.9/kdesu/kdesud/kdesud.cpp	2007-05-14 03:55:53.000000000 -0400
+++ kdebase-3.5.9-new/kdesu/kdesud/kdesud.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -246,7 +246,7 @@
  * Main program
  */
 
-int main(int argc, char *argv[])
+extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
 {
     KAboutData aboutData("kdesud", I18N_NOOP("KDE su daemon"),
             Version, I18N_NOOP("Daemon used by kdesu"),
diff -uNbwr kdebase-3.5.9/kdialog/Makefile.am kdebase-3.5.9-new/kdialog/Makefile.am
--- kdebase-3.5.9/kdialog/Makefile.am	2005-09-10 04:25:36.000000000 -0400
+++ kdebase-3.5.9-new/kdialog/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -1,11 +1,13 @@
 KDE_CXXFLAGS = -DQT_NO_CAST_ASCII -DQT_NO_ASCII_CAST
 INCLUDES = $(all_includes)
 
-bin_PROGRAMS = kdialog
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kdialog.la
 
-kdialog_SOURCES = kdialog.cpp widgets.cpp klistboxdialog.cpp progressdialog.cpp progressdialogiface.skel
-kdialog_LDADD = $(LIB_KIO)
-kdialog_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kdialog_la_SOURCES = kdialog.cpp widgets.cpp klistboxdialog.cpp progressdialog.cpp progressdialogiface.skel
+kdialog_la_LIBADD = $(LIB_KIO)
+kdialog_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
 
 METASOURCES = AUTO
 
diff -uNbwr kdebase-3.5.9/kdialog/kdialog.cpp kdebase-3.5.9-new/kdialog/kdialog.cpp
--- kdebase-3.5.9/kdialog/kdialog.cpp	2006-05-22 14:12:42.000000000 -0400
+++ kdebase-3.5.9-new/kdialog/kdialog.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -660,7 +660,7 @@
 }
 
 
-int main(int argc, char *argv[])
+extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
 {
   KAboutData aboutData( "kdialog", I18N_NOOP("KDialog"),
                         "1.0", I18N_NOOP( "KDialog can be used to show nice dialog boxes from shell scripts" ),
diff -uNbwr kdebase-3.5.9/kdm/kfrontend/kdm_greet.c kdebase-3.5.9-new/kdm/kfrontend/kdm_greet.c
--- kdebase-3.5.9/kdm/kfrontend/kdm_greet.c	2005-10-10 11:04:31.000000000 -0400
+++ kdebase-3.5.9-new/kdm/kfrontend/kdm_greet.c	2008-02-13 21:05:55.000000000 -0500
@@ -44,8 +44,9 @@
 # include <sched.h>
 #endif
 
-#if defined(HAVE_XTEST) || defined(HAVE_XKB)
 # include <X11/Xlib.h>
+
+#if defined(HAVE_XTEST) || defined(HAVE_XKB)
 # include <X11/keysym.h>
 #endif
 
diff -uNbwr kdebase-3.5.9/kfind/Makefile.am kdebase-3.5.9-new/kfind/Makefile.am
--- kdebase-3.5.9/kfind/Makefile.am	2005-09-10 04:25:00.000000000 -0400
+++ kdebase-3.5.9-new/kfind/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -28,9 +28,12 @@
 
 #And this is for kfind
 
-bin_PROGRAMS = kfind
-kfind_SOURCES = kfwin.cpp kfinddlg.cpp main.cpp 
-kfind_LDADD   =  libkfind_common.la $(LIB_KPARTS)
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kfind.la
+
+kfind_la_SOURCES = kfwin.cpp kfinddlg.cpp main.cpp 
+kfind_la_LIBADD  =  libkfind_common.la $(LIB_KPARTS)
 
 # the library search path.
-kfind_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kfind_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
diff -uNbwr kdebase-3.5.9/kfind/main.cpp kdebase-3.5.9-new/kfind/main.cpp
--- kdebase-3.5.9/kfind/main.cpp	2005-09-10 04:25:00.000000000 -0400
+++ kdebase-3.5.9-new/kfind/main.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -19,7 +19,7 @@
   KCmdLineLastOption
 };
 
-int main( int argc, char ** argv )
+extern "C" KDE_EXPORT int kdemain( int argc, char ** argv )
 {
   KLocale::setMainCatalogue("kfindpart");
   KAboutData aboutData( "kfind", I18N_NOOP("KFind"),
diff -uNbwr kdebase-3.5.9/khelpcenter/Makefile.am kdebase-3.5.9-new/khelpcenter/Makefile.am
--- kdebase-3.5.9/khelpcenter/Makefile.am	2005-09-10 04:25:18.000000000 -0400
+++ kdebase-3.5.9-new/khelpcenter/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -3,14 +3,14 @@
 INCLUDES = $(all_includes)
 METASOURCES = AUTO
 
-bin_PROGRAMS = khc_indexbuilder
+bin_PROGRAMS = 
 lib_LTLIBRARIES = 
 
-khc_indexbuilder_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-khc_indexbuilder_LDADD = $(LIB_KDECORE)
-khc_indexbuilder_SOURCES = khc_indexbuilder.cpp
+khc_indexbuilder_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+khc_indexbuilder_la_LIBADD = $(LIB_KDECORE)
+khc_indexbuilder_la_SOURCES = khc_indexbuilder.cpp
 
-kdeinit_LTLIBRARIES = khelpcenter.la
+kdeinit_LTLIBRARIES = khelpcenter.la khc_indexbuilder.la
 
 khelpcenter_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
 khelpcenter_la_LIBADD = $(LIB_KHTML)
diff -uNbwr kdebase-3.5.9/khelpcenter/htmlsearch/Makefile.am kdebase-3.5.9-new/khelpcenter/htmlsearch/Makefile.am
--- kdebase-3.5.9/khelpcenter/htmlsearch/Makefile.am	2005-09-10 04:25:18.000000000 -0400
+++ kdebase-3.5.9-new/khelpcenter/htmlsearch/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -21,14 +21,15 @@
 
 xdg_apps_DATA = htmlsearch.desktop
 
-bin_PROGRAMS = khtmlindex
+bin_PROGRAMS = 
+kdeinit_LTLIBRARIES = khtmlindex.la
 
 wrapperdir = $(kde_datadir)/khelpcenter/
 wrapper_SCRIPTS = meinproc_wrapper
 
-khtmlindex_SOURCES = index.cpp
-khtmlindex_LDFLAGS = $(KDE_RPATH) $(all_libraries)
-khtmlindex_LDADD = libhtmlsearch.la $(LIB_KDEUI)
+khtmlindex_la_SOURCES = index.cpp
+khtmlindex_la_LDFLAGS = $(KDE_PLUGIN) $(all_libraries) -module
+khtmlindex_la_LIBADD = libhtmlsearch.la $(LIB_KDEUI)
 
 xpm_DATA = unchecked.xpm checked.xpm
 xpmdir = $(kde_datadir)/khelpcenter/pics
diff -uNbwr kdebase-3.5.9/khelpcenter/htmlsearch/index.cpp kdebase-3.5.9-new/khelpcenter/htmlsearch/index.cpp
--- kdebase-3.5.9/khelpcenter/htmlsearch/index.cpp	2005-09-10 04:25:18.000000000 -0400
+++ kdebase-3.5.9-new/khelpcenter/htmlsearch/index.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -13,7 +13,7 @@
 };
 
 
-int main(int argc, char *argv[])
+extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
 {
   KAboutData aboutData( "khtmlindex", I18N_NOOP("KHtmlIndex"),
 	"",
diff -uNbwr kdebase-3.5.9/khelpcenter/khc_indexbuilder.cpp kdebase-3.5.9-new/khelpcenter/khc_indexbuilder.cpp
--- kdebase-3.5.9/khelpcenter/khc_indexbuilder.cpp	2007-10-08 05:51:18.000000000 -0400
+++ kdebase-3.5.9-new/khelpcenter/khc_indexbuilder.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -168,7 +168,7 @@
   KCmdLineLastOption
 };
 
-int main( int argc, char **argv )
+extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
 {
   KAboutData aboutData( "khc_indexbuilder",
                         I18N_NOOP("KHelpCenter Index Builder"),
diff -uNbwr kdebase-3.5.9/kicker/extensions/kasbar/Makefile.am kdebase-3.5.9-new/kicker/extensions/kasbar/Makefile.am
--- kdebase-3.5.9/kicker/extensions/kasbar/Makefile.am	2005-09-10 04:25:29.000000000 -0400
+++ kdebase-3.5.9-new/kicker/extensions/kasbar/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -35,10 +35,12 @@
 
 EXTRA_DIST = $(lnk_DATA)
 
-bin_PROGRAMS = kasbar
-kasbar_SOURCES = kasbarapp.cpp
-kasbar_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-kasbar_LDADD = 	libkasbar.la \
+bin_PROGRAMS = 
+kdeinit_LTLIBRARIES = kasbar.la
+
+kasbar_la_SOURCES = kasbarapp.cpp
+kasbar_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kasbar_la_LIBADD = 	libkasbar.la \
 		$(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI)
 
 
diff -uNbwr kdebase-3.5.9/kicker/extensions/kasbar/kasbarapp.cpp kdebase-3.5.9-new/kicker/extensions/kasbar/kasbarapp.cpp
--- kdebase-3.5.9/kicker/extensions/kasbar/kasbarapp.cpp	2005-10-10 11:03:59.000000000 -0400
+++ kdebase-3.5.9-new/kicker/extensions/kasbar/kasbarapp.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -73,7 +73,7 @@
    KCmdLineLastOption
 };
 
-int main( int argc, char **argv )
+extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
 {
   KCmdLineArgs::init( argc, argv, "kasbar", "KasBar", I18N_NOOP( "An alternative task manager" ), VERSION_STRING );
   KCmdLineArgs::addCmdLineOptions( options );
diff -uNbwr kdebase-3.5.9/kioslave/info/kde-info2html.conf kdebase-3.5.9-new/kioslave/info/kde-info2html.conf
--- kdebase-3.5.9/kioslave/info/kde-info2html.conf	2005-09-10 04:25:37.000000000 -0400
+++ kdebase-3.5.9-new/kioslave/info/kde-info2html.conf	2008-02-13 21:05:55.000000000 -0500
@@ -25,6 +25,7 @@
 
 #-- location of info files.
 our @INFODIR = (
+	    "@FINKPREFIX@/share/info",
 	    "/usr/share/info",
 	    "/usr/info",
 	    "/usr/lib/info",
diff -uNbwr kdebase-3.5.9/kioslave/ldap/configure.in.in kdebase-3.5.9-new/kioslave/ldap/configure.in.in
--- kdebase-3.5.9/kioslave/ldap/configure.in.in	2005-10-10 11:04:01.000000000 -0400
+++ kdebase-3.5.9-new/kioslave/ldap/configure.in.in	2008-02-13 21:05:55.000000000 -0500
@@ -38,10 +38,11 @@
 case "$with_ldap" in
 no) AC_MSG_RESULT(no) ;;
 framework)
-  LDAP_LIBS="-Xlinker -framework -Xlinker LDAP"
+  LDAP_LIBS="-Wl,-framework,LDAP"
   AC_DEFINE_UNQUOTED(HAVE_LIBLDAP, 1, [Define if you have LDAP libraries])
   LDAP_SUBDIR="ldap"
   AC_MSG_RESULT(Apple framework)
+  with_ldap=FOUND
   ;;
 FOUND)
   AC_MSG_RESULT(incs=$ldap_incdir libs=$ldap_libdir)
diff -uNbwr kdebase-3.5.9/kioslave/man/kio_man.cpp kdebase-3.5.9-new/kioslave/man/kio_man.cpp
--- kdebase-3.5.9/kioslave/man/kio_man.cpp	2007-10-08 05:51:22.000000000 -0400
+++ kdebase-3.5.9-new/kioslave/man/kio_man.cpp	2008-02-13 21:05:55.000000000 -0500
@@ -50,7 +50,7 @@
 
 MANProtocol *MANProtocol::_self = 0;
 
-#define SGML2ROFF_DIRS "/usr/lib/sgml"
+#define SGML2ROFF_DIRS "@FINKPREFIX@/share/sgml"
 
 /*
  * Drop trailing ".section[.gz]" from name
@@ -895,6 +895,7 @@
 
     // Default paths
     static const char *manpaths[] = {
+        "@FINKPREFIX@/share/man",
         "/usr/X11/man",
         "/usr/X11R6/man",
         "/usr/man",
diff -uNbwr kdebase-3.5.9/kioslave/media/configure.in.in kdebase-3.5.9-new/kioslave/media/configure.in.in
--- kdebase-3.5.9/kioslave/media/configure.in.in	2007-05-14 03:55:41.000000000 -0400
+++ kdebase-3.5.9-new/kioslave/media/configure.in.in	2008-02-13 21:05:55.000000000 -0500
@@ -182,3 +182,5 @@
 
 AC_CHECK_FUNCS(statvfs)
 
+AC_CHECK_FUNCS(statvfs)
+
diff -uNbwr kdebase-3.5.9/kioslave/media/mounthelper/Makefile.am kdebase-3.5.9-new/kioslave/media/mounthelper/Makefile.am
--- kdebase-3.5.9/kioslave/media/mounthelper/Makefile.am	2006-07-22 04:15:42.000000000 -0400
+++ kdebase-3.5.9-new/kioslave/media/mounthelper/Makefile.am	2008-02-13 21:05:55.000000000 -0500
@@ -1,12 +1,14 @@
-bin_PROGRAMS = kio_media_mounthelper
+bin_PROGRAMS =
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kio_media_mounthelper.la
 
 INCLUDES = -I$(srcdir)/../libmediacommon $(all_includes)
 AM_LDFLAGS = $(all_libraries)
 
-kio_media_mounthelper_SOURCES = kio_media_mounthelper.cpp
+kio_media_mounthelper_la_SOURCES = kio_media_mounthelper.cpp
 
-kio_media_mounthelper_LDFLAGS = $(KDE_RPATH) $(all_libraries)
-kio_media_mounthelper_LDADD = ../libmediacommon/libmediacommon.la $(LIB_KIO)
+kio_media_mounthelper_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) $(KDE_PLUGIN)
+kio_media_mounthelper_la_LIBADD = ../libmediacommon/libmediacommon.la $(LIB_KIO)
 
 METASOURCES = AUTO
 
diff -uNbwr kdebase-3.5.9/kioslave/media/mounthelper/kio_media_mounthelper.cpp kdebase-3.5.9-new/kioslave/media/mounthelper/kio_media_mounthelper.cpp
--- kdebase-3.5.9/kioslave/media/mounthelper/kio_media_mounthelper.cpp	2007-05-14 03:55:40.000000000 -0400
+++ kdebase-3.5.9-new/kioslave/media/mounthelper/kio_media_mounthelper.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -188,7 +188,7 @@
 };
 
 
-int main(int argc, char **argv)
+extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
 {
 	KCmdLineArgs::init(argc, argv, "kio_media_mounthelper",
 	                   "kio_media_mounthelper", "kio_media_mounthelper",
diff -uNbwr kdebase-3.5.9/kioslave/nfs/mount_xdr.c kdebase-3.5.9-new/kioslave/nfs/mount_xdr.c
--- kdebase-3.5.9/kioslave/nfs/mount_xdr.c	2005-09-10 04:25:37.000000000 -0400
+++ kdebase-3.5.9-new/kioslave/nfs/mount_xdr.c	2008-02-13 21:05:56.000000000 -0500
@@ -43,6 +43,13 @@
 
 /* from @(#)mount.x	1.3 91/03/11 TIRPC 1.0 */
 
+#if defined(__APPLE__) && !defined(IXDR_GET_INT32)
+#define IXDR_GET_INT32(buf)             ((int32_t)ntohl((u_int32_t)*(buf)++))
+#define IXDR_PUT_INT32(buf, v)          (*(buf)++ =(int32_t)htonl((u_int32_t)v))
+#define IXDR_GET_U_INT32(buf)           ((u_int32_t)IXDR_GET_INT32(buf))
+#define IXDR_PUT_U_INT32(buf, v)        IXDR_PUT_INT32((buf), ((int32_t)(v)))
+#endif
+
 bool_t
 xdr_fhandle(XDR *xdrs, fhandle objp)
 {
diff -uNbwr kdebase-3.5.9/kioslave/trash/Makefile.am kdebase-3.5.9-new/kioslave/trash/Makefile.am
--- kdebase-3.5.9/kioslave/trash/Makefile.am	2005-09-10 04:25:37.000000000 -0400
+++ kdebase-3.5.9-new/kioslave/trash/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -9,10 +9,13 @@
 kio_trash_la_LIBADD  = libtrashcommon.la $(LIB_KIO)
 kio_trash_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) -no-undefined
 
-bin_PROGRAMS = ktrash
-ktrash_SOURCES = ktrash.cpp
-ktrash_LDADD = $(LIB_KIO)
-ktrash_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = ktrash.la
+
+ktrash_la_SOURCES = ktrash.cpp
+ktrash_la_LIBADD = $(LIB_KIO)
+ktrash_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
 
 kde_services_DATA = trash.protocol
 
diff -uNbwr kdebase-3.5.9/kioslave/trash/ktrash.cpp kdebase-3.5.9-new/kioslave/trash/ktrash.cpp
--- kdebase-3.5.9/kioslave/trash/ktrash.cpp	2005-10-10 11:04:01.000000000 -0400
+++ kdebase-3.5.9-new/kioslave/trash/ktrash.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -35,7 +35,7 @@
     KCmdLineLastOption
 };
 
-int main(int argc, char *argv[])
+extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
 {
     KApplication::disableAutoDcopRegistration();
     KCmdLineArgs::init( argc, argv, "ktrash",
diff -uNbwr kdebase-3.5.9/knetattach/Makefile.am kdebase-3.5.9-new/knetattach/Makefile.am
--- kdebase-3.5.9/knetattach/Makefile.am	2005-09-10 04:25:49.000000000 -0400
+++ kdebase-3.5.9-new/knetattach/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -1,9 +1,12 @@
 INCLUDES= $(all_includes)
 
-bin_PROGRAMS = knetattach
-knetattach_SOURCES = knetattach.ui main.cpp
-knetattach_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-knetattach_LDADD   = $(LIB_KIO)
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = knetattach.la
+
+knetattach_la_SOURCES = knetattach.ui main.cpp
+knetattach_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+knetattach_la_LIBADD  = $(LIB_KIO)
 METASOURCES = AUTO
 xdg_apps_DATA = knetattach.desktop
 KDE_ICON = AUTO
diff -uNbwr kdebase-3.5.9/knetattach/main.cpp kdebase-3.5.9-new/knetattach/main.cpp
--- kdebase-3.5.9/knetattach/main.cpp	2005-10-10 11:04:20.000000000 -0400
+++ kdebase-3.5.9-new/knetattach/main.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -25,7 +25,7 @@
 
 #include "knetattach.h"
 
-int main(int argc, char **argv) {
+extern "C" KDE_EXPORT int kdemain(int argc, char **argv) {
 	KAboutData about("knetattach", I18N_NOOP("KDE Network Wizard"), "1.0",
 		I18N_NOOP("KDE Network Wizard"),
 		KAboutData::License_GPL,
diff -uNbwr kdebase-3.5.9/konqueror/keditbookmarks/Makefile.am kdebase-3.5.9-new/konqueror/keditbookmarks/Makefile.am
--- kdebase-3.5.9/konqueror/keditbookmarks/Makefile.am	2005-09-10 04:25:49.000000000 -0400
+++ kdebase-3.5.9-new/konqueror/keditbookmarks/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -2,13 +2,13 @@
 
 METASOURCES = AUTO
 
-bin_PROGRAMS = kbookmarkmerger
+bin_PROGRAMS = 
 lib_LTLIBRARIES =
-kdeinit_LTLIBRARIES = keditbookmarks.la
+kdeinit_LTLIBRARIES = keditbookmarks.la kbookmarkmerger.la
 
-kbookmarkmerger_SOURCES = kbookmarkmerger.cpp
-kbookmarkmerger_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-kbookmarkmerger_LDADD = $(LIB_KIO)
+kbookmarkmerger_la_SOURCES = kbookmarkmerger.cpp
+kbookmarkmerger_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kbookmarkmerger_la_LIBADD = $(LIB_KIO)
 
 dcop_DCOPIDLNG = true
 keditbookmarks_la_SOURCES = main.cpp listview.cpp toplevel.cpp actionsimpl.cpp commands.cpp importers.cpp dcop.skel dcop.cpp bookmarkiterator.cpp  \
diff -uNbwr kdebase-3.5.9/konqueror/keditbookmarks/kbookmarkmerger.cpp kdebase-3.5.9-new/konqueror/keditbookmarks/kbookmarkmerger.cpp
--- kdebase-3.5.9/konqueror/keditbookmarks/kbookmarkmerger.cpp	2005-09-10 04:25:49.000000000 -0400
+++ kdebase-3.5.9-new/konqueror/keditbookmarks/kbookmarkmerger.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -55,7 +55,7 @@
 	return XGetSelectionOwner( dpy, atom ) != None;
 }
 
-int main( int argc, char**argv )
+extern "C" KDE_EXPORT int kdemain( int argc, char**argv )
 {
 	const bool kdeRunning = kdeIsRunning();
 
diff -uNbwr kdebase-3.5.9/kpager/Makefile.am kdebase-3.5.9-new/kpager/Makefile.am
--- kdebase-3.5.9/kpager/Makefile.am	2005-09-10 04:25:36.000000000 -0400
+++ kdebase-3.5.9-new/kpager/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -1,14 +1,16 @@
 INCLUDES= $(all_includes)
 
-bin_PROGRAMS = kpager
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kpager.la
 
-kpager_SOURCES = desktop.cpp kpager.cpp config.cpp windowdrag.cpp \
+kpager_la_SOURCES = desktop.cpp kpager.cpp config.cpp windowdrag.cpp \
 	kpagerIface.skel main.cpp  
 
-kpager_METASOURCES = AUTO
-kpager_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kpager_la_METASOURCES = AUTO
+kpager_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
 
-kpager_LDADD = $(LIB_KDEUI)
+kpager_la_LIBADD = $(LIB_KDEUI)
 
 KDE_ICON = kpager
 
diff -uNbwr kdebase-3.5.9/kpager/main.cpp kdebase-3.5.9-new/kpager/main.cpp
--- kdebase-3.5.9/kpager/main.cpp	2005-10-10 11:04:00.000000000 -0400
+++ kdebase-3.5.9-new/kpager/main.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -62,7 +62,7 @@
 
 };
 
-int main(int argc, char **argv)
+extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
 {
     KAboutData *aboutdata = new KAboutData("kpager", "KPager", "1.5",
 					   I18N_NOOP("Desktop Overview"), KAboutData::License_GPL,
diff -uNbwr kdebase-3.5.9/kpersonalizer/Makefile.am kdebase-3.5.9-new/kpersonalizer/Makefile.am
--- kdebase-3.5.9/kpersonalizer/Makefile.am	2005-09-10 04:25:00.000000000 -0400
+++ kdebase-3.5.9-new/kpersonalizer/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -1,11 +1,14 @@
-bin_PROGRAMS = kpersonalizer
-kpersonalizer_SOURCES = stylepreview.ui krefinepage.cpp \
+bin_PROGRAMS =
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kpersonalizer.la
+
+kpersonalizer_la_SOURCES = stylepreview.ui krefinepage.cpp \
       kstylepage.cpp keyecandypage.cpp kospage.cpp kcountrypage.cpp kpersonalizer.cpp \
       main.cpp kfindlanguage.cpp \
       kcountrypagedlg.ui kospagedlg.ui keyecandypagedlg.ui kstylepagedlg.ui \
       krefinepagedlg.ui  ksysinfo.cpp
 
-kpersonalizer_LDADD   = $(LIB_KIO) 
+kpersonalizer_la_LIBADD  = $(LIB_KIO) 
 
 EXTRA_DIST = main.cpp kpersonalizer.cpp kpersonalizer.h kpersonalizer.desktop kcountrypage.cpp kcountrypage.h kospage.cpp kospage.h keyecandypage.cpp keyecandypage.h kstylepage.cpp kstylepage.h krefinepage.cpp krefinepage.h cr16-app-kpersonalizer.png cr32-app-kpersonalizer.png README kcountrypagedlg.ui kospage.ui keyecandypagedlg.ui kstylepagedlg.ui krefinepagedlg.ui kfindlanguage.cpp kfindlanguage.h
 
@@ -38,7 +41,7 @@
 
 KDE_ICON= AUTO
 # the library search path. 
-kpersonalizer_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kpersonalizer_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
 
 # Uncomment the following two lines if you add a ui.rc file for your application to make use of
 # KDE´s XML GUI builing
diff -uNbwr kdebase-3.5.9/kpersonalizer/main.cpp kdebase-3.5.9-new/kpersonalizer/main.cpp
--- kdebase-3.5.9/kpersonalizer/main.cpp	2005-09-10 04:25:00.000000000 -0400
+++ kdebase-3.5.9-new/kpersonalizer/main.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -33,7 +33,7 @@
         KCmdLineLastOption
 };
 
-int main(int argc, char *argv[])
+extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
 {
 	KAboutData aboutData( "kpersonalizer", I18N_NOOP("KPersonalizer"),
 		VERSION, description, KAboutData::License_GPL,
diff -uNbwr kdebase-3.5.9/kreadconfig/Makefile.am kdebase-3.5.9-new/kreadconfig/Makefile.am
--- kdebase-3.5.9/kreadconfig/Makefile.am	2005-09-10 04:25:36.000000000 -0400
+++ kdebase-3.5.9-new/kreadconfig/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -1,12 +1,17 @@
 AM_CPPFLAGS = -DQT_NO_CAST_ASCII 
 
 INCLUDES = $(all_includes)
-AM_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-LDADD   =       $(LIB_KDECORE)
 
-bin_PROGRAMS	= kreadconfig kwriteconfig
-kreadconfig_SOURCES	= kreadconfig.cpp
-kwriteconfig_SOURCES	= kwriteconfig.cpp
+bin_PROGRAMS	= 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kreadconfig.la kwriteconfig.la
+kreadconfig_la_SOURCES = kreadconfig.cpp
+kreadconfig_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kreadconfig_la_LIBADD  = $(LIB_KDECORE)
+
+kwriteconfig_la_SOURCES	= kwriteconfig.cpp
+kwriteconfig_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwriteconfig_la_LIBADD  = $(LIB_KDECORE)
 
 messages:
 	$(XGETTEXT) $(kreadconfig_SOURCES) -o $(podir)/kreadconfig.pot
diff -uNbwr kdebase-3.5.9/kreadconfig/kreadconfig.cpp kdebase-3.5.9-new/kreadconfig/kreadconfig.cpp
--- kdebase-3.5.9/kreadconfig/kreadconfig.cpp	2005-09-10 04:25:36.000000000 -0400
+++ kdebase-3.5.9-new/kreadconfig/kreadconfig.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -41,7 +41,7 @@
 	{ "type <type>", I18N_NOOP("Type of variable"), 0 },
         KCmdLineLastOption
 };
-int main(int argc, char **argv)
+extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
 {
 	KAboutData aboutData("kreadconfig", I18N_NOOP("KReadConfig"),
 		"1.0.1",
diff -uNbwr kdebase-3.5.9/kreadconfig/kwriteconfig.cpp kdebase-3.5.9-new/kreadconfig/kwriteconfig.cpp
--- kdebase-3.5.9/kreadconfig/kwriteconfig.cpp	2005-09-10 04:25:36.000000000 -0400
+++ kdebase-3.5.9-new/kreadconfig/kwriteconfig.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -23,7 +23,7 @@
 	{ "+value", I18N_NOOP( "The value to write. Mandatory, on a shell use '' for empty" ), 0 },
         KCmdLineLastOption
 };
-int main(int argc, char **argv)
+extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
 {
 	KAboutData aboutData("kwriteconfig", I18N_NOOP("KWriteConfig"),
 		"1.0.0",
diff -uNbwr kdebase-3.5.9/ksplashml/Makefile.am kdebase-3.5.9-new/ksplashml/Makefile.am
--- kdebase-3.5.9/ksplashml/Makefile.am	2005-09-10 04:25:51.000000000 -0400
+++ kdebase-3.5.9-new/ksplashml/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -4,10 +4,13 @@
 
 METASOURCES=AUTO
 
-bin_PROGRAMS = ksplash
-ksplash_SOURCES = wndmain.cpp ksplashiface.skel main.cpp
-ksplash_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-ksplash_LDADD = $(LIB_KDEUI) themeengine/default/libthemedefault.la themeengine/libksplashthemes.la $(LIB_KIO)
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = ksplash.la
+
+ksplash_la_SOURCES = wndmain.cpp ksplashiface.skel main.cpp
+ksplash_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+ksplash_la_LIBADD = $(LIB_KDEUI) themeengine/default/libthemedefault.la themeengine/libksplashthemes.la $(LIB_KIO)
 
 noinst_HEADERS = ksplashiface.h wndmain.h
 
diff -uNbwr kdebase-3.5.9/ksplashml/main.cpp kdebase-3.5.9-new/ksplashml/main.cpp
--- kdebase-3.5.9/ksplashml/main.cpp	2005-09-10 04:25:51.000000000 -0400
+++ kdebase-3.5.9-new/ksplashml/main.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -37,7 +37,7 @@
   KCmdLineLastOption
 };
 
-int main( int argc, char **argv )
+extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
 {
   KAboutData about(
     "ksplash",
diff -uNbwr kdebase-3.5.9/ksplashml/themeengine/simple/Makefile.am kdebase-3.5.9-new/ksplashml/themeengine/simple/Makefile.am
--- kdebase-3.5.9/ksplashml/themeengine/simple/Makefile.am	2005-09-10 04:25:50.000000000 -0400
+++ kdebase-3.5.9-new/ksplashml/themeengine/simple/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -1,7 +1,10 @@
 
 INCLUDES = $(all_includes)
 
-bin_PROGRAMS = ksplashsimple
-ksplashsimple_SOURCES = main.cpp
-ksplashsimple_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-ksplashsimple_LDADD = $(LIB_XINERAMA) $(LIB_X11)
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = ksplashsimple.la
+
+ksplashsimple_la_SOURCES = main.cpp
+ksplashsimple_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+ksplashsimple_la_LIBADD = $(LIB_XINERAMA) $(LIB_X11)
diff -uNbwr kdebase-3.5.9/ksplashml/themeengine/simple/main.cpp kdebase-3.5.9-new/ksplashml/themeengine/simple/main.cpp
--- kdebase-3.5.9/ksplashml/themeengine/simple/main.cpp	2006-10-01 13:32:04.000000000 -0400
+++ kdebase-3.5.9-new/ksplashml/themeengine/simple/main.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -31,10 +31,11 @@
 # endif
 #endif
 
+#include <kdemacros.h>
 
 //#define DEBUG
 
-int main( int argc, char* argv[])
+extern "C" KDE_EXPORT int kdemain( int argc, char* argv[])
     {
     if( fork() != 0 )
         return 0;
diff -uNbwr kdebase-3.5.9/kstart/Makefile.am kdebase-3.5.9-new/kstart/Makefile.am
--- kdebase-3.5.9/kstart/Makefile.am	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.9-new/kstart/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -6,10 +6,13 @@
 
 #######	Files
 
-bin_PROGRAMS	= kstart
-kstart_SOURCES	= kstart.cpp
-kstart_LDFLAGS  = $(all_libraries) $(KDE_RPATH)
-kstart_LDADD    = $(LIB_KDECORE)
+bin_PROGRAMS	= 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kstart.la
+
+kstart_la_SOURCES	= kstart.cpp
+kstart_la_LDFLAGS  = $(all_libraries) $(KDE_PLUGIN) -module
+kstart_la_LIBADD   = $(LIB_KDECORE)
 METASOURCES =	kstart.moc 
 
 noinst_HEADERS = kstart.h version.h
diff -uNbwr kdebase-3.5.9/kstart/kstart.cpp kdebase-3.5.9-new/kstart/kstart.cpp
--- kdebase-3.5.9/kstart/kstart.cpp	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.9-new/kstart/kstart.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -283,7 +283,7 @@
   KCmdLineLastOption
 };
 
-int main( int argc, char *argv[] )
+extern "C" KDE_EXPORT int kdemain( int argc, char *argv[] )
 {
   // David, 05/03/2000
   KAboutData aboutData( "kstart", I18N_NOOP("KStart"), KSTART_VERSION,
diff -uNbwr kdebase-3.5.9/ksysguard/gui/Makefile.am kdebase-3.5.9-new/ksysguard/gui/Makefile.am
--- kdebase-3.5.9/ksysguard/gui/Makefile.am	2005-09-10 04:26:15.000000000 -0400
+++ kdebase-3.5.9-new/ksysguard/gui/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -18,21 +18,23 @@
  
 ####### This part is very ksysguard specific
 # you can add here more. This one gets installed 
-bin_PROGRAMS = ksysguard kpm
+bin_PROGRAMS = kpm
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = ksysguard.la
 
 # Which sources should be compiled for ksysguard.
-ksysguard_SOURCES = \
+ksysguard_la_SOURCES = \
 	SensorBrowser.cc \
 	WorkSheet.cc \
 	WorkSheetSettings.cc \
 	Workspace.cc \
 	ksysguard.cc ksysguard.skel
 
-ksysguard_LDADD = \
+ksysguard_la_LIBADD = \
 	ksgrd/libksgrd.la \
 	SensorDisplayLib/libsensordisplays.la \
 	$(LIB_KDEUI) $(LIB_KIO) $(LIB_KDNSSD)
-ksysguard_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+ksysguard_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module
 
 kpm_SOURCES = kpm.c
 
diff -uNbwr kdebase-3.5.9/ksysguard/gui/ksysguard.cc kdebase-3.5.9-new/ksysguard/gui/ksysguard.cc
--- kdebase-3.5.9/ksysguard/gui/ksysguard.cc	2006-03-17 05:17:48.000000000 -0500
+++ kdebase-3.5.9-new/ksysguard/gui/ksysguard.cc	2008-02-13 21:05:56.000000000 -0500
@@ -520,7 +520,7 @@
 /*
  * Once upon a time...
  */
-int main( int argc, char** argv )
+extern "C" KDE_EXPORT int kdemain( int argc, char** argv )
 {
   // initpipe is used to keep the parent process around till the child
   // has registered with dcop.
diff -uNbwr kdebase-3.5.9/ksystraycmd/Makefile.am kdebase-3.5.9-new/ksystraycmd/Makefile.am
--- kdebase-3.5.9/ksystraycmd/Makefile.am	2005-09-10 04:26:16.000000000 -0400
+++ kdebase-3.5.9-new/ksystraycmd/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -1,16 +1,19 @@
 ####### Fiddle here
 
 INCLUDES = $(all_includes)
-LDADD    = $(LIB_KDEUI)
 
 #######	Files
 
-bin_PROGRAMS	= ksystraycmd
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = ksystraycmd.la
+
 METASOURCES	= ksystraycmd.moc
 noinst_HEADERS  = ksystraycmd.h
 
-ksystraycmd_SOURCES = ksystraycmd.cpp main.cpp
-ksystraycmd_LDFLAGS  = $(all_libraries) $(KDE_RPATH)
+ksystraycmd_la_SOURCES = ksystraycmd.cpp main.cpp
+ksystraycmd_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+ksystraycmd_la_LIBADD  = $(LIB_KDEUI)
 
 messages:
 	$(XGETTEXT) $(ksystraycmd_SOURCES) -o $(podir)/ksystraycmd.pot
diff -uNbwr kdebase-3.5.9/ksystraycmd/main.cpp kdebase-3.5.9-new/ksystraycmd/main.cpp
--- kdebase-3.5.9/ksystraycmd/main.cpp	2006-10-01 13:32:16.000000000 -0400
+++ kdebase-3.5.9-new/ksystraycmd/main.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -46,7 +46,7 @@
   KCmdLineLastOption
 };
 
-int main( int argc, char *argv[] )
+extern "C" KDE_EXPORT int kdemain( int argc, char *argv[] )
 {
   KAboutData aboutData( "ksystraycmd", I18N_NOOP( "KSysTrayCmd" ),
 			"KSysTrayCmd 0.1",
diff -uNbwr kdebase-3.5.9/ktip/Makefile.am kdebase-3.5.9-new/ktip/Makefile.am
--- kdebase-3.5.9/ktip/Makefile.am	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.9-new/ktip/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -2,10 +2,13 @@
 
 SUBDIRS = pics
 
-bin_PROGRAMS = ktip
-ktip_SOURCES = ktipwindow.cpp
-ktip_LDADD = $(LIB_KDEUI)
-ktip_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = ktip.la
+
+ktip_la_SOURCES = ktipwindow.cpp
+ktip_la_LIBADD = $(LIB_KDEUI)
+ktip_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
 
 METASOURCES = AUTO
 KDE_ICON = AUTO
diff -uNbwr kdebase-3.5.9/ktip/ktipwindow.cpp kdebase-3.5.9-new/ktip/ktipwindow.cpp
--- kdebase-3.5.9/ktip/ktipwindow.cpp	2005-10-10 11:04:21.000000000 -0400
+++ kdebase-3.5.9-new/ktip/ktipwindow.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -31,7 +31,7 @@
 
 static const char description[] = I18N_NOOP("Useful tips");
 
-int main(int argc, char *argv[])
+extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
 {
 	KAboutData aboutData("ktip", I18N_NOOP("KTip"),
 				"0.3", description, KAboutData::License_GPL,
diff -uNbwr kdebase-3.5.9/kwin/clients/kwmtheme/cli_installer/Makefile.am kdebase-3.5.9-new/kwin/clients/kwmtheme/cli_installer/Makefile.am
--- kdebase-3.5.9/kwin/clients/kwmtheme/cli_installer/Makefile.am	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.9-new/kwin/clients/kwmtheme/cli_installer/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -4,15 +4,17 @@
 
 ####### This part is very kwmtheme specific
 # you can add here more. This one gets installed 
-bin_PROGRAMS = 	kwmtheme
+bin_PROGRAMS = 	
+lib_LTLIBRARIES = 
+kdeinit_LTLIBRARIES = kwmtheme.la
 
 # Which sources should be compiled for kwmtheme.
-kwmtheme_SOURCES = main.cpp 
+kwmtheme_la_SOURCES = main.cpp 
 
 # the library search path. 
-kwmtheme_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kwmtheme_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
 
 # the libraries to link against. Be aware of the order. First the libraries,
 # that depend on the following ones.
-kwmtheme_LDADD   = $(LIB_KDECORE)
+kwmtheme_la_LIBADD   = $(LIB_KDECORE)
 
diff -uNbwr kdebase-3.5.9/kwin/clients/kwmtheme/cli_installer/main.cpp kdebase-3.5.9-new/kwin/clients/kwmtheme/cli_installer/main.cpp
--- kdebase-3.5.9/kwin/clients/kwmtheme/cli_installer/main.cpp	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.9-new/kwin/clients/kwmtheme/cli_installer/main.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -37,7 +37,7 @@
     copyOutput.close();
 }
 
-int main(int argc, char **argv)
+extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
 {
     KCmdLineArgs::init(argc, argv, "kwmtheme", description, "0.1");
     KCmdLineArgs::addCmdLineOptions( options );
diff -uNbwr kdebase-3.5.9/kwin/killer/Makefile.am kdebase-3.5.9-new/kwin/killer/Makefile.am
--- kdebase-3.5.9/kwin/killer/Makefile.am	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.9-new/kwin/killer/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -1,9 +1,11 @@
 INCLUDES = $(all_includes)
 
-bin_PROGRAMS = kwin_killer_helper
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kwin_killer_helper.la
 
-kwin_killer_helper_SOURCES = killer.cpp
-kwin_killer_helper_LDADD = $(LIB_KDEUI)
-kwin_killer_helper_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kwin_killer_helper_la_SOURCES = killer.cpp
+kwin_killer_helper_la_LIBADD = $(LIB_KDEUI)
+kwin_killer_helper_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
 
 METASOURCES = AUTO
diff -uNbwr kdebase-3.5.9/kwin/killer/killer.cpp kdebase-3.5.9-new/kwin/killer/killer.cpp
--- kdebase-3.5.9/kwin/killer/killer.cpp	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.9-new/kwin/killer/killer.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -43,7 +43,7 @@
         KCmdLineLastOption
     };
 
-int main( int argc, char* argv[] )
+extern "C" KDE_EXPORT int kdemain( int argc, char* argv[] )
     {
     KLocale::setMainCatalogue( "kwin" ); // the messages are in kwin's .po file
     KCmdLineArgs::init( argc, argv, "kwin_killer_helper", I18N_NOOP( "KWin" ),
diff -uNbwr kdebase-3.5.9/libkonq/Makefile.am kdebase-3.5.9-new/libkonq/Makefile.am
--- kdebase-3.5.9/libkonq/Makefile.am	2005-10-10 11:04:21.000000000 -0400
+++ kdebase-3.5.9-new/libkonq/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -21,7 +21,7 @@
 
 lib_LTLIBRARIES = libkonq.la
 libkonq_la_LDFLAGS = $(all_libraries) -version-info 6:0:2 -no-undefined
-libkonq_la_LIBADD = $(LIB_KPARTS)
+libkonq_la_LIBADD = $(LIB_KPARTS) $(LIBZ)
 
 libkonq_la_SOURCES = konq_popupmenu.cc knewmenu.cc \
    konq_xmlguiclient.cc\
diff -uNbwr kdebase-3.5.9/nsplugins/Makefile.am kdebase-3.5.9-new/nsplugins/Makefile.am
--- kdebase-3.5.9/nsplugins/Makefile.am	2007-10-08 05:51:24.000000000 -0400
+++ kdebase-3.5.9-new/nsplugins/Makefile.am	2008-02-13 21:05:56.000000000 -0500
@@ -13,10 +13,13 @@
 libnsplugin_la_LDFLAGS = $(all_libraries) -avoid-version -module $(KDE_PLUGIN) -no-undefined
 libnsplugin_la_LIBADD  = -lkparts
 
-bin_PROGRAMS = nspluginscan
-nspluginscan_SOURCES = pluginscan.cpp 
-nspluginscan_LDFLAGS =  $(KDE_RPATH) $(all_libraries) -export-dynamic
-nspluginscan_LDADD = $(LIB_KDEUI) $(LIB_KSYCOCA) -lXt libpluginpaths.la
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = nspluginscan.la
+
+nspluginscan_la_SOURCES = pluginscan.cpp
+nspluginscan_la_LDFLAGS =  $(KDE_PLUGIN) $(all_libraries) -export-dynamic -module
+nspluginscan_la_LIBADD = $(LIB_KDEUI) $(LIB_KSYCOCA) -lXt libpluginpaths.la
 
 kcm_nsplugins_la_SOURCES = kcm_nsplugins.cpp 
 kcm_nsplugins_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
diff -uNbwr kdebase-3.5.9/nsplugins/pluginscan.cpp kdebase-3.5.9-new/nsplugins/pluginscan.cpp
--- kdebase-3.5.9/nsplugins/pluginscan.cpp	2007-10-08 05:51:24.000000000 -0400
+++ kdebase-3.5.9-new/nsplugins/pluginscan.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -516,7 +516,7 @@
 };
 
 
-int main( int argc, char **argv )
+extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
 {
     KAboutData aboutData( "nspluginscan", I18N_NOOP("nspluginscan"),
                           "0.3", "nspluginscan", KAboutData::License_GPL,
diff -uNbwr kdebase-3.5.9/nsplugins/sdk/prcpucfg.h kdebase-3.5.9-new/nsplugins/sdk/prcpucfg.h
--- kdebase-3.5.9/nsplugins/sdk/prcpucfg.h	2008-02-13 04:40:38.000000000 -0500
+++ kdebase-3.5.9-new/nsplugins/sdk/prcpucfg.h	2008-02-13 21:05:56.000000000 -0500
@@ -48,7 +48,7 @@
 
 #define PR_AF_INET6 10  /* same as AF_INET6 */
 
-#ifdef __powerpc__
+#if defined(__powerpc__) || defined(__POWERPC__)
 
 #undef  IS_LITTLE_ENDIAN
 #define IS_BIG_ENDIAN    1
diff -uNbwr kdebase-3.5.9/nsplugins/viewer/Makefile.am kdebase-3.5.9-new/nsplugins/viewer/Makefile.am
--- kdebase-3.5.9/nsplugins/viewer/Makefile.am	2008-02-13 04:40:38.000000000 -0500
+++ kdebase-3.5.9-new/nsplugins/viewer/Makefile.am	2008-02-13 21:07:01.000000000 -0500
@@ -1,11 +1,13 @@
 INCLUDES = -I$(top_srcdir)/nsplugins -I$(top_builddir)/nsplugins $(all_includes) `pkg-config --cflags glib-2.0`
 METASOURCES = AUTO
 
-bin_PROGRAMS = nspluginviewer 
+bin_PROGRAMS = 
+lib_LTLIBRARIES = 
+kdeinit_LTLIBRARIES = nspluginviewer.la
 
-nspluginviewer_SOURCES = NSPluginCallbackIface.stub NSPluginClassIface.skel \
+nspluginviewer_la_SOURCES = NSPluginCallbackIface.stub NSPluginClassIface.skel \
 	nsplugin.cpp viewer.cpp kxt.cpp qxteventloop.cpp glibevents.cpp
-nspluginviewer_LDFLAGS = $(all_libraries) $(KDE_RPATH) -export-dynamic `pkg-config --libs glib-2.0`
-nspluginviewer_LDADD = $(LIB_KIO) $(LIB_KPARTS) -lXt
+nspluginviewer_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -export-dynamic `pkg-config --libs glib-2.0`
+nspluginviewer_la_LIBADD = $(LIB_KIO) $(LIB_KPARTS) -lXt
 
 NSPluginCallbackIface_DIR = $(srcdir)/..
diff -uNbwr kdebase-3.5.9/nsplugins/viewer/viewer.cpp kdebase-3.5.9-new/nsplugins/viewer/viewer.cpp
--- kdebase-3.5.9/nsplugins/viewer/viewer.cpp	2008-02-13 04:40:38.000000000 -0500
+++ kdebase-3.5.9-new/nsplugins/viewer/viewer.cpp	2008-02-13 21:05:56.000000000 -0500
@@ -22,6 +22,9 @@
 
 */
 
+#if defined(__APPLE__) && !defined(RLIMIT_AS) && defined(RLIMIT_RSS)
+#define RLIMIT_AS RLIMIT_RSS
+#endif
 
 #include <config.h>
 
@@ -214,7 +217,7 @@
 #endif
 
 
-int main(int argc, char** argv)
+extern "C" KDE_EXPORT int kdemain(int argc, char** argv)
 {
     // nspluginviewer is a helper app, it shouldn't do session management at all
    setenv( "SESSION_MANAGER", "", 1 );
diff -uNbwr kdebase-3.5.9/startkde kdebase-3.5.9-new/startkde
--- kdebase-3.5.9/startkde	2008-02-13 04:49:19.000000000 -0500
+++ kdebase-3.5.9-new/startkde	2008-02-13 21:05:56.000000000 -0500
@@ -3,6 +3,11 @@
 #  DEFAULT KDE STARTUP SCRIPT ( KDE-3.5.9 )
 #
 
+source "@FINKPREFIX@/bin/init.sh"
+
+[ -x @FINKPREFIX@/bin/remap-bad-apple-keys.pl ] && @FINKPREFIX@/bin/remap-bad-apple-keys.pl
+
+
 # When the X server dies we get a HUP signal from xinit. We must ignore it
 # because we still need to do some cleanup.
 trap 'echo GOT SIGHUP' HUP
@@ -285,20 +290,23 @@
 
 echo 'startkde: Starting up...'  1>&2
 
-# run KPersonalizer before the session, if this is the first login
-if test "$kpersonalizerrc_general_firstlogin" = "true"; then
-    # start only dcopserver, don't start whole kdeinit (takes too long)
-    echo 'startkde: Running kpersonalizer...'  1>&2
-    dcopserver
-    kwin --lock &
-    kpersonalizer --before-session
-    # handle kpersonalizer restarts (language change)
-    while test $? -eq 1; do
-        kpersonalizer --r --before-session
-    done
-    dcopquit kwin
-    dcopserver_shutdown --wait
-fi
+# on osx we skip this, the defaults are sane and most people
+# do bad things like "mac os menus" which makes it worse
+
+## run KPersonalizer before the session, if this is the first login
+#if test "$kpersonalizerrc_general_firstlogin" = "true"; then
+#    # start only dcopserver, don't start whole kdeinit (takes too long)
+#    echo 'startkde: Running kpersonalizer...'  1>&2
+#    dcopserver
+#    kwin --lock &
+#    kpersonalizer --before-session
+#    # handle kpersonalizer restarts (language change)
+#    while test $? -eq 1; do
+#        kpersonalizer --r --before-session
+#    done
+#    dcopquit kwin
+#    dcopserver_shutdown --wait
+#fi
 
 if test -z "$dl"; then
   # the splashscreen and progress indicator
@@ -368,7 +376,33 @@
 # We only check for 255 which means that the ksmserver process could not be 
 # started, any problems thereafter, e.g. ksmserver failing to initialize, 
 # will remain undetected.
-test -n "$KDEWM" && KDEWM="--windowmanager $KDEWM"
+
+USE_PROXY=0
+if test -n "$KDEWM"; then
+  if test -z `expr "$KDEWM" : '\(.*quartz-wm.*\)'`; then
+    USE_PROXY=1
+  fi
+  KDEWM="--windowmanager $KDEWM"
+else
+  KDEWM="--windowmanager kwin"
+  USE_PROXY=1
+fi
+
+if test "$DISABLE_PROXY" = "1" || test "$DISABLE_PROXY" = "true"; then
+	USE_PROXY=0
+fi
+
+if test "$USE_PROXY" = "1"; then
+  if test -x /usr/X11R6/bin/quartz-wm; then
+    /usr/X11R6/bin/quartz-wm --only-proxy >/dev/null 2>&1 &
+  else
+    AUTOCUTSEL=`which autocutsel 2>/dev/null`
+    if test -n "$AUTOCUTSEL" && test -x "$AUTOCUTSEL"; then
+      $AUTOCUTSEL >/dev/null 2>&1 &
+    fi
+  fi
+fi
+
 kwrapper ksmserver $KDEWM 
 if test $? -eq 255; then
   # Startup error
