diff --git a/configure b/configure index f109e738fd9..13e78479617 100755 --- a/configure +++ b/configure @@ -13578,6 +13578,88 @@ cat >>confdefs.h <<_ACEOF _ACEOF +fi + +fi + +if test "$ac_cv_header_cups_cups_h" = "yes" +then + { echo "$as_me:$LINENO: checking for -lcups" >&5 +echo $ECHO_N "checking for -lcups... $ECHO_C" >&6; } +if test "${ac_cv_lib_soname_cups+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_soname_save_LIBS=$LIBS +LIBS="-lcups $LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cupsGetDefault (); +int +main () +{ +return cupsGetDefault (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + case "$LIBEXT" in + dll) ;; + dylib) ac_cv_lib_soname_cups=`otool -L conftest$ac_exeext | grep "libcups\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libcups\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + *) ac_cv_lib_soname_cups=`$ac_cv_path_LDD conftest$ac_exeext | grep "libcups\\.$LIBEXT" | sed -e "s/^.*\(libcups\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` ;; + esac +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_soname_save_LIBS +fi +if test "x$ac_cv_lib_soname_cups" = "x"; then + { echo "$as_me:$LINENO: result: not found" >&5 +echo "${ECHO_T}not found" >&6; } + +else + { echo "$as_me:$LINENO: result: $ac_cv_lib_soname_cups" >&5 +echo "${ECHO_T}$ac_cv_lib_soname_cups" >&6; } + +cat >>confdefs.h <<_ACEOF +#define SONAME_LIBCUPS "$ac_cv_lib_soname_cups" +_ACEOF + + fi fi @@ -15070,84 +15152,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -fi - -{ echo "$as_me:$LINENO: checking for -lcups" >&5 -echo $ECHO_N "checking for -lcups... $ECHO_C" >&6; } -if test "${ac_cv_lib_soname_cups+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_soname_save_LIBS=$LIBS -LIBS="-lcups $LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char cupsGetDefault (); -int -main () -{ -return cupsGetDefault (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - case "$LIBEXT" in - dll) ;; - dylib) ac_cv_lib_soname_cups=`otool -L conftest$ac_exeext | grep "libcups\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libcups\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_cups=`$ac_cv_path_LDD conftest$ac_exeext | grep "libcups\\.$LIBEXT" | sed -e "s/^.*\(libcups\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` ;; - esac -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if test "x$ac_cv_lib_soname_cups" = "x"; then - { echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6; } - -else - { echo "$as_me:$LINENO: result: $ac_cv_lib_soname_cups" >&5 -echo "${ECHO_T}$ac_cv_lib_soname_cups" >&6; } - -cat >>confdefs.h <<_ACEOF -#define SONAME_LIBCUPS "$ac_cv_lib_soname_cups" -_ACEOF - - fi { echo "$as_me:$LINENO: checking for -ljack" >&5 diff --git a/configure.ac b/configure.ac index 0c5b1a4586c..7deadf5616a 100644 --- a/configure.ac +++ b/configure.ac @@ -967,6 +967,12 @@ then WINE_CHECK_SONAME(capi20,capi20_register) fi +dnl **** Check for cups **** +if test "$ac_cv_header_cups_cups_h" = "yes" +then + WINE_CHECK_SONAME(cups,cupsGetDefault) +fi + dnl **** Check for gcc specific options **** AC_SUBST(EXTRACFLAGS,"") @@ -1115,7 +1121,6 @@ WINE_CHECK_SONAME(Xcursor,XcursorImageLoadCursor,,,[$X_LIBS -lX11 $X_EXTRA_LIBS] WINE_CHECK_SONAME(freetype,FT_Init_FreeType,,,[$X_LIBS]) WINE_CHECK_SONAME(GL,glXQueryExtension,,,[$X_LIBS $X_EXTRA_LIBS]) WINE_CHECK_SONAME(txc_dxtn,fetch_2d_texel_rgba_dxt1) -WINE_CHECK_SONAME(cups,cupsGetDefault) WINE_CHECK_SONAME(jack,jack_client_new) WINE_CHECK_SONAME(fontconfig,FcInit) WINE_CHECK_SONAME(ssl,SSL_library_init) diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index cf3b8a51e5e..a794becbd52 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -45,11 +45,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv); -#ifndef SONAME_LIBCUPS -#define SONAME_LIBCUPS "libcups" SONAME_EXT -#endif - -#ifdef HAVE_CUPS_CUPS_H +#ifdef SONAME_LIBCUPS static void *cupshandle = NULL; #endif @@ -144,7 +140,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) HeapDestroy(PSDRV_Heap); return FALSE; } -#ifdef HAVE_CUPS_CUPS_H +#ifdef SONAME_LIBCUPS /* dynamically load CUPS if not yet loaded */ if (!cupshandle) { cupshandle = wine_dlopen(SONAME_LIBCUPS, RTLD_NOW, NULL, 0); @@ -157,7 +153,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) DeleteObject( PSDRV_DefaultFont ); HeapDestroy( PSDRV_Heap ); -#ifdef HAVE_CUPS_CUPS_H +#ifdef SONAME_LIBCUPS if (cupshandle && (cupshandle != (void*)-1)) { wine_dlclose(cupshandle, NULL, 0); cupshandle = NULL; @@ -580,7 +576,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name) goto cleanup; } -#ifdef HAVE_CUPS_CUPS_H +#ifdef SONAME_LIBCUPS if (cupshandle != (void*)-1) { typeof(cupsGetPPD) * pcupsGetPPD = NULL; diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index d379df6bddc..19b70bea99b 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -38,9 +38,6 @@ #include #ifdef HAVE_CUPS_CUPS_H # include -# ifndef SONAME_LIBCUPS -# define SONAME_LIBCUPS "libcups" SONAME_EXT -# endif #endif #define NONAMELESSUNION @@ -410,7 +407,7 @@ static BOOL add_printer_driver(const char *name) return TRUE; } -#ifdef HAVE_CUPS_CUPS_H +#ifdef SONAME_LIBCUPS static typeof(cupsGetDests) *pcupsGetDests; static typeof(cupsGetPPD) *pcupsGetPPD; static typeof(cupsPrintFile) *pcupsPrintFile; @@ -1567,7 +1564,7 @@ void WINSPOOL_LoadSystemPrinters(void) } -#ifdef HAVE_CUPS_CUPS_H +#ifdef SONAME_LIBCUPS done = CUPS_LoadPrinters(); #endif @@ -7129,7 +7126,7 @@ static BOOL schedule_lpr(LPCWSTR printer_name, LPCWSTR filename) */ static BOOL schedule_cups(LPCWSTR printer_name, LPCWSTR filename, LPCWSTR document_title) { -#if HAVE_CUPS_CUPS_H +#ifdef SONAME_LIBCUPS if(pcupsPrintFile) { char *unixname, *queue, *doc_titleA;