Changeset 1058


Ignore:
Timestamp:
Sep 7, 2011, 1:09:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

OS/2: Enable linking to cups.dll at runtime.

This requires CUPS 1.4.8 and above. Older versions will not
work anymore.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/README.OS2

    r1040 r1058  
    7575      http://www.os2site.com/sw/util/archiver/lxlt133.zip
    7676
    77   - CUPS 1.3.11 or later to support printing in Qt. The CUPS libraries are
     77  - CUPS 1.4.8 or later to support printing in Qt. The CUPS libraries are
    7878    available at:
    7979
    80       http://download.smedley.info/cups-1.3.11-os2-20090807.zip
    81 
    82     Linking against eCUPS also requires pthread.lib:
    83 
    84       http://web.os2power.com/download/lib/pthread-20100217-os2.zip
     80      http://sourceforge.net/projects/ecsports/files/CUPS/cups-1.4.8-os2-20110831.zip/download
     81      http://svn.netlabs.org/ecups/wiki/CupsPort
    8582
    8683  - OpenSSL 0.9.8o or later to support OpenSSL in Qt. The OpenSSL libraries are
     
    9592      http://download.smedley.info/mysql-5.1.51-os2-20101001.zip
    9693
    97     Note that you will also need the above OpenSSL libraries and pthread.lib to
    98     be able to use this MySQL build. The MySQL Qt plugin itself will require
    99     OpenSSL DLLs in your LIBPATH at runtime.
     94    Linking against this MySQL build also requires pthread.lib:
     95
     96      http://web.os2power.com/download/lib/pthread-20100217-os2.zip
     97
     98    Note that you will also need the above OpenSSL libraries to be able to use
     99    this MySQL build. The MySQL Qt plugin itself will require OpenSSL DLLs in
     100    your LIBPATH at runtime.
    100101
    101102  - PostgersSQL 9.0.1 or later to support the PostgresSQL Qt plugin. The
     
    191192
    192193      set CUPS_INCLUDEPATH=<path_to_CUPS>\include
    193       set CUPS_LIBS=-L<path_to_CUPS>\lib -llibcups.a -L<path_to_pthread> -lpthread.lib
     194      set CUPS_LIBS=
     195
     196    Note that you will also need to add the location of cups.dll to BEGINLIBPATH
     197    (if it is not already in your LIBPATH) so that Qt applications can find it
     198    at runtime:
     199
     200      set BEGINLIBPATH=<path_to_CUPS>\sbin;%BEGINLIBPATH%
    194201
    195202  - Unzip the OpenSSL libraries to some directory and set the following
     
    199206      set OPENSSL_LIBS=
    200207
    201     Note that you will also need to place OpenSSL DLLs to BEGINLIBPATH (if they
    202     are not already in your LIBPATH) so that Qt applications can find them at
    203     runtime:
     208    Note that you will also need to add the location of OpenSSL DLLs to
     209    BEGINLIBPATH (if they are not already in your LIBPATH) so that Qt
     210    applications can find them at runtime:
    204211
    205212      set BEGINLIBPATH=<path_to_OpenSSL>\dll;%BEGINLIBPATH%
  • trunk/configure.cmd

    r1055 r1058  
    839839    G.CUPS_INCLUDEPATH = GetEnv('CUPS_INCLUDEPATH')
    840840    G.CUPS_LIBS = GetEnv('CUPS_LIBS')
    841     if (G.CUPS_INCLUDEPATH \== '' & G.CUPS_LIBS \== '') then do
     841    if (G.CUPS_INCLUDEPATH \== '') then do
    842842        call SayVerbose 'CUPS include path : 'G.CUPS_INCLUDEPATH
    843843        call SayVerbose 'CUPS libraries    : 'G.CUPS_LIBS
  • trunk/src/gui/painting/qcups.cpp

    r846 r1058  
    5050
    5151QT_BEGIN_NAMESPACE
    52 
    53 #ifndef Q_WS_PM
    5452
    5553typedef int (*CupsGetDests)(cups_dest_t **dests);
     
    8886static CupsPrintFile _cupsPrintFile = 0;
    8987
    90 #else // ifndef Q_WS_PM
    91 
    92 // On OS/2, we link to libcups statically
    93 
    94 static bool cupsLoaded = false;
    95 static int qt_cups_num_printers = 0;
    96 
    97 #define _cupsGetDests cupsGetDests
    98 #define _cupsFreeDests cupsFreeDests
    99 #define _cupsGetPPD cupsGetPPD
    100 #define _cupsLangGet cupsLangGet
    101 #define _cupsLangEncoding cupsLangEncoding
    102 #define _ppdOpenFile ppdOpenFile
    103 #define _ppdMarkDefaults ppdMarkDefaults
    104 #define _ppdClose ppdClose
    105 #define _cupsMarkOptions cupsMarkOptions
    106 #define _ppdMarkOption ppdMarkOption
    107 #define _cupsFreeOptions cupsFreeOptions
    108 #define _cupsSetDests cupsSetDests
    109 #define _cupsAddOption cupsAddOption
    110 #define _cupsTempFd cupsTempFd
    111 #define _cupsPrintFile cupsPrintFile
    112 
    113 #endif // ifndef Q_WS_PM
     88#ifdef Q_OS_OS2
     89#define CUPS_RESOLVE_cups(func) _cups##func = (Cups##func) cupsLib.resolve("_cups"#func)
     90#define CUPS_RESOLVE_ppd(func) _ppd##func = (PPD##func) cupsLib.resolve("_ppd"#func)
     91#else
     92#define CUPS_RESOLVE_cups(func) _cups##func = (Cups##func) cupsLib.resolve("cups"#func)
     93#define CUPS_RESOLVE_ppd(func) _ppd##func = (PPD##func) cupsLib.resolve("ppd"#func)
     94#endif
    11495
    11596static void resolveCups()
    11697{
    117 #ifndef Q_WS_PM
    11898    QLibrary cupsLib(QLatin1String("cups"), 2);
    11999    if(cupsLib.load()) {
    120         _cupsGetDests = (CupsGetDests) cupsLib.resolve("cupsGetDests");
    121         _cupsFreeDests = (CupsFreeDests) cupsLib.resolve("cupsFreeDests");
    122         _cupsGetPPD = (CupsGetPPD) cupsLib.resolve("cupsGetPPD");
    123         _cupsLangGet = (CupsLangGet) cupsLib.resolve("cupsLangGet");
    124         _cupsLangEncoding = (CupsLangEncoding) cupsLib.resolve("cupsLangEncoding");
    125         _ppdOpenFile = (PPDOpenFile) cupsLib.resolve("ppdOpenFile");
    126         _ppdMarkDefaults = (PPDMarkDefaults) cupsLib.resolve("ppdMarkDefaults");
    127         _ppdClose = (PPDClose) cupsLib.resolve("ppdClose");
    128         _cupsMarkOptions = (CupsMarkOptions) cupsLib.resolve("cupsMarkOptions");
    129         _ppdMarkOption = (PPDMarkOption) cupsLib.resolve("ppdMarkOption");
    130         _cupsFreeOptions = (CupsFreeOptions) cupsLib.resolve("cupsFreeOptions");
    131         _cupsSetDests = (CupsSetDests) cupsLib.resolve("cupsSetDests");
    132         _cupsAddOption = (CupsAddOption) cupsLib.resolve("cupsAddOption");
    133         _cupsTempFd = (CupsTempFd) cupsLib.resolve("cupsTempFd");
    134         _cupsPrintFile = (CupsPrintFile) cupsLib.resolve("cupsPrintFile");
     100        CUPS_RESOLVE_cups(GetDests);
     101        CUPS_RESOLVE_cups(FreeDests);
     102        CUPS_RESOLVE_cups(GetPPD);
     103        CUPS_RESOLVE_cups(LangGet);
     104        CUPS_RESOLVE_cups(LangEncoding);
     105        CUPS_RESOLVE_ppd(OpenFile);
     106        CUPS_RESOLVE_ppd(MarkDefaults);
     107        CUPS_RESOLVE_ppd(Close);
     108        CUPS_RESOLVE_cups(MarkOptions);
     109        CUPS_RESOLVE_ppd(MarkOption);
     110        CUPS_RESOLVE_cups(FreeOptions);
     111        CUPS_RESOLVE_cups(SetDests);
     112        CUPS_RESOLVE_cups(AddOption);
     113        CUPS_RESOLVE_cups(TempFd);
     114        CUPS_RESOLVE_cups(PrintFile);
    135115
    136116        if (_cupsGetDests && _cupsFreeDests) {
    137 #endif
    138117            cups_dest_t *printers;
    139118            int num_printers = _cupsGetDests(&printers);
     
    141120                _cupsFreeDests(num_printers, printers);
    142121            qt_cups_num_printers = num_printers;
    143 #ifndef Q_WS_PM
    144         }
    145     }
    146 #endif
     122        }
     123    }
    147124    cupsLoaded = true;
    148125}
     
    250227
    251228    return
    252 #ifndef Q_WS_PM
    253229        _cupsGetDests &&
    254230        _cupsFreeDests &&
     
    264240        _cupsLangEncoding &&
    265241        _cupsAddOption &&
    266 #endif
    267242        (qt_cups_num_printers > 0);
    268243}
  • trunk/src/gui/painting/qcups_p.h

    r846 r1058  
    6060#ifndef QT_NO_CUPS
    6161
    62 #ifndef Q_WS_PM
    6362#include <QtCore/qlibrary.h>
    64 #endif
    6563#include <cups/cups.h>
    6664#include <cups/ppd.h>
Note: See TracChangeset for help on using the changeset viewer.