diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile | 8 | ||||
| -rwxr-xr-x | configure | 40 | ||||
| -rw-r--r-- | package/deps-build | 4 | ||||
| -rw-r--r-- | package/deps.mak | 1 | ||||
| -rw-r--r-- | package/targets.mak | 1 | ||||
| -rwxr-xr-x | tools/gen-deps.sh | 6 | ||||
| -rwxr-xr-x | tools/gen-dotpc.sh | 44 |
8 files changed, 49 insertions, 56 deletions
@@ -2,6 +2,7 @@ *.lo /*.a.xyzzy /*.so.xyzzy +/*.pc /config.mak /src/include/execline/config.h /src/multicall/execline.c @@ -42,13 +42,11 @@ lib$(2).pc: includedir="$(includedir)" \ dynlibdir="$(dynlibdir)" \ libdir="$(libdir)" \ - buildtime_includedirs="$(buildtime_includedirs)" \ - buildtime_dynlibdirs="$(buildtime_dynlibdirs)" \ - buildtime_libdirs="$(buildtime_libdirs)" \ + extra_includedirs="$(extra_includedirs)" \ + extra_libdirs="$(extra_libdirs)" \ extra_libs="$$(strip $$(EXTRA_LIBS))" \ - requires="$$($(1)_REQUIRES)" \ - requires_private="$$($(1)_REQUIRES_PRIVATE)" \ description="$$($(1)_DESCRIPTION)" \ + url="$$($(1)_URL)" \ ldlibs="$(LDLIBS)" \ ./tools/gen-dotpc.sh > $$@.tmp exec mv -f $$@.tmp $$@ @@ -166,12 +166,12 @@ allstatic=true evenmorestatic=false pkgconf= addincpath='' -depincpath='' addlibspath='' addlibdpath='' +depincpath='' +deplibpath='' vpaths='' vpathd='' -requires='' build= for arg ; do @@ -253,9 +253,9 @@ done # Process deps-build if test -n "$pkgconf" || $pcw || $slashpackage ; then oldifs="$IFS" - while IFS=" " read condvar pkg ver isdepinc libs ; do + while IFS=" " read cond usedinlibs pkg ver libs ; do IFS="$oldifs" - eval "cond=$condvar" + eval "cond=$cond; usedinlibs=$usedinlibs" if $cond ; then if test -n "$pkgconf" ; then for lib in $libs ; do @@ -263,37 +263,34 @@ if test -n "$pkgconf" || $pcw || $slashpackage ; then echo "./configure: fatal: $pkgconf --atleast-version=${ver} --print-errors -- $lib failed" 1>&2 exit 1 fi - thisinc=`$pkgconf --cflags-only-I -- $lib` - addincpath="${addincpath}${thisinc:+ }$thisinc" - if $isdepinc ; then - depincpath="${depincpath}${thisinc:+ }$thisinc" - fi + thisinc="`$pkgconf --cflags-only-I -- $lib`" sldflags="`$pkgconf --libs-only-L --static -- $lib`" dldflags="`$pkgconf --libs-only-L -- $lib`" - addlibspath="$addlibspath $sldflags" - addlibdpath="$addlibdpath $dldflags" + 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 - done - fi - if $pcw ; then - for lib in $libs ; do - req="${req}${req:+, }$lib >= $ver" + if $usedinlibs ; then + depincpath="${depincpath}${thisinc:+ }$thisinc" + deplibpath="${deplibpath}${sldflags:+ }$sldflags" + fi done fi if $slashpackage ; then addincpath="$addincpath -I${DESTDIR}${sproot}${pkg}/include" - if $isdepinc ; then - depincpath="$depincpath -I${DESTDIR}${sproot}${pkg}/include" - fi 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 @@ -461,9 +458,8 @@ sproot := $sproot version := $version home := $home exthome := $exthome -buildtime_includedirs :=$depincpath -buildtime_libdirs :=$addlibspath -buildtime_dynlibdirs :=$addlibdpath +extra_includedirs :=$depincpath +extra_libdirs :=$deplibpath SPAWN_LIB := ${spawn_lib} SOCKET_LIB := ${socket_lib} SYSCLOCK_LIB := ${sysclock_lib} diff --git a/package/deps-build b/package/deps-build index 689b950..7814462 100644 --- a/package/deps-build +++ b/package/deps-build @@ -1,2 +1,2 @@ -true /package/prog/skalibs 2.14.4.0 true libskarnet -$usensss /package/admin/nsss 0.2.0.6 false libnsss +true true /package/prog/skalibs 2.14.4.0 libskarnet +$usensss false /package/admin/nsss 0.2.0.6 libnsss diff --git a/package/deps.mak b/package/deps.mak index 293e0a6..f5c43fb 100644 --- a/package/deps.mak +++ b/package/deps.mak @@ -81,7 +81,6 @@ src/libexecline/exlsn_free.o src/libexecline/exlsn_free.lo: src/libexecline/exls src/libexecline/exlsn_importas.o src/libexecline/exlsn_importas.lo: src/libexecline/exlsn_importas.c src/include/execline/execline.h src/include-local/exlsn.h src/libexecline/exlsn_main.o src/libexecline/exlsn_main.lo: src/libexecline/exlsn_main.c src/include/execline/execline.h src/include-local/exlsn.h src/libexecline/exlsn_multidefine.o src/libexecline/exlsn_multidefine.lo: src/libexecline/exlsn_multidefine.c src/include/execline/execline.h src/include-local/exlsn.h -src/multicall/execline.o src/multicall/execline.lo: src/multicall/execline.c src/include/execline/config.h src/include/execline/execline.h src/include-local/exlsn.h background: EXTRA_LIBS := ${SPAWN_LIB} background: src/execline/background.o ${LIBEXECLINE} -lskarnet diff --git a/package/targets.mak b/package/targets.mak index 0f8716a..8fc04a1 100644 --- a/package/targets.mak +++ b/package/targets.mak @@ -1,7 +1,6 @@ LIBEXEC_TARGETS := LIB_DEFS := EXECLINE=execline -EXECLINE_REQUIRES := libskarnet ifeq ($(MULTICALL),1) diff --git a/tools/gen-deps.sh b/tools/gen-deps.sh index 8e944d4..8d3c6cd 100755 --- a/tools/gen-deps.sh +++ b/tools/gen-deps.sh @@ -62,9 +62,9 @@ for dir in $(ls -1 src | grep -v ^include) ; do both= libs= while read dep ; do - if echo $dep | grep -q '^\${.*_LIB}' ; then + if echo $dep | grep -qx '\${.*_LIB}' ; then libs="$libs $dep" - elif echo $dep | grep -q '^-l' ; then + elif echo $dep | grep -q -e '^-l' -e '^\${LIB' ; then both="$both $dep" else deps="$deps src/$dir/$dep" @@ -91,7 +91,7 @@ for dir in $(ls -1 src | grep -v ^include) ; do if echo $dep | grep -q \\.o$ ; then dep="src/$dir/$dep" fi - if echo $dep | grep -q '^\${.*_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 index b33f348..63c8929 100755 --- a/tools/gen-dotpc.sh +++ b/tools/gen-dotpc.sh @@ -36,15 +36,22 @@ filterout () { printf %s\\n "$res" } -splitlibs () { - req= - while test "$1" != -lskarnet ; do - if test -z "$1" ; then - echo "gen-dotpc.sh: fatal: can't happen: was called on a library that doesn't depend on libskarnet" 1>&2 - exit 102 - fi - - done +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 @@ -56,24 +63,20 @@ slist= if test "${includedir}" != /usr/include ; then ilist="-I${includedir}" fi -if test -n "${buildtime_includedirs}" ; then - ilist="${ilist}${ilist:+ }${buildtime_includedirs}" +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 -n "${buildtime_dynlibdirs}" ; then - dlist="${dlist}${dlist:+ }${buildtime_dynlibdirs}" -fi -dlist=`uniqit ${dlist}` if test "${libdir}" != /usr/lib && test "${libdir}" != /lib ; then slist="-L${libdir}" fi -if test -n "${buildtime_libdirs}" ; then - slist="${slist}${slist:+ }${buildtime_libdirs}" +if test -n "${extra_libdirs}" ; then + slist="${slist}${slist:+ }${extra_libdirs}" fi slist="$(filterout "${dlist}" $(uniqit ${slist}))" @@ -86,11 +89,8 @@ echo "Name: ${library}" echo "Version: ${version}" echo "Description: ${description:-The ${library} library.}" echo "URL: ${url:-https://skarnet.org/software/${package}/}" -if test -n "${requires}" ; then - echo "Requires: ${requires}" -fi -if test -n "${requires_private}" ; then - echo "Requires.private: ${requires_private}" +if test -n "${extra_libs}" ; then + print_requires ${extra_libs} fi if test -n "$ilist" ; then echo "Cflags: ${ilist}" |
