--- kde-2.2/kdelibs/kio/global.cpp.orig	Wed May  2 08:24:33 2001
+++ kde-2.2/kdelibs/kio/global.cpp	Wed May  2 08:25:11 2001
@@ -433,8 +433,29 @@
 #include <fstab.h>
 #endif
 #if defined(_AIX)
+#define vmount _vmount
 #include <sys/mntctl.h>
 #include <sys/vmount.h>
+#undef vmount
+struct vmount {
+        uint    vmt_revision;   /* I revision level, currently 1        */
+        uint    vmt_length;     /* I total length of structure and data */
+        fsid_t  vmt_fsid;       /* O id of file system                  */
+        int     vmt_vfsnumber;  /* O unique mount id of file system     */
+        uint    vmt_time;       /* O time of mount                      */
+        uint    vmt_timepad;    /* O (in future, time is 2 longs)       */
+        int     vmt_flags;      /* I general mount flags                */
+                                /* O MNT_REMOTE is output only          */
+        int     vmt_gfstype;    /* I type of gfs, see MNT_XXX above     */
+        struct _vmt_data {
+                short vmt_off;  /* I offset of data, word aligned       */
+                short vmt_size; /* I actual size of data in bytes       */
+        } vmt_data[VMT_LASTINDEX + 1];
+        /*
+         * the variable length data goes here, starting at word (32 bit)
+         * boundaries.
+         */
+};
 #include <sys/vfs.h>
 /* AIX does not prototype mntctl anywhere that I can find */
 #ifndef mntctl
--- kde-2.2/kdelibs/arts/mcop/startupmanager.cc.orig	Wed May  2 08:48:00 2001
+++ kde-2.2/kdelibs/arts/mcop/startupmanager.cc	Wed May  2 08:48:35 2001
@@ -38,6 +38,11 @@
 	StartupManager::add(this);
 }
 
