PATCH: cups dynamical dependency

Marcus Meissner marcus at jet.franken.de
Mon Nov 11 04:37:45 CST 2002


On Sun, Nov 10, 2002 at 11:18:27PM -0500, Dimitrie O. Paun wrote:
> On November 10, 2002 02:40 pm, Marcus Meissner wrote:
> 
> >        Do not link against -lcups directly, but dynamically load it
> >        if present. (just like freetype etc.)
> [...]
> > +#ifdef HAVE_CUPS
> > +           /* dynamically load CUPS if not yet loaded */
> > +           if (!cupshandle) {
> > +               cupshandle = wine_dlopen(CUPS_SONAME, RTLD_NOW, NULL, 0);
> > +               if (!cupshandle) cupshandle = (void*)-1;
> > +           }
> > +#endif
> 
> Well, if we do this dynamically, why have this HAVE_CUPS check which is a
> compile time check? IMO we should just include a copy of the CUPS headers
> that we need, and drop the compile time check altogether.

Actually we would just need 4 lines of function prototypes with char*,
char** and int* arguments, no structures are passed.

> In fact, this
> check is misleading, as it suggests that we've verified some sort of
> compatibility with CUPS which we haven't.

But we did check against at least one set of function prototypes.

> We _assume_ that a certain API
> is available at runtime, so why pretend we use something that's on the
> machine we compile on?

It is the same for freetype.

I can do it the other way easily. I'll send a new patch later this day. 

Ciao, Marcus



More information about the wine-devel mailing list