
--- kdebase-3.5.3/applnk/Makefile.am	2005-09-10 04:25:45.000000000 -0400
+++ kdebase-3.5.3-new/applnk/Makefile.am	2006-05-24 10:17:59.000000000 -0400
@@ -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 \
--- kdebase-3.5.3/doc/userguide/kde-for-admins.docbook	2006-03-17 05:17:25.000000000 -0500
+++ kdebase-3.5.3-new/doc/userguide/kde-for-admins.docbook	2006-05-24 10:17:59.000000000 -0400
@@ -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>
--- kdebase-3.5.3/drkonqi/Makefile.am	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.3-new/drkonqi/Makefile.am	2006-05-24 10:17:59.000000000 -0400
@@ -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
--- kdebase-3.5.3/drkonqi/main.cpp	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.3-new/drkonqi/main.cpp	2006-05-24 10:17:59.000000000 -0400
@@ -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());
--- kdebase-3.5.3/kappfinder/Makefile.am	2005-09-10 04:25:41.000000000 -0400
+++ kdebase-3.5.3-new/kappfinder/Makefile.am	2006-05-24 10:17:59.000000000 -0400
@@ -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
--- kdebase-3.5.3/kappfinder/main.cpp	2005-10-10 11:04:07.000000000 -0400
+++ kdebase-3.5.3-new/kappfinder/main.cpp	2006-05-24 10:18:00.000000000 -0400
@@ -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,
--- kdebase-3.5.3/kcontrol/filetypes/Makefile.am	2005-09-10 04:25:08.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/filetypes/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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
--- kdebase-3.5.3/kcontrol/filetypes/keditfiletype.cpp	2005-10-10 11:03:47.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/filetypes/keditfiletype.cpp	2006-05-24 10:18:00.000000000 -0400
@@ -108,7 +108,7 @@
   KCmdLineLastOption
 };
 
-int main(int argc, char ** argv)
+extern "C" KDE_EXPORT int kdemain(int argc, char ** argv)
 {
   KServiceTypeProfile::setConfigurationMode();
   KLocale::setMainCatalogue("filetypes");
--- kdebase-3.5.3/kcontrol/fonts/Makefile.am	2006-03-17 05:17:12.000000000 -0500
+++ kdebase-3.5.3-new/kcontrol/fonts/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -4,13 +4,13 @@
 libkxftconfig_la_LIBADD = $(LIBFONTCONFIG_LIBS)
 libkxftconfig_la_LDFLAGS = $(LIBFONTCONFIG_RPATH)
 
-AM_CPPFLAGS  = $(all_includes) $(LIBFONTCONFIG_CFLAGS) -D_LARGEFILE64_SOURCE
+AM_CPPFLAGS  = $(LIBFONTCONFIG_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) -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
--- kdebase-3.5.3/kcontrol/fonts/configure.in.in	2005-09-10 04:25:04.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/fonts/configure.in.in	2006-05-24 10:18:00.000000000 -0400
@@ -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;}'`
--- kdebase-3.5.3/kcontrol/kfontinst/configure.in.in	2006-01-19 12:00:50.000000000 -0500
+++ kdebase-3.5.3-new/kcontrol/kfontinst/configure.in.in	2006-05-24 10:18:00.000000000 -0400
@@ -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;}'`
--- kdebase-3.5.3/kcontrol/kfontinst/kcmfontinst/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/kfontinst/kcmfontinst/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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
  
--- kdebase-3.5.3/kcontrol/kfontinst/kfile-plugin/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/kfontinst/kfile-plugin/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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
--- kdebase-3.5.3/kcontrol/kfontinst/kfontinst/Main.cpp	2005-10-10 11:03:47.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/kfontinst/kfontinst/Main.cpp	2006-05-24 10:18:00.000000000 -0400
@@ -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[]=
--- kdebase-3.5.3/kcontrol/kfontinst/kfontinst/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/kfontinst/kfontinst/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -1,5 +1,8 @@
-bin_PROGRAMS = kfontinst
-kfontinst_SOURCES = \
+bin_PROGRAMS = 
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = kfontinst.la
+
+kfontinst_la_SOURCES = \
 CompressedFile.cpp \
 Main.cpp \
 Encodings.cpp \