+void StartupClass::startup()
+{
+        // shutdown is optional, startup is mandatory
+}
+
 void StartupClass::shutdown()
 {
 	// shutdown is optional, startup is mandatory
--- kde-2.2/kdelibs/arts/mcop/startupmanager.h.orig	Wed May  2 08:48:07 2001
+++ kde-2.2/kdelibs/arts/mcop/startupmanager.h	Wed May  2 08:48:46 2001
@@ -40,7 +40,7 @@
 class StartupClass {
 public:
 	StartupClass();
-	virtual void startup() = 0;
+	virtual void startup();
 	virtual void shutdown();
 };
 
--- kde-2.2/kdelibs/arts/soundserver/wavplayobject_impl.cc.orig	Wed May  2 09:12:33 2001
+++ kde-2.2/kdelibs/arts/soundserver/wavplayobject_impl.cc	Wed May  2 09:13:06 2001
@@ -8,7 +8,13 @@
 #include "convert.h"
 #include "debug.h"
 #include <iostream>
+#if defined(_AIX) && !defined(_AIX51)
+#  define exception _exception
+#endif
 #include <math.h>
+#if defined(_AIX) && !defined(_AIX51)
+#  undef exception
+#endif
 
 using namespace std;
 using namespace Arts;
--- kde-2.2/kdelibs/dcop/Makefile.am.orig	Thu May  3 16:59:26 2001
+++ kde-2.2/kdelibs/dcop/Makefile.am	Thu May  3 16:59:46 2001
@@ -32,7 +32,7 @@
 
 lib_LTLIBRARIES  = libDCOP.la dcopserver.la
 libDCOP_la_LIBADD = KDE-ICE/libkICE.la $(LIB_QT)
-libDCOP_la_LDFLAGS = -version-info 1:0 $(all_libraries) -no-undefined
+libDCOP_la_LDFLAGS = $(KDE_RPATH) -version-info 1:0 $(all_libraries) -no-undefined
 
 include_HEADERS = dcopclient.h dcopobject.h dcopstub.h dcopref.h
 noinst_HEADERS = version.h dcopglobal.h dcopserver.h dcop-doc.h testdcop.h dcopsignals.h
--- kde-2.2/kdelibs/arts/artsc/artscbackend.cc:1.1.1.1	Tue Feb 27 10:56:08 2001
+++ kde-2.2/kdelibs/arts/artsc/artscbackend.cc	Wed Feb 28 13:21:38 2001
@@ -30,7 +30,13 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <iostream>
+#if defined(_AIX) && !defined(_AIX51)
+#define exception _exception
+#endif
 #include <math.h>
+#if defined(_AIX) && !defined(_AIX51)
+#undef exception
+#endif
 #include <queue>
 #include <assert.h>
 
--- kde-2.2/kdelibs/arts/flow/convert.cc:1.1.1.1	Tue Feb 27 10:56:10 2001
+++ kde-2.2/kdelibs/arts/flow/convert.cc	Wed Feb 28 13:21:38 2001
@@ -21,7 +21,13 @@
     */
 
 #include "convert.h"
+#if defined(_AIX) && !defined(_AIX51)
+#  define exception _exception
+#endif
 #include <math.h>
+#if defined(_AIX) && !defined(_AIX51)
+#  undef exception
+#endif
 #include <string.h>
 #include <assert.h>
 #include <config.h>
--- kde-2.2/kdelibs/arts/flow/stereofftscope_impl.cc:1.1.1.1	Tue Feb 27 10:56:10 2001
+++ kde-2.2/kdelibs/arts/flow/stereofftscope_impl.cc	Wed Feb 28 13:21:38 2001
@@ -23,7 +23,13 @@
 #include "artsflow.h"
 #include "fft.h"
 #include "stdsynthmodule.h"
+#if defined(_AIX) && !defined(_AIX51)
+#define exception _exception
+#endif
 #include <math.h>
+#if defined(_AIX) && !defined(_AIX51)
+#undef exception
+#endif
 #include <iostream>
 
 using namespace std;
--- kde-2.2/kdelibs/arts/flow/stereovolumecontrol_impl.cc:1.1.1.1	Tue Feb 27 10:56:10 2001
+++ kde-2.2/kdelibs/arts/flow/stereovolumecontrol_impl.cc	Wed Feb 28 13:21:38 2001
@@ -20,7 +20,13 @@
 
     */
 
+#if defined(_AIX) && !defined(_AIX51)
+#define exception _exception
+#endif
 #include <math.h>
+#if defined(_AIX) && !defined(_AIX51)
+#undef exception
+#endif
 #include "artsflow.h"
 #include "stdsynthmodule.h"
 
--- kde-2.2/kdelibs/arts/flow/synth_frequency_impl.cc:1.1.1.1	Tue Feb 27 10:56:10 2001
+++ kde-2.2/kdelibs/arts/flow/synth_frequency_impl.cc	Wed Feb 28 13:21:39 2001
@@ -22,7 +22,13 @@
 
 #include "artsflow.h"
 #include "stdsynthmodule.h"
+#if defined(_AIX) && !defined(_AIX51)
+#define exception _exception
+#endif
 #include <math.h>
+#if defined(_AIX) && !defined(_AIX51)
+#undef exception
+#endif
 #include <stdio.h>
 
 using namespace Arts;
--- kde-2.2/kdelibs/arts/flow/synth_wave_sin_impl.cc:1.1.1.1	Tue Feb 27 10:56:10 2001
+++ kde-2.2/kdelibs/arts/flow/synth_wave_sin_impl.cc	Wed Feb 28 13:21:39 2001
@@ -22,7 +22,13 @@
 
 #include "artsflow.h"
 #include "stdsynthmodule.h"
+#if defined(_AIX) && !defined(_AIX51)
+#define exception _exception
+#endif
 #include <math.h>
+#if defined(_AIX) && !defined(_AIX51)
+#undef exception
+#endif
 
 using namespace Arts;
 
--- kde-2.2/kdelibs/arts/qtmcop/Makefile.am.orig	Fri May  4 14:41:16 2001
+++ kde-2.2/kdelibs/arts/qtmcop/Makefile.am	Fri May  4 14:41:33 2001
@@ -5,7 +5,7 @@
 
 libqtmcop_la_SOURCES = qiomanager.cc
 libqtmcop_la_LIBADD = $(top_builddir)/arts/mcop/libmcop.la $(LIB_QT)
-libqtmcop_la_LDFLAGS = -no-undefined $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS)
+libqtmcop_la_LDFLAGS = $(KDE_RPATH) -no-undefined $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS)
 
 METASOURCES = qiomanager_p.moc
 
--- kde-2.2/kdelibs/arts/kde/Makefile.am.orig	Tue May 22 09:55:07 2001
+++ kde-2.2/kdelibs/arts/kde/Makefile.am	Tue May 22 09:58:33 2001
@@ -8,7 +8,7 @@
 libartskde_la_SOURCES	    =	artskde.cc kioinputstream_impl.cpp kplayobject.cc \
 				kplayobjectfactory.cc kartsfloatwatch.cpp kartsdispatcher.cc
 libartskde_la_LIBADD        =   $(LIB_KSYCOCA) $(top_builddir)/arts/qtmcop/libqtmcop.la $(top_builddir)/arts/soundserver/libsoundserver_idl.la
-libartskde_la_LDFLAGS       =   $(all_libraries) -avoid-version -no-undefined
+libartskde_la_LDFLAGS       =   $(KDE_RPATH) $(all_libraries) -avoid-version -no-undefined
 libartskde_la_METASOURCES   =	AUTO
 
 artskdeincludedir	    =	$(includedir)/arts
--- kde-2.2/kdelibs/configure.in.orig	Fri Aug 10 14:53:28 2001
+++ kde-2.2/kdelibs/configure.in	Fri Aug 10 14:53:48 2001
@@ -1445,7 +1445,7 @@
 if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries"; then
  SSL_LDFLAGS=""
 else
- SSL_LDFLAGS="-L$ssl_libraries"
+ SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
 fi
 
 AC_SUBST(SSL_INCLUDES)
--- kde-2.2/kdelibs/libltdl/ltdl.c.orig	Mon Aug 27 14:04:28 2001
+++ kde-2.2/kdelibs/libltdl/ltdl.c	Mon Aug 27 16:35:07 2001
@@ -166,6 +166,7 @@
 #define LT_DLRESIDENT_FLAG	    (0x01 << 0)
 #ifdef _AIX
 #define LT_DLNOTFOUND_FLAG	    (0x01 << 1) /* may be linked statically */
+#define LT_DLMEMBER_FLAG	    RTLD_MEMBER
 #endif /* _AIX */
 /* ...add more flags here... */
 
