(1) New variable, SCRIPTS_ENV, which is passed to scripts/configure

and scripts/{pre,post}-* as environment vars.  Also, if BATCH is
    set, "BATCH=yes" is automatically added to SCRIPTS_ENV.
    (Requested by: max)

(2) The INSTALL_* macros are added to SCRIPTS_ENV and MAKE_ENV as
    BSD_INSTALL_*.  (Requested by: obrien)

(3) New variable MOTIF_ONLY, which will only build ports with
    REQUIRES_MOTIF defined.  This doesn't do dependencies right (what
    if the depended port doesn't need Motif) yet.

(4) Try not to clean the same port twice in clean-depends when (for
    instance) it's defined in both BUILD_DEPENDS and INSTALL_DEPENDS.
    Note that it won't check chained dependencies so you may still see
    the same port cleaned multiple times, but checking that far will
    surely make this run slower than the un-"optimized" case so I left
    it as is.  (Requested by: jkh)

(5) Ignore *.rej files in patches/ directory in addition to *~ and
    *.orig.
This commit is contained in:
Satoshi Asami 1997-01-12 11:48:26 +00:00
parent 0423508d59
commit 0f003de40d
1 changed files with 43 additions and 23 deletions

View File

@ -6,7 +6,7 @@
# bsd.port.mk - 940820 Jordan K. Hubbard. # bsd.port.mk - 940820 Jordan K. Hubbard.
# This file is in the public domain. # This file is in the public domain.
# #
# $Id: bsd.port.mk,v 1.243 1996/12/26 01:02:29 asami Exp $ # $Id: bsd.port.mk,v 1.244 1997/01/10 21:02:27 wosch Exp $
# #
# Please view me with 4 column tabs! # Please view me with 4 column tabs!
@ -121,8 +121,12 @@
# GNU_CONFIGURE - Set if you are using GNU configure (optional). # GNU_CONFIGURE - Set if you are using GNU configure (optional).
# CONFIGURE_SCRIPT - Name of configure script, defaults to 'configure'. # CONFIGURE_SCRIPT - Name of configure script, defaults to 'configure'.
# CONFIGURE_ARGS - Pass these args to configure if ${HAS_CONFIGURE} is set. # CONFIGURE_ARGS - Pass these args to configure if ${HAS_CONFIGURE} is set.
# CONFIGURE_ENV - Pass these env (shell-like) to configure if # CONFIGURE_ENV - Pass these env (shell-like) to configure if
# ${HAS_CONFIGURE} is set. # ${HAS_CONFIGURE} is set.
# SCRIPTS_ENV - Additional environment vars passed to scripts in
# ${SCRIPTDIR} executed by bsd.port.mk.
# MAKE_ENV - Additional environment vars passed to sub-make in build
# stage.
# IS_INTERACTIVE - Set this if your port needs to interact with the user # IS_INTERACTIVE - Set this if your port needs to interact with the user
# during a build. User can then decide to skip this port by # during a build. User can then decide to skip this port by
# setting ${BATCH}, or compiling only the interactive ports # setting ${BATCH}, or compiling only the interactive ports
@ -183,6 +187,8 @@
# MOTIFLIB - Set automatically to appropriate value depending on # MOTIFLIB - Set automatically to appropriate value depending on
# ${MOTIF_STATIC}. Substitute references to -lXm with # ${MOTIF_STATIC}. Substitute references to -lXm with
# patches to make your port conform to our standards. # patches to make your port conform to our standards.
# MOTIF_ONLY - If set, build Motif ports only. (Not much use except for
# building packages.)
# #
# Variables to change if you want a special behavior: # Variables to change if you want a special behavior:
# #
@ -384,6 +390,13 @@ INSTALL_DATA= \
INSTALL_MAN= \ INSTALL_MAN= \
${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
BSD_INSTALL_DATA="${INSTALL_DATA}" \
BSD_INSTALL_MAN="${INSTALL_MAN}"
MAKE_ENV+= ${INSTALL_MACROS}
SCRIPTS_ENV+= ${INSTALL_MACROS}
# The user can override the NO_PACKAGE by specifying this from # The user can override the NO_PACKAGE by specifying this from
# the make command line # the make command line
.if defined(FORCE_PACKAGE) .if defined(FORCE_PACKAGE)
@ -438,6 +451,7 @@ GZIP?= -9
GZIP_CMD?= /usr/bin/gzip -nf ${GZIP} GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
GUNZIP_CMD?= /usr/bin/gunzip -f GUNZIP_CMD?= /usr/bin/gunzip -f
SED?= /usr/bin/sed SED?= /usr/bin/sed
TR?= /usr/bin/tr
# Used to print all the '===>' style prompts - override this to turn them off. # Used to print all the '===>' style prompts - override this to turn them off.
ECHO_MSG?= ${ECHO} ECHO_MSG?= ${ECHO}
@ -563,6 +577,17 @@ CONFIGURE_ARGS+= --prefix=${PREFIX}
HAS_CONFIGURE= yes HAS_CONFIGURE= yes
.endif .endif
# Passed to most of script invocations
SCRIPTS_ENV+= CURDIR=${.CURDIR} DISTDIR=${DISTDIR} \
WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
PORTSDIR=${PORTSDIR} DEPENDS="${DEPENDS}" \
PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE}
.if defined(BATCH)
SCRIPTS_ENV+= BATCH=yes
.endif
MANPREFIX?= ${PREFIX} MANPREFIX?= ${PREFIX}
.for sect in 1 2 3 4 5 6 7 8 9 .for sect in 1 2 3 4 5 6 7 8 9
@ -624,6 +649,8 @@ IGNORE= "is an interactive port"
IGNORE= "is not an interactive port" IGNORE= "is not an interactive port"
.elif (defined(REQUIRES_MOTIF) && !defined(HAVE_MOTIF)) .elif (defined(REQUIRES_MOTIF) && !defined(HAVE_MOTIF))
IGNORE= "requires Motif" IGNORE= "requires Motif"
.elif (defined(MOTIF_ONLY) && !defined(REQUIRES_MOTIF))
IGNORE= "does not require Motif"
.elif (defined(NO_CDROM) && defined(FOR_CDROM)) .elif (defined(NO_CDROM) && defined(FOR_CDROM))
IGNORE= "may not be placed on a CDROM: ${NO_CDROM}" IGNORE= "may not be placed on a CDROM: ${NO_CDROM}"
.elif (defined(RESTRICTED) && defined(NO_RESTRICTED)) .elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
@ -852,7 +879,7 @@ do-patch:
${ECHO_MSG} "===> Applying ${OPSYS} patches for ${PKGNAME}" ; \ ${ECHO_MSG} "===> Applying ${OPSYS} patches for ${PKGNAME}" ; \
for i in ${PATCHDIR}/patch-*; do \ for i in ${PATCHDIR}/patch-*; do \
case $$i in \ case $$i in \
*.orig|*~) \ *.orig|*.rej|*~) \
${ECHO_MSG} "===> Ignoring patchfile $$i" ; \ ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
;; \ ;; \
*) \ *) \
@ -872,11 +899,8 @@ do-patch:
.if !target(do-configure) .if !target(do-configure)
do-configure: do-configure:
@if [ -f ${SCRIPTDIR}/configure ]; then \ @if [ -f ${SCRIPTDIR}/configure ]; then \
cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTDIR=${DISTDIR}\ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} /bin/sh \
WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \ ${SCRIPTDIR}/configure; \
SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} DEPENDS="${DEPENDS}" \
X11BASE=${X11BASE} /bin/sh ${SCRIPTDIR}/configure; \
fi fi
.if defined(HAS_CONFIGURE) .if defined(HAS_CONFIGURE)
@(cd ${WRKSRC} && CC="${CC}" ac_cv_path_CC="${CC}" CFLAGS="${CFLAGS}" \ @(cd ${WRKSRC} && CC="${CC}" ac_cv_path_CC="${CC}" CFLAGS="${CFLAGS}" \
@ -1001,21 +1025,14 @@ _PORT_USE: .USE
.endif .endif
@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/pre-/} @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/pre-/}
@if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/} ]; then \ @if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/} ]; then \
cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} \ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} /bin/sh \
WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \ ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/}; \
FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
DEPENDS="${DEPENDS}" X11BASE=${X11BASE} \
/bin/sh ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/}; \
fi fi
@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/do-/} @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/do-/}
@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/post-/} @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/post-/}
@if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/post-/} ]; then \ @if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/post-/} ]; then \
cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTDIR=${DISTDIR}\ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} /bin/sh \
WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \ ${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \
SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} DEPENDS="${DEPENDS}" \
X11BASE=${X11BASE} \
/bin/sh ${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \
fi fi
.if make(real-install) && defined(_MANPAGES) .if make(real-install) && defined(_MANPAGES)
.if defined(MANCOMPRESSED) && defined(NOMANCOMPRESS) .if defined(MANCOMPRESSED) && defined(NOMANCOMPRESS)
@ -1444,14 +1461,17 @@ misc-depends:
clean-depends: clean-depends:
.if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) \ .if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) \
|| defined(RUN_DEPENDS) || defined(RUN_DEPENDS)
@for i in ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}; do \ @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/.*://' | sort | uniq`; do \
dir=`${ECHO} $$i | ${SED} -e 's/.*://'`; \ if [ -d $$dir ] ; then \
if [ -d $$dir ] ; then (cd $$dir; ${MAKE} clean); fi \ (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean clean-depends); \
fi \
done done
.endif .endif
.if defined(DEPENDS) .if defined(DEPENDS)
@for dir in ${DEPENDS}; do \ @for dir in ${DEPENDS}; do \
if [ -d $$dir ] ; then (cd $$dir; ${MAKE} clean); fi \ if [ -d $$dir ] ; then \
(cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean clean-depends); \
fi \
done done
.endif .endif
.endif .endif