aboutsummaryrefslogtreecommitdiffstats
path: root/package/configure-snippets/configure_extra_checks
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2025-04-27 21:53:35 +0000
committerLaurent Bercot <ska@appnovation.com>2025-04-27 21:53:35 +0000
commit1a24089c821b7ab71af9733a58ffc762accd84dd (patch)
tree790ebe40aa8da93d76e974921c18f4434cddea90 /package/configure-snippets/configure_extra_checks
parente850b94f5e796ad12b994ea664d3ecfd2d176620 (diff)
downloads6-linux-init-1a24089c821b7ab71af9733a58ffc762accd84dd.tar.gz
Prepare for 1.1.3.0, templated configure, pkg-config support, etc.
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'package/configure-snippets/configure_extra_checks')
-rw-r--r--package/configure-snippets/configure_extra_checks28
1 files changed, 28 insertions, 0 deletions
diff --git a/package/configure-snippets/configure_extra_checks b/package/configure-snippets/configure_extra_checks
new file mode 100644
index 0000000..eeb117e
--- /dev/null
+++ b/package/configure-snippets/configure_extra_checks
@@ -0,0 +1,28 @@
+isprefix () {
+ case "$1" in "$2"*) return 0 ;; *) return 1 ;; esac ;
+}
+
+getmacro () {
+ echo "#include <$1>" | $CC_AUTO $CPPFLAGS_AUTO $CPPFLAGS $CPPFLAGS_POST $CFLAGS_AUTO $CFLAGS $CFLAGS_POST -E -dM - | grep -F -- "$2" | cut -d' ' -f3-
+}
+
+getmacrostring () {
+ getmacro "$1" "$2" | sed -e 's/^"//' -e 's/"$//'
+}
+
+if $utmps ; then
+ echo "Sanity checking cross-package configuration..."
+ p=`getmacrostring utmps/config.h UTMPS_UTMPD_PATH`
+ if isprefix "$p" "$tmpfsdir"/ ; then : ; else
+ echo "UTMPS_UTMPD_PATH has been configured as $p which is not located under $tmpfsdir"
+ exit 1
+ fi
+ utmpd_path=${p##${tmpfsdir}/}
+ p=`getmacrostring utmps/config.h UTMPS_WTMPD_PATH`
+ if isprefix "$p" "$tmpfsdir"/ ; then : ; else
+ echo "UTMPS_WTMPD_PATH has been configured as $p which is not located under $tmpfsdir"
+ exit 1
+ fi
+ wtmpd_path=${p##${tmpfsdir}/}
+ echo " ... ok"
+fi