From 6b1a96991c986014a8ac11dc6446b715efb5e6f8 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 31 Jul 2013 14:19:08 +0200 Subject: [PATCH] configure: Add pkg-config support for libjpeg. --- configure | 53 ++++++++++++++++++++++++++++++---- configure.ac | 15 ++++++---- dlls/gphoto2.ds/Makefile.in | 2 +- dlls/windowscodecs/Makefile.in | 2 +- 4 files changed, 59 insertions(+), 13 deletions(-) diff --git a/configure b/configure index 5b1e50f7892..531fbb35213 100755 --- a/configure +++ b/configure @@ -643,6 +643,8 @@ LIBOPENAL LIBMPG123 PNG_LIBS PNG_CFLAGS +JPEG_LIBS +JPEG_CFLAGS FONTCONFIGINCL CUPSINCL OSS4INCL @@ -886,6 +888,8 @@ FREETYPE_CFLAGS FREETYPE_LIBS GSTREAMER_CFLAGS GSTREAMER_LIBS +JPEG_CFLAGS +JPEG_LIBS PNG_CFLAGS PNG_LIBS' @@ -1607,6 +1611,8 @@ Some influential environment variables: C compiler flags for gstreamer-app-0.10, overriding pkg-config GSTREAMER_LIBS Linker flags for gstreamer-app-0.10, overriding pkg-config + JPEG_CFLAGS C compiler flags for libjpeg, overriding pkg-config + JPEG_LIBS Linker flags for libjpeg, overriding pkg-config PNG_CFLAGS C compiler flags for libpng, overriding pkg-config PNG_LIBS Linker flags for libpng, overriding pkg-config @@ -2704,7 +2710,7 @@ fi # Check whether --with-jpeg was given. if test "${with_jpeg+set}" = set; then : - withval=$with_jpeg; if test "x$withval" = "xno"; then ac_cv_header_jpeglib_h=no; fi + withval=$with_jpeg; fi @@ -5951,7 +5957,6 @@ for ac_header in \ ieeefp.h \ inet/mib2.h \ io.h \ - jpeglib.h \ kstat.h \ lber.h \ ldap.h \ @@ -11802,15 +11807,44 @@ This is an error since --with-gsm was requested." "$LINENO" 5 ;; esac fi -if test "$ac_cv_header_jpeglib_h" = "yes" +if test "x$with_jpeg" != "xno" then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -ljpeg" >&5 + if test -n "$JPEG_CFLAGS"; then : + +elif test -n "$PKG_CONFIG"; then : + JPEG_CFLAGS=`$PKG_CONFIG --cflags libjpeg 2>/dev/null` +fi + +if test -n "$JPEG_LIBS"; then : + +elif test -n "$PKG_CONFIG"; then : + JPEG_LIBS=`$PKG_CONFIG --libs libjpeg 2>/dev/null` +fi + + +ac_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $JPEG_CFLAGS" +for ac_header in jpeglib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" +if test "x$ac_cv_header_jpeglib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_JPEGLIB_H 1 +_ACEOF + +fi + +done + + if test "$ac_cv_header_jpeglib_h" = "yes" + then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -ljpeg" >&5 $as_echo_n "checking for -ljpeg... " >&6; } if ${ac_cv_lib_soname_jpeg+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_soname_save_LIBS=$LIBS -LIBS="-ljpeg $LIBS" +LIBS="-ljpeg $JPEG_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11846,7 +11880,7 @@ fi if test "x$ac_cv_lib_soname_jpeg" = "x"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - + JPEG_CFLAGS="" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_jpeg" >&5 $as_echo "$ac_cv_lib_soname_jpeg" >&6; } @@ -11857,6 +11891,13 @@ _ACEOF fi + else + JPEG_CFLAGS="" + fi +CPPFLAGS=$ac_save_CPPFLAGS +test -z "$JPEG_CFLAGS" || JPEG_CFLAGS=`echo " $JPEG_CFLAGS" | sed 's/ -I\([^/]\)/ -I\$(top_builddir)\/\1/g'` +test -z "$JPEG_LIBS" || JPEG_LIBS=`echo " $JPEG_LIBS" | sed 's/ -L\([^/]\)/ -L\$(top_builddir)\/\1/g'` + fi if test "x$ac_cv_lib_soname_jpeg" = "x"; then : case "x$with_jpeg" in diff --git a/configure.ac b/configure.ac index f9e35e61d73..b69c9ababf8 100644 --- a/configure.ac +++ b/configure.ac @@ -54,8 +54,7 @@ AC_ARG_WITH(gsm, AS_HELP_STRING([--without-gsm],[do not use libgsm (GSM 06 [if test "x$withval" = "xno"; then ac_cv_header_gsm_h=no; ac_cv_header_gsm_gsm_h=no; fi]) AC_ARG_WITH(gstreamer, AS_HELP_STRING([--without-gstreamer],[do not use GStreamer (codecs support)])) AC_ARG_WITH(hal, AS_HELP_STRING([--without-hal],[do not use HAL (dynamic device support)])) -AC_ARG_WITH(jpeg, AS_HELP_STRING([--without-jpeg],[do not use JPEG]), - [if test "x$withval" = "xno"; then ac_cv_header_jpeglib_h=no; fi]) +AC_ARG_WITH(jpeg, AS_HELP_STRING([--without-jpeg],[do not use JPEG])) AC_ARG_WITH(ldap, AS_HELP_STRING([--without-ldap],[do not use LDAP]), [if test "x$withval" = "xno"; then ac_cv_header_ldap_h=no; ac_cv_header_lber_h=no; fi]) AC_ARG_WITH(mpg123, AS_HELP_STRING([--without-mpg123],[do not use the mpg123 library]), @@ -430,7 +429,6 @@ AC_CHECK_HEADERS(\ ieeefp.h \ inet/mib2.h \ io.h \ - jpeglib.h \ kstat.h \ lber.h \ ldap.h \ @@ -1646,9 +1644,16 @@ WINE_NOTICE_WITH(gsm,[test "x$ac_cv_lib_soname_gsm" = "x"], [libgsm ${notice_platform}development files not found, gsm 06.10 codec won't be supported.]) dnl **** Check for libjpeg **** -if test "$ac_cv_header_jpeglib_h" = "yes" +if test "x$with_jpeg" != "xno" then - WINE_CHECK_SONAME(jpeg,jpeg_start_decompress) + WINE_PACKAGE_FLAGS(JPEG,[libjpeg],,,, + [AC_CHECK_HEADERS([jpeglib.h]) + if test "$ac_cv_header_jpeglib_h" = "yes" + then + WINE_CHECK_SONAME(jpeg,jpeg_start_decompress,,[JPEG_CFLAGS=""],[$JPEG_LIBS]) + else + JPEG_CFLAGS="" + fi]) fi WINE_WARNING_WITH(jpeg,[test "x$ac_cv_lib_soname_jpeg" = "x"], [libjpeg ${notice_platform}development files not found, JPEG won't be supported.]) diff --git a/dlls/gphoto2.ds/Makefile.in b/dlls/gphoto2.ds/Makefile.in index 1e716fc4df9..ffde0ae26c0 100644 --- a/dlls/gphoto2.ds/Makefile.in +++ b/dlls/gphoto2.ds/Makefile.in @@ -1,7 +1,7 @@ MODULE = gphoto2.ds IMPORTS = comctl32 user32 gdi32 advapi32 EXTRALIBS = @GPHOTO2_LIBS@ @GPHOTO2_PORT_LIBS@ -EXTRAINCL = @GPHOTO2_CFLAGS@ @GPHOTO2_PORT_CFLAGS@ +EXTRAINCL = @GPHOTO2_CFLAGS@ @GPHOTO2_PORT_CFLAGS@ @JPEG_CFLAGS@ C_SRCS = \ capability.c \ diff --git a/dlls/windowscodecs/Makefile.in b/dlls/windowscodecs/Makefile.in index 61f02c496ac..eab1c62779b 100644 --- a/dlls/windowscodecs/Makefile.in +++ b/dlls/windowscodecs/Makefile.in @@ -1,7 +1,7 @@ MODULE = windowscodecs.dll IMPORTLIB = windowscodecs IMPORTS = uuid ole32 oleaut32 rpcrt4 shlwapi user32 gdi32 advapi32 -EXTRAINCL = @PNG_CFLAGS@ +EXTRAINCL = @JPEG_CFLAGS@ @PNG_CFLAGS@ EXTRADEFS = -DENTRY_PREFIX=WIC_ -DPROXY_DELEGATION -DWINE_REGISTER_DLL EXTRALIBS = @APPLICATIONSERVICESLIB@