aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2025-04-27 01:36:39 +0000
committerLaurent Bercot <ska@appnovation.com>2025-04-27 01:36:39 +0000
commit83115bc06793c68f460ea05fc2d8182751e86c35 (patch)
tree9910ad3babb43525b706f2ee291760efaef8a360
parent9d79ca45023c6e24534386ef7a52a0bad0396275 (diff)
downloadexecline-83115bc06793c68f460ea05fc2d8182751e86c35.tar.gz
Document pkg-config options in INSTALL; a few small changes
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r--INSTALL29
-rw-r--r--Makefile8
-rw-r--r--NEWS1
-rwxr-xr-xconfigure22
-rwxr-xr-xtools/run-test.sh22
5 files changed, 69 insertions, 13 deletions
diff --git a/INSTALL b/INSTALL
index 0f5ea3c..867a438 100644
--- a/INSTALL
+++ b/INSTALL
@@ -7,7 +7,7 @@ Build Instructions
- A POSIX-compliant C development environment
- GNU make version 3.81 or later
- skalibs version 2.14.4.0 or later: https://skarnet.org/software/skalibs/
- - Optional: nsss version 0.2.0.6 or later: https://skarnet.org/software/nsss/
+ - Optional: nsss version 0.2.1.0 or later: https://skarnet.org/software/nsss/
This software will run on any operating system that implements
POSIX.1-2008, available at:
@@ -28,6 +28,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 7a8575f..3c1f939 100644
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,7 @@ EXTRA_TARGETS :=
PC_TARGETS :=
LIB_DEFS :=
BIN_SYMLINKS :=
+TEST_BINS :=
define library_definition
LIB$(1) := lib$(2).$(if $(DO_ALLSTATIC),a,so).xyzzy
@@ -130,6 +131,11 @@ 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),)
$(DESTDIR)$(exthome): $(DESTDIR)$(home)
@@ -182,6 +188,6 @@ lib%.a.xyzzy:
lib%.so.xyzzy:
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 install-pkgconfig
+.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 3055f08..919ecc4 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ In 2.9.7.0
----------
- Bugfixes.
+ - pkg-config support.
- New "-P maxpar" option to forx and forstdin, for bounded parallelism.
diff --git a/configure b/configure
index 6240a96..a5f37af 100755
--- a/configure
+++ b/configure
@@ -45,9 +45,9 @@ Optional features:
--disable-allstatic do not prefer linking against static libraries [enabled]
--enable-static-libc make entirely static binaries [disabled]
--disable-all-pic do not build executables or static libs as PIC [enabled]
+ --enable-pkgconfig Build and install .pc files for pkg-config [disabled]
--enable-slashpackage[=ROOT] assume /package installation at ROOT [disabled]
--enable-absolute-paths hardcode absolute BINDIR/foobar paths in binaries [disabled]
- --enable-pkgconfig Build and install .pc files for pkg-config [disabled]
--enable-nsss use the nsss library for user information [disabled]
--enable-pedantic-posix use pedantically POSIX-compatible binaries [disabled]
--enable-multicall build a multicall binary [disabled]
@@ -203,13 +203,13 @@ 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 ;;
--enable-absolute-paths|--enable-absolute-paths=yes) abspath=true ;;
--disable-absolute-paths|--enable-absolute-paths=no) abspath=false ;;
- --enable-pkgconfig|--enable-pkgconfig=yes) pcw=true ;;
- --disable-pkgconfig|--enable-pkgconfig=no) pcw=false ;;
--enable-nsss|--enable-nsss=yes) usensss=true ;;
--disable-nsss|--enable-nsss=no) usensss=false ;;
--enable-pedantic-posix|--enable-pedantic-posix=yes) pposix=true ;;
@@ -231,12 +231,12 @@ if test -z "$prefix" ; then
if test "$libdir" = '$prefix/lib' ; then
libdir=/usr/lib
fi
- if test "$pkgconfdir" = '$prefix/lib/pkgconfig' ; then
- pkgconfdir=/usr/lib/pkgconfig
- fi
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
@@ -498,16 +498,16 @@ if $shared ; then
else
echo "DO_SHARED :="
fi
-if $allpic ; then
- echo "STATIC_LIBS_ARE_PIC := 1"
-else
- echo "STATIC_LIBS_ARE_PIC :="
-fi
if $pcw ; then
echo "DO_PKGCONFIG := 1"
else
echo "DO_PKGCONFIG :="
fi
+if $allpic ; then
+ echo "STATIC_LIBS_ARE_PIC := 1"
+else
+ echo "STATIC_LIBS_ARE_PIC :="
+fi
if $usensss ; then
echo "LIBNSSS := -lnsss"
echo "MAYBEPTHREAD_LIB := -lpthread"
diff --git a/tools/run-test.sh b/tools/run-test.sh
new file mode 100755
index 0000000..d651b09
--- /dev/null
+++ b/tools/run-test.sh
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+
+prog="$1"
+
+if test -x "./src/tests/${prog}.wrapper" ; then
+ cmd="./src/tests/${prog}.wrapper $prog"
+else
+ cmd="./$prog"
+fi
+
+if test -r "./src/tests/${prog}.expected" ; then
+ cp -f "./src/tests/${prog}.expected" "./${prog}.expected"
+elif test -x "./src/tests/${prog}.baseline" ; then
+ "./src/tests/${prog}.baseline" > "./${prog}.expected"
+else
+ echo "run-test.sh: fatal: missing baseline for $prog" 1>&2 ; exit 100
+fi
+
+$cmd | diff "./${prog}.expected" -
+
+rm -f "./${prog}.expected"
+echo "run-test.sh: info: $prog: pass" 1>&2