Subject: bug#30346: lcms.c doesn't compile when lcms.h isn't in default search path

From: Eli Zaretskii <[email-masked]>
Date: Mon, 05 Feb 2018 19:21:28 +0200

> From: Noam Postavsky <[email-masked]>
> Date: Sun, 04 Feb 2018 20:54:45 -0500
> Cc: [email-masked]
> 
> Does the below work?  (I notice that all of a sudden this bug's severity
> has been set to "important", although it looks more like it should be
> "minor" to me.  And I would intend the patch for master, not emacs-26.)

I agree.

>  HAVE_LCMS2=no
>  LIBLCMS2=
>  if test "${with_lcms2}" != "no"; then
> -  OLIBS=$LIBS
> -  AC_SEARCH_LIBS([cmsCreateTransform], [lcms2], [HAVE_LCMS2=yes])
> -  LIBS=$OLIBS
> -  case $ac_cv_search_cmsCreateTransform in
> -    -*) LIBLCMS2=$ac_cv_search_cmsCreateTransform ;;
> -  esac
> +  EMACS_CHECK_MODULES([LCMS2], [lcms2])
> +  AC_CHECK_HEADER([lcms2.h])
> +  AC_CHECK_LIB([lcms2], [cmsCreateTransform])
>  fi
>  if test "${HAVE_LCMS2}" = "yes"; then
>    AC_DEFINE([HAVE_LCMS2], 1, [Define to 1 if you have the lcms2 library (-llcms2).])
> @@ -3483,7 +3480,8 @@ AC_DEFUN
>       LIBLCMS2=
>    fi
>  fi
> -AC_SUBST(LIBLCMS2)
> +AC_SUBST(LCMS2_CFLAGS)
> +AC_SUBST(LCMS2_LIBS)

Maybe I'm missing something, but it looks like you effectively renamed
LIBLCMS2 to LCMS2_LIBS, so now LIBLCMS2 is set, but not used, and the
part of configure.ac that took care of the MS-Windows build, where
"-lcms2" should NOT be used at link time, now does nothing useful.
Right?