From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Cc: 30346@debbugs.gnu.org
Subject: bug#30346: lcms.c doesn't compile when lcms.h isn't in default search path
Date: Sun, 04 Feb 2018 20:54:45 -0500 [thread overview]
Message-ID: <874lmwfbfe.fsf@users.sourceforge.net> (raw)
In-Reply-To: <yddmv0oq1rw.fsf@CeBiTec.Uni-Bielefeld.DE> (Rainer Orth's message of "Sun, 04 Feb 2018 15:15:31 +0100")
[-- Attachment #1: Type: text/plain, Size: 846 bytes --]
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> I just tried to compile emacs 26.0.91 on Solaris 11.4 Beta. This failed
> building lcms.o:
>
> CC lcms.o
> /vol/gnu/src/emacs/emacs-26.0.91/src/lcms.c:23:19: fatal error: lcms2.h: No such file or directory
>
> lcms.h lives in /usr/include/lcms/lcms.h and lcms2.pc correctly adds a
> matching -I to Cflags. However, configure.ac just does a link test for
> cmsCreateTransform, which succeeds. I can work around this by adding a
> matching -I option to CPPFLAGS at configure time, but it seems silly
> having to do so if the information can be derived automatically.
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.)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 2618 bytes --]
From 30b2c9bcc26739cc6634f496b3dc415cf5310555 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Sun, 4 Feb 2018 20:43:26 -0500
Subject: [PATCH v1] Use pkg-config to find lcms2 CFLAGS and LIBS (Bug#30346)
* configure.ac: Use EMACS_CHECK_MODULES fors LCMS2 rather than
AC_SEARCH_LIBS.
* src/Makefile.in: Get LCMS2_LIBS and LCMS2_CFLAGS from configure,
instead of just LIBLCMS2.
---
configure.ac | 12 +++++-------
src/Makefile.in | 7 ++++---
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/configure.ac b/configure.ac
index f9c7bb76e5..7ee1fae83b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3469,12 +3469,9 @@ AC_DEFUN
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)
HAVE_ZLIB=no
LIBZ=
diff --git a/src/Makefile.in b/src/Makefile.in
index 15ca1667d6..9fa1d7b6f2 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -234,7 +234,8 @@ LIBXML2_CFLAGS =
GETADDRINFO_A_LIBS = @GETADDRINFO_A_LIBS@
-LIBLCMS2 = @LIBLCMS2@
+LCMS2_LIBS = @LCMS2_LIBS@
+LCMS2_CFLAGS = @LCMS2_CFLAGS@
LIBZ = @LIBZ@
@@ -360,7 +361,7 @@ EMACS_CFLAGS=
$(GNUSTEP_CFLAGS) $(CFLAGS_SOUND) $(RSVG_CFLAGS) $(IMAGEMAGICK_CFLAGS) \
$(PNG_CFLAGS) $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) \
$(XRANDR_CFLAGS) $(XINERAMA_CFLAGS) $(XFIXES_CFLAGS) $(XDBE_CFLAGS) \
- $(WEBKIT_CFLAGS) \
+ $(WEBKIT_CFLAGS) $(LCMS2_CFLAGS) \
$(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \
$(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) \
$(LIBSYSTEMD_CFLAGS) \
@@ -492,7 +493,7 @@ LIBES =
$(LIBXML2_LIBS) $(LIBGPM) $(LIBS_SYSTEM) $(CAIRO_LIBS) \
$(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \
$(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
- $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(GETADDRINFO_A_LIBS) $(LIBLCMS2) \
+ $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(GETADDRINFO_A_LIBS) $(LCMS2_LIBS) \
$(NOTIFY_LIBS) $(LIB_MATH) $(LIBZ) $(LIBMODULES) $(LIBSYSTEMD_LIBS)
## FORCE it so that admin/unidata can decide whether these files
--
2.11.0
next prev parent reply other threads:[~2018-02-05 1:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-04 14:15 bug#30346: lcms.c doesn't compile when lcms.h isn't in default search path Rainer Orth
2018-02-05 1:54 ` Noam Postavsky [this message]
2018-02-05 17:21 ` Eli Zaretskii
2018-02-05 19:37 ` Noam Postavsky
2018-02-06 10:18 ` Rainer Orth
2018-02-06 18:51 ` Eli Zaretskii
2018-02-06 18:53 ` Rainer Orth
2018-02-17 14:12 ` Noam Postavsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874lmwfbfe.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=30346@debbugs.gnu.org \
--cc=ro@CeBiTec.Uni-Bielefeld.DE \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.