From: Geert Uytterhoeven <geert@linux-m68k.org>
To: linux-fbdev@vger.kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Helge Deller <deller@gmx.de>
Subject: [PATCH fbtest] pnmtohex: Optionally use pkg-config for netpbm
Date: Sun, 26 Mar 2023 12:42:32 +0200 [thread overview]
Message-ID: <20230326104232.3099222-1-geert@linux-m68k.org> (raw)
As of libnetpbm11 in Debian/Ubuntu, the netpbm header files are no
longer located in the root include directory, but in a netbpm
subdirectory. Fortunately the same version added support for
pkg-config.
Support both old and new systems by using pkg-config, when available.
Reported-by: Helge Deller <deller@gmx.de>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Helge: Does this fix the issue for you. I don't have a system with
libnetpbm11 handy yet.
Rules.make | 2 +-
pnmtohex/Makefile | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/Rules.make b/Rules.make
index 51c4e9431699d2f3..b9a098d5e0f409cb 100644
--- a/Rules.make
+++ b/Rules.make
@@ -5,7 +5,7 @@ HOSTCC = gcc
IFLAGS = -I$(TOPDIR)/include
#DFLAGS = -g
OFLAGS = -O3 -fomit-frame-pointer
-CFLAGS = -Wall -Werror $(IFLAGS) $(DFLAGS) $(OFLAGS)
+CFLAGS += -Wall -Werror $(IFLAGS) $(DFLAGS) $(OFLAGS)
SRCS += $(wildcard *.c)
OBJS += $(subst .c,.o,$(SRCS))
diff --git a/pnmtohex/Makefile b/pnmtohex/Makefile
index d89c8e448db0c527..642a26f0c10c3bc2 100644
--- a/pnmtohex/Makefile
+++ b/pnmtohex/Makefile
@@ -3,9 +3,12 @@ TOPDIR = ..
HOST_TARGET = pnmtohex
+CFLAGS += $(shell pkg-config --exists netpbm && pkg-config --cflags netpbm)
+
# Modern distro's (e.g. Debian, Fedora Core) seem to have -lnetpbm only
#LIBS += -lnetpnm -lnetpbm -lnetpgm -lnetppm
LIBS += -lnetpbm
+LIBS += $(shell pkg-config --exists netpbm && pkg-config --libs netpbm)
include $(TOPDIR)/Rules.make
--
2.34.1
next reply other threads:[~2023-03-26 10:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-26 10:42 Geert Uytterhoeven [this message]
2023-03-28 12:20 ` [PATCH fbtest] pnmtohex: Optionally use pkg-config for netpbm Helge Deller
2023-04-03 9:11 ` Geert Uytterhoeven
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=20230326104232.3099222-1-geert@linux-m68k.org \
--to=geert@linux-m68k.org \
--cc=deller@gmx.de \
--cc=linux-fbdev@vger.kernel.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).