Alexandre Julliard : configure: Add a pkg-config check for liblcms.

Alexandre Julliard julliard at winehq.org
Mon May 6 14:08:45 CDT 2013


Module: wine
Branch: master
Commit: 9ddd30d11c458884312c63b4bd95d405d58b467b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9ddd30d11c458884312c63b4bd95d405d58b467b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon May  6 11:47:31 2013 +0200

configure: Add a pkg-config check for liblcms.

---

 configure              |   55 ++++++++++++++++++++++++++++++++++++++++-------
 configure.ac           |   23 ++++++++++++-------
 dlls/mscms/Makefile.in |    3 +-
 3 files changed, 62 insertions(+), 19 deletions(-)

diff --git a/configure b/configure
index 794b4f2..8829b5e 100755
--- a/configure
+++ b/configure
@@ -652,7 +652,8 @@ LIBGETTEXTPO
 ZLIB
 FREETYPE_LIBS
 FREETYPE_CFLAGS
-LCMSLIBS
+LCMS_LIBS
+LCMS_CFLAGS
 RESOLVLIBS
 GPHOTO2_PORT_LIBS
 GPHOTO2_PORT_CFLAGS
@@ -878,6 +879,8 @@ GPHOTO2_CFLAGS
 GPHOTO2_LIBS
 GPHOTO2_PORT_CFLAGS
 GPHOTO2_PORT_LIBS
+LCMS_CFLAGS
+LCMS_LIBS
 FREETYPE_CFLAGS
 FREETYPE_LIBS
 GSTREAMER_CFLAGS
@@ -1590,6 +1593,8 @@ Some influential environment variables:
               C compiler flags for libgphoto2_port, overriding pkg-config
   GPHOTO2_PORT_LIBS
               Linker flags for libgphoto2_port, overriding pkg-config
+  LCMS_CFLAGS C compiler flags for lcms, overriding pkg-config
+  LCMS_LIBS   Linker flags for lcms, overriding pkg-config
   FREETYPE_CFLAGS
               C compiler flags for freetype2, overriding pkg-config
   FREETYPE_LIBS
@@ -2603,7 +2608,7 @@ fi
 
 # Check whether --with-cms was given.
 if test "${with_cms+set}" = set; then :
-  withval=$with_cms; if test "x$withval" = "xno"; then ac_cv_header_lcms_h=no; ac_cv_header_lcms_lcms_h=no; fi
+  withval=$with_cms;
 fi
 
 
@@ -5851,8 +5856,6 @@ for ac_header in \
 	jpeglib.h \
 	kstat.h \
 	lber.h \
-	lcms.h \
-	lcms/lcms.h \
 	ldap.h \
 	link.h \
 	linux/cdrom.h \
@@ -10843,11 +10846,39 @@ rm -f core conftest.err conftest.$ac_objext \
     LIBS="$ac_save_LIBS"
 fi
 
-LCMSLIBS=""
-
-if test "$ac_cv_header_lcms_h" = "yes" -o "$ac_cv_header_lcms_lcms_h" = "yes"
+if test "x$with_lcms" != "xno"
 then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cmsOpenProfileFromFile in -llcms" >&5