@@ -15,6 +18,6 @@
 Fontmap.h \
 XConfig.h
 
-kfontinst_LDADD = ../../fonts/libkxftconfig.la $(LIBFONTCONFIG_LIBS) $(LIBFREETYPE_LIBS) $(LIB_FONT_ENC) $(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_la_LIBADD = $(LIBFONTCONFIG_LIBS) $(LIBFREETYPE_LIBS) $(LIB_FONT_ENC) ../../fonts/libkxftconfig.la $(LIBZ) $(LIB_KIO) ../lib/libkfontinst.la
+kfontinst_la_LDFLAGS = $(LIBFONTCONFIG_RPATH) $(LIBFREETYPE_RPATH) $(all_libraries) $(KDE_PLUGIN) -module
+AM_CPPFLAGS= -DOS_$(UNAME) -I$(srcdir)/../lib -I$(srcdir)/../../fonts $(LIBFREETYPE_CFLAGS) $(LIBFONTCONFIG_CFLAGS) $(all_includes)
--- kdebase-3.5.3/kcontrol/kfontinst/kio/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/kfontinst/kio/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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 = \
--- kdebase-3.5.3/kcontrol/kfontinst/lib/FcEngine.h	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/kfontinst/lib/FcEngine.h	2006-05-24 10:18:00.000000000 -0400
@@ -5,6 +5,8 @@
 #include "config.h"
 #endif
 
+#define KFI_FC_NO_WIDTHS 1
+
 #include <qstring.h>
 #include <qvaluevector.h>
 #include <qfont.h>
--- kdebase-3.5.3/kcontrol/kfontinst/lib/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/kfontinst/lib/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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)
--- kdebase-3.5.3/kcontrol/kfontinst/thumbnail/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/kfontinst/thumbnail/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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)
--- kdebase-3.5.3/kcontrol/kfontinst/viewpart/FontViewerApp.cpp	2005-10-10 11:03:47.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/kfontinst/viewpart/FontViewerApp.cpp	2006-05-24 10:18:00.000000000 -0400
@@ -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);
--- kdebase-3.5.3/kcontrol/kfontinst/viewpart/Makefile.am	2005-09-10 04:25:09.000000000 -0400
+++ kdebase-3.5.3-new/kcontrol/kfontinst/viewpart/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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
 
 
--- kdebase-3.5.3/kdcop/Makefile.am	2005-09-10 04:25:53.000000000 -0400
+++ kdebase-3.5.3-new/kdcop/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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
--- kdebase-3.5.3/kdcop/kdcop.cpp	2005-09-10 04:25:53.000000000 -0400
+++ kdebase-3.5.3-new/kdcop/kdcop.cpp	2006-05-24 10:18:00.000000000 -0400
@@ -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" ),
--- kdebase-3.5.3/kdebugdialog/Makefile.am	2005-09-10 04:24:57.000000000 -0400
+++ kdebase-3.5.3-new/kdebugdialog/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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	
--- kdebase-3.5.3/kdebugdialog/main.cpp	2005-10-10 11:03:40.000000000 -0400
+++ kdebase-3.5.3-new/kdebugdialog/main.cpp	2006-05-24 10:18:00.000000000 -0400
@@ -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"),
--- kdebase-3.5.3/kdepasswd/Makefile.am	2005-09-10 04:24:59.000000000 -0400
+++ kdebase-3.5.3-new/kdepasswd/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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)
--- kdebase-3.5.3/kdepasswd/kdepasswd.cpp	2005-09-10 04:24:59.000000000 -0400
+++ kdebase-3.5.3-new/kdepasswd/kdepasswd.cpp	2006-05-24 10:18:00.000000000 -0400
@@ -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."),
--- kdebase-3.5.3/kdeprint/kdeprintfax/Makefile.am	2005-09-10 04:25:38.000000000 -0400
+++ kdebase-3.5.3-new/kdeprint/kdeprintfax/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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
 
