summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2022-11-29 18:10:38 +0400
committerKonstantin Pavlov <thresh@nginx.com>2022-11-29 18:10:38 +0400
commit09ac678943e253dfea65f84cd84963d863580efe (patch)
treec2b0fc9796f0a98e104ebdb9f72d1911c080d822 /auto
parentd862f581db968519fb7adb38c8872d020f4f21e6 (diff)
downloadunit-09ac678943e253dfea65f84cd84963d863580efe.tar.gz
unit-09ac678943e253dfea65f84cd84963d863580efe.tar.bz2
Used pkg-config to detect njs where available.
Diffstat (limited to 'auto')
-rw-r--r--auto/njs16
1 files changed, 12 insertions, 4 deletions
diff --git a/auto/njs b/auto/njs
index 72304793..c0c43f19 100644
--- a/auto/njs
+++ b/auto/njs
@@ -5,10 +5,18 @@
nxt_found=no
NXT_HAVE_NJS=NO
-NXT_NJS_CFLAGS=
-NXT_NJS_AUX_CFLAGS=
-NXT_NJS_LIBS="-lnjs"
-NXT_NJS_AUX_LIBS="$NXT_LIBM $NXT_LIB_AUX_LIBS"
+if /bin/sh -c "(pkg-config njs --exists)" >> $NXT_AUTOCONF_ERR 2>&1;
+then
+ NXT_NJS_AUX_CFLAGS=
+ NXT_NJS_AUX_LIBS=
+ NXT_NJS_CFLAGS=`pkg-config njs --cflags`
+ NXT_NJS_LIBS=`pkg-config njs --libs`
+else
+ NXT_NJS_AUX_CFLAGS=
+ NXT_NJS_AUX_LIBS="$NXT_LIBM $NXT_LIB_AUX_LIBS"
+ NXT_NJS_CFLAGS=
+ NXT_NJS_LIBS="-lnjs"
+fi
nxt_feature="NJS"
nxt_feature_name=NXT_HAVE_NJS