distinguish between _BUILDLIB_DEPENDS and LIB_DEPENDS, and _BUILDWANTLIB

and WANTLIB.

Get the rules for the LIBSPECS_COOKIES out of the loop that dictates their
usage.

Introduce *DEP3 variables, to keep *-depends-list compatible with old stuff.

Use _BUILDLIB_DEPENDS and _BUILDWANTLIB everywhere this makes sense.
This commit is contained in:
espie 2006-11-20 10:36:13 +00:00
parent a0b5fa8262
commit b46318f8f6

View File

@ -1,6 +1,6 @@
#-*- mode: Makefile; tab-width: 4; -*- #-*- mode: Makefile; tab-width: 4; -*-
# ex:ts=4 sw=4 filetype=make: # ex:ts=4 sw=4 filetype=make:
# $OpenBSD: bsd.port.mk,v 1.819 2006/11/20 09:59:11 espie Exp $ # $OpenBSD: bsd.port.mk,v 1.820 2006/11/20 10:36:13 espie Exp $
# $FreeBSD: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp 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 $ # $NetBSD: bsd.port.mk,v 1.62 1998/04/09 12:47:02 hubertf Exp $
# #
@ -463,12 +463,10 @@ _ALL_COOKIES=${_EXTRACT_COOKIE} ${_PATCH_COOKIE} ${_CONFIGURE_COOKIE} \
${_INSTALL_PRE_COOKIE} ${_BUILD_COOKIE} ${_REGRESS_COOKIE} \ ${_INSTALL_PRE_COOKIE} ${_BUILD_COOKIE} ${_REGRESS_COOKIE} \
${_SYSTRACE_COOKIE} ${_PACKAGE_COOKIES} \ ${_SYSTRACE_COOKIE} ${_PACKAGE_COOKIES} \
${_DISTPATCH_COOKIE} ${_PREPATCH_COOKIE} ${_FAKE_COOKIE} \ ${_DISTPATCH_COOKIE} ${_PREPATCH_COOKIE} ${_FAKE_COOKIE} \
${_WRKDIR_COOKIE} ${_DEPLIB_COOKIES} ${_DEPBUILD_COOKIES} \ ${_WRKDIR_COOKIE} ${_DEPBUILD_COOKIES} \
${_DEPRUN_COOKIES} ${_DEPREGRESS_COOKIES} ${_UPDATE_COOKIE} \ ${_DEPRUN_COOKIES} ${_DEPREGRESS_COOKIES} ${_UPDATE_COOKIE} \
${_DEPLIBSPECS_COOKIES} \
${_DEPBUILDLIB_COOKIES} ${_DEPRUNLIB_COOKIES} \ ${_DEPBUILDLIB_COOKIES} ${_DEPRUNLIB_COOKIES} \
${_DEPBUILDWANTLIB_COOKIE} ${_DEPBUILDLIBSPECS_COOKIES} \ ${_DEPBUILDWANTLIB_COOKIE} ${_DEPRUNWANTLIB_COOKIE}${_DEPLIBSPECS_COOKIES}
${_DEPRUNWANTLIB_COOKIE} ${_DEPRUNLIBSPECS_COOKIES} \
_MAKE_COOKIE=touch _MAKE_COOKIE=touch
@ -1089,22 +1087,24 @@ _PKG_ADD_FORCE=
_FULL_PACKAGE_NAME?=No _FULL_PACKAGE_NAME?=No
_BUILDLIB_DEPENDS= ${LIB_DEPENDS}
_BUILDWANTLIB= ${WANTLIB}
.if ${NO_DEPENDS:L} == "no" .if ${NO_DEPENDS:L} == "no"
_BUILD_DEPLIST= ${BUILD_DEPENDS:S/^://} _BUILD_DEPLIST= ${BUILD_DEPENDS:S/^://}
_RUN_DEPLIST= ${RUN_DEPENDS${SUBPACKAGE}:S/^://} _RUN_DEPLIST= ${RUN_DEPENDS${SUBPACKAGE}:S/^://}
_REGRESS_DEPLIST= ${REGRESS_DEPENDS:S/^://} _REGRESS_DEPLIST= ${REGRESS_DEPENDS:S/^://}
_LIB_DEPLIST=${LIB_DEPENDS:C/^[^:]*://} _BUILDLIB_DEPLIST= ${_BUILDLIB_DEPENDS:C/^[^:]*://}
_RUNLIB_DEPLIST= ${LIB_DEPENDS:C/^[^:]*://}
.endif .endif
_DEPLIST=${_BUILD_DEPLIST} ${_RUN_DEPLIST} ${_REGRESS_DEPLIST} ${_LIB_DEPLIST} _DEPLIST= ${_BUILD_DEPLIST} ${_RUN_DEPLIST} ${_REGRESS_DEPLIST} ${_BUILDLIB_DEPLIST} ${_RUNLIB_DEPLIST}
.for _DEP in BUILD RUN LIB REGRESS .for _DEP in BUILD RUN BUILDLIB RUNLIB REGRESS
_DEP${_DEP}_COOKIES= _DEP${_DEP}_COOKIES=
. for _i in ${_${_DEP}_DEPLIST} . for _i in ${_${_DEP}_DEPLIST}
_DEP${_DEP}_COOKIES+=${WRKDIR}/.dep${_i:C,[|:/<=>*],-,g} _DEP${_DEP}_COOKIES+=${WRKDIR}/.dep${_i:C,[|:/<=>*],-,g}
. endfor . endfor
.endfor .endfor
_DEPBUILDLIB_COOKIES=${_DEPLIB_COOKIES}
_DEPRUNLIB_COOKIES=${_DEPLIB_COOKIES}
# Normal user-mode targets are PHONY targets, e.g., don't create the # Normal user-mode targets are PHONY targets, e.g., don't create the
# corresponding file. However, there is nothing phony about the cookie. # corresponding file. However, there is nothing phony about the cookie.
@ -1143,42 +1143,42 @@ _FMN+= ${PKGPATH}/${FULLPKGNAME${_S}}
# Only keep pkg:dir spec # Only keep pkg:dir spec
_BUILD_DEP2= ${BUILD_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/} _BUILD_DEP2= ${BUILD_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
_BUILD_DEP3= ${BUILD_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
_RUN_DEP2= ${RUN_DEPENDS${SUBPACKAGE}:C/^[^:]*:([^:]*:[^:]*).*$/\1/} _RUN_DEP2= ${RUN_DEPENDS${SUBPACKAGE}:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
_RUN_DEP3= ${RUN_DEPENDS${SUBPACKAGE}:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
_REGRESS_DEP2= ${REGRESS_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/} _REGRESS_DEP2= ${REGRESS_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
.if ${NO_SHARED_LIBS:L} != "yes" .if ${NO_SHARED_LIBS:L} != "yes"
_RUN_DEP2+= ${LIB_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/} _RUN_DEP2+= ${LIB_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
_DEPLIBS=${LIB_DEPENDS:C/:.*//:S/,/ /g} _LIB_DEP3= ${LIB_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
_DEPRUNLIBS= ${LIB_DEPENDS:C/:.*//:S/,/ /g}
.else .else
_DEPLIBS= _DEPRUNLIBS=
.endif .endif
_BUILD_DEP2 += ${LIB_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/} _BUILD_DEP2+= ${_BUILDLIB_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
_DEPBUILDLIBS= ${_BUILDLIB_DEPENDS:C/:.*//:S/,/ /g}
.if defined(WANTLIB) _DEPBUILDLIBS+= ${_BUILDWANTLIB}
_DEPLIBS+=${WANTLIB} _DEPRUNLIBS+= ${WANTLIB}
.endif
_DEPLIBSPECS_COOKIES= .if ${NO_DEPENDS:L} == "no"
.if !empty(_DEPLIBS) && ${NO_DEPENDS:L} == "no" . for i in ${_DEPBUILDLIBS:C,[|:/<=>*],-,g}
. for i in ${WANTLIB:C,[|:/<=>*],-,g} _DEPBUILDLIBSPECS_COOKIES+=${WRKDIR}/.spec-$i
_DEPLIBSPECS_COOKIES+=${WRKDIR}/.spec-$i
. endfor . endfor
_DEPBUILDWANTLIB_COOKIE=${WRKDIR}/.buildwantlibs _DEPBUILDWANTLIB_COOKIE=${WRKDIR}/.buildwantlibs
. for i in ${_DEPRUNLIBS:C,[|:/<=>*],-,g}
_DEPRUNLIBSPECS_COOKIES+=${WRKDIR}/.spec-$i
. endfor
_DEPRUNWANTLIB_COOKIE=${WRKDIR}/.runwantlibs${SUBPACKAGE} _DEPRUNWANTLIB_COOKIE=${WRKDIR}/.runwantlibs${SUBPACKAGE}
.else .else
_DEPBUILDWANTLIB_COOKIE= _DEPBUILDWANTLIB_COOKIE=
_DEPRUNWANTLIB_COOKIE= _DEPRUNWANTLIB_COOKIE=
.endif .endif
_DEPBUILDLIBS=${_DEPLIBS}
_DEPRUNLIBS=${_DEPLIBS}
_DEPBUILDLIBSPECS_COOKIES=${_DEPLIBSPECS_COOKIES} _DEPLIBSPECS_COOKIES=${_DEPBUILDLIBSPECS_COOKIES} ${_DEPRUNLIBSPECS_COOKIES}
_DEPRUNLIBSPECS_COOKIES=${_DEPLIBSPECS_COOKIES}
_LIB_DEP2= ${LIB_DEPENDS}
_BUILD_DEP= ${_BUILD_DEP2:C/[^:]*://} _BUILD_DEP= ${_BUILD_DEP2:C/[^:]*://}
_RUN_DEP= ${_RUN_DEP2:C/[^:]*://} _RUN_DEP= ${_RUN_DEP2:C/[^:]*://}
@ -1448,16 +1448,18 @@ ${WRKDIR}/.dep${_i:C,[|:/<=>*],-,g}: ${_WRKDIR_COOKIE}
_internal-build-depends: ${_DEPBUILD_COOKIES} _internal-build-depends: ${_DEPBUILD_COOKIES}
_internal-run-depends: ${_DEPRUN_COOKIES} _internal-run-depends: ${_DEPRUN_COOKIES}
_internal-lib-depends: ${_DEPLIB_COOKIES} _internal-lib-depends: ${_DEPBUILDLIB_COOKIES}
_internal-regress-depends: ${_DEPREGRESS_COOKIES} _internal-regress-depends: ${_DEPREGRESS_COOKIES}
_internal-buildlib-depends: ${_DEPBUILDLIB_COOKIES} _internal-buildlib-depends: ${_DEPBUILDLIB_COOKIES}
_internal-runlib-depends: ${_DEPRUNLIB_COOKIES} _internal-runlib-depends: ${_DEPRUNLIB_COOKIES}
. if !empty(_DEPLIBSPECS_COOKIES)
${_DEPLIBSPECS_COOKIES}: ${_WRKDIR_COOKIE}
@${_MAKE_COOKIE} $@
.endif
.for _m in BUILD RUN .for _m in BUILD RUN
. if !empty(_DEP${_m}WANTLIB_COOKIE) . if !empty(_DEP${_m}WANTLIB_COOKIE)
${_DEP${_m}LIBSPECS_COOKIES}: ${_WRKDIR_COOKIE}
@${_MAKE_COOKIE} $@
${_DEP${_m}WANTLIB_COOKIE}: ${_DEP${_m}LIBSPECS_COOKIES} ${_DEP${_m}LIB_COOKIES} ${_DEPBUILD_COOKIES} ${_WRKDIR_COOKIE} ${_DEP${_m}WANTLIB_COOKIE}: ${_DEP${_m}LIBSPECS_COOKIES} ${_DEP${_m}LIB_COOKIES} ${_DEPBUILD_COOKIES} ${_WRKDIR_COOKIE}
@${ECHO_MSG} "===> Verifying specs: ${_DEP${_m}LIBS}" @${ECHO_MSG} "===> Verifying specs: ${_DEP${_m}LIBS}"
@listlibs="echo ${LOCALBASE}/lib/lib* /usr/lib/lib* ${X11BASE}/lib/lib*"; \ @listlibs="echo ${LOCALBASE}/lib/lib* /usr/lib/lib* ${X11BASE}/lib/lib*"; \
@ -2286,7 +2288,7 @@ subdescribe:
fi; \ fi; \
echo -n "${MAINTAINER}|${CATEGORIES}|" echo -n "${MAINTAINER}|${CATEGORIES}|"
.for _d in LIB BUILD RUN .for _d in LIB BUILD RUN
. if !empty(_${_d}_DEP2) . if !empty(_${_d}_DEP3)
@cd ${.CURDIR} && _FINAL_ECHO=: _INITIAL_ECHO=: exec ${MAKE} ${_d:L}-depends-list @cd ${.CURDIR} && _FINAL_ECHO=: _INITIAL_ECHO=: exec ${MAKE} ${_d:L}-depends-list
. endif . endif
@echo -n "|" @echo -n "|"
@ -2420,13 +2422,13 @@ _license-check:
# run-depends-list, build-depends-list, lib-depends-list # run-depends-list, build-depends-list, lib-depends-list
.for _i in RUN BUILD LIB .for _i in RUN BUILD LIB
${_i:L}-depends-list: ${_i:L}-depends-list:
. if !empty(_${_i}_DEP2) . if !empty(_${_i}_DEP3)
@unset FLAVOR SUBPACKAGE || true; \ @unset FLAVOR SUBPACKAGE || true; \
: $${_INITIAL_ECHO:='echo -n "This port requires \""'}; \ : $${_INITIAL_ECHO:='echo -n "This port requires \""'}; \
: $${_ECHO='echo -n'}; \ : $${_ECHO='echo -n'}; \
: $${_FINAL_ECHO:='echo "\" for ${_i:L}."'}; space=''; \ : $${_FINAL_ECHO:='echo "\" for ${_i:L}."'}; space=''; \
eval $${_INITIAL_ECHO}; \ eval $${_INITIAL_ECHO}; \
for spec in `echo '${_${_i}_DEP2}' \ for spec in `echo '${_${_i}_DEP3}' \
| tr '\040' '\012' | sort -u`; do \ | tr '\040' '\012' | sort -u`; do \
$${_ECHO} "$$space$${spec}"; \ $${_ECHO} "$$space$${spec}"; \
space=' '; \ space=' '; \
@ -2438,7 +2440,7 @@ ${_i:L}-depends-list:
print-package-signature: print-package-signature:
@echo -n ${FULLPKGNAME${SUBPACKAGE}} @echo -n ${FULLPKGNAME${SUBPACKAGE}}
.if !empty(_DEPLIBS) .if !empty(_DEPRUNLIBS)
@cd ${.CURDIR} && PACKAGING='${SUBPACKAGE}' LIST_LIBS=`${MAKE} _list-port-libs` ${MAKE} _print-package-signature-lib _print-package-signature-run| \ @cd ${.CURDIR} && PACKAGING='${SUBPACKAGE}' LIST_LIBS=`${MAKE} _list-port-libs` ${MAKE} _print-package-signature-lib _print-package-signature-run| \
sort -u| \ sort -u| \
while read i; do echo -n ",$$i"; done while read i; do echo -n ",$$i"; done