--- kdebase-3.5.3/kdeprint/kdeprintfax/main.cpp	2005-10-10 11:04:02.000000000 -0400
+++ kdebase-3.5.3-new/kdeprint/kdeprintfax/main.cpp	2006-05-24 10:18:00.000000000 -0400
@@ -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"),
--- kdebase-3.5.3/kdeprint/kprinter/printwrapper.cpp	2005-10-10 11:04:05.000000000 -0400
+++ kdebase-3.5.3-new/kdeprint/kprinter/printwrapper.cpp	2006-05-24 10:18:00.000000000 -0400
@@ -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);
--- kdebase-3.5.3/kdesktop/Makefile.am	2006-05-22 14:12:51.000000000 -0400
+++ kdebase-3.5.3-new/kdesktop/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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
 
--- kdebase-3.5.3/kdesktop/kcheckrunning.cpp	2005-10-10 11:04:11.000000000 -0400
+++ kdebase-3.5.3-new/kdesktop/kcheckrunning.cpp	2006-05-24 10:18:00.000000000 -0400
@@ -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 )
--- kdebase-3.5.3/kdesktop/kwebdesktop/Makefile.am	2005-09-10 04:25:45.000000000 -0400
+++ kdebase-3.5.3-new/kdesktop/kwebdesktop/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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
--- kdebase-3.5.3/kdesktop/kwebdesktop/kwebdesktop.cpp	2006-05-22 14:12:50.000000000 -0400
+++ kdebase-3.5.3-new/kdesktop/kwebdesktop/kwebdesktop.cpp	2006-05-24 10:18:00.000000000 -0400
@@ -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,
--- kdebase-3.5.3/kdesktop/lock/Makefile.am	2005-09-10 04:25:41.000000000 -0400
+++ kdebase-3.5.3-new/kdesktop/lock/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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
 
--- kdebase-3.5.3/kdesktop/lock/main.cc	2006-03-17 05:17:37.000000000 -0500
+++ kdebase-3.5.3-new/kdesktop/lock/main.cc	2006-05-24 10:18:00.000000000 -0400
@@ -59,7 +59,7 @@
 
 // -----------------------------------------------------------------------------
 
-int main( int argc, char **argv )
+extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
 {
     KLocale::setMainCatalogue("kdesktop");
 
--- kdebase-3.5.3/kdesu/kdesu/Makefile.am	2005-09-10 04:26:14.000000000 -0400
+++ kdebase-3.5.3-new/kdesu/kdesu/Makefile.am	2006-05-24 10:18:00.000000000 -0400
@@ -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
--- kdebase-3.5.3/kdesu/kdesu/kdesu.cpp	2006-05-22 14:13:07.000000000 -0400
+++ kdebase-3.5.3-new/kdesu/kdesu/kdesu.cpp	2006-05-24 10:19:04.000000000 -0400
@@ -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. :)
--- kdebase-3.5.3/kdesu/kdesud/Makefile.am	2005-09-10 04:26:13.000000000 -0400
+++ kdebase-3.5.3-new/kdesu/kdesud/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
--- kdebase-3.5.3/kdesu/kdesud/kdesud.cpp	2005-09-10 04:26:13.000000000 -0400
+++ kdebase-3.5.3-new/kdesu/kdesud/kdesud.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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"),
--- kdebase-3.5.3/kdialog/Makefile.am	2005-09-10 04:25:36.000000000 -0400
+++ kdebase-3.5.3-new/kdialog/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
 
