diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2023-03-26 12:42:32 +0200 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2023-04-03 11:12:30 +0200 |
commit | 131c53cd0e5c7984d7b1c5d764559431690c6fef (patch) | |
tree | 33eecfba01082802d5d80aa48802c2e4813bfe46 | |
parent | dbf4e0bd06410e54617f847f8f33a5280f1b8c93 (diff) | |
download | fbtest-131c53cd0e5c7984d7b1c5d764559431690c6fef.tar.gz |
pnmtohex: Optionally use pkg-config for netpbm
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>
Link: https://lore.kernel.org/r/20230326104232.3099222-1-geert@linux-m68k.org
Tested-by: Helge Deller <deller@gmx.de>
-rw-r--r-- | Rules.make | 2 | ||||
-rw-r--r-- | pnmtohex/Makefile | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -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 d89c8e4..642a26f 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 |