aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2025-04-27 02:21:20 +0000
committerLaurent Bercot <ska@appnovation.com>2025-04-27 02:21:20 +0000
commitda00770799d03803d9961189285bd15d5c7c5c89 (patch)
treef9c3b248738f231c5c9e3c2978d6085cbab949ba
parentf9ef7b0d59a17b648bb1812d5537c640dead80a1 (diff)
downloadnsss-da00770799d03803d9961189285bd15d5c7c5c89.tar.gz
Add pkg-config support
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r--.gitignore1
-rw-r--r--INSTALL29
-rw-r--r--Makefile79
-rw-r--r--NEWS3
-rwxr-xr-xconfigure131
-rw-r--r--doc/index.html4
-rw-r--r--doc/upgrade.html6
-rw-r--r--package/deps-build2
-rw-r--r--package/deps.mak38
-rw-r--r--package/info2
-rw-r--r--package/targets.mak2
-rwxr-xr-xtools/gen-deps.sh17
-rwxr-xr-xtools/gen-dotpc.sh101
13 files changed, 328 insertions, 87 deletions
diff --git a/.gitignore b/.gitignore
index 4fb2d9b..5926be4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
*.o
*.lo
+/*.pc
/config.mak
/src/include/nsss/config.h
/libnsss.a.xyzzy
diff --git a/INSTALL b/INSTALL
index 363b5e0..b5c8ab6 100644
--- a/INSTALL
+++ b/INSTALL
@@ -8,7 +8,7 @@ Build Instructions
- GNU make version 3.81 or later
- skalibs version 2.14.4.0 or later: https://skarnet.org/software/skalibs/
- To run the test suite and the nsssd-* programs:
- s6 version 2.13.1.1 or later: https://skarnet.org/software/s6/
+ s6 version 2.13.2.0 or later: https://skarnet.org/software/s6/
This software will run on any operating system that implements
POSIX.1-2008, available at:
@@ -29,6 +29,33 @@ POSIX.1-2008, available at:
off them.
+* pkg-config
+ ----------
+
+ pkg-config is a tool used by some Linux and BSD distributions, providing
+a registry to store policy information about libraries exported by a
+software package; that is supposed to make it easier to build software
+depending on these libraries, by having a tool to automatically extract
+the various flags to pass to the compiler and linker in order to correctly
+build against these libraries.
+ This package supports pkg-config, but you need to explicitly ask for it:
+ - To use the pkg-config tool to *read* information from the registry and
+use it to build *this* package: --with-pkgconfig[=PROG]. This assumes
+PROG supports the pkg-config interface (as the popular pkgconf
+implementation does). If PROG is not supplied, the PKG_CONFIG environment
+variable is used to find the program to use, and if empty/unset, it defaults
+to pkg-config.
+ - To build a .pc file for each library exported by this package, and then
+install it to the pkg-config registry, in other words to *write* information
+so that other software can use pkg-config to build against this package,
+use --enable-pkgconfig.
+
+ pkg-config and slashpackage (see below) configure options can be set
+together, but the slashpackage convention provides its own installation
+policies that generally make it unnecessary to use pkg-config. You
+probably should not mix both.
+
+
* Customization
-------------
diff --git a/Makefile b/Makefile
index b82361b..752b8ba 100644
--- a/Makefile
+++ b/Makefile
@@ -12,28 +12,65 @@ ifeq "" "$(strip $(filter $(make_need), $(firstword $(sort $(make_need) $(MAKE_V
fail := $(error Your make ($(MAKE_VERSION)) is too old. You need $(make_need) or newer)
endif
+uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
+
CC = $(error Please use ./configure first)
STATIC_LIBS :=
SHARED_LIBS :=
INTERNAL_LIBS :=
EXTRA_TARGETS :=
+PC_TARGETS :=
LIB_DEFS :=
+BIN_SYMLINKS :=
+TEST_BINS :=
define library_definition
-LIB$(firstword $(subst =, ,$(1))) := lib$(lastword $(subst =, ,$(1))).$(if $(DO_ALLSTATIC),a,so).xyzzy
+LIB$(1) := lib$(2).$(if $(DO_ALLSTATIC),a,so).xyzzy
ifdef DO_SHARED
-SHARED_LIBS += lib$(lastword $(subst =, ,$(1))).so.xyzzy
+SHARED_LIBS += lib$(2).so.xyzzy
endif
ifdef DO_STATIC
-STATIC_LIBS += lib$(lastword $(subst =, ,$(1))).a.xyzzy
+STATIC_LIBS += lib$(2).a.xyzzy
+endif
+ifdef DO_PKGCONFIG
+PC_TARGETS += lib$(2).pc
endif
+
+lib$(2).pc:
+ exec env \
+ library="$(2)" \
+ includedir="$(includedir)" \
+ dynlibdir="$(dynlibdir)" \
+ libdir="$(libdir)" \
+ extra_includedirs="$(extra_includedirs)" \
+ extra_libdirs="$(extra_libdirs)" \
+ extra_libs="$$(strip $$(EXTRA_LIBS))" \
+ description="$$($(1)_DESCRIPTION)" \
+ url="$$($(1)_URL)" \
+ ldlibs="$(LDLIBS)" \
+ ./tools/gen-dotpc.sh > $$@.tmp
+ exec mv -f $$@.tmp $$@
+
+endef
+
+define binary_installation_rule
+$(DESTDIR)$(1)/$(2): ./$(2) package/modes
+ exec $(INSTALL) -D -m 600 $$< $$@
+ grep -- ^$$(@F) < package/modes | { read name mode owner && \
+ if [ x$$$$owner != x ] ; then chown -- $$$$owner $$@ ; fi && \
+ chmod $$$$mode $$@ ; }
+endef
+
+define symlink_installation_rule
+$(DESTDIR)$(1)/$(2): $(DESTDIR)$(1)/$(SYMLINK_TARGET_$(2))
+ exec $(INSTALL) -l $$(<F) $$@
endef
-include config.mak
include package/targets.mak
-$(foreach var,$(LIB_DEFS),$(eval $(call library_definition,$(var))))
+$(foreach var,$(LIB_DEFS),$(eval $(call library_definition,$(firstword $(subst =, ,$(var))),$(lastword $(subst =, ,$(var))))))
include package/deps.mak
@@ -53,14 +90,18 @@ RANLIB := $(CROSS_COMPILE)ranlib
STRIP := $(CROSS_COMPILE)strip
INSTALL := ./tools/install.sh
+$(foreach var,$(BIN_TARGETS),$(eval $(call binary_installation_rule,$(bindir),$(var))))
+$(foreach var,$(LIBEXEC_TARGETS),$(eval $(call binary_installation_rule,$(libexecdir),$(var))))
+$(foreach var,$(BIN_SYMLINKS),$(eval $(call symlink_installation_rule,$(bindir),$(var))))
+
ALL_BINS := $(LIBEXEC_TARGETS) $(BIN_TARGETS)
ALL_LIBS := $(SHARED_LIBS) $(STATIC_LIBS) $(INTERNAL_LIBS)
ALL_INCLUDES := $(wildcard src/include/$(package)/*.h)
-all: $(ALL_LIBS) $(ALL_BINS) $(ALL_INCLUDES) $(EXTRA_INCLUDES)
+all: $(ALL_LIBS) $(ALL_BINS) $(ALL_INCLUDES) $(EXTRA_INCLUDES) $(PC_TARGETS)
clean:
- @exec rm -f $(ALL_LIBS) $(ALL_BINS) $(wildcard src/*/*.o src/*/*.lo) $(EXTRA_TARGETS)
+ @exec rm -f $(ALL_LIBS) $(ALL_BINS) $(TEST_BINS) $(wildcard src/*/*.o src/*/*.lo) $(PC_TARGETS) $(EXTRA_TARGETS)
distclean: clean
@exec rm -f config.mak src/include/$(package)/config.h
@@ -81,12 +122,19 @@ ifneq ($(strip $(ALL_BINS)$(SHARED_LIBS)),)
exec $(STRIP) -R .note -R .comment $(ALL_BINS) $(SHARED_LIBS)
endif
-install: install-dynlib install-libexec install-bin install-lib install-include
+install: install-dynlib install-libexec install-bin install-symlinks install-lib install-include install-pkgconfig
install-dynlib: $(SHARED_LIBS:lib%.so.xyzzy=$(DESTDIR)$(dynlibdir)/lib%.so)
install-libexec: $(LIBEXEC_TARGETS:%=$(DESTDIR)$(libexecdir)/%)
install-bin: $(BIN_TARGETS:%=$(DESTDIR)$(bindir)/%)
+install-symlinks: $(BIN_SYMLINKS:%=$(DESTDIR)$(bindir)/%)
install-lib: $(STATIC_LIBS:lib%.a.xyzzy=$(DESTDIR)$(libdir)/lib%.a)
install-include: $(ALL_INCLUDES:src/include/$(package)/%.h=$(DESTDIR)$(includedir)/$(package)/%.h) $(EXTRA_INCLUDES:src/include/%.h=$(DESTDIR)$(includedir)/%.h)
+install-pkgconfig: $(PC_TARGETS:%=$(DESTDIR)$(pkgconfdir)/%)
+
+tests: $(TEST_BINS)
+
+check: tests
+ @for i in $(TEST_BINS) ; do ./tools/run-test.sh $$i || exit 1 ; done
ifneq ($(exthome),)
@@ -95,7 +143,7 @@ $(DESTDIR)$(exthome): $(DESTDIR)$(home)
update: $(DESTDIR)$(exthome)
-global-links: $(DESTDIR)$(exthome) $(SHARED_LIBS:lib%.so.xyzzy=$(DESTDIR)$(sproot)/library.so/lib%.so.$(version_M)) $(BIN_TARGETS:%=$(DESTDIR)$(sproot)/command/%)
+global-links: $(DESTDIR)$(exthome) $(SHARED_LIBS:lib%.so.xyzzy=$(DESTDIR)$(sproot)/library.so/lib%.so.$(version_M)) $(BIN_TARGETS:%=$(DESTDIR)$(sproot)/command/%) $(BIN_SYMLINKS:%=$(DESTDIR)$(sproot)/command/%)
$(DESTDIR)$(sproot)/command/%: $(DESTDIR)$(home)/command/%
exec $(INSTALL) -D -l ..$(subst $(sproot),,$(exthome))/command/$(<F) $@
@@ -112,12 +160,6 @@ $(DESTDIR)$(dynlibdir)/lib%.so $(DESTDIR)$(dynlibdir)/lib%.so.$(version_M): lib%
$(INSTALL) -l $(@F).$(version) $@.$(version_M) && \
exec $(INSTALL) -l $(@F).$(version_M) $@
-$(DESTDIR)$(libexecdir)/% $(DESTDIR)$(bindir)/%: % package/modes
- exec $(INSTALL) -D -m 600 $< $@
- grep -- ^$(@F) < package/modes | { read name mode owner && \
- if [ x$$owner != x ] ; then chown -- $$owner $@ ; fi && \
- chmod $$mode $@ ; }
-
$(DESTDIR)$(libdir)/lib%.a: lib%.a.xyzzy
exec $(INSTALL) -D -m 644 $< $@
@@ -127,13 +169,16 @@ $(DESTDIR)$(includedir)/$(package)/%.h: src/include/$(package)/%.h
$(DESTDIR)$(includedir)/%.h: src/include/%.h
exec $(INSTALL) -D -m 644 $< $@
+$(DESTDIR)$(pkgconfdir)/lib%.pc: lib%.pc
+ exec $(INSTALL) -D -m 644 $< $@
+
%.o: %.c
exec $(CC) $(CPPFLAGS_ALL) $(CFLAGS_ALL) -c -o $@ $<
%.lo: %.c
exec $(CC) $(CPPFLAGS_ALL) $(CFLAGS_ALL) $(CFLAGS_SHARED) -c -o $@ $<
-$(ALL_BINS):
+$(ALL_BINS) $(TEST_BINS):
exec $(CC) -o $@ $(CFLAGS_ALL) $(LDFLAGS_ALL) $(LDFLAGS_NOSHARED) $^ $(EXTRA_LIBS) $(LDLIBS)
lib%.a.xyzzy:
@@ -141,8 +186,8 @@ lib%.a.xyzzy:
exec $(RANLIB) $@
lib%.so.xyzzy:
- exec $(CC) -o $@ $(CFLAGS_ALL) $(CFLAGS_SHARED) $(LDFLAGS_ALL) $(LDFLAGS_SHARED) -Wl,-soname,$(patsubst lib%.so.xyzzy,lib%.so.$(version_M),$@) $^ $(EXTRA_LIBS) $(LDLIBS)
+ exec $(CC) -o $@ $(CFLAGS_ALL) $(CFLAGS_SHARED) $(LDFLAGS_ALL) $(LDFLAGS_SHARED) -Wl,-soname,$(patsubst lib%.so.xyzzy,lib%.so.$(version_M),$@) -Wl,-rpath=$(dynlibdir) $^ $(EXTRA_LIBS) $(LDLIBS)
-.PHONY: it all clean distclean tgz strip install install-dynlib install-bin install-lib install-include
+.PHONY: it all clean distclean tests check tgz strip install install-dynlib install-bin install-lib install-include install-pkgconfig
.DELETE_ON_ERROR:
diff --git a/NEWS b/NEWS
index 02691ca..096b9ef 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,10 @@
Changelog for nsss.
-In 0.2.0.6
+In 0.2.1.0
----------
- Bugfixes.
+ - pkg-config support.
In 0.2.0.5
diff --git a/configure b/configure
index 55acc14..7e01d5f 100755
--- a/configure
+++ b/configure
@@ -23,6 +23,7 @@ Fine tuning of the installation directories:
--libexecdir=DIR package-scoped executables [EPREFIX/libexec]
--libdir=DIR static library files [PREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
+ --pkgconfdir=DIR pkg-config .pc files [PREFIX/lib/pkgconfig]
If no --prefix option is given, by default libdir (but not dynlibdir) will be
/usr/lib, and includedir will be /usr/include.
@@ -32,6 +33,7 @@ Dependencies:
--with-include=DIR add DIR to the list of searched directories for headers
--with-lib=DIR add DIR to the list of searched directories for static libraries
--with-dynlib=DIR add DIR to the list of searched directories for shared libraries
+ --with-pkgconfig[=PROG] use pkg-config to look for dependencies
If no --prefix option is given, by default sysdeps will be fetched from
/usr/lib/skalibs/sysdeps.
@@ -43,8 +45,8 @@ Optional features:
--enable-static-libc make entirely static binaries [disabled]
--disable-all-pic don't build executables or static libs as PIC [enabled]
--enable-slashpackage[=ROOT] assume /package installation at ROOT [disabled]
- --enable-absolute-paths do not rely on PATH to access this package's binaries,
- hardcode absolute BINDIR/foobar paths instead [disabled]
+ --enable-absolute-paths hardcode absolute BINDIR/foobar paths in binaries [disabled]
+ --enable-pkgconfig Build and install .pc files for pkg-config [disabled]
--with-nsssd-socket=PATH assume the nsssd socket is at PATH [/run/service/nsssd/s]
--enable-libc-includes overwrite {pwd,grp,shadow}.h in includedir [disabled]
@@ -142,6 +144,7 @@ libexecdir='$exec_prefix/libexec'
bindir='$exec_prefix/bin'
libdir='$prefix/lib'
includedir='$prefix/include'
+pkgconfdir='$prefix/lib/pkgconfig'
sysdeps='$prefix/lib/skalibs/sysdeps'
manualsysdeps=false
shared=false
@@ -149,14 +152,18 @@ static=true
allpic=true
slashpackage=false
abspath=false
+pcw=false
sproot=
home=
exthome=
allstatic=true
evenmorestatic=false
+pkgconf=
addincpath=''
addlibspath=''
addlibdpath=''
+depincpath=''
+deplibpath=''
vpaths=''
vpathd=''
build=
@@ -173,10 +180,14 @@ for arg ; do
--bindir=*) bindir=${arg#*=} ;;
--libdir=*) libdir=${arg#*=} ;;
--includedir=*) includedir=${arg#*=} ;;
+ --pkgconfigdir=*) pkgconfigdir=${arg#*=} ;;
--with-sysdeps=*) sysdeps=${arg#*=} manualsysdeps=true ;;
--with-include=*) var=${arg#*=} ; stripdir var ; addincpath="$addincpath -I$var" ;;
--with-lib=*) var=${arg#*=} ; stripdir var ; addlibspath="$addlibspath -L$var" ; vpaths="$vpaths $var" ;;
--with-dynlib=*) var=${arg#*=} ; stripdir var ; addlibdpath="$addlibdpath -L$var" ; vpathd="$vpathd $var" ;;
+ --with-pkgconfig=*) pkgconf=${arg#*=} ;;
+ --with-pkgconfig) pkgconf=${PKG_CONFIG:-pkg-config} ;;
+ --without-pkgconfig) pkgconf= ;;
--enable-shared|--enable-shared=yes) shared=true ;;
--disable-shared|--enable-shared=no) shared=false ;;
--enable-static|--enable-static=yes) static=true ;;
@@ -187,6 +198,8 @@ for arg ; do
--disable-static-libc|--enable-static-libc=no) evenmorestatic=false ;;
--enable-all-pic|--enable-all-pic=yes) allpic=true ;;
--disable-all-pic|--enable-all-pic=no) allpic=false ;;
+ --enable-pkgconfig|--enable-pkgconfig=yes) pcw=true ;;
+ --disable-pkgconfig|--enable-pkgconfig=no) pcw=false ;;
--enable-slashpackage=*) sproot=${arg#*=} ; slashpackage=true ; ;;
--enable-slashpackage) sproot= ; slashpackage=true ;;
--disable-slashpackage) sproot= ; slashpackage=false ;;
@@ -212,6 +225,9 @@ if test -z "$prefix" ; then
if test "$includedir" = '$prefix/include' ; then
includedir=/usr/include
fi
+ if test "$pkgconfdir" = '$prefix/lib/pkgconfig' ; then
+ pkgconfdir=/usr/lib/pkgconfig
+ fi
if test "$sysdeps" = '$prefix/lib/skalibs/sysdeps' ; then
sysdeps=/usr/lib/skalibs/sysdeps
fi
@@ -219,29 +235,60 @@ fi
# Expand installation directories
stripdir prefix
-for i in exec_prefix dynlibdir libexecdir bindir libdir includedir sysdeps sproot ; do
+for i in exec_prefix dynlibdir libexecdir bindir libdir includedir pkgconfdir sysdeps sproot ; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
-# Get usable temp filenames
-i=0
-set -C
-while : ; do
- i=$(($i+1))
- tmpc="./tmp-configure-$$-$PPID-$i.c"
- tmpo="./tmp-configure-$$-$PPID-$i.o"
- tmpe="./tmp-configure-$$-$PPID-$i.tmp"
- 2>|/dev/null > "$tmpc" && break
- 2>|/dev/null > "$tmpo" && break
- 2>|/dev/null > "$tmpe" && break
- test "$i" -gt 50 && fail "$0: cannot create temporary files"
-done
-set +C
-trap 'rm -f "$tmpc" "$tmpo" "$tmpe"' EXIT ABRT INT QUIT TERM HUP
+# Process deps-build
+if test -n "$pkgconf" || $pcw || $slashpackage ; then
+ oldifs="$IFS"
+ while IFS=" " read cond usedinlibs pkg ver libs ; do
+ IFS="$oldifs"
+ eval "cond=$cond; usedinlibs=$usedinlibs"
+ if $cond ; then
+ if test -n "$pkgconf" ; then
+ for lib in $libs ; do
+ if ! $pkgconf --atleast-version=${ver} --print-errors -- "$lib" ; then
+ echo "./configure: fatal: $pkgconf --atleast-version=${ver} --print-errors -- $lib failed" 1>&2
+ exit 1
+ fi
+ thisinc="`$pkgconf --cflags-only-I -- $lib`"
+ sldflags="`$pkgconf --libs-only-L --static -- $lib`"
+ dldflags="`$pkgconf --libs-only-L -- $lib`"
+ addincpath="${addincpath}${thisinc:+ }$thisinc"
+ addlibspath="${addlibspath}${sldflags:+ }$sldflags"
+ addlibdpath="${addlibdpath}${dldflags:+ }$dldflags"
+ for i in $sldflags ; do
+ vpaths="$vpaths ${i##-L}"
+ done
+ for i in $dldflags ; do
+ vpathd="$vpathd ${i##-L}"
+ done
+ if $usedinlibs ; then
+ depincpath="${depincpath}${thisinc:+ }$thisinc"
+ deplibpath="${deplibpath}${sldflags:+ }$sldflags"
+ fi
+ done
+ fi
+ if $slashpackage ; then
+ addincpath="$addincpath -I${DESTDIR}${sproot}${pkg}/include"
+ vpaths="$vpaths ${DESTDIR}${sproot}${pkg}/library"
+ addlibspath="$addlibspath -L${DESTDIR}${sproot}${pkg}/library"
+ vpathd="$vpathd ${DESTDIR}${sproot}${pkg}/library.so"
+ addlibdpath="$addlibdpath -L${DESTDIR}${sproot}${pkg}/library.so"
+ if $usedinlibs ; then
+ depincpath="$depincpath -I${DESTDIR}${sproot}${pkg}/include"
+ deplibpath="$deplibpath -L${DESTDIR}${sproot}${pkg}/library"
+ fi
+ fi
+ fi
+ done < package/deps-build
+ IFS="$oldifs"
+fi
-# Set slashpackage values
+# Other slashpackage values
if $slashpackage ; then
home=${sproot}/package/${category}/${package}-${version}
exthome=${sproot}/package/${category}/${package}
@@ -256,22 +303,25 @@ if $slashpackage ; then
libdir=${home}/library
libexecdir=$bindir
includedir=${home}/include
- while read dep condvar ; do
- if test -n "$condvar" ; then
- eval "cond=$condvar"
- else
- cond=true
- fi
- if $cond ; then
- addincpath="$addincpath -I${DESTDIR}${sproot}${dep}/include"
- vpaths="$vpaths ${DESTDIR}${sproot}${dep}/library"
- addlibspath="$addlibspath -L${DESTDIR}${sproot}${dep}/library"
- vpathd="$vpathd ${DESTDIR}${sproot}${dep}/library.so"
- addlibdpath="$addlibdpath -L${DESTDIR}${sproot}${dep}/library.so"
- fi
- done < package/deps-build
+ pkgconfdir=${home}/pkgconfig
fi
+# Get usable temp filenames
+i=0
+set -C
+while : ; do
+ i=$(($i+1))
+ tmpc="./tmp-configure-$$-$PPID-$i.c"
+ tmpo="./tmp-configure-$$-$PPID-$i.o"
+ tmpe="./tmp-configure-$$-$PPID-$i.tmp"
+ 2>|/dev/null > "$tmpc" && break
+ 2>|/dev/null > "$tmpo" && break
+ 2>|/dev/null > "$tmpe" && break
+ test "$i" -gt 50 && fail "$0: cannot create temporary files"
+done
+set +C
+trap 'rm -f "$tmpc" "$tmpo" "$tmpe"' EXIT ABRT INT QUIT TERM HUP
+
# Find a C compiler to use
if test -n "$target" && test x${build} != x${target} ; then
cross=${target}-
@@ -389,12 +439,15 @@ libexecdir := $libexecdir
bindir := $bindir
libdir := $libdir
includedir := $includedir
+pkgconfdir := $pkgconfdir
sysdeps := $sysdeps
slashpackage := $slashpackage
sproot := $sproot
version := $version
home := $home
exthome := $exthome
+extra_includedirs :=$depincpath
+extra_libdirs :=$deplibpath
SPAWN_LIB := ${spawn_lib}
SOCKET_LIB := ${socket_lib}
SYSCLOCK_LIB := ${sysclock_lib}
@@ -403,17 +456,18 @@ UTIL_LIB := ${util_lib}
CC := $CC_AUTO
CPPFLAGS_AUTO := $CPPFLAGS_AUTO
-CPPFLAGS := $CPPFLAGS $CPPFLAGS_POST
+CPPFLAGS := ${CPPFLAGS}${CPPFLAGS_POST:+ }$CPPFLAGS_POST
CFLAGS_AUTO := $CFLAGS_AUTO
-CFLAGS := $CFLAGS $CFLAGS_POST
+CFLAGS := ${CFLAGS}${CFLAGS_POST:+ }$CFLAGS_POST
LDFLAGS_AUTO := $LDFLAGS_AUTO
-LDFLAGS := $LDFLAGS $LDFLAGS_POST
+LDFLAGS := ${LDFLAGS}${LDFLAGS_POST:+ }$LDFLAGS_POST
LDFLAGS_SHARED := $LDFLAGS_SHARED
LDFLAGS_NOSHARED := $LDFLAGS_NOSHARED
CROSS_COMPILE := $cross
vpath lib%.a$vpaths
vpath lib%.so$vpathd
+
EOF
if $allstatic ; then
echo ".LIBPATTERNS := lib%.a"
@@ -431,6 +485,11 @@ if $shared ; then
else
echo "DO_SHARED :="
fi
+if $pcw ; then
+ echo "DO_PKGCONFIG := 1"
+else
+ echo "DO_PKGCONFIG :="
+fi
if $allpic ; then
echo "STATIC_LIBS_ARE_PIC := 1"
else
diff --git a/doc/index.html b/doc/index.html
index a79ece0..cce2f7c 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -85,7 +85,7 @@ functions.
requirement if you link against the shared version of the skalibs
library. </li>
<li> <a href="//skarnet.org/software/s6/">s6</a> version
-2.13.1.1 or later. It's a <em>run-time</em> requirement only, to run
+2.13.2.0 or later. It's a <em>run-time</em> requirement only, to run
the nsssd service (and can be done without if you have a suitable replacement
for <a href="//skarnet.org/software/s6/s6-ipcserver.html">s6-ipcserver</a>). </li>
</ul>
@@ -100,7 +100,7 @@ for <a href="//skarnet.org/software/s6/s6-ipcserver.html">s6-ipcserver</a>). </l
<h3> Download </h3>
<ul>
- <li> The current released version of nsss is <a href="nsss-0.2.0.6.tar.gz">0.2.0.6</a>. </li>
+ <li> The current released version of nsss is <a href="nsss-0.2.1.0.tar.gz">0.2.1.0</a>. </li>
<li> Alternatively, you can checkout a copy of the
<a href="//git.skarnet.org/cgi-bin/cgit.cgi/nsss/">nsss
git repository</a>:
diff --git a/doc/upgrade.html b/doc/upgrade.html
index bdb72f6..fca02aa 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -18,14 +18,14 @@
<h1> What has changed in nsss </h1>
-<h2> In 0.2.0.6 </h2>
+<h2> In 0.2.1.0 </h2>
<ul>
<li> <a href="//skarnet.org/software/skalibs/">skalibs</a>
dependency bumped to 2.14.4.0. </li>
<li> <a href="//skarnet.org/software/s6/">s6</a> run-time
-dependency bumped to 2.13.1.1. </li>
- <li> Static libraries now install in <tt>/usr/lib</tt> by default. </li>
+dependency bumped to 2.13.2.0. </li>
+ <li> <tt>pkg-config</tt> is now supported, see <tt>./configure --help</tt>. </li>
</ul>
<h2> In 0.2.0.5 </h2>
diff --git a/package/deps-build b/package/deps-build
index 05d5af4..1a04c17 100644
--- a/package/deps-build
+++ b/package/deps-build
@@ -1 +1 @@
-/package/prog/skalibs
+true true /package/prog/skalibs 2.14.4.0 libskarnet
diff --git a/package/deps.mak b/package/deps.mak
index ec98fd2..6ef4e7b 100644
--- a/package/deps.mak
+++ b/package/deps.mak
@@ -162,29 +162,31 @@ src/tests/test-unix.o src/tests/test-unix.lo: src/tests/test-unix.c src/include/
ifeq ($(strip $(STATIC_LIBS_ARE_PIC)),)
libnsss.a.xyzzy: src/libnsss/nsss_all_endgrent.o src/libnsss/nsss_all_endpwent.o src/libnsss/nsss_all_endspent.o src/libnsss/nsss_all_errno.o src/libnsss/nsss_all_getgrent.o src/libnsss/nsss_all_getgrent_r.o src/libnsss/nsss_all_getgrgid.o src/libnsss/nsss_all_getgrgid_r.o src/libnsss/nsss_all_getgrnam.o src/libnsss/nsss_all_getgrnam_r.o src/libnsss/nsss_all_getgrouplist.o src/libnsss/nsss_all_getpwent.o src/libnsss/nsss_all_getpwent_r.o src/libnsss/nsss_all_getpwnam.o src/libnsss/nsss_all_getpwnam_r.o src/libnsss/nsss_all_getpwuid.o src/libnsss/nsss_all_getpwuid_r.o src/libnsss/nsss_all_getspent.o src/libnsss/nsss_all_getspent_r.o src/libnsss/nsss_all_getspnam.o src/libnsss/nsss_all_getspnam_r.o src/libnsss/nsss_all_setgrent.o src/libnsss/nsss_all_setpwent.o src/libnsss/nsss_all_setspent.o src/libnsss/nsss_grp_copy.o src/libnsss/nsss_grp_here.o src/libnsss/nsss_grouplist_adjust.o src/libnsss/nsss_pwd_copy.o src/libnsss/nsss_pwd_here.o src/libnsss/nsss_shadow_copy.o src/libnsss/nsss_shadow_here.o src/libnsss/nsss_switch_end.o src/libnsss/nsss_switch_endgrent.o src/libnsss/nsss_switch_endpwent.o src/libnsss/nsss_switch_endspent.o src/libnsss/nsss_switch_enumerator.o src/libnsss/nsss_switch_getgrent.o src/libnsss/nsss_switch_getgrent_r.o src/libnsss/nsss_switch_getgrgid.o src/libnsss/nsss_switch_getgrgid_r.o src/libnsss/nsss_switch_getgrnam.o src/libnsss/nsss_switch_getgrnam_r.o src/libnsss/nsss_switch_getgrouplist.o src/libnsss/nsss_switch_getpwent.o src/libnsss/nsss_switch_getpwent_r.o src/libnsss/nsss_switch_getpwnam.o src/libnsss/nsss_switch_getpwnam_r.o src/libnsss/nsss_switch_getpwuid.o src/libnsss/nsss_switch_getpwuid_r.o src/libnsss/nsss_switch_getspent.o src/libnsss/nsss_switch_getspent_r.o src/libnsss/nsss_switch_getspnam.o src/libnsss/nsss_switch_getspnam_r.o src/libnsss/nsss_switch_grp_end.o src/libnsss/nsss_switch_grp_get.o src/libnsss/nsss_switch_grp_getbygid.o src/libnsss/nsss_switch_grp_getbyname.o src/libnsss/nsss_switch_grp_getlist.o src/libnsss/nsss_switch_grp_read.o src/libnsss/nsss_switch_grp_rewind.o src/libnsss/nsss_switch_op.o src/libnsss/nsss_switch_pwd_end.o src/libnsss/nsss_switch_pwd_get.o src/libnsss/nsss_switch_pwd_getbyname.o src/libnsss/nsss_switch_pwd_getbyuid.o src/libnsss/nsss_switch_pwd_read.o src/libnsss/nsss_switch_pwd_rewind.o src/libnsss/nsss_switch_query.o src/libnsss/nsss_switch_query_mutex.o src/libnsss/nsss_switch_query_start.o src/libnsss/nsss_switch_send.o src/libnsss/nsss_switch_sendv.o src/libnsss/nsss_switch_setgrent.o src/libnsss/nsss_switch_setpwent.o src/libnsss/nsss_switch_setspent.o src/libnsss/nsss_switch_shadow_end.o src/libnsss/nsss_switch_shadow_get.o src/libnsss/nsss_switch_shadow_getbyname.o src/libnsss/nsss_switch_shadow_read.o src/libnsss/nsss_switch_shadow_rewind.o src/libnsss/nsss_switch_set_timeout.o src/libnsss/nsss_switch_start.o src/libnsss/nsss_switch_startf.o src/libnsss/nsss_unix_end.o src/libnsss/nsss_unix_endgrent.o src/libnsss/nsss_unix_endpwent.o src/libnsss/nsss_unix_endspent.o src/libnsss/nsss_unix_field.o src/libnsss/nsss_unix_getgrent.o src/libnsss/nsss_unix_getgrent_r.o src/libnsss/nsss_unix_getgrgid.o src/libnsss/nsss_unix_getgrgid_r.o src/libnsss/nsss_unix_getgrnam.o src/libnsss/nsss_unix_getgrnam_r.o src/libnsss/nsss_unix_getgrouplist.o src/libnsss/nsss_unix_getgrouplist_preadjust.o src/libnsss/nsss_unix_getpwent.o src/libnsss/nsss_unix_getpwent_r.o src/libnsss/nsss_unix_getpwnam.o src/libnsss/nsss_unix_getpwnam_r.o src/libnsss/nsss_unix_getpwuid.o src/libnsss/nsss_unix_getpwuid_r.o src/libnsss/nsss_unix_getspent.o src/libnsss/nsss_unix_getspent_r.o src/libnsss/nsss_unix_getspnam.o src/libnsss/nsss_unix_getspnam_r.o src/libnsss/nsss_unix_grp_get.o src/libnsss/nsss_unix_grp_getbygid.o src/libnsss/nsss_unix_grp_getbyname.o src/libnsss/nsss_unix_grp_getlist.o src/libnsss/nsss_unix_grp_here.o src/libnsss/nsss_unix_maybe_start.o src/libnsss/nsss_unix_pwd_get.o src/libnsss/nsss_unix_pwd_getbyname.o src/libnsss/nsss_unix_pwd_getbyuid.o src/libnsss/nsss_unix_pwd_here.o src/libnsss/nsss_unix_rewind.o src/libnsss/nsss_unix_setgrent.o src/libnsss/nsss_unix_setpwent.o src/libnsss/nsss_unix_setspent.o src/libnsss/nsss_unix_shadow_get.o src/libnsss/nsss_unix_shadow_getbyname.o src/libnsss/nsss_unix_shadow_here.o src/libnsss/nsss_unix_start.o
else
-libnsss.a.xyzzy: src/libnsss/nsss_all_endgrent.lo src/libnsss/nsss_all_endpwent.lo src/libnsss/nsss_all_endspent.lo src/libnsss/nsss_all_errno.lo src/libnsss/nsss_all_getgrent.lo src/libnsss/nsss_all_getgrent_r.lo src/libnsss/nsss_all_getgrgid.lo src/libnsss/nsss_all_getgrgid_r.lo src/libnsss/nsss_all_getgrnam.lo src/libnsss/nsss_all_getgrnam_r.lo src/libnsss/nsss_all_getgrouplist.lo src/libnsss/nsss_all_getpwent.lo src/libnsss/nsss_all_getpwent_r.lo src/libnsss/nsss_all_getpwnam.lo src/libnsss/nsss_all_getpwnam_r.lo src/libnsss/nsss_all_getpwuid.lo src/libnsss/nsss_all_getpwuid_r.lo src/libnsss/nsss_all_getspent.lo src/libnsss/nsss_all_getspent_r.lo src/libnsss/nsss_all_getspnam.lo src/libnsss/nsss_all_getspnam_r.lo src/libnsss/nsss_all_setgrent.lo src/libnsss/nsss_all_setpwent.lo src/libnsss/nsss_all_setspent.lo src/libnsss/nsss_grp_copy.lo src/libnsss/nsss_grp_here.lo src/libnsss/nsss_grouplist_adjust.lo src/libnsss/nsss_pwd_copy.lo src/libnsss/nsss_pwd_here.lo src/libnsss/nsss_shadow_copy.lo src/libnsss/nsss_shadow_here.lo src/libnsss/nsss_switch_end.lo src/libnsss/nsss_switch_endgrent.lo src/libnsss/nsss_switch_endpwent.lo src/libnsss/nsss_switch_endspent.lo src/libnsss/nsss_switch_enumerator.lo src/libnsss/nsss_switch_getgrent.lo src/libnsss/nsss_switch_getgrent_r.lo src/libnsss/nsss_switch_getgrgid.lo src/libnsss/nsss_switch_getgrgid_r.lo src/libnsss/nsss_switch_getgrnam.lo src/libnsss/nsss_switch_getgrnam_r.lo src/libnsss/nsss_switch_getgrouplist.lo src/libnsss/nsss_switch_getpwent.lo src/libnsss/nsss_switch_getpwent_r.lo src/libnsss/nsss_switch_getpwnam.lo src/libnsss/nsss_switch_getpwnam_r.lo src/libnsss/nsss_switch_getpwuid.lo src/libnsss/nsss_switch_getpwuid_r.lo src/libnsss/nsss_switch_getspent.lo src/libnsss/nsss_switch_getspent_r.lo src/libnsss/nsss_switch_getspnam.lo src/libnsss/nsss_switch_getspnam_r.lo src/libnsss/nsss_switch_grp_end.lo src/libnsss/nsss_switch_grp_get.lo src/libnsss/nsss_switch_grp_getbygid.lo src/libnsss/nsss_switch_grp_getbyname.lo src/libnsss/nsss_switch_grp_getlist.lo src/libnsss/nsss_switch_grp_read.lo src/libnsss/nsss_switch_grp_rewind.lo src/libnsss/nsss_switch_op.lo src/libnsss/nsss_switch_pwd_end.lo src/libnsss/nsss_switch_pwd_get.lo src/libnsss/nsss_switch_pwd_getbyname.lo src/libnsss/nsss_switch_pwd_getbyuid.lo src/libnsss/nsss_switch_pwd_read.lo src/libnsss/nsss_switch_pwd_rewind.lo src/libnsss/nsss_switch_query.lo src/libnsss/nsss_switch_query_mutex.lo src/libnsss/nsss_switch_query_start.lo src/libnsss/nsss_switch_send.lo src/libnsss/nsss_switch_sendv.lo src/libnsss/nsss_switch_setgrent.lo src/libnsss/nsss_switch_setpwent.lo src/libnsss/nsss_switch_setspent.lo src/libnsss/nsss_switch_shadow_end.lo src/libnsss/nsss_switch_shadow_get.lo src/libnsss/nsss_switch_shadow_getbyname.lo src/libnsss/nsss_switch_shadow_read.lo src/libnsss/nsss_switch_shadow_rewind.lo src/libnsss/nsss_switch_set_timeout.lo src/libnsss/nsss_switch_start.lo src/libnsss/nsss_switch_startf.lo src/libnsss/nsss_unix_end.lo src/libnsss/nsss_unix_endgrent.lo src/libnsss/nsss_unix_endpwent.lo src/libnsss/nsss_unix_endspent.lo src/libnsss/nsss_unix_field.lo src/libnsss/nsss_unix_getgrent.lo src/libnsss/nsss_unix_getgrent_r.lo src/libnsss/nsss_unix_getgrgid.lo src/libnsss/nsss_unix_getgrgid_r.lo src/libnsss/nsss_unix_getgrnam.lo src/libnsss/nsss_unix_getgrnam_r.lo src/libnsss/nsss_unix_getgrouplist.lo src/libnsss/nsss_unix_getgrouplist_preadjust.lo src/libnsss/nsss_unix_getpwent.lo src/libnsss/nsss_unix_getpwent_r.lo src/libnsss/nsss_unix_getpwnam.lo src/libnsss/nsss_unix_getpwnam_r.lo src/libnsss/nsss_unix_getpwuid.lo src/libnsss/nsss_unix_getpwuid_r.lo src/libnsss/nsss_unix_getspent.lo src/libnsss/nsss_unix_getspent_r.lo src/libnsss/nsss_unix_getspnam.lo src/libnsss/nsss_unix_getspnam_r.lo src/libnsss/nsss_unix_grp_get.lo src/libnsss/nsss_unix_grp_getbygid.lo src/libnsss/nsss_unix_grp_getbyname.lo src/libnsss/nsss_unix_grp_getlist.lo src/libnsss/nsss_unix_grp_here.lo src/libnsss/nsss_unix_maybe_start.lo src/libnsss/nsss_unix_pwd_get.lo src/libnsss/nsss_unix_pwd_getbyname.lo src/libnsss/nsss_unix_pwd_getbyuid.lo src/libnsss/nsss_unix_pwd_here.lo src/libnsss/nsss_unix_rewind.lo src/libnsss/nsss_unix_setgrent.lo src/libnsss/nsss_unix_setpwent.lo src/libnsss/nsss_unix_setspent.lo src/libnsss/nsss_unix_shadow_get.lo src/libnsss/nsss_unix_shadow_getbyname.lo src/libnsss/nsss_unix_shadow_here.lo src/libnsss/nsss_unix_start.lo
+libnsss.a.xyzzy:src/libnsss/nsss_all_endgrent.lo src/libnsss/nsss_all_endpwent.lo src/libnsss/nsss_all_endspent.lo src/libnsss/nsss_all_errno.lo src/libnsss/nsss_all_getgrent.lo src/libnsss/nsss_all_getgrent_r.lo src/libnsss/nsss_all_getgrgid.lo src/libnsss/nsss_all_getgrgid_r.lo src/libnsss/nsss_all_getgrnam.lo src/libnsss/nsss_all_getgrnam_r.lo src/libnsss/nsss_all_getgrouplist.lo src/libnsss/nsss_all_getpwent.lo src/libnsss/nsss_all_getpwent_r.lo src/libnsss/nsss_all_getpwnam.lo src/libnsss/nsss_all_getpwnam_r.lo src/libnsss/nsss_all_getpwuid.lo src/libnsss/nsss_all_getpwuid_r.lo src/libnsss/nsss_all_getspent.lo src/libnsss/nsss_all_getspent_r.lo src/libnsss/nsss_all_getspnam.lo src/libnsss/nsss_all_getspnam_r.lo src/libnsss/nsss_all_setgrent.lo src/libnsss/nsss_all_setpwent.lo src/libnsss/nsss_all_setspent.lo src/libnsss/nsss_grp_copy.lo src/libnsss/nsss_grp_here.lo src/libnsss/nsss_grouplist_adjust.lo src/libnsss/nsss_pwd_copy.lo src/libnsss/nsss_pwd_here.lo src/libnsss/nsss_shadow_copy.lo src/libnsss/nsss_shadow_here.lo src/libnsss/nsss_switch_end.lo src/libnsss/nsss_switch_endgrent.lo src/libnsss/nsss_switch_endpwent.lo src/libnsss/nsss_switch_endspent.lo src/libnsss/nsss_switch_enumerator.lo src/libnsss/nsss_switch_getgrent.lo src/libnsss/nsss_switch_getgrent_r.lo src/libnsss/nsss_switch_getgrgid.lo src/libnsss/nsss_switch_getgrgid_r.lo src/libnsss/nsss_switch_getgrnam.lo src/libnsss/nsss_switch_getgrnam_r.lo src/libnsss/nsss_switch_getgrouplist.lo src/libnsss/nsss_switch_getpwent.lo src/libnsss/nsss_switch_getpwent_r.lo src/libnsss/nsss_switch_getpwnam.lo src/libnsss/nsss_switch_getpwnam_r.lo src/libnsss/nsss_switch_getpwuid.lo src/libnsss/nsss_switch_getpwuid_r.lo src/libnsss/nsss_switch_getspent.lo src/libnsss/nsss_switch_getspent_r.lo src/libnsss/nsss_switch_getspnam.lo src/libnsss/nsss_switch_getspnam_r.lo src/libnsss/nsss_switch_grp_end.lo src/libnsss/nsss_switch_grp_get.lo src/libnsss/nsss_switch_grp_getbygid.lo src/libnsss/nsss_switch_grp_getbyname.lo src/libnsss/nsss_switch_grp_getlist.lo src/libnsss/nsss_switch_grp_read.lo src/libnsss/nsss_switch_grp_rewind.lo src/libnsss/nsss_switch_op.lo src/libnsss/nsss_switch_pwd_end.lo src/libnsss/nsss_switch_pwd_get.lo src/libnsss/nsss_switch_pwd_getbyname.lo src/libnsss/nsss_switch_pwd_getbyuid.lo src/libnsss/nsss_switch_pwd_read.lo src/libnsss/nsss_switch_pwd_rewind.lo src/libnsss/nsss_switch_query.lo src/libnsss/nsss_switch_query_mutex.lo src/libnsss/nsss_switch_query_start.lo src/libnsss/nsss_switch_send.lo src/libnsss/nsss_switch_sendv.lo src/libnsss/nsss_switch_setgrent.lo src/libnsss/nsss_switch_setpwent.lo src/libnsss/nsss_switch_setspent.lo src/libnsss/nsss_switch_shadow_end.lo src/libnsss/nsss_switch_shadow_get.lo src/libnsss/nsss_switch_shadow_getbyname.lo src/libnsss/nsss_switch_shadow_read.lo src/libnsss/nsss_switch_shadow_rewind.lo src/libnsss/nsss_switch_set_timeout.lo src/libnsss/nsss_switch_start.lo src/libnsss/nsss_switch_startf.lo src/libnsss/nsss_unix_end.lo src/libnsss/nsss_unix_endgrent.lo src/libnsss/nsss_unix_endpwent.lo src/libnsss/nsss_unix_endspent.lo src/libnsss/nsss_unix_field.lo src/libnsss/nsss_unix_getgrent.lo src/libnsss/nsss_unix_getgrent_r.lo src/libnsss/nsss_unix_getgrgid.lo src/libnsss/nsss_unix_getgrgid_r.lo src/libnsss/nsss_unix_getgrnam.lo src/libnsss/nsss_unix_getgrnam_r.lo src/libnsss/nsss_unix_getgrouplist.lo src/libnsss/nsss_unix_getgrouplist_preadjust.lo src/libnsss/nsss_unix_getpwent.lo src/libnsss/nsss_unix_getpwent_r.lo src/libnsss/nsss_unix_getpwnam.lo src/libnsss/nsss_unix_getpwnam_r.lo src/libnsss/nsss_unix_getpwuid.lo src/libnsss/nsss_unix_getpwuid_r.lo src/libnsss/nsss_unix_getspent.lo src/libnsss/nsss_unix_getspent_r.lo src/libnsss/nsss_unix_getspnam.lo src/libnsss/nsss_unix_getspnam_r.lo src/libnsss/nsss_unix_grp_get.lo src/libnsss/nsss_unix_grp_getbygid.lo src/libnsss/nsss_unix_grp_getbyname.lo src/libnsss/nsss_unix_grp_getlist.lo src/libnsss/nsss_unix_grp_here.lo src/libnsss/nsss_unix_maybe_start.lo src/libnsss/nsss_unix_pwd_get.lo src/libnsss/nsss_unix_pwd_getbyname.lo src/libnsss/nsss_unix_pwd_getbyuid.lo src/libnsss/nsss_unix_pwd_here.lo src/libnsss/nsss_unix_rewind.lo src/libnsss/nsss_unix_setgrent.lo src/libnsss/nsss_unix_setpwent.lo src/libnsss/nsss_unix_setspent.lo src/libnsss/nsss_unix_shadow_get.lo src/libnsss/nsss_unix_shadow_getbyname.lo src/libnsss/nsss_unix_shadow_here.lo src/libnsss/nsss_unix_start.lo
endif
+libnsss.pc: EXTRA_LIBS := -lskarnet -lpthread
libnsss.so.xyzzy: EXTRA_LIBS := -lskarnet -lpthread
-libnsss.so.xyzzy: src/libnsss/nsss_all_endgrent.lo src/libnsss/nsss_all_endpwent.lo src/libnsss/nsss_all_endspent.lo src/libnsss/nsss_all_errno.lo src/libnsss/nsss_all_getgrent.lo src/libnsss/nsss_all_getgrent_r.lo src/libnsss/nsss_all_getgrgid.lo src/libnsss/nsss_all_getgrgid_r.lo src/libnsss/nsss_all_getgrnam.lo src/libnsss/nsss_all_getgrnam_r.lo src/libnsss/nsss_all_getgrouplist.lo src/libnsss/nsss_all_getpwent.lo src/libnsss/nsss_all_getpwent_r.lo src/libnsss/nsss_all_getpwnam.lo src/libnsss/nsss_all_getpwnam_r.lo src/libnsss/nsss_all_getpwuid.lo src/libnsss/nsss_all_getpwuid_r.lo src/libnsss/nsss_all_getspent.lo src/libnsss/nsss_all_getspent_r.lo src/libnsss/nsss_all_getspnam.lo src/libnsss/nsss_all_getspnam_r.lo src/libnsss/nsss_all_setgrent.lo src/libnsss/nsss_all_setpwent.lo src/libnsss/nsss_all_setspent.lo src/libnsss/nsss_grp_copy.lo src/libnsss/nsss_grp_here.lo src/libnsss/nsss_grouplist_adjust.lo src/libnsss/nsss_pwd_copy.lo src/libnsss/nsss_pwd_here.lo src/libnsss/nsss_shadow_copy.lo src/libnsss/nsss_shadow_here.lo src/libnsss/nsss_switch_end.lo src/libnsss/nsss_switch_endgrent.lo src/libnsss/nsss_switch_endpwent.lo src/libnsss/nsss_switch_endspent.lo src/libnsss/nsss_switch_enumerator.lo src/libnsss/nsss_switch_getgrent.lo src/libnsss/nsss_switch_getgrent_r.lo src/libnsss/nsss_switch_getgrgid.lo src/libnsss/nsss_switch_getgrgid_r.lo src/libnsss/nsss_switch_getgrnam.lo src/libnsss/nsss_switch_getgrnam_r.lo src/libnsss/nsss_switch_getgrouplist.lo src/libnsss/nsss_switch_getpwent.lo src/libnsss/nsss_switch_getpwent_r.lo src/libnsss/nsss_switch_getpwnam.lo src/libnsss/nsss_switch_getpwnam_r.lo src/libnsss/nsss_switch_getpwuid.lo src/libnsss/nsss_switch_getpwuid_r.lo src/libnsss/nsss_switch_getspent.lo src/libnsss/nsss_switch_getspent_r.lo src/libnsss/nsss_switch_getspnam.lo src/libnsss/nsss_switch_getspnam_r.lo src/libnsss/nsss_switch_grp_end.lo src/libnsss/nsss_switch_grp_get.lo src/libnsss/nsss_switch_grp_getbygid.lo src/libnsss/nsss_switch_grp_getbyname.lo src/libnsss/nsss_switch_grp_getlist.lo src/libnsss/nsss_switch_grp_read.lo src/libnsss/nsss_switch_grp_rewind.lo src/libnsss/nsss_switch_op.lo src/libnsss/nsss_switch_pwd_end.lo src/libnsss/nsss_switch_pwd_get.lo src/libnsss/nsss_switch_pwd_getbyname.lo src/libnsss/nsss_switch_pwd_getbyuid.lo src/libnsss/nsss_switch_pwd_read.lo src/libnsss/nsss_switch_pwd_rewind.lo src/libnsss/nsss_switch_query.lo src/libnsss/nsss_switch_query_mutex.lo src/libnsss/nsss_switch_query_start.lo src/libnsss/nsss_switch_send.lo src/libnsss/nsss_switch_sendv.lo src/libnsss/nsss_switch_setgrent.lo src/libnsss/nsss_switch_setpwent.lo src/libnsss/nsss_switch_setspent.lo src/libnsss/nsss_switch_shadow_end.lo src/libnsss/nsss_switch_shadow_get.lo src/libnsss/nsss_switch_shadow_getbyname.lo src/libnsss/nsss_switch_shadow_read.lo src/libnsss/nsss_switch_shadow_rewind.lo src/libnsss/nsss_switch_set_timeout.lo src/libnsss/nsss_switch_start.lo src/libnsss/nsss_switch_startf.lo src/libnsss/nsss_unix_end.lo src/libnsss/nsss_unix_endgrent.lo src/libnsss/nsss_unix_endpwent.lo src/libnsss/nsss_unix_endspent.lo src/libnsss/nsss_unix_field.lo src/libnsss/nsss_unix_getgrent.lo src/libnsss/nsss_unix_getgrent_r.lo src/libnsss/nsss_unix_getgrgid.lo src/libnsss/nsss_unix_getgrgid_r.lo src/libnsss/nsss_unix_getgrnam.lo src/libnsss/nsss_unix_getgrnam_r.lo src/libnsss/nsss_unix_getgrouplist.lo src/libnsss/nsss_unix_getgrouplist_preadjust.lo src/libnsss/nsss_unix_getpwent.lo src/libnsss/nsss_unix_getpwent_r.lo src/libnsss/nsss_unix_getpwnam.lo src/libnsss/nsss_unix_getpwnam_r.lo src/libnsss/nsss_unix_getpwuid.lo src/libnsss/nsss_unix_getpwuid_r.lo src/libnsss/nsss_unix_getspent.lo src/libnsss/nsss_unix_getspent_r.lo src/libnsss/nsss_unix_getspnam.lo src/libnsss/nsss_unix_getspnam_r.lo src/libnsss/nsss_unix_grp_get.lo src/libnsss/nsss_unix_grp_getbygid.lo src/libnsss/nsss_unix_grp_getbyname.lo src/libnsss/nsss_unix_grp_getlist.lo src/libnsss/nsss_unix_grp_here.lo src/libnsss/nsss_unix_maybe_start.lo src/libnsss/nsss_unix_pwd_get.lo src/libnsss/nsss_unix_pwd_getbyname.lo src/libnsss/nsss_unix_pwd_getbyuid.lo src/libnsss/nsss_unix_pwd_here.lo src/libnsss/nsss_unix_rewind.lo src/libnsss/nsss_unix_setgrent.lo src/libnsss/nsss_unix_setpwent.lo src/libnsss/nsss_unix_setspent.lo src/libnsss/nsss_unix_shadow_get.lo src/libnsss/nsss_unix_shadow_getbyname.lo src/libnsss/nsss_unix_shadow_here.lo src/libnsss/nsss_unix_start.lo
+libnsss.so.xyzzy:src/libnsss/nsss_all_endgrent.lo src/libnsss/nsss_all_endpwent.lo src/libnsss/nsss_all_endspent.lo src/libnsss/nsss_all_errno.lo src/libnsss/nsss_all_getgrent.lo src/libnsss/nsss_all_getgrent_r.lo src/libnsss/nsss_all_getgrgid.lo src/libnsss/nsss_all_getgrgid_r.lo src/libnsss/nsss_all_getgrnam.lo src/libnsss/nsss_all_getgrnam_r.lo src/libnsss/nsss_all_getgrouplist.lo src/libnsss/nsss_all_getpwent.lo src/libnsss/nsss_all_getpwent_r.lo src/libnsss/nsss_all_getpwnam.lo src/libnsss/nsss_all_getpwnam_r.lo src/libnsss/nsss_all_getpwuid.lo src/libnsss/nsss_all_getpwuid_r.lo src/libnsss/nsss_all_getspent.lo src/libnsss/nsss_all_getspent_r.lo src/libnsss/nsss_all_getspnam.lo src/libnsss/nsss_all_getspnam_r.lo src/libnsss/nsss_all_setgrent.lo src/libnsss/nsss_all_setpwent.lo src/libnsss/nsss_all_setspent.lo src/libnsss/nsss_grp_copy.lo src/libnsss/nsss_grp_here.lo src/libnsss/nsss_grouplist_adjust.lo src/libnsss/nsss_pwd_copy.lo src/libnsss/nsss_pwd_here.lo src/libnsss/nsss_shadow_copy.lo src/libnsss/nsss_shadow_here.lo src/libnsss/nsss_switch_end.lo src/libnsss/nsss_switch_endgrent.lo src/libnsss/nsss_switch_endpwent.lo src/libnsss/nsss_switch_endspent.lo src/libnsss/nsss_switch_enumerator.lo src/libnsss/nsss_switch_getgrent.lo src/libnsss/nsss_switch_getgrent_r.lo src/libnsss/nsss_switch_getgrgid.lo src/libnsss/nsss_switch_getgrgid_r.lo src/libnsss/nsss_switch_getgrnam.lo src/libnsss/nsss_switch_getgrnam_r.lo src/libnsss/nsss_switch_getgrouplist.lo src/libnsss/nsss_switch_getpwent.lo src/libnsss/nsss_switch_getpwent_r.lo src/libnsss/nsss_switch_getpwnam.lo src/libnsss/nsss_switch_getpwnam_r.lo src/libnsss/nsss_switch_getpwuid.lo src/libnsss/nsss_switch_getpwuid_r.lo src/libnsss/nsss_switch_getspent.lo src/libnsss/nsss_switch_getspent_r.lo src/libnsss/nsss_switch_getspnam.lo src/libnsss/nsss_switch_getspnam_r.lo src/libnsss/nsss_switch_grp_end.lo src/libnsss/nsss_switch_grp_get.lo src/libnsss/nsss_switch_grp_getbygid.lo src/libnsss/nsss_switch_grp_getbyname.lo src/libnsss/nsss_switch_grp_getlist.lo src/libnsss/nsss_switch_grp_read.lo src/libnsss/nsss_switch_grp_rewind.lo src/libnsss/nsss_switch_op.lo src/libnsss/nsss_switch_pwd_end.lo src/libnsss/nsss_switch_pwd_get.lo src/libnsss/nsss_switch_pwd_getbyname.lo src/libnsss/nsss_switch_pwd_getbyuid.lo src/libnsss/nsss_switch_pwd_read.lo src/libnsss/nsss_switch_pwd_rewind.lo src/libnsss/nsss_switch_query.lo src/libnsss/nsss_switch_query_mutex.lo src/libnsss/nsss_switch_query_start.lo src/libnsss/nsss_switch_send.lo src/libnsss/nsss_switch_sendv.lo src/libnsss/nsss_switch_setgrent.lo src/libnsss/nsss_switch_setpwent.lo src/libnsss/nsss_switch_setspent.lo src/libnsss/nsss_switch_shadow_end.lo src/libnsss/nsss_switch_shadow_get.lo src/libnsss/nsss_switch_shadow_getbyname.lo src/libnsss/nsss_switch_shadow_read.lo src/libnsss/nsss_switch_shadow_rewind.lo src/libnsss/nsss_switch_set_timeout.lo src/libnsss/nsss_switch_start.lo src/libnsss/nsss_switch_startf.lo src/libnsss/nsss_unix_end.lo src/libnsss/nsss_unix_endgrent.lo src/libnsss/nsss_unix_endpwent.lo src/libnsss/nsss_unix_endspent.lo src/libnsss/nsss_unix_field.lo src/libnsss/nsss_unix_getgrent.lo src/libnsss/nsss_unix_getgrent_r.lo src/libnsss/nsss_unix_getgrgid.lo src/libnsss/nsss_unix_getgrgid_r.lo src/libnsss/nsss_unix_getgrnam.lo src/libnsss/nsss_unix_getgrnam_r.lo src/libnsss/nsss_unix_getgrouplist.lo src/libnsss/nsss_unix_getgrouplist_preadjust.lo src/libnsss/nsss_unix_getpwent.lo src/libnsss/nsss_unix_getpwent_r.lo src/libnsss/nsss_unix_getpwnam.lo src/libnsss/nsss_unix_getpwnam_r.lo src/libnsss/nsss_unix_getpwuid.lo src/libnsss/nsss_unix_getpwuid_r.lo src/libnsss/nsss_unix_getspent.lo src/libnsss/nsss_unix_getspent_r.lo src/libnsss/nsss_unix_getspnam.lo src/libnsss/nsss_unix_getspnam_r.lo src/libnsss/nsss_unix_grp_get.lo src/libnsss/nsss_unix_grp_getbygid.lo src/libnsss/nsss_unix_grp_getbyname.lo src/libnsss/nsss_unix_grp_getlist.lo src/libnsss/nsss_unix_grp_here.lo src/libnsss/nsss_unix_maybe_start.lo src/libnsss/nsss_unix_pwd_get.lo src/libnsss/nsss_unix_pwd_getbyname.lo src/libnsss/nsss_unix_pwd_getbyuid.lo src/libnsss/nsss_unix_pwd_here.lo src/libnsss/nsss_unix_rewind.lo src/libnsss/nsss_unix_setgrent.lo src/libnsss/nsss_unix_setpwent.lo src/libnsss/nsss_unix_setspent.lo src/libnsss/nsss_unix_shadow_get.lo src/libnsss/nsss_unix_shadow_getbyname.lo src/libnsss/nsss_unix_shadow_here.lo src/libnsss/nsss_unix_start.lo
ifeq ($(strip $(STATIC_LIBS_ARE_PIC)),)
libnsssd.a.xyzzy: src/nsssd/nsssd_main.o src/nsssd/nsssd_convert.o
else
-libnsssd.a.xyzzy: src/nsssd/nsssd_main.lo src/nsssd/nsssd_convert.lo
+libnsssd.a.xyzzy:src/nsssd/nsssd_main.lo src/nsssd/nsssd_convert.lo
endif
+libnsssd.pc: EXTRA_LIBS := -lskarnet
libnsssd.so.xyzzy: EXTRA_LIBS := -lskarnet
-libnsssd.so.xyzzy: src/nsssd/nsssd_main.lo src/nsssd/nsssd_convert.lo
-nsssd-nslcd: EXTRA_LIBS := -lskarnet ${SOCKET_LIB} ${SYSCLOCK_LIB}
-nsssd-nslcd: src/nsssd/nsssd-nslcd.o ${LIBNSSSD}
-nsssd-switch: EXTRA_LIBS := -lskarnet ${SOCKET_LIB} ${SYSCLOCK_LIB}
-nsssd-switch: src/nsssd/nsssd-switch.o ${LIBNSSSD} ${LIBNSSS}
-nsssd-unix: EXTRA_LIBS := -lskarnet
-nsssd-unix: src/nsssd/nsssd-unix.o ${LIBNSSSD} ${LIBNSSS}
-test-all-fallback: EXTRA_LIBS := -lskarnet ${SOCKET_LIB} ${SYSCLOCK_LIB}
-test-all-fallback: src/tests/test-all-fallback.o ${LIBNSSS}
-test-nsssd-switch: EXTRA_LIBS := -lskarnet ${SOCKET_LIB} ${SYSCLOCK_LIB}
-test-nsssd-switch: src/tests/test-nsssd-switch.o ${LIBNSSS}
-test-switch: EXTRA_LIBS := -lskarnet ${SOCKET_LIB} ${SYSCLOCK_LIB}
-test-switch: src/tests/test-switch.o ${LIBNSSS}
-test-unix: EXTRA_LIBS := -lskarnet
-test-unix: src/tests/test-unix.o ${LIBNSSS}
+libnsssd.so.xyzzy:src/nsssd/nsssd_main.lo src/nsssd/nsssd_convert.lo
+nsssd-nslcd: EXTRA_LIBS := ${SOCKET_LIB} ${SYSCLOCK_LIB}
+nsssd-nslcd: src/nsssd/nsssd-nslcd.o ${LIBNSSSD} -lskarnet
+nsssd-switch: EXTRA_LIBS := ${SOCKET_LIB} ${SYSCLOCK_LIB}
+nsssd-switch: src/nsssd/nsssd-switch.o ${LIBNSSSD} ${LIBNSSS} -lskarnet
+nsssd-unix: EXTRA_LIBS :=
+nsssd-unix: src/nsssd/nsssd-unix.o ${LIBNSSSD} ${LIBNSSS} -lskarnet
+test-all-fallback: EXTRA_LIBS := ${SOCKET_LIB} ${SYSCLOCK_LIB}
+test-all-fallback: src/tests/test-all-fallback.o ${LIBNSSS} -lskarnet
+test-nsssd-switch: EXTRA_LIBS := ${SOCKET_LIB} ${SYSCLOCK_LIB}
+test-nsssd-switch: src/tests/test-nsssd-switch.o ${LIBNSSS} -lskarnet
+test-switch: EXTRA_LIBS := ${SOCKET_LIB} ${SYSCLOCK_LIB}
+test-switch: src/tests/test-switch.o ${LIBNSSS} -lskarnet
+test-unix: EXTRA_LIBS :=
+test-unix: src/tests/test-unix.o ${LIBNSSS} -lskarnet
INTERNAL_LIBS :=
diff --git a/package/info b/package/info
index a23bf2b..8323879 100644
--- a/package/info
+++ b/package/info
@@ -1,4 +1,4 @@
package=nsss
-version=0.2.0.6
+version=0.2.1.0
category=admin
package_macro_name=NSSS
diff --git a/package/targets.mak b/package/targets.mak
index 06d3672..e7b8b54 100644
--- a/package/targets.mak
+++ b/package/targets.mak
@@ -12,6 +12,8 @@ test-nsssd-switch \
test-all-fallback
LIB_DEFS := NSSS=nsss NSSSD=nsssd
+NSSS_DESCRIPTION := The nsss library (user-facing part of nsss, applications link against it)
+NSSSD_DESCRIPTION := The nsssd library (non-user-facing part of nsss, only nsss modules link against it)
ifneq ($(DO_LIBC_INCLUDES),)
EXTRA_INCLUDES := src/include/pwd.h src/include/grp.h src/include/shadow.h
diff --git a/tools/gen-deps.sh b/tools/gen-deps.sh
index befe021..9e18eb1 100755
--- a/tools/gen-deps.sh
+++ b/tools/gen-deps.sh
@@ -61,20 +61,23 @@ for dir in $(ls -1 src | grep -v ^include) ; do
deps=
libs=
while read dep ; do
- if echo $dep | grep -q -e ^-l -e '^\${.*_LIB}' ; then
+ if echo $dep | grep -q -e '^-l' -e '^\${.*_LIB}' ; then
libs="$libs $dep"
+ elif echo $dep | grep -q '^\${LIB' ; then
+ deps="$deps $dep"
else
deps="$deps src/$dir/$dep"
fi
done < src/$dir/deps-lib/$file
echo 'ifeq ($(strip $(STATIC_LIBS_ARE_PIC)),)'
- echo "lib${file}.a.xyzzy:$deps"
+ echo "lib${file}.a.xyzzy:${deps}"
echo else
- echo "lib${file}.a.xyzzy:$(echo "$deps" | sed 's/\.o/.lo/g')"
+ echo "lib${file}.a.xyzzy:$(echo ${deps} | sed 's/\.o/.lo/g')"
echo endif
- if grep -E "^LIB_DEFS [+:]=" package/targets.mak | grep -qF "$file" ; then
+ if grep -qE "^LIB_DEFS [+:]= .*=$file" package/targets.mak ; then
+ echo "lib${file}.pc: EXTRA_LIBS :=${libs}"
echo "lib${file}.so.xyzzy: EXTRA_LIBS :=$libs"
- echo "lib${file}.so.xyzzy:$(echo "$deps" | sed 's/\.o/.lo/g')"
+ echo "lib${file}.so.xyzzy:$(echo ${deps} | sed 's/\.o/.lo/g')"
else
internal_libs="$internal_libs lib${file}.a.xyzzy"
fi
@@ -84,10 +87,10 @@ for dir in $(ls -1 src | grep -v ^include) ; do
deps=
libs=
while read dep ; do
- if echo $dep | grep -q -- \\.o$ ; then
+ if echo $dep | grep -q \\.o$ ; then
dep="src/$dir/$dep"
fi
- if echo $dep | grep -q -e ^-l -e '^\${.*_LIB}' ; then
+ if echo $dep | grep -qx '\${.*_LIB}' ; then
libs="$libs $dep"
else
deps="$deps $dep"
diff --git a/tools/gen-dotpc.sh b/tools/gen-dotpc.sh
new file mode 100755
index 0000000..63c8929
--- /dev/null
+++ b/tools/gen-dotpc.sh
@@ -0,0 +1,101 @@
+#!/bin/sh -e
+
+isunique () {
+ x=$1
+ set -- $2
+ while test "$#" -gt 0 ; do
+ if test "$x" = "$1" ; then
+ return 1
+ fi
+ shift
+ done
+ return 0
+}
+
+uniqit () {
+ res=
+ while test "$#" -gt 0 ; do
+ if isunique "$1" "$res" ; then
+ res="${res}${res:+ }${1}"
+ fi
+ shift
+ done
+ printf %s\\n "$res"
+}
+
+filterout () {
+ res=
+ filter="$1"
+ shift
+ while test "$#" -gt 0 ; do
+ if isunique "$1" "$filter" ; then
+ res="${res}${res:+ }${1}"
+ fi
+ shift
+ done
+ printf %s\\n "$res"
+}
+
+print_requires () {
+ line=
+ oldifs="$IFS"
+ while IFS=" " read condvar usedinlibs pkg ver libs ; do
+ IFS="$oldifs"
+ for h ; do
+ i=lib${h##-l}
+ for j in $libs ; do
+ if test "$i" = "$j" ; then
+ line="${line}${line:+, }${i} >= ${ver}"
+ fi
+ done
+ done
+ done < package/deps-build
+ IFS="$oldifs"
+ echo "Requires: $line"
+}
+
+. package/info
+
+ilist=
+dlist=
+slist=
+
+if test "${includedir}" != /usr/include ; then
+ ilist="-I${includedir}"
+fi
+if test -n "${extra_includedirs}" ; then
+ ilist="${ilist}${ilist:+ }${extra_includedirs}"
+fi
+ilist=`uniqit ${ilist}`
+
+if test "${dynlibdir}" != /usr/lib && test "${dynlibdir}" != /lib ; then
+ dlist="-L${dynlibdir}"
+fi
+
+if test "${libdir}" != /usr/lib && test "${libdir}" != /lib ; then
+ slist="-L${libdir}"
+fi
+if test -n "${extra_libdirs}" ; then
+ slist="${slist}${slist:+ }${extra_libdirs}"
+fi
+slist="$(filterout "${dlist}" $(uniqit ${slist}))"
+
+echo "prefix=${prefix}"
+echo "includedir=${includedir}"
+echo "libdir=${libdir}"
+echo "dynlibdir=${dynlibdir}"
+echo
+echo "Name: ${library}"
+echo "Version: ${version}"
+echo "Description: ${description:-The ${library} library.}"
+echo "URL: ${url:-https://skarnet.org/software/${package}/}"
+if test -n "${extra_libs}" ; then
+ print_requires ${extra_libs}
+fi
+if test -n "$ilist" ; then
+ echo "Cflags: ${ilist}"
+fi
+echo "Libs: ${dlist}${dlist:+ }-l${library}${ldlibs:+ }${ldlibs}"
+if test -n "${extra_libs}" ; then
+ echo "Libs.private: ${slist}${slist:+ }${extra_libs}"
+fi