Date: Tue, 4 Sep 2001 20:19:21 -0700 From: Marcel Moolenaar <marcel@xcllnt.net> To: portmgr@FreeBSD.org, ports@FreeBSD.org Subject: Conflict with MAKEFILE make variable as used in ports Message-ID: <20010904201921.A76421@athlon.pn.xcllnt.net>
next in thread | raw e-mail | index | archive | help
Hi, I have my ports tree mounted through NFS and arranged to have the work directory created on some local FS. This setup, although it appears to be supported (by means of WRKDIRPREFIX) breaks the ports collection. Below an heavily formatted abstract from a build of XFree86-4 with the loud debugging option (-b l): ===> Building for XFree86-4.1.0_6 cd /nfs/ports/x11/XFree86-4 && \ make 'CKSUMFILES+=X410src-1.tgz X410src-2.tgz' pre-build /usr/bin/true if [ -f /nfs/ports/x11/XFree86-4/scripts/pre-build ]; then \ cd /nfs/ports/x11/XFree86-4 && /usr/bin/env OSVERSION=500022 \ PORTOBJFORMAT=elf BSD_INSTALL_PROGRAM="install -c -s \ -o root -g wheel -m 555" BSD_INSTALL_SCRIPT="install \ -c -o root -g wheel -m 555" BSD_INSTALL_DATA="install \ -c -o root -g wheel -m 444" BSD_INSTALL_MAN="install \ -c -o root -g wheel -m 444" \ CURDIR=/nfs/ports/x11/XFree86-4 \ DISTDIR=/nfs/ports/distfiles \ WRKDIR=/usr/obj/nfs/ports/x11/XFree86-4/work \ WRKSRC=/usr/obj/nfs/ports/x11/XFree86-4/work/xc \ PATCHDIR=/nfs/ports/x11/XFree86-4/files \ SCRIPTDIR=/nfs/ports/x11/XFree86-4/scripts \ FILESDIR=/nfs/ports/x11/XFree86-4/files \ PORTSDIR=/nfs/ports DEPENDS="" \ PREFIX=/usr/X11R6 LOCALBASE=/usr/local \ X11BASE=/usr/X11R6 \ /bin/sh /nfs/ports/x11/XFree86-4/scripts/pre-build; \ fi cd /nfs/ports/x11/XFree86-4 && \ make 'CKSUMFILES+=X410src-1.tgz X410src-2.tgz' do-build (cd /usr/obj/nfs/ports/x11/XFree86-4/work/xc; \ /usr/bin/env PORTOBJFORMAT=elf PREFIX=/usr/X11R6 LOCALBASE=/usr/local \ X11BASE=/usr/X11R6 MOTIFLIB="-L/usr/X11R6/lib -lXm -lXp" \ LIBDIR="/usr/lib" CFLAGS="-O -pipe " CXXFLAGS=" -O -pipe " \ BSD_INSTALL_PROGRAM="install -c -s -o root -g wheel -m 555" \ BSD_INSTALL_SCRIPT="install -c -o root -g wheel -m 555" \ BSD_INSTALL_DATA="install -c -o root -g wheel -m 444" \ BSD_INSTALL_MAN="install -c -o root -g wheel -m 444" \ make -f /nfs/ports/x11/XFree86-4/Makefile WORLDOPTS= World) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ make: don't know how to make World. Stop *** Error code 2 The problem is that make is given the wrong makefile (ie /nfs/ports/x11/XFree86-4/Makefile) while it should have been just Makefile. The rules in question live in /usr/ports/Mk/bsd.port.mk and there we see that the variable MAKEFILE is used to allow ports to define a different name for the makefile. Unfortunately, MAKEFILE is also a variable set by make(1) itself when it's done a chdir(2) and needs to locate the makefile. The following comment comes from /usr/src/usr.bin/make/main.c: /* * set the MAKEFILE variable desired by System V fans -- the * placement of the setting here means it gets set to the last * makefile specified, as it is set by SysV make. */ Houston, we have a problem! Renaming the MAKEFILE variable in /usr/ports/Mk/bsd.port.mk to, for example, MAKE_FILE solves the problem. See diffs below. Such a change would have an impact though. There are currently 291 ports that define MAKEFILE and they need to be changed as well. I spare you the list of ports. You can easily find that yourself by grepping for MAKEFILE in all the makefiles. FYI, Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.378 diff -u -r1.378 bsd.port.mk --- bsd.port.mk 31 Aug 2001 02:13:02 -0000 1.378 +++ bsd.port.mk 5 Sep 2001 01:31:29 -0000 @@ -943,7 +943,7 @@ MD5_FILE?= ${MASTERDIR}/distinfo MAKE_FLAGS?= -f -MAKEFILE?= Makefile +MAKE_FILE?= Makefile MAKE_ENV+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" LIBDIR="${LIBDIR}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" .if ${OSVERSION} < 500016 @@ -1831,9 +1831,9 @@ .if !target(do-build) do-build: .if defined(USE_GMAKE) - @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET}) + @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKE_FILE} ${MAKE_ARGS} ${ALL_TARGET}) .else - @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET}) + @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKE_FILE} ${MAKE_ARGS} ${ALL_TARGET}) .endif .endif @@ -1842,14 +1842,14 @@ .if !target(do-install) do-install: .if defined(USE_GMAKE) - @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) + @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKE_FILE} ${MAKE_ARGS} ${INSTALL_TARGET}) .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES) - @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man) + @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKE_FILE} ${MAKE_ARGS} install.man) .endif .else defined(USE_GMAKE) - @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) + @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKE_FILE} ${MAKE_ARGS} ${INSTALL_TARGET}) .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES) - @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man) + @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKE_FILE} ${MAKE_ARGS} install.man) -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010904201921.A76421>