Skip to content

Commit 9b8797c

Browse files
committed
Added pkg-config discovery for QuickJS-NG.
1 parent 88272af commit 9b8797c

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

auto/quickjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,21 @@ if [ $NJS_TRY_QUICKJS = YES ]; then
4949
. auto/feature
5050
fi
5151

52+
if [ $njs_found = no ]; then
53+
if /bin/sh -c "(pkg-config quickjs-ng --exists)" >> $NJS_AUTOCONF_ERR 2>&1; then
54+
55+
# pkg-config
56+
57+
njs_feature="QuickJS-NG library via pkg-config"
58+
59+
njs_feature_incs="$NJS_QUICKJS_DEFAULT_INCS"
60+
njs_feature_incs="$njs_feature_incs $(pkg-config quickjs-ng --cflags-only-I | sed -e 's/-I//g')"
61+
njs_feature_libs=$(pkg-config quickjs-ng --libs)
62+
63+
. auto/feature
64+
fi
65+
fi
66+
5267
if [ $njs_found = no ]; then
5368
njs_feature="QuickJS-NG library -lqjs"
5469
njs_feature_incs="$NJS_QUICKJS_DEFAULT_INCS"

nginx/config

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ if [ $NJS_QUICKJS != NO ]; then
6363
. auto/feature
6464
fi
6565

66+
if [ $ngx_found = no ]; then
67+
if /bin/sh -c "(pkg-config quickjs-ng --exists)" >> /dev/null 2>&1; then
68+
69+
# pkg-config
70+
71+
ngx_feature="QuickJS-NG library via pkg-config"
72+
73+
ngx_feature_path="$NJS_QUICKJS_DEFAULT_INCS"
74+
ngx_feature_path="$ngx_feature_path $(pkg-config quickjs-ng --cflags-only-I | sed -e 's/-I//g')"
75+
ngx_feature_libs=$(pkg-config quickjs-ng --libs)
76+
77+
. auto/feature
78+
fi
79+
fi
80+
6681
if [ $ngx_found = no ]; then
6782
ngx_feature="QuickJS-NG library -lqjs"
6883
ngx_feature_path="$NJS_QUICKJS_DEFAULT_INCS"

0 commit comments

Comments
 (0)