--- kdebase-3.5.3/kfind/Makefile.am	2005-09-10 04:25:00.000000000 -0400
+++ kdebase-3.5.3-new/kfind/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
--- kdebase-3.5.3/kfind/main.cpp	2005-09-10 04:25:00.000000000 -0400
+++ kdebase-3.5.3-new/kfind/main.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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"),
--- kdebase-3.5.3/khelpcenter/Makefile.am	2005-09-10 04:25:18.000000000 -0400
+++ kdebase-3.5.3-new/khelpcenter/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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)
--- kdebase-3.5.3/khelpcenter/htmlsearch/Makefile.am	2005-09-10 04:25:18.000000000 -0400
+++ kdebase-3.5.3-new/khelpcenter/htmlsearch/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
--- kdebase-3.5.3/khelpcenter/htmlsearch/index.cpp	2005-09-10 04:25:18.000000000 -0400
+++ kdebase-3.5.3-new/khelpcenter/htmlsearch/index.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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"),
 	"",
--- kdebase-3.5.3/khelpcenter/khc_indexbuilder.cpp	2005-10-10 11:03:57.000000000 -0400
+++ kdebase-3.5.3-new/khelpcenter/khc_indexbuilder.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -163,7 +163,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"),
--- kdebase-3.5.3/kicker/extensions/kasbar/Makefile.am	2005-09-10 04:25:29.000000000 -0400
+++ kdebase-3.5.3-new/kicker/extensions/kasbar/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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)
 
 
--- kdebase-3.5.3/kicker/extensions/kasbar/kasbarapp.cpp	2005-10-10 11:03:59.000000000 -0400
+++ kdebase-3.5.3-new/kicker/extensions/kasbar/kasbarapp.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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 );
--- kdebase-3.5.3/kioslave/info/kde-info2html.conf	2005-09-10 04:25:37.000000000 -0400
+++ kdebase-3.5.3-new/kioslave/info/kde-info2html.conf	2006-05-24 10:18:12.000000000 -0400
@@ -25,6 +25,7 @@
 
 #-- location of info files.
 our @INFODIR = (
+	    "@FINKPREFIX@/share/info",
 	    "/usr/share/info",
 	    "/usr/info",
 	    "/usr/lib/info",
--- kdebase-3.5.3/kioslave/ldap/configure.in.in	2005-10-10 11:04:01.000000000 -0400
+++ kdebase-3.5.3-new/kioslave/ldap/configure.in.in	2006-05-24 10:18:12.000000000 -0400
@@ -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)
--- kdebase-3.5.3/kioslave/man/kio_man.cpp	2005-10-10 11:04:01.000000000 -0400
+++ kdebase-3.5.3-new/kioslave/man/kio_man.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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
@@ -883,6 +883,7 @@
 
     // Default paths
     static const char *manpaths[] = {
+        "@FINKPREFIX@/share/man",
         "/usr/X11/man",
         "/usr/X11R6/man",
         "/usr/man",
--- kdebase-3.5.3/kioslave/media/mounthelper/Makefile.am	2005-09-10 04:25:36.000000000 -0400
+++ kdebase-3.5.3-new/kioslave/media/mounthelper/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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 = $(LIB_KIO) ../libmediacommon/libmediacommon.la
+kio_media_mounthelper_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -module
+kio_media_mounthelper_la_LIBADD = $(LIB_KIO) ../libmediacommon/libmediacommon.la
 
 METASOURCES = AUTO
 
--- kdebase-3.5.3/kioslave/media/mounthelper/kio_media_mounthelper.cpp	2006-03-17 05:17:33.000000000 -0500
+++ kdebase-3.5.3-new/kioslave/media/mounthelper/kio_media_mounthelper.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -192,7 +192,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",
--- kdebase-3.5.3/kioslave/trash/Makefile.am	2005-09-10 04:25:37.000000000 -0400
+++ kdebase-3.5.3-new/kioslave/trash/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
 
--- kdebase-3.5.3/kioslave/trash/ktrash.cpp	2005-10-10 11:04:01.000000000 -0400
+++ kdebase-3.5.3-new/kioslave/trash/ktrash.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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",
--- kdebase-3.5.3/knetattach/Makefile.am	2005-09-10 04:25:49.000000000 -0400
+++ kdebase-3.5.3-new/knetattach/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
--- kdebase-3.5.3/knetattach/main.cpp	2005-10-10 11:04:20.000000000 -0400
+++ kdebase-3.5.3-new/knetattach/main.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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,
--- kdebase-3.5.3/konqueror/keditbookmarks/Makefile.am	2005-09-10 04:25:49.000000000 -0400
+++ kdebase-3.5.3-new/konqueror/keditbookmarks/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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  \
--- kdebase-3.5.3/konqueror/keditbookmarks/kbookmarkmerger.cpp	2005-09-10 04:25:49.000000000 -0400
+++ kdebase-3.5.3-new/konqueror/keditbookmarks/kbookmarkmerger.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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();
 
--- kdebase-3.5.3/kpager/Makefile.am	2005-09-10 04:25:36.000000000 -0400
+++ kdebase-3.5.3-new/kpager/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
 
--- kdebase-3.5.3/kpager/main.cpp	2005-10-10 11:04:00.000000000 -0400
+++ kdebase-3.5.3-new/kpager/main.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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,
--- kdebase-3.5.3/kpersonalizer/Makefile.am	2005-09-10 04:25:00.000000000 -0400
+++ kdebase-3.5.3-new/kpersonalizer/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
--- kdebase-3.5.3/kpersonalizer/main.cpp	2005-09-10 04:25:00.000000000 -0400
+++ kdebase-3.5.3-new/kpersonalizer/main.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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,
--- kdebase-3.5.3/kreadconfig/Makefile.am	2005-09-10 04:25:36.000000000 -0400
+++ kdebase-3.5.3-new/kreadconfig/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
--- kdebase-3.5.3/kreadconfig/kreadconfig.cpp	2005-09-10 04:25:36.000000000 -0400
+++ kdebase-3.5.3-new/kreadconfig/kreadconfig.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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",
--- kdebase-3.5.3/kreadconfig/kwriteconfig.cpp	2005-09-10 04:25:36.000000000 -0400
+++ kdebase-3.5.3-new/kreadconfig/kwriteconfig.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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",
--- kdebase-3.5.3/ksplashml/Makefile.am	2005-09-10 04:25:51.000000000 -0400
+++ kdebase-3.5.3-new/ksplashml/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
 
--- kdebase-3.5.3/ksplashml/main.cpp	2005-09-10 04:25:51.000000000 -0400
+++ kdebase-3.5.3-new/ksplashml/main.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -37,7 +37,7 @@
   KCmdLineLastOption
 };
 
