From 5fbea622bfe7bf91a9f567bf6f36e0b26dacaaa1 Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Tue, 7 Nov 2017 14:48:32 +0200 Subject: [PATCH] pkg-config is now configurable --- defaults/Jambase.pkgcfg | 10 +++++----- defaults/Jambase.vars | 2 ++ defaults/configure/Jambase.configure | 8 ++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/defaults/Jambase.pkgcfg b/defaults/Jambase.pkgcfg index a913c67..cc27fd7 100644 --- a/defaults/Jambase.pkgcfg +++ b/defaults/Jambase.pkgcfg @@ -15,7 +15,7 @@ # return empty string if condition is not met rule pkg-config-exists { local cf res ; - cf = [ Command "pkg-config --exists '$(1)' 2>/dev/null" : exit-code code-first ] ; + cf = [ Command "$(PKG-CONFIG) --exists '$(1)' 2>/dev/null" : exit-code code-first ] ; if $(cf[1]) = '0' { res = 'tan' ; } else { @@ -29,7 +29,7 @@ rule pkg-config-exists { # add output to var $(2) # return resulting (non-empty) string if library is present # if $(2) = "" -- don't add flags, just return -# [ lib-config-ex 'pkg-config sdl --cflags' : 'CFLAGS' ] +# [ lib-config-ex '$(PKG-CONFIG) sdl --cflags' : 'CFLAGS' ] rule lib-config-ex { local cf lf res ; cf = [ Command "$(1) 2>/dev/null" : parse-output exit-code code-first ] ; @@ -49,7 +49,7 @@ rule lib-config-ex { # add necessary flags to compiler and linker vars # return 'tan' (non-empty string) if library is present # if $(2) != "" -- don't add flags, just check -# [ lib-config 'pkg-config sdl' ] +# [ lib-config '$(PKG-CONFIG) sdl' ] rule lib-config { local cf lf hasit ; @@ -82,13 +82,13 @@ rule lib-config { rule pkg-config { local res ; - res = [ lib-config "pkg-config $(1)" ] ; + res = [ lib-config "$(PKG-CONFIG) $(1)" ] ; return $(res) ; } rule pkg-config-has { local res ; - res = [ lib-config-ex "pkg-config $(1) --cflags --libs" ] ; + res = [ lib-config-ex "$(PKG-CONFIG) $(1) --cflags --libs" ] ; return $(res) ; } diff --git a/defaults/Jambase.vars b/defaults/Jambase.vars index 1b507b7..5269223 100644 --- a/defaults/Jambase.vars +++ b/defaults/Jambase.vars @@ -167,6 +167,7 @@ else if $(UNIX) { PICFLAGS ?= -fpic ; STDHDRS ?= /usr/include ; HDRPATH_IGNORE ?= /usr ; # no regexp yet + PKG-CONFIG ?= pkg-config ; } # shared library object file suffix. We assume that it is identical @@ -237,6 +238,7 @@ if $(USE_DMD) { GDCLINK ?= gdc -pipe ; } HDRPATTERN = '^\s*#\s*include\s+[<"]([^">]+)[">].*$' ; +PKG-CONFIG ?= pkg-config ; OSFULL = $(OS)$(OSVER)$(OSPLAT) $(OS)$(OSPLAT) $(OS)$(OSVER) $(OS) ; diff --git a/defaults/configure/Jambase.configure b/defaults/configure/Jambase.configure index 066f2e4..8632a95 100644 --- a/defaults/configure/Jambase.configure +++ b/defaults/configure/Jambase.configure @@ -157,8 +157,8 @@ rule -configure-pkg-config- { if $(ex) { Echo 'found' ; -configure-add-line- '#' $(1) ; - flg = [ lib-config-ex "pkg-config '$(2)' --cflags" ] ; - lib = [ lib-config-ex "pkg-config '$(2)' --libs" ] ; + flg = [ lib-config-ex "$(PKG-CONFIG) '$(2)' --cflags" ] ; + lib = [ lib-config-ex "$(PKG-CONFIG) '$(2)' --libs" ] ; if $(flg) { -configure-add-line- 'CFLAGS.all +=' $(flg) ';' ; } @@ -257,8 +257,8 @@ rule -configure-pkg-config-get-flags- { } else { Echo "checking for $(displibname) ... " : -n ; -configure-add-line- '#' $(displibname) ; - flg = [ lib-config-ex "pkg-config $(pcargs) --cflags" ] ; - lib = [ lib-config-ex "pkg-config $(pcargs) --libs" ] ; + flg = [ lib-config-ex "$(PKG-CONFIG) $(pcargs) --cflags" ] ; + lib = [ lib-config-ex "$(PKG-CONFIG) $(pcargs) --libs" ] ; if ! $(flg) && ! $(lib) { # no such package Echo 'not found' ; -- 2.11.4.GIT