details:   https://hg.nginx.org/njs/rev/47b4fd12767e
branches:  
changeset: 2002:47b4fd12767e
user:      Konstantin Pavlov <thr...@nginx.com>
date:      Mon Oct 17 16:45:53 2022 +0400
description:
Added a target to generate pkg-config file.

diffstat:

 auto/make     |  15 ++++++++++++++-
 src/njs.pc.in |   8 ++++++++
 2 files changed, 22 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r 487780764501 -r 47b4fd12767e auto/make
--- a/auto/make Wed Nov 16 16:09:47 2022 -0800
+++ b/auto/make Mon Oct 17 16:45:53 2022 +0400
@@ -64,7 +64,7 @@ default: njs
 NJS_LIB_INCS = $njs_incs
 NJS_LIB_OBJS = $njs_objs
 
-libnjs: $NJS_BUILD_DIR/libnjs.a
+libnjs: $NJS_BUILD_DIR/libnjs.a pc
 
 $NJS_BUILD_DIR/libnjs.a:   \\
        $NJS_BUILD_DIR/njs_auto_config.h \\
@@ -314,6 +314,19 @@ ts_clean:
        rm -rf $NJS_BUILD_DIR/ts
 END
 
+# pkg-config file
+cat << END >> $NJS_MAKEFILE
+
+pc: $NJS_BUILD_DIR/njs.pc
+
+$NJS_BUILD_DIR/njs.pc: $NJS_BUILD_DIR/njs_auto_config.h
+       sed -e "s,@PREFIX@,$(pwd)/$NJS_BUILD_DIR," \\
+               -e "s,@LIBDIR@,$(pwd)/$NJS_BUILD_DIR," \\
+               -e "s,@CFLAGS@,-I$(pwd)/$NJS_BUILD_DIR -I$(pwd)/src," \\
+               -e "s,@VERSION@,\$(NJS_VER)," \\
+               -e "s,@EXTRA_LIBS@,-lm $NJS_LIBS $NJS_LIB_AUX_LIBS," \\
+               src/njs.pc.in > \$@
+END
 
 # Makefile.
 
diff -r 487780764501 -r 47b4fd12767e src/njs.pc.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src/njs.pc.in     Mon Oct 17 16:45:53 2022 +0400
@@ -0,0 +1,8 @@
+prefix=@PREFIX@
+libdir=@LIBDIR@
+
+Name: njs
+Description: library to embed njs scripting language
+Version: @VERSION@
+Libs: -L${libdir} -lnjs @EXTRA_LIBS@
+Cflags: @CFLAGS@
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-le...@nginx.org

Reply via email to