-int main( int argc, char **argv )
+extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
 {
   KAboutData about(
     "ksplash",
--- kdebase-3.5.3/ksplashml/themeengine/simple/Makefile.am	2005-09-10 04:25:50.000000000 -0400
+++ kdebase-3.5.3-new/ksplashml/themeengine/simple/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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)
--- kdebase-3.5.3/ksplashml/themeengine/simple/main.cpp	2006-05-22 14:13:00.000000000 -0400
+++ kdebase-3.5.3-new/ksplashml/themeengine/simple/main.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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;
--- kdebase-3.5.3/kstart/Makefile.am	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.3-new/kstart/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
--- kdebase-3.5.3/kstart/kstart.cpp	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.3-new/kstart/kstart.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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,
--- kdebase-3.5.3/ksysguard/gui/Makefile.am	2005-09-10 04:26:15.000000000 -0400
+++ kdebase-3.5.3-new/ksysguard/gui/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
 
--- kdebase-3.5.3/ksysguard/gui/ksysguard.cc	2006-03-17 05:17:48.000000000 -0500
+++ kdebase-3.5.3-new/ksysguard/gui/ksysguard.cc	2006-05-24 10:18:12.000000000 -0400
@@ -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.
--- kdebase-3.5.3/ksystraycmd/Makefile.am	2005-09-10 04:26:16.000000000 -0400
+++ kdebase-3.5.3-new/ksystraycmd/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
--- kdebase-3.5.3/ksystraycmd/main.cpp	2006-01-19 12:03:19.000000000 -0500
+++ kdebase-3.5.3-new/ksystraycmd/main.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -45,7 +45,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",
--- kdebase-3.5.3/ktip/Makefile.am	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.3-new/ktip/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
--- kdebase-3.5.3/ktip/ktipwindow.cpp	2005-10-10 11:04:21.000000000 -0400
+++ kdebase-3.5.3-new/ktip/ktipwindow.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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,
--- kdebase-3.5.3/kwin/clients/kwmtheme/cli_installer/Makefile.am	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.3-new/kwin/clients/kwmtheme/cli_installer/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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)
 
