[PATCH fbtest] pnmtohex: Optionally use pkg-config for netpbm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
---
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




[Index of Archives]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Tourism]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux