summaryrefslogtreecommitdiffhomepage
path: root/auto/make
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2023-08-31 09:41:46 -0700
committerKonstantin Pavlov <thresh@nginx.com>2023-08-31 09:41:46 -0700
commitc45c8919c7232eb20023484f6d1fc9f1f50395d8 (patch)
treecc12eb307c1611494948645e4b487fa06495c3d2 /auto/make
parent88c90e1c351ab8c5bd487a5cd4b735014b08e271 (diff)
parent9b22b6957bc87b3df002d0bc691fdae6a20abdac (diff)
downloadunit-c45c8919c7232eb20023484f6d1fc9f1f50395d8.tar.gz
unit-c45c8919c7232eb20023484f6d1fc9f1f50395d8.tar.bz2
Merged with the default branch.1.31.0-1
Diffstat (limited to '')
-rw-r--r--auto/make35
1 files changed, 34 insertions, 1 deletions
diff --git a/auto/make b/auto/make
index ecf31826..abfd41ad 100644
--- a/auto/make
+++ b/auto/make
@@ -94,7 +94,9 @@ $NXT_BUILD_DIR/lib/$NXT_LIB_SHARED: \$(NXT_LIB_OBJS)
$NXT_BUILD_DIR/lib/$NXT_LIB_STATIC: \$(NXT_LIB_OBJS)
$NXT_STATIC_LINK \$@ \$(NXT_LIB_OBJS)
-$NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC: \$(NXT_LIB_UNIT_OBJS)
+$NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC: \$(NXT_LIB_UNIT_OBJS) \\
+ $NXT_BUILD_DIR/share/pkgconfig/unit.pc \\
+ $NXT_BUILD_DIR/share/pkgconfig/unit-uninstalled.pc
$NXT_STATIC_LINK \$@ \$(NXT_LIB_UNIT_OBJS)
END
@@ -397,6 +399,10 @@ libunit-install: $NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC
|| install -d \$(DESTDIR)$NXT_LIBDIR
install -p -m u=rw,go=r $NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC \
\$(DESTDIR)$NXT_LIBDIR/
+ test -d \$(DESTDIR)$NXT_PKGCONFIGDIR \
+ || install -d \$(DESTDIR)$NXT_PKGCONFIGDIR
+ install -p -m u=rw,go=r $NXT_BUILD_DIR/share/pkgconfig/unit.pc \
+ \$(DESTDIR)$NXT_PKGCONFIGDIR/
test -d \$(DESTDIR)$NXT_INCLUDEDIR \
|| install -d \$(DESTDIR)$NXT_INCLUDEDIR
install -p -m u=rw,go=r src/nxt_unit.h \
@@ -414,6 +420,8 @@ libunit-install: $NXT_BUILD_DIR/lib/$NXT_LIB_UNIT_STATIC
libunit-uninstall:
rm -f \$(DESTDIR)$NXT_LIBDIR/$NXT_LIB_UNIT_STATIC
@rmdir -p \$(DESTDIR)$NXT_LIBDIR 2>/dev/null || true
+ rm -f \$(DESTDIR)$NXT_PKGCONFIGDIR/unit.pc
+ @rmdir -p \$(DESTDIR)$NXT_PKGCONFIGDIR 2>/dev/null || true
rm -f \$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit.h \
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_field.h \
\$(DESTDIR)$NXT_INCLUDEDIR/nxt_unit_request.h \
@@ -428,6 +436,31 @@ libunit-uninstall:
END
+# pkg-config files
+
+cat << END >> $NXT_MAKEFILE
+
+$NXT_BUILD_DIR/share/pkgconfig/unit.pc: src/unit.pc.in
+ sed -e "s|@PREFIX@|$NXT_PREFIX|" \\
+ -e "s|@LIBDIR@|$NXT_LIBDIR|" \\
+ -e "s|@CFLAGS@|-I$NXT_INCLUDEDIR|" \\
+ -e "s|@VERSION@|\$(NXT_VERSION)|" \\
+ -e "s|@EXTRA_LIBS@|$NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS|" \\
+ -e "s|@CONFARGS@|$(echo $NXT_CONFIGURE_OPTIONS | sed -e 's| -pie||' -e 's| --njs||')|" \\
+ -e "s|@MODULESDIR@|$NXT_MODULESDIR|" \\
+ < src/unit.pc.in > \$@
+
+$NXT_BUILD_DIR/share/pkgconfig/unit-uninstalled.pc: src/unit.pc.in
+ sed -e "s|@PREFIX@|$(pwd)/$NXT_BUILD_DIR|" \\
+ -e "s|@LIBDIR@|$(pwd)/$NXT_BUILD_DIR/lib|" \\
+ -e "s|@CFLAGS@|-I$(pwd)/src -I$(pwd)$NXT_BUILD_DIR/include|" \\
+ -e "s|@VERSION@|\$(NXT_VERSION)|" \\
+ -e "s|@EXTRA_LIBS@|$NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS|" \\
+ -e "s|@CONFARGS@|$(echo $NXT_CONFIGURE_OPTIONS | sed -e 's| -pie||' -e 's| --njs||')|" \\
+ < src/unit.pc.in > \$@
+
+END
+
# Makefile.
# *.dSYM is MacOSX Clang debug information.