--- kdebase-3.5.3/kwin/clients/kwmtheme/cli_installer/main.cpp	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.3-new/kwin/clients/kwmtheme/cli_installer/main.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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 );
--- kdebase-3.5.3/kwin/killer/Makefile.am	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.3-new/kwin/killer/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
--- kdebase-3.5.3/kwin/killer/killer.cpp	2005-09-10 04:25:55.000000000 -0400
+++ kdebase-3.5.3-new/kwin/killer/killer.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -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" ),
--- kdebase-3.5.3/libkonq/Makefile.am	2005-10-10 11:04:21.000000000 -0400
+++ kdebase-3.5.3-new/libkonq/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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\
--- kdebase-3.5.3/nsplugins/Makefile.am	2005-09-10 04:25:39.000000000 -0400
+++ kdebase-3.5.3-new/nsplugins/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -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
+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
 
 kcm_nsplugins_la_SOURCES = kcm_nsplugins.cpp
 kcm_nsplugins_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
--- kdebase-3.5.3/nsplugins/pluginscan.cpp	2006-05-22 14:12:46.000000000 -0400
+++ kdebase-3.5.3-new/nsplugins/pluginscan.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -559,7 +559,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,
--- kdebase-3.5.3/nsplugins/viewer/Makefile.am	2005-09-10 04:25:39.000000000 -0400
+++ kdebase-3.5.3-new/nsplugins/viewer/Makefile.am	2006-05-24 10:18:12.000000000 -0400
@@ -1,12 +1,14 @@
 INCLUDES = -I$(top_srcdir)/nsplugins -I$(top_builddir)/nsplugins $(all_includes)
 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
-nspluginviewer_LDFLAGS = $(all_libraries) $(KDE_RPATH) -export-dynamic
-nspluginviewer_LDADD = $(LIB_KIO) $(LIB_KPARTS) -lXt
+nspluginviewer_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -export-dynamic -module
+nspluginviewer_la_LIBADD = $(LIB_KIO) $(LIB_KPARTS) -lXt
 
 NSPluginCallbackIface_DIR = $(srcdir)/..
 
--- kdebase-3.5.3/nsplugins/viewer/viewer.cpp	2006-01-19 12:01:49.000000000 -0500
+++ kdebase-3.5.3-new/nsplugins/viewer/viewer.cpp	2006-05-24 10:18:12.000000000 -0400
@@ -22,6 +22,9 @@
 
 */
 
+#if defined(__APPLE__) && !defined(RLIMIT_AS) && defined(RLIMIT_RSS)
+#define RLIMIT_AS RLIMIT_RSS
+#endif
 
 #include <config.h>
 
@@ -213,7 +216,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 );
--- kdebase-3.5.3/startkde	2006-05-23 07:33:49.000000000 -0400
+++ kdebase-3.5.3-new/startkde	2006-05-24 10:18:12.000000000 -0400
@@ -3,6 +3,11 @@
 #  DEFAULT KDE STARTUP SCRIPT ( KDE-3.5.3 )
 #
 
+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
@@ -254,20 +259,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
 
 # the splashscreen and progress indicator
 case "$ksplashrc_ksplash_theme" in 
@@ -314,7 +322,29 @@
 # 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 "$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
