From ea41495cab211a7d67acea6a2dd72270755ab82c Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 24 Jun 2015 02:25:47 +0000 Subject: Use pkg-config instead of xxx-config for merge link if available git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2565 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- GNUmakefile | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 1647bd57..caf8e37d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -302,22 +302,30 @@ ifneq ($(LINUXSVGALIB),NONE) MERGELIBS += $(LINUXSVGALIB) endif -ifeq ($(shell libpng$(PNGVER)-config --version),) - PNGLD = $(shell $(LIBOPT) $(LIBOPTR) $(PNGLIB) $(ZLIB)) +ifneq ($(shell pkg-config --modversion libpng$(PNGVER)),) + PNGLD = $(shell pkg-config --libs libpng$(PNGVER)) else - PNGLD = $(shell libpng$(PNGVER)-config --ldflags) + ifneq ($(shell libpng$(PNGVER)-config --version),) + PNGLD = $(shell libpng$(PNGVER)-config --ldflags) + else + PNGLD = $(shell $(LIBOPT) $(LIBOPTR) $(PNGLIB) $(ZLIB)) + endif endif -ifeq ($(shell xml2-config --version),) - XML2LD= +ifneq ($(shell pkg-config --modversion libxml-2.0),) + XML2LD=$(shell pkg-config --libs libxml-2.0) else - XML2LD=$(shell xml2-config --libs) + ifneq ($(shell xml2-config --version),) + XML2LD=$(shell xml2-config --libs) + else + XML2LD= + endif endif -ifeq ($(shell pkg-config x11 --libs),) - X11LD = $(shell $(LIBOPT) $(LIBOPTR) $(X11LIB)) -else +ifneq ($(shell pkg-config x11 --libs),) X11LD = $(shell pkg-config x11 --libs) +else + X11LD = $(shell $(LIBOPT) $(LIBOPTR) $(X11LIB)) endif -- cgit 1.4.1