@@ -601,7 +602,18 @@
      lt_user_data loader_data;
      const char *filename;
 {
+#ifdef _AIX
+  lt_module module;
+
+  /* If the basename is of the form "libname.a(member)", 
+     set the appropriate flag. */
+  if (strrchr(filename, '('))
+    lt_dlopen_flag |= LT_DLMEMBER_FLAG;
+
+  module = dlopen (filename, lt_dlopen_flag);
+#else
   lt_module   module   = dlopen (filename, lt_dlopen_flag);
+#endif
 
   if (!module)
     {
--- kde-2.2/kdelibs/kssl/kopenssl.cc.orig	Mon Aug 13 08:32:56 2001
+++ kde-2.2/kdelibs/kssl/kopenssl.cc	Sat Jul 28 23:55:41 2001
@@ -187,7 +187,8 @@
          _cryptoLib = ll->globalLibrary(libname.latin1());
    }
 #else
-   libpaths << "/usr/lib/"
+   libpaths << "/opt/freeware/lib/"
+            << "/usr/lib/"
             << "/usr/local/lib/"
             << "/usr/local/openssl/lib/"
             << "/usr/local/ssl/lib/"
@@ -195,11 +196,13 @@
             << "";
 
 // FIXME: #define here for the various OS types to optimize
-   libnamess << "libssl.so.0"
+   libnamess << "libssl.a(libssl.so.0)"
+             << "libssl.so.0"
              << "libssl.so"
              << "libssl.sl";
 
-   libnamesc << "libcrypto.so.0"
+   libnamesc << "libcrypto.a(libcrypto.so.0)"
+             << "libcrypto.so.0"
              << "libcrypto.so"
              << "libcrypto.sl";
 
@@ -240,9 +243,9 @@
       K_X509_dup = (X509* (*)(X509*)) _cryptoLib->symbol("X509_dup");
       K_BIO_new_fp = (BIO* (*)(FILE*, int)) _cryptoLib->symbol("BIO_new_fp");
       K_BIO_free = (int (*)(BIO*)) _cryptoLib->symbol("BIO_free");
-      K_PEM_ASN1_write_bio = (int (*)(int (*)(), const char *,BIO*, char*, const EVP_CIPHER *, unsigned char *, int, pem_password_cb *, void *)) _cryptoLib->symbol("PEM_ASN1_write_bio");
+      K_PEM_ASN1_write_bio = (int (*)(int (*)(...), const char *,BIO*, char*, const EVP_CIPHER *, unsigned char *, int, pem_password_cb *, void *)) _cryptoLib->symbol("PEM_ASN1_write_bio");
       K_X509_asn1_meth = (ASN1_METHOD* (*)(void)) _cryptoLib->symbol("X509_asn1_meth");
-      K_ASN1_i2d_fp = (int (*)(int (*)(), FILE*, unsigned char *)) _cryptoLib->symbol("ASN1_i2d_fp");
+      K_ASN1_i2d_fp = (int (*)(int (*)(...), FILE*, unsigned char *)) _cryptoLib->symbol("ASN1_i2d_fp");
       K_i2d_ASN1_HEADER = (int (*)(ASN1_HEADER *, unsigned char **)) _cryptoLib->symbol("i2d_ASN1_HEADER");
       K_X509_print_fp = (int (*)(FILE*, X509*)) _cryptoLib->symbol("X509_print_fp");
       K_i2d_PKCS12_fp = (int (*)(FILE *, PKCS12*)) _cryptoLib->symbol("i2d_PKCS12_fp");
@@ -257,7 +260,7 @@
       K_sk_free = (void (*) (STACK *)) _cryptoLib->symbol("sk_free");
       K_sk_num = (int (*) (STACK *)) _cryptoLib->symbol("sk_num");
       K_sk_value = (char* (*) (STACK *, int)) _cryptoLib->symbol("sk_value");
-      K_sk_new = (STACK* (*) (int (*)())) _cryptoLib->symbol("sk_new");
+      K_sk_new = (STACK* (*) (int (*)(...))) _cryptoLib->symbol("sk_new");
       K_sk_push = (int (*) (STACK*, char*)) _cryptoLib->symbol("sk_push");
       K_sk_dup = (STACK* (*) (STACK *)) _cryptoLib->symbol("sk_dup");
 #endif
@@ -307,10 +310,10 @@
                                   _sslLib->symbol("SSL_get_current_cipher");
       K_SSL_ctrl = (long (*)(SSL * ,int, long, char *))
                                   _sslLib->symbol("SSL_ctrl");
-      K_TLSv1_client_method = (SSL_METHOD *(*)()) _sslLib->symbol("TLSv1_client_method");
-      K_SSLv2_client_method = (SSL_METHOD *(*)()) _sslLib->symbol("SSLv2_client_method");
-      K_SSLv3_client_method = (SSL_METHOD *(*)()) _sslLib->symbol("SSLv3_client_method");
-      K_SSLv23_client_method = (SSL_METHOD *(*)()) _sslLib->symbol("SSLv23_client_method");
+      K_TLSv1_client_method = (SSL_METHOD *(*)(...)) _sslLib->symbol("TLSv1_client_method");
+      K_SSLv2_client_method = (SSL_METHOD *(*)(...)) _sslLib->symbol("SSLv2_client_method");
+      K_SSLv3_client_method = (SSL_METHOD *(*)(...)) _sslLib->symbol("SSLv3_client_method");
+      K_SSLv23_client_method = (SSL_METHOD *(*)(...)) _sslLib->symbol("SSLv23_client_method");
       K_SSL_get_peer_certificate = (X509 *(*)(SSL *)) _sslLib->symbol("SSL_get_peer_certificate");
       K_SSL_CIPHER_get_bits = (int (*)(SSL_CIPHER *,int *)) _sslLib->symbol("SSL_CIPHER_get_bits");
       K_SSL_CIPHER_get_version = (char * (*)(SSL_CIPHER *)) _sslLib->symbol("SSL_CIPHER_get_version");
@@ -634,7 +637,7 @@
 
 
 int KOpenSSLProxy::PEM_write_bio_X509(BIO *bp, X509 *x) {
-   if (K_PEM_ASN1_write_bio) return (K_PEM_ASN1_write_bio) ((int (*)())K_i2d_X509, PEM_STRING_X509, bp, (char *)x, NULL, NULL, 0, NULL, NULL);
+   if (K_PEM_ASN1_write_bio) return (K_PEM_ASN1_write_bio) ((int (*)(...))K_i2d_X509, PEM_STRING_X509, bp, (char *)x, NULL, NULL, 0, NULL, NULL);
    else return -1;
 }
 
@@ -647,7 +650,7 @@
 
 int KOpenSSLProxy::ASN1_i2d_fp(FILE *out,unsigned char *x) {
    if (K_ASN1_i2d_fp && K_i2d_ASN1_HEADER) 
-        return (K_ASN1_i2d_fp)((int (*)())K_i2d_ASN1_HEADER, out, x);
+        return (K_ASN1_i2d_fp)((int (*)(...))K_i2d_ASN1_HEADER, out, x);
    else return -1;
 }
 
@@ -752,7 +755,7 @@
 
 
 STACK* KOpenSSLProxy::sk_new(int (*cmp)()) {
-   if (K_sk_new) return (K_sk_new)(cmp);
+   if (K_sk_new) return (K_sk_new)((int (*)(...))cmp);
    else return NULL;
 }
 
--- kde-2.2/kdelibs/configure.orig	Thu Aug  9 15:38:05 2001
+++ kde-2.2/kdelibs/configure	Fri Aug 10 14:51:25 2001
@@ -4014,6 +4014,15 @@
 	data2 = malloc(2 * pagesize);
 	if (!data2)
 		exit(1);
+#ifdef _AIX
+        /*
+         *   We want to ensure data2 is not in the process private segment,
+         *   so issue mmap MAP_VARIABLE to get the first available address
+         *   in this process.
+         */
+        data2 = mmap(data2, pagesize, PROT_READ | PROT_WRITE,
+                     MAP_PRIVATE | MAP_VARIABLE, fd, 0L);
+#endif
 	data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
 	if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
 	    MAP_PRIVATE | MAP_FIXED, fd, 0L))
@@ -4043,7 +4052,7 @@
 }
 
 EOF
-if { (eval echo configure:4047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (XPG_SUS_ENV=ON ./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -14536,7 +14545,7 @@
 if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries"; then
  SSL_LDFLAGS=""
 else
- SSL_LDFLAGS="-L$ssl_libraries"
+ SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
 fi
 
 
--- kde-2.2/kdelibs/kio/http/http.cc.orig	Thu Aug  9 11:03:24 2001
+++ kde-2.2/kdelibs/kio/http/http.cc	Thu Aug  9 11:04:05 2001
@@ -39,6 +39,9 @@
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
+#ifdef _AIX
+#include <sys/machine.h>
+#endif
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <assert.h>
--- kde-2.2/kdelibs/config.h.in.orig	Thu Aug  9 09:10:41 2001
+++ kde-2.2/kdelibs/config.h.in	Thu Aug  9 09:11:11 2001
@@ -827,7 +827,7 @@
 /*
  * AIX prior to 4.3.3ml8 fails to provide a declaration for initgroups()
  */
-#if defined(HAVE_INITGROUPS) && !defined(HAVE_INITGROUPS_PROTO)
+#if defined(HAVE_INITGROUPS) && !HAVE_INITGROUPS_PROTO
 #include <grp.h>
 #ifdef __cplusplus
 extern "C"
--- kde-2.2/kdelibs/config.h.bot.orig	Thu Aug  9 09:25:01 2001
+++ kde-2.2/kdelibs/config.h.bot	Thu Aug  9 09:25:15 2001
@@ -181,7 +181,7 @@
 /*
  * AIX prior to 4.3.3ml8 fails to provide a declaration for initgroups()
  */
-#if defined(HAVE_INITGROUPS) && !defined(HAVE_INITGROUPS_PROTO)
+#if defined(HAVE_INITGROUPS) && !HAVE_INITGROUPS_PROTO
 #include <grp.h>
 #ifdef __cplusplus
 extern "C"
