From 39af33c6d066a06b89c457cd9353d2f259cd5eb5 Mon Sep 17 00:00:00 2001 From: PS Date: Tue, 10 Mar 2026 22:42:08 +0100 Subject: Fix build system --- configure | 74 +++++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 33 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 99fadb6..28e9bc5 100755 --- a/configure +++ b/configure @@ -25,6 +25,9 @@ Fine tuning of the installation directories: --includedir=DIR C header files [PREFIX/include] --sysconfdir=DIR global configuration files [PREFIX/etc] --pkgconfdir=DIR pkg-config .pc files [PREFIX/lib/pkgconfig] + --bootdb=PATH default path for the boot database [SYSCONFDIR/s6-rc/compiled/current] + --livedir=DIR default live directory [/run/s6-rc] + --repodir=DIR default repo directory [/var/lib/s6-rc/repository] If no --prefix option is given, by default libdir (but not dynlibdir) will be /usr/lib, and includedir will be /usr/include. @@ -48,8 +51,7 @@ Optional features: --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-nsss use the nsss library for user information [disabled] - --disable-execline don't use the execline library [enabled] + --with-default-bundle=def name of the bundle started at boot [default] EOF exit 0 @@ -149,6 +151,7 @@ pkgconfdir='$prefix/lib/pkgconfig' shebangdir='$bindir' sysdeps='$prefix/lib/skalibs/sysdeps' manualsysdeps=false +shlibext=so shared=false static=true allpic=true @@ -169,8 +172,10 @@ deplibpath='' vpaths='' vpathd='' build= -usensss=false -useexecline=true +bootdb='$sysconfdir/s6-rc/compiled/current' +livedir=/run/s6-rc +repodir=/var/lib/s6-rc/repository +defaultbundle=default for arg ; do case "$arg" in @@ -195,9 +200,9 @@ for arg ; do --disable-shared|--enable-shared=no) shared=false ;; --enable-static|--enable-static=yes) static=true ;; --disable-static|--enable-static=no) static=false ;; - --enable-allstatic|--enable-allstatic=yes) allstatic=true ;; - --disable-allstatic|--enable-allstatic=no) allstatic=false ; evenmorestatic=false ;; - --enable-static-libc|--enable-static-libc=yes) allstatic=true ; evenmorestatic=true ;; + --enable-allstatic|--enable-allstatic=yes) static=true ; allstatic=true ;; + --disable-allstatic|--enable-allstatic=no) allstatic=false ; evenmorestatic=false ; shared=true ;; + --enable-static-libc|--enable-static-libc=yes) static=true ; allstatic=true ; evenmorestatic=true ;; --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 ;; @@ -208,10 +213,11 @@ for arg ; do --disable-slashpackage) sproot= ; slashpackage=false ;; --enable-absolute-paths|--enable-absolute-paths=yes) abspath=true ;; --disable-absolute-paths|--enable-absolute-paths=no) abspath=false ;; - --enable-nsss|--enable-nsss=yes) usensss=true ;; - --disable-nsss|--enable-nsss=no) usensss=false ;; - --enable-execline|--enable-execline=yes) useexecline=true ;; - --disable-execline|--enable-execline=no) useexecline=false ;; + --bootdb=*) bootdb=${arg#*=} ;; + --livedir=*) livedir=${arg#*=} ;; + --repodir=*) repodir=${arg#*=} ;; + --with-default-bundle=*) defaultbundle=${arg#*=} ;; + --enable-*|--disable-*|--with-*|--without-*|--*dir=*) ;; --enable-*|--disable-*|--with-*|--without-*|--*dir=*) ;; --host=*|--target=*) target=${arg#*=} ;; @@ -240,7 +246,7 @@ fi # Expand installation directories stripdir prefix -for i in exec_prefix dynlibdir libexecdir bindir libdir includedir sysconfdir pkgconfdir sysdeps sproot ; do +for i in exec_prefix dynlibdir libexecdir bindir libdir includedir sysconfdir pkgconfdir sysdeps sproot bootdb livedir repodir ; do eval tmp=\${$i} eval $i=$tmp stripdir $i @@ -379,16 +385,25 @@ if test ! -d $sysdeps || test ! -f $sysdeps/target ; then echo "$0: error: $sysdeps is not a valid sysdeps directory" exit 1 fi -if [ "x$target" != "x$(cat $sysdeps/target)" ] ; then +if test "$target" != "$(cat $sysdeps/target)" ; then echo "$0: error: target $target does not match the contents of $sysdeps/target" exit 1 fi +echo "Shared libraries will be named ..." +libc="${target##*-}" +if test "${libc##darwin}" != "$libc" ; then + shlibext=dylib +fi +echo " ... *.$shlibext" + if $allpic ; then tryflag CPPFLAGS_AUTO -fPIC fi -spawn_lib=$(cat $sysdeps/spawn.lib) + +pthread_lib=$(cat $sysdeps/pthread.lib) socket_lib=$(cat $sysdeps/socket.lib) +spawn_lib=$(cat $sysdeps/spawn.lib) sysclock_lib=$(cat $sysdeps/sysclock.lib) timer_lib=$(cat $sysdeps/timer.lib) util_lib=$(cat $sysdeps/util.lib) @@ -457,8 +472,10 @@ home := $home exthome := $exthome extra_includedirs :=$depincpath extra_libdirs :=$deplibpath -SPAWN_LIB := ${spawn_lib} + +PTHREAD_LIB := ${pthread_lib} SOCKET_LIB := ${socket_lib} +SPAWN_LIB := ${spawn_lib} SYSCLOCK_LIB := ${sysclock_lib} TIMER_LIB := ${timer_lib} UTIL_LIB := ${util_lib} @@ -473,16 +490,17 @@ LDFLAGS := ${LDFLAGS}${LDFLAGS_POST:+ }$LDFLAGS_POST LDFLAGS_SHARED := $LDFLAGS_SHARED LDFLAGS_NOSHARED :=$LDFLAGS_NOSHARED CROSS_COMPILE := $cross +SHLIB_EXT := ${shlibext} vpath lib%.a$vpaths -vpath lib%.so$vpathd +vpath lib%.${shlibext}$vpathd EOF if $allstatic ; then echo ".LIBPATTERNS := lib%.a" echo "DO_ALLSTATIC := 1" else - echo ".LIBPATTERNS := lib%.so" + echo ".LIBPATTERNS := lib%.${shlibext}" echo "DO_ALLSTATIC :=" fi if $static ; then @@ -505,18 +523,7 @@ if $allpic ; then else echo "STATIC_LIBS_ARE_PIC :=" fi -if $usensss ; then - echo "LIBNSSS := -lnsss" - echo "MAYBEPTHREAD_LIB := -lpthread" -else - echo "LIBNSSS :=" - echo "MAYBEPTHREAD_LIB :=" -fi -if $useexecline ; then - echo "EXECLINE_LIB := -lexecline" -else - echo "EXECLINE_LIB :=" -fi + exec 1>&3 3>&- echo " ... done." @@ -548,10 +555,11 @@ else fi echo "#define ${package_macro_name}_LIBEXECPREFIX \"$libexecdir/\"" echo "#define ${package_macro_name}_SYSCONFPREFIX \"$sysconfdir/\"" -echo "#undef ${package_macro_name}_USE_EXECLINE" -if $useexecline ; then - echo "#define ${package_macro_name}_USE_EXECLINE" -fi +echo "#define ${package_macro_name}_BOOTDB \"$bootdb\"" +echo "#define ${package_macro_name}_LIVEDIR \"$livedir\"" +echo "#define ${package_macro_name}_REPODIR \"$repodir\"" +echo "#define ${package_macro_name}_DEFBUNDLE \"$defaultbundle\"" + echo echo "#endif" exec 1>&3 3>&- -- cgit v1.2.3