+    ac_save_CPPFLAGS="$CPPFLAGS"
+    if test -n "$LCMS_CFLAGS"; then :
+
+elif test -n "$PKG_CONFIG"; then :
+  LCMS_CFLAGS=`$PKG_CONFIG --cflags lcms 2>/dev/null`
+fi
+
+CPPFLAGS="$CPPFLAGS $LCMS_CFLAGS"
+if test -n "$LCMS_LIBS"; then :
+
+elif test -n "$PKG_CONFIG"; then :
+  LCMS_LIBS=`$PKG_CONFIG --libs lcms 2>/dev/null`
+fi
+
+LCMS_LIBS=${LCMS_LIBS:-"-llcms"}
+    for ac_header in lcms.h lcms/lcms.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+    if test "$ac_cv_header_lcms_h" = "yes" -o "$ac_cv_header_lcms_lcms_h" = "yes"
+    then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cmsOpenProfileFromFile in -llcms" >&5
 $as_echo_n "checking for cmsOpenProfileFromFile in -llcms... " >&6; }
 if ${ac_cv_lib_lcms_cmsOpenProfileFromFile+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -10887,9 +10918,15 @@ if test "x$ac_cv_lib_lcms_cmsOpenProfileFromFile" = xyes; then :
 
 $as_echo "#define HAVE_LCMS 1" >>confdefs.h
 
-         LCMSLIBS="-llcms"
+else
+  LCMS_LIBS=""
 fi
 
+    else
+        LCMS_CFLAGS=""
+        LCMS_LIBS=""
+    fi
+    CPPFLAGS="$ac_save_CPPFLAGS"
 fi
 if test "$ac_cv_lib_lcms_cmsOpenProfileFromFile" != "yes"; then :
   case "x$with_cms" in
diff --git a/configure.ac b/configure.ac
index 86a2fb9..98c3dd4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,8 +35,7 @@ AC_ARG_WITH(alsa,      AS_HELP_STRING([--without-alsa],[do not use the Alsa soun
             [if test "x$withval" = "xno"; then ac_cv_header_sys_asoundlib_h=no; ac_cv_header_alsa_asoundlib_h=no; fi])
 AC_ARG_WITH(capi,      AS_HELP_STRING([--without-capi],[do not use CAPI (ISDN support)]),
             [if test "x$withval" = "xno"; then ac_cv_header_capi20_h=no; ac_cv_header_linux_capi_h=no; fi])
-AC_ARG_WITH(cms,       AS_HELP_STRING([--without-cms],[do not use CMS (color management support)]),
-            [if test "x$withval" = "xno"; then ac_cv_header_lcms_h=no; ac_cv_header_lcms_lcms_h=no; fi])
+AC_ARG_WITH(cms,       AS_HELP_STRING([--without-cms],[do not use CMS (color management support)]))
 AC_ARG_WITH(coreaudio, AS_HELP_STRING([--without-coreaudio],[do not use the CoreAudio sound support]),
             [if test "x$withval" = "xno"; then ac_cv_header_CoreAudio_CoreAudio_h=no; fi])
 AC_ARG_WITH(cups,      AS_HELP_STRING([--without-cups],[do not use CUPS]))
@@ -434,8 +433,6 @@ AC_CHECK_HEADERS(\
 	jpeglib.h \
 	kstat.h \
 	lber.h \
-	lcms.h \
-	lcms/lcms.h \
 	ldap.h \
 	link.h \
 	linux/cdrom.h \
@@ -1445,12 +1442,20 @@ then
 fi
 
 dnl **** Check for LittleCMS ***
-AC_SUBST(LCMSLIBS,"")
-if test "$ac_cv_header_lcms_h" = "yes" -o "$ac_cv_header_lcms_lcms_h" = "yes"
+if test "x$with_lcms" != "xno"
 then
-    AC_CHECK_LIB(lcms, cmsOpenProfileFromFile,
-        [AC_DEFINE(HAVE_LCMS, 1, [Define if you have the LittleCMS development environment])
-         LCMSLIBS="-llcms"])
+    ac_save_CPPFLAGS="$CPPFLAGS"
+    WINE_PACKAGE_FLAGS(LCMS,[lcms],[-llcms])
+    AC_CHECK_HEADERS([lcms.h lcms/lcms.h])
+    if test "$ac_cv_header_lcms_h" = "yes" -o "$ac_cv_header_lcms_lcms_h" = "yes"
+    then
+        AC_CHECK_LIB(lcms, cmsOpenProfileFromFile,
+            [AC_DEFINE(HAVE_LCMS, 1, [Define if you have the LittleCMS development environment])],[LCMS_LIBS=""])
+    else
+        LCMS_CFLAGS=""
+        LCMS_LIBS=""
+    fi
+    CPPFLAGS="$ac_save_CPPFLAGS"
 fi
 WINE_NOTICE_WITH(cms,[test "$ac_cv_lib_lcms_cmsOpenProfileFromFile" != "yes"],
                  [liblcms ${notice_platform}development files not found, Color Management won't be supported.])
diff --git a/dlls/mscms/Makefile.in b/dlls/mscms/Makefile.in
index 6589598..6fb5e1f 100644
--- a/dlls/mscms/Makefile.in
+++ b/dlls/mscms/Makefile.in
@@ -1,7 +1,8 @@
 MODULE    = mscms.dll
 IMPORTLIB = mscms
 IMPORTS   = shlwapi advapi32
-EXTRALIBS = @LCMSLIBS@
+EXTRAINCL = @LCMS_CFLAGS@
+EXTRALIBS = @LCMS_LIBS@
 
 C_SRCS = \
 	handle.c \




More information about the wine-cvs mailing list