How to make INSTALLS_DEPENDS?

YONETANI Tomokazu qhwt+dfly at les.ath.cx
Mon Apr 4 19:18:13 PDT 2005


On Mon, Apr 04, 2005 at 12:07:26PM -0700, Max Okumoto wrote:
> YONETANI Tomokazu wrote:
> >On Mon, Apr 04, 2005 at 05:52:05AM -0700, Max Okumoto wrote:
> >
> >>And it looks like its something in .MAKEFLAGS
> >>something is inserting a space in "-D INSTALL_DEPENDS"
> >
> >
> >It happens on FreeBSD too so it should be OK. The biggest difference
> >is how make command in DragonFly parses MAKEFLAGS:
> >
> >[FreeBSD]
> >$ env MAKEFLAGS='FOO= -D BAR' make
> >make: no target to make.
> >
> >[DragonFly]
> >$ env MAKEFLAGS='FOO= -D BAR' make
> >make: don't know how to make BAR. Stop
> 
> Sorry wasn't clear.

It's clear; BAR treated as make target in DragonFly whereas
a varible name in FreeBSD.

> MAKEFLAGS contains the folllowing which is the error.
> 
> ARCH=i386 OPSYS=FreeBSD OSREL=4.8 OSVERSION=480102 PORTOBJFORMAT=elf 
> SYSTEMVERSION= -D INSTALLS_DEPENDS ARCH=i386 OPSYS=FreeBSD OSREL=4.8 
> OSVERSION=480102 PORTOBJFORMAT=elf SYSTEMVERSION

> As you can see, ARCH and some other variables are assigned twice, and
> "-D INSTALLS_DEPENDS" has a space between the D and the I.

As for duplicated assignment, do you have a customized .mk files in
/usr/share/mk or /usr/ports/Mk? I don't see it here.

> Something is inserting a space between the -D and INSTALL_DEPENDS.
> 
> It should be -DINSTALL_DEPENDS

That hasn't been a problem since at least 4.9-RELEASE.
What changed how MAKEFLAGS gets parsed is this commit:

http://www.dragonflybsd.org/cvsweb/src/lib/libc/stdlib/getopt.c.diff?r1=1.3&r2=1.4&f=u

What's affected in make command is at the tail of the function
MainParseArgs(). When it sees a flag in the "rest of the arguments",
it sets optind to 0 and re-enter the getopt() loop. After that commit,
setting optind to 0 is no different than setting it to 1 because getopt()
sets it to 1 anyway.





More information about the Users mailing list