diff options
Diffstat (limited to 'auto')
-rw-r--r-- | auto/help | 1 | ||||
-rw-r--r-- | auto/make | 35 | ||||
-rw-r--r-- | auto/options | 2 | ||||
-rw-r--r-- | auto/summary | 1 |
4 files changed, 38 insertions, 1 deletions
@@ -20,6 +20,7 @@ cat << END --modulesdir=DIR default: "\$libdir/unit/modules" --datarootdir=DIR default: "\$prefix/share" --mandir=DIR default: "\$datarootdir/man" + --pkgconfigdir=DIR default: "\$datarootdir/pkgconfig" --localstatedir=DIR default: "\$prefix/var" --statedir=DIR default: "\$localstatedir/lib/unit" --runstatedir=DIR default: "\$localstatedir/run/unit" @@ -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. diff --git a/auto/options b/auto/options index 5487be7f..0550c699 100644 --- a/auto/options +++ b/auto/options @@ -73,6 +73,7 @@ do ;; --datarootdir=*) NXT_DATAROOTDIR="$value" ;; --mandir=*) NXT_MANDIR="$value" ;; + --pkgconfigdir=*) NXT_PKGCONFIGDIR="$value" ;; --localstatedir=*) NXT_LOCALSTATEDIR="$value" ;; --statedir=*) NXT_STATEDIR="$value" ;; --state=*) @@ -158,6 +159,7 @@ NXT_MODULESDIR="${NXT_MODULESDIR-"$NXT_LIBDIR/unit/modules"}" NXT_DATAROOTDIR="${NXT_DATAROOTDIR-"$NXT_PREFIX/share"}" NXT_MANDIR="${NXT_MANDIR-"$NXT_DATAROOTDIR/man"}" +NXT_PKGCONFIGDIR="${NXT_PKGCONFIGDIR-"$NXT_DATAROOTDIR/pkgconfig"}" NXT_LOCALSTATEDIR="${NXT_LOCALSTATEDIR-"$NXT_PREFIX/var"}" NXT_STATEDIR="${NXT_STATEDIR-"$NXT_LOCALSTATEDIR/lib/unit"}" diff --git a/auto/summary b/auto/summary index fabe3b10..3aa41669 100644 --- a/auto/summary +++ b/auto/summary @@ -11,6 +11,7 @@ Unit configuration summary: sbin directory: ............ "$NXT_SBINDIR" lib directory: ............. "$NXT_LIBDIR" include directory: ......... "$NXT_INCLUDEDIR" + pkgconfig directory: ....... "$NXT_PKGCONFIGDIR" man pages directory: ....... "$NXT_MANDIR" modules directory: ......... "$NXT_MODULESDIR" state directory: ........... "$NXT_STATEDIR" |