Basic new lib dependency code for package.
LIB_DEPENDS are no longer part of ALWAYS_DEPEND for the new-depends code, but use their own code. The code does scan the list of libraries for dependent packages, and insert corresponding @libdepend lines into the resulting package. There are a few important consequences: - no libdepend lines are inserted if only a static library is found. So RUN_DEPENDS are now needed to supplement LIB_DEPENDS if a package requires another package for something that isn't a library. - dependency checking for installed stuff can go one step further, since we have the major/minor number of the libraries used for the build. At the moment, pkg resolve dependencies does nothing smart with the inserted libdepends, but it will (soon). In fact, for most libdepends, if the major/minor scheme are correct, no check on the installed pkgspec ought to be necessary... which is why the `default pkgspec to check' is pkg-* for libraries. - resolving recursive run dependencies need to go one step further: a RUN_DEPENDS pkg may have some LIB_DEPENDS, and the RUN_DEPENDS pkg will be needed to explicitly write the required information into the resulting package... Hence the necessity of being able to tune the list of libraries to ask the uninstalled package (and to make sure the uninstalled package is built). This is only preliminary work. Currently, this doesn't yield any real benefits to the old approach, as a few semantic details need to be sharpened out. Also, there are now quite a few old targets that are a complete mess and will need to be cleaned up/removed entirely. Thanks to naddy@ for testing various preliminary versions of this patch and helping me iron bugs out.
This commit is contained in:
parent
e0fed41baf
commit
863226a22f
@ -1,6 +1,6 @@
|
||||
#-*- mode: Fundamental; tab-width: 4; -*-
|
||||
# ex:ts=4 sw=4 filetype=make:
|
||||
FULL_REVISION=$$OpenBSD: bsd.port.mk,v 1.495 2001/11/12 14:24:06 espie Exp $$
|
||||
FULL_REVISION=$$OpenBSD: bsd.port.mk,v 1.496 2001/11/12 14:32:52 espie Exp $$
|
||||
# $FreeBSD: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp Exp $
|
||||
# $NetBSD: bsd.port.mk,v 1.62 1998/04/09 12:47:02 hubertf Exp $
|
||||
#
|
||||
@ -2266,8 +2266,10 @@ pre-repackage:
|
||||
.if defined(LIB_DEPENDS) || defined(MISC_DEPENDS)
|
||||
_ALWAYS_DEP2 = ${LIB_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/} \
|
||||
${MISC_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
||||
_ALWAYS_DEP3 = ${MISC_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
||||
_ALWAYS_DEP= ${_ALWAYS_DEP2:C/[^:]*://}
|
||||
.else
|
||||
_ALWAYS_DEP3=
|
||||
_ALWAYS_DEP2=
|
||||
_ALWAYS_DEP=
|
||||
.endif
|
||||
@ -2326,11 +2328,11 @@ describe:
|
||||
echo -n "/dev/null|"; \
|
||||
fi; \
|
||||
echo -n "${MAINTAINER}|${CATEGORIES}|"
|
||||
. if !empty(_ALWAYS_DEP2) || !empty(_BUILD_DEP2)
|
||||
. if !empty(_ALWAYS_DEP3) || !empty(_BUILD_DEP2)
|
||||
@cd ${.CURDIR} && _FINAL_ECHO=: _INITIAL_ECHO=: exec ${MAKE} build-depends-list
|
||||
. endif
|
||||
@echo -n "|"
|
||||
. if !empty(_ALWAYS_DEP2) || !empty(_RUN_DEP2)
|
||||
. if !empty(_ALWAYS_DEP3) || !empty(_RUN_DEP2)
|
||||
@cd ${.CURDIR} && _FINAL_ECHO=: _INITIAL_ECHO=: exec ${MAKE} run-depends-list
|
||||
. endif
|
||||
@echo -n "|"
|
||||
@ -2609,14 +2611,14 @@ package-dir-depends:
|
||||
.endif
|
||||
|
||||
new-depends:
|
||||
.if !empty(_ALWAYS_DEP2) || !empty(_RUN_DEP2)
|
||||
.if !empty(_ALWAYS_DEP3) || !empty(_RUN_DEP2)
|
||||
@unset FLAVOR SUBPACKAGE || true; \
|
||||
: $${self:=self}; \
|
||||
for spec in `echo '${_ALWAYS_DEP2} ${_RUN_DEP2}' \
|
||||
for spec in `echo '${_ALWAYS_DEP3} ${_RUN_DEP2}' \
|
||||
| tr '\040' '\012' | sort -u`; do \
|
||||
dir=$${spec#*:}; pkg=$${spec%:*}; \
|
||||
${_flavor_fragment}; \
|
||||
default=`eval $$toset ${MAKE} package-name`; \
|
||||
default=`eval $$toset ${MAKE} _print-packagename`; \
|
||||
: $${pkg:=$$default}; \
|
||||
echo "@newdepend $$self:$$pkg:$$default"; \
|
||||
toset="$$toset self=\"$$default\""; \
|
||||
@ -2626,6 +2628,48 @@ new-depends:
|
||||
fi; \
|
||||
done
|
||||
.endif
|
||||
.if !defined(NO_SHARED_LIBS) && defined(LIB_DEPENDS) && !empty(LIB_DEPENDS)
|
||||
. for _i in ${LIB_DEPENDS}
|
||||
@unset FLAVOR SUBPACKAGE || true; \
|
||||
: $${self:=self}; \
|
||||
echo '${_i}'|{ \
|
||||
IFS=:; read dep pkg dir target; \
|
||||
${_flavor_fragment}; \
|
||||
libspecs='';comma=''; \
|
||||
default=`eval $$toset ${MAKE} _print-packagename`; \
|
||||
case "X$$pkg" in X) pkg=`echo $$default|sed -e 's,-[0-9].*,-*,'`;; esac; \
|
||||
if pkg dependencies check $$pkg; then \
|
||||
listlibs='ls $$shdir 2>/dev/null'; \
|
||||
else \
|
||||
eval $$toset ${MAKE} ${PKGREPOSITORY}/$$default.tgz >/dev/null; \
|
||||
listlibs='pkg_info -L ${PKGREPOSITORY}/$$default.tgz|grep $$shdir|sed -e "s,^$$shdir/,,"'; \
|
||||
fi; \
|
||||
IFS=,; for d in $$dep; do \
|
||||
${_libresolve_fragment}; \
|
||||
case "X$$check" in \
|
||||
Xlib*.a) continue;; \
|
||||
X) \
|
||||
echo 1>&2 "Can't resolve libspec $$d"; \
|
||||
exit 1;; \
|
||||
X*) \
|
||||
libspecs="$$libspecs$$comma$$shprefix$$check"; \
|
||||
comma=',';; \
|
||||
esac; \
|
||||
done; \
|
||||
case "X$$libspecs" in \
|
||||
X) ;;\
|
||||
*) \
|
||||
echo "@libdepend $$self:$$libspecs:$$pkg:$$default"; \
|
||||
toset="$$toset self=\"$$default\""; \
|
||||
if ! eval $$toset ${MAKE} new-depends; then \
|
||||
echo 1>&2 "*** Problem checking deps in \"$$dir\"." ; \
|
||||
exit 1; \
|
||||
fi;; \
|
||||
esac; \
|
||||
}
|
||||
. endfor
|
||||
.endif
|
||||
|
||||
README_NAME?= ${TEMPLATES}/README.port
|
||||
|
||||
.if !target(readmes)
|
||||
|
Loading…
Reference in New Issue
Block a user