--- kdebase-3.5.3/kdialog/kdialog.cpp	2006-05-22 14:12:42.000000000 -0400
+++ kdebase-3.5.3-new/kdialog/kdialog.cpp	2006-05-24 22:10:32.000000000 -0400
@@ -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" ),
--- kdebase-3.5.3/kioslave/nfs/mount_xdr.c	Sat Sep 10 04:25:37 2005
+++ kdebase-3.5.3-new/kioslave/nfs/mount_xdr.c	Thu May 25 21:39:23 2006
@@ -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)
 {
--- kdebase-3.5.3/ksysguard/ksysguardd/ksysguardd.c	(revision 549512)
+++ kdebase-3.5.3/ksysguard/ksysguardd/ksysguardd.c	(working copy)
@@ -207,15 +207,19 @@ static void dropPrivileges( void )
 {
   struct passwd *pwd;
 
-  if ( ( pwd = getpwnam( "nobody" ) ) != NULL )
-    setuid( pwd->pw_uid );
-	else {
+  if ( ( pwd = getpwnam( "nobody" ) ) != NULL ) {
+    if ( !setgid(pwd->pw_gid) )
+      setuid(pwd->pw_uid);
+    if (!geteuid() && getuid() != pwd->pw_uid)
+      _exit(1);
+  }
+  else {
     log_error( "User 'nobody' does not exist." );
     /**
       We exit here to avoid becoming vulnerable just because
       user nobody does not exist.
      */
-    exit( 1 );
+    _exit(1);
   }
 }
 
@@ -231,7 +235,7 @@ void makeDaemon( void )
       chdir( "/" );
       umask( 0 );
       if ( createLockFile() < 0 )
-        exit( 1 );
+        _exit( 1 );
 
       dropPrivileges();
       installSignalHandler();
--- kdebase-3.5.3/drkonqi/main.cpp	(revision 549512)
+++ kdebase-3.5.3/drkonqi/main.cpp	(working copy)
@@ -61,7 +61,8 @@ int main( int argc, char* argv[] )
 {
   // Drop privs.
   setgid(getgid());
-  setuid(getuid());
+  if (setuid(getuid()) < 0 && geteuid() != getuid())
+     exit (255);
 
   // Make sure that DrKonqi doesn't start DrKonqi when it crashes :-]
   setenv("KDE_DEBUG", "true", 1);
--- kdebase-3.5.3/kdm/kfrontend/kgreeter.cpp	(revision 549445)
+++ kdebase-3.5.3/kdm/kfrontend/kgreeter.cpp	(working copy)
@@ -251,7 +251,12 @@ KGreeter::insertUsers()
 	// XXX remove seteuid-voodoo when we run as nobody
 	if (!(ps = getpwnam( "nobody" )))
 		return;
-	seteuid( ps->pw_uid );
+        if (setegid( ps->pw_gid )) 
+                return;
+        if (seteuid( ps->pw_uid )) {
+                setegid(0);
+                return;
+        }
 
 	QImage default_pix;
 	if (userView) {
@@ -318,6 +323,7 @@ KGreeter::insertUsers()
 
 	// XXX remove seteuid-voodoo when we run as nobody
 	seteuid( 0 );
+        setegid( 0 );
 }
 
 void
--- kdebase-3.5.3/kdm/backend/client.c	(revision 547560)
+++ kdebase-3.5.3/kdm/backend/client.c	(working copy)
@@ -1537,16 +1542,6 @@ ReadDmrc()
 
 	if (!StrApp( &fname, p->pw_dir, "/.dmrc", (char *)0 ))
 		return GE_Error;
-	if ((curdmrc = iniLoad( fname ))) {
-		free( fname );
-		return GE_Ok;
-	}
-
-	if (errno != EACCES) {
-		free( fname );
-		return GE_NoFile;
-	}
-
 	if (pipe( pfd ))
 		return GE_Error;
 	if ((pid = Fork()) < 0) {
