Index: trunk/README.OS2
===================================================================
--- trunk/README.OS2	(revision 1057)
+++ trunk/README.OS2	(revision 1058)
@@ -75,12 +75,9 @@
       http://www.os2site.com/sw/util/archiver/lxlt133.zip
 
-  - CUPS 1.3.11 or later to support printing in Qt. The CUPS libraries are
+  - CUPS 1.4.8 or later to support printing in Qt. The CUPS libraries are
     available at:
 
-      http://download.smedley.info/cups-1.3.11-os2-20090807.zip
-
-    Linking against eCUPS also requires pthread.lib:
-
-      http://web.os2power.com/download/lib/pthread-20100217-os2.zip
+      http://sourceforge.net/projects/ecsports/files/CUPS/cups-1.4.8-os2-20110831.zip/download
+      http://svn.netlabs.org/ecups/wiki/CupsPort
 
   - OpenSSL 0.9.8o or later to support OpenSSL in Qt. The OpenSSL libraries are
@@ -95,7 +92,11 @@
       http://download.smedley.info/mysql-5.1.51-os2-20101001.zip
 
-    Note that you will also need the above OpenSSL libraries and pthread.lib to
-    be able to use this MySQL build. The MySQL Qt plugin itself will require
-    OpenSSL DLLs in your LIBPATH at runtime.
+    Linking against this MySQL build also requires pthread.lib:
+
+      http://web.os2power.com/download/lib/pthread-20100217-os2.zip
+
+    Note that you will also need the above OpenSSL libraries to be able to use
+    this MySQL build. The MySQL Qt plugin itself will require OpenSSL DLLs in
+    your LIBPATH at runtime.
 
   - PostgersSQL 9.0.1 or later to support the PostgresSQL Qt plugin. The
@@ -191,5 +192,11 @@
 
       set CUPS_INCLUDEPATH=<path_to_CUPS>\include
-      set CUPS_LIBS=-L<path_to_CUPS>\lib -llibcups.a -L<path_to_pthread> -lpthread.lib
+      set CUPS_LIBS=
+
+    Note that you will also need to add the location of cups.dll to BEGINLIBPATH
+    (if it is not already in your LIBPATH) so that Qt applications can find it
+    at runtime:
+
+      set BEGINLIBPATH=<path_to_CUPS>\sbin;%BEGINLIBPATH%
 
   - Unzip the OpenSSL libraries to some directory and set the following
@@ -199,7 +206,7 @@
       set OPENSSL_LIBS=
 
-    Note that you will also need to place OpenSSL DLLs to BEGINLIBPATH (if they
-    are not already in your LIBPATH) so that Qt applications can find them at
-    runtime:
+    Note that you will also need to add the location of OpenSSL DLLs to
+    BEGINLIBPATH (if they are not already in your LIBPATH) so that Qt
+    applications can find them at runtime:
 
       set BEGINLIBPATH=<path_to_OpenSSL>\dll;%BEGINLIBPATH%
Index: trunk/configure.cmd
===================================================================
--- trunk/configure.cmd	(revision 1057)
+++ trunk/configure.cmd	(revision 1058)
@@ -839,5 +839,5 @@
     G.CUPS_INCLUDEPATH = GetEnv('CUPS_INCLUDEPATH')
     G.CUPS_LIBS = GetEnv('CUPS_LIBS')
-    if (G.CUPS_INCLUDEPATH \== '' & G.CUPS_LIBS \== '') then do
+    if (G.CUPS_INCLUDEPATH \== '') then do
         call SayVerbose 'CUPS include path : 'G.CUPS_INCLUDEPATH
         call SayVerbose 'CUPS libraries    : 'G.CUPS_LIBS
Index: trunk/src/gui/painting/qcups.cpp
===================================================================
--- trunk/src/gui/painting/qcups.cpp	(revision 1057)
+++ trunk/src/gui/painting/qcups.cpp	(revision 1058)
@@ -50,6 +50,4 @@
 
 QT_BEGIN_NAMESPACE
-
-#ifndef Q_WS_PM
 
 typedef int (*CupsGetDests)(cups_dest_t **dests);
@@ -88,52 +86,33 @@
 static CupsPrintFile _cupsPrintFile = 0;
 
