port breakage with recent make
Ruslan Ermilov
ru at FreeBSD.org
Mon Aug 23 01:10:29 PDT 2004
On Sat, Aug 21, 2004 at 05:45:42AM +0200, Michael Nottebrock wrote:
> science/hdf breaks with the latest make(1). What it does seems innocent
> enough: It passes PREFIX via MAKE_ARGS to the main Makefile (MAKE_ARGS=
> PREFIX="${PREFIX}") and the main Makefile has:
>
> LIBDIR ?= ${PREFIX}/lib
> BINDIR ?= ${PREFIX}/bin
>
> .MAKEFLAGS: PREFIX=${PREFIX} LIBDIR=${LIBDIR} BINDIR=${BINDIR}
>
> It does some more redefinitions of LIBDIR and BINDIR (with references to
> PREFIX ...) in Makefiles further down (the ports seems to replace the
> autotools Makefiles rather completely with custom-made ones), but there's
> nothing that looks like it should undefine or change PREFIX. Is the port
> wrong or make?
>
Recent make(1) just exposed a bug in a port. Here's what happens here.
bsd.port.mk passes LIBDIR=/usr/lib in environment:
: (cd /usr/ports/science/hdf/work/HDF4.1r5 && \
: /usr/bin/env SHELL=/bin/sh PORTOBJFORMAT=elf \
: PREFIX=/usr/local LOCALBASE=/usr/local X11BASE=/usr/X11R6 \
: MOTIFLIB="-L/usr/X11R6/lib -lXm -lXp" \
: LIBDIR="/usr/lib" \
: CFLAGS="-O -pipe " \
: CXXFLAGS=" -O -pipe " \
: MANPREFIX="/usr/local" \
: 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 Makefile PREFIX="/usr/local" -j 2 install)
Port's makefile does this:
: # cat /usr/ports/science/hdf/files/Makefile
: # $FreeBSD: ports/science/hdf/files/Makefile,v 1.1 1999/11/14 02:32:03 steve Exp $
:
: SUBDIR = hdf mfhdf man
: #PREFIX ?= /usr/local
: LIBDIR ?= ${PREFIX}/lib
: BINDIR ?= ${PREFIX}/bin
:
: .MAKEFLAGS: PREFIX=${PREFIX} LIBDIR=${LIBDIR} BINDIR=${BINDIR}
:
: test: all
: # testing in hdf
: @cd hdf && ${MAKE} hdf-test
: # testing in mfhdf
: @cd mfhdf && ${MAKE} test
:
: .include <bsd.subdir.mk>
So, Makefile sees /usr/lib and passes it as a command-line variable
(using .MAKEFLAGS), as requested. Old make(1) was buggy and did not
pass this variable as a command-line variable. New make(1) does
the required thing, so LIBDIR ends up being set to /usr/lib.
The fix is trivial:
%%%
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/science/hdf/files/Makefile,v
retrieving revision 1.1
diff -u -r1.1 Makefile
--- Makefile 14 Nov 1999 02:32:03 -0000 1.1
+++ Makefile 23 Aug 2004 08:08:00 -0000
@@ -2,8 +2,8 @@
SUBDIR = hdf mfhdf man
#PREFIX ?= /usr/local
-LIBDIR ?= ${PREFIX}/lib
-BINDIR ?= ${PREFIX}/bin
+LIBDIR = ${PREFIX}/lib
+BINDIR = ${PREFIX}/bin
.MAKEFLAGS: PREFIX=${PREFIX} LIBDIR=${LIBDIR} BINDIR=${BINDIR}
%%%
Feel free to commit it.
Cheers,
--
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20040823/837794d1/attachment.bin
More information about the freebsd-current
mailing list