From 3927178ead14723281af625609f706f238e0dc51 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Mon, 28 Nov 2016 20:27:36 +0000 Subject: Add PKG_CONFIG config variable git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2840 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- config.mk.in | 6 ++++++ converter/other/Makefile | 12 ++++++------ other/pamx/Makefile | 10 +++++----- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/config.mk.in b/config.mk.in index b63831aa..ee692332 100644 --- a/config.mk.in +++ b/config.mk.in @@ -161,6 +161,12 @@ LEX = flex # # LEX = lex +# PKG_CONFIG is the beginning of a shell command that tells things about how +# some package (e.g. the PNG library) is installed on the build system. For +# example, it can tell what link options you need to link the PNG library to a +# program. +PKG_CONFIG = pkg-config + # C compiler options # gcc: diff --git a/converter/other/Makefile b/converter/other/Makefile index 6a3d14ed..b01f66ae 100644 --- a/converter/other/Makefile +++ b/converter/other/Makefile @@ -7,12 +7,12 @@ VPATH=.:$(SRCDIR)/$(SUBDIR) include $(BUILDDIR)/config.mk -TEST_PKGCONFIG_LIBXML2 = if pkg-config libxml-2.0; then echo exists; fi +TEST_PKGCONFIG_LIBXML2 = if $(PKG_CONFIG) libxml-2.0; then echo exists; fi ifneq ($(shell $(TEST_PKGCONFIG_LIBXML2)),) # pkg-config libxml2 works on this system - XML2_LIBS = $(shell pkg-config libxml-2.0 --libs) - XML2_CFLAGS = $(shell pkg-config libxml-2.0 --cflags) + XML2_LIBS = $(shell $(PKG_CONFIG) libxml-2.0 --libs) + XML2_CFLAGS = $(shell $(PKG_CONFIG) libxml-2.0 --cflags) else ifeq ($(shell xml2-config --version),) XML2_LIBS=NONE @@ -34,12 +34,12 @@ ifneq ($(TIFFLIB),NONE) endif endif -TEST_PKGCONFIG_LIBPNG = if pkg-config libpng$(PNGVER); then echo exists; fi +TEST_PKGCONFIG_LIBPNG = if $(PKG_CONFIG) libpng$(PNGVER); then echo exists; fi ifneq ($(shell $(TEST_PKGCONFIG_LIBPNG)),) # pkg-config libpng works on this system HAVE_PNGLIB = Y - EXTERN_INCLUDES += $(shell pkg-config libpng$(PNGVER) --cflags) + EXTERN_INCLUDES += $(shell $(PKG_CONFIG) libpng$(PNGVER) --cflags) else ifneq ($(shell libpng$(PNGVER)-config --version),) # No pkg-config, but we have libpng-config on this system @@ -192,7 +192,7 @@ tifftopnm pamtotiff pnmtotiffcmyk: \ ifneq ($(shell $(TEST_PKGCONFIG_LIBPNG)),) # pkg-config libpng works on this system - PNGLIB_LIBOPTS = $(shell pkg-config libpng$(PNGVER) --libs) + PNGLIB_LIBOPTS = $(shell $(PKG_CONFIG) libpng$(PNGVER) --libs) else ifneq ($(shell libpng$(PNGVER)-config --version),) # No pkg-config, but we have libpng-config on this system diff --git a/other/pamx/Makefile b/other/pamx/Makefile index 4e06e0fd..e4892540 100644 --- a/other/pamx/Makefile +++ b/other/pamx/Makefile @@ -9,7 +9,7 @@ include $(BUILDDIR)/config.mk EXTERN_INCLUDE = -ifeq ($(shell pkg-config x11 --modversion --silence-errors),) +ifeq ($(shell $(PKG_CONFIG) x11 --modversion --silence-errors),) # Pkg-config has never heard of X11, or doesn't even exist ifneq ($(X11LIB),NONE) @@ -20,8 +20,8 @@ ifeq ($(shell pkg-config x11 --modversion --silence-errors),) endif else HAVE_X11LIB = Y - X11LIB = $(shell pkg-config x11 --libs) - EXTERN_INCLUDES += $(shell pkg-config x11 --cflags) + X11LIB = $(shell $(PKG_CONFIG) x11 --libs) + EXTERN_INCLUDES += $(shell $(PKG_CONFIG) x11 --cflags) endif ifeq ($(HAVE_X11LIB),Y) @@ -46,10 +46,10 @@ all: $(BINARIES) include $(SRCDIR)/common.mk -ifeq ($(shell pkg-config x11 --libs),) +ifeq ($(shell $(PKG_CONFIG) x11 --libs),) X11_LIBOPTS = $(shell $(LIBOPT) $(LIBOPTR) $(X11LIB)) else - X11_LIBOPTS = $(shell pkg-config x11 --libs) + X11_LIBOPTS = $(shell $(PKG_CONFIG) x11 --libs) endif pamx: image.o send.o window.o -- cgit 1.4.1