-#else // ifndef Q_WS_PM
-
-// On OS/2, we link to libcups statically
-
-static bool cupsLoaded = false;
-static int qt_cups_num_printers = 0;
-
-#define _cupsGetDests cupsGetDests
-#define _cupsFreeDests cupsFreeDests
-#define _cupsGetPPD cupsGetPPD
-#define _cupsLangGet cupsLangGet
-#define _cupsLangEncoding cupsLangEncoding
-#define _ppdOpenFile ppdOpenFile
-#define _ppdMarkDefaults ppdMarkDefaults
-#define _ppdClose ppdClose
-#define _cupsMarkOptions cupsMarkOptions
-#define _ppdMarkOption ppdMarkOption
-#define _cupsFreeOptions cupsFreeOptions
-#define _cupsSetDests cupsSetDests
-#define _cupsAddOption cupsAddOption
-#define _cupsTempFd cupsTempFd
-#define _cupsPrintFile cupsPrintFile
-
-#endif // ifndef Q_WS_PM
+#ifdef Q_OS_OS2
+#define CUPS_RESOLVE_cups(func) _cups##func = (Cups##func) cupsLib.resolve("_cups"#func)
+#define CUPS_RESOLVE_ppd(func) _ppd##func = (PPD##func) cupsLib.resolve("_ppd"#func)
+#else
+#define CUPS_RESOLVE_cups(func) _cups##func = (Cups##func) cupsLib.resolve("cups"#func)
+#define CUPS_RESOLVE_ppd(func) _ppd##func = (PPD##func) cupsLib.resolve("ppd"#func)
+#endif
 
 static void resolveCups()
 {
-#ifndef Q_WS_PM
     QLibrary cupsLib(QLatin1String("cups"), 2);
     if(cupsLib.load()) {
-        _cupsGetDests = (CupsGetDests) cupsLib.resolve("cupsGetDests");
-        _cupsFreeDests = (CupsFreeDests) cupsLib.resolve("cupsFreeDests");
-        _cupsGetPPD = (CupsGetPPD) cupsLib.resolve("cupsGetPPD");
-        _cupsLangGet = (CupsLangGet) cupsLib.resolve("cupsLangGet");
-        _cupsLangEncoding = (CupsLangEncoding) cupsLib.resolve("cupsLangEncoding");
-        _ppdOpenFile = (PPDOpenFile) cupsLib.resolve("ppdOpenFile");
-        _ppdMarkDefaults = (PPDMarkDefaults) cupsLib.resolve("ppdMarkDefaults");
-        _ppdClose = (PPDClose) cupsLib.resolve("ppdClose");
-        _cupsMarkOptions = (CupsMarkOptions) cupsLib.resolve("cupsMarkOptions");
-        _ppdMarkOption = (PPDMarkOption) cupsLib.resolve("ppdMarkOption");
-        _cupsFreeOptions = (CupsFreeOptions) cupsLib.resolve("cupsFreeOptions");
-        _cupsSetDests = (CupsSetDests) cupsLib.resolve("cupsSetDests");
-        _cupsAddOption = (CupsAddOption) cupsLib.resolve("cupsAddOption");
-        _cupsTempFd = (CupsTempFd) cupsLib.resolve("cupsTempFd");
-        _cupsPrintFile = (CupsPrintFile) cupsLib.resolve("cupsPrintFile");
+        CUPS_RESOLVE_cups(GetDests);
+        CUPS_RESOLVE_cups(FreeDests);
+        CUPS_RESOLVE_cups(GetPPD);
+        CUPS_RESOLVE_cups(LangGet);
+        CUPS_RESOLVE_cups(LangEncoding);
+        CUPS_RESOLVE_ppd(OpenFile);
+        CUPS_RESOLVE_ppd(MarkDefaults);
+        CUPS_RESOLVE_ppd(Close);
+        CUPS_RESOLVE_cups(MarkOptions);
+        CUPS_RESOLVE_ppd(MarkOption);
+        CUPS_RESOLVE_cups(FreeOptions);
+        CUPS_RESOLVE_cups(SetDests);
+        CUPS_RESOLVE_cups(AddOption);
+        CUPS_RESOLVE_cups(TempFd);
+        CUPS_RESOLVE_cups(PrintFile);
 
         if (_cupsGetDests && _cupsFreeDests) {
-#endif
             cups_dest_t *printers;
             int num_printers = _cupsGetDests(&printers);
@@ -141,8 +120,6 @@
                 _cupsFreeDests(num_printers, printers);
             qt_cups_num_printers = num_printers;
-#ifndef Q_WS_PM
-        }
-    }
-#endif
+        }
+    }
     cupsLoaded = true;
 }
@@ -250,5 +227,4 @@
 
     return
-#ifndef Q_WS_PM
         _cupsGetDests &&
         _cupsFreeDests &&
@@ -264,5 +240,4 @@
         _cupsLangEncoding &&
         _cupsAddOption &&
-#endif
         (qt_cups_num_printers > 0);
 }
Index: trunk/src/gui/painting/qcups_p.h
===================================================================
--- trunk/src/gui/painting/qcups_p.h	(revision 1057)
+++ trunk/src/gui/painting/qcups_p.h	(revision 1058)
@@ -60,7 +60,5 @@
 #ifndef QT_NO_CUPS
 
-#ifndef Q_WS_PM
 #include <QtCore/qlibrary.h>
-#endif
 #include <cups/cups.h>
 #include <cups/ppd.h>
