summaryrefslogtreecommitdiffhomepage
path: root/auto/make
diff options
context:
space:
mode:
Diffstat (limited to 'auto/make')
-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.