Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 May 2006 19:45:30 -0300
From:      Fernan Aguero <fernan@iib.unsam.edu.ar>
To:        Florent Thoumie <flz@xbsd.org>
Cc:        Sideris Michael <msid@daemons.gr>, Jeremy Chadwick <freebsd@jdc.parodius.com>, Ulrich Spoerlein <uspoerlein@gmail.com>, freebsd-ports@freebsd.org
Subject:   Re: ports structure and improvement suggestions
Message-ID:  <20060511224530.GD80660@iib.unsam.edu.ar>
In-Reply-To: <1147246256.29638.20.camel@localhost>
References:  <20060508200926.GA6005@daemons.gr> <20060509061026.GA14039@pentarou.parodius.com> <20060509111435.GA1228@roadrunner.aventurien.local> <1147183253.4810.38.camel@mayday.esat.net> <20060509212049.GE1733@iib.unsam.edu.ar> <1147206782.29638.14.camel@localhost> <20060510003921.GA2074@iib.unsam.edu.ar> <1147246256.29638.20.camel@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
+----[ Florent Thoumie <flz@xbsd.org> (10.May.2006 06:01):
|
| On Tue, 2006-05-09 at 21:39 -0300, Fernan Aguero wrote:
| 
| > Florent,
| > 
| > thanks now for a fast turnaround :)
| > 
| > unfortunately, this doesn't work. 
| > 
| > For all ports above it works, except for x11/xterm.
| > 
| > The problem seems to be the space within the quoted value:
| > the following works:
| > x11/xterm: CONFIGURE_ARGS='--enable-me'
| > but this doesn't:
| > x11/xterm: CONFIGURE_ARGS='--enable-me --and-me'
| 
| True, refetch the script and replace make.conf lines with these:
| 
| .if ${.CURDIR:N/usr/ports/*}==""
| _MKCONF!=mkconf
| .for i in ${_MKCONF:S/|/ /g}
| ${i:S/%/ /g}
| .endfor
| .endif
|
+----]

Florent, sorry for the delay in replying. Your fixes helped,
but there's something strange going on here ... in some
cases the first argument of CONFIGURE_ARGS gets truncated.

This is not related to your
make.conf/mkconf/ports.conf trick, but to something else ...
however this only happens when the values come from
/etc/make.conf ... maybe this message doesn't belong in this
thread anymore and I should be sending a PR about it.

However, what happens is so weird that I'm still thinking
about it ... details follow (sorry for the long post).

Fernan

Setup: 
o latest mkconf (echo ${_line#*:} | tr ' ' '%')

o ports.conf
  category/port: WITH_XYZ="1"
  category/port: WITH_XYZ="1"|WITH_ABC="1"
  x11/xterm: CONFIGURE_ARGS="--enable-256-color --enable-tcap-query"

o /etc/make.conf with variable substitution as above
  ( ${_MKCONF:S/|/ /g}, ${i:S/%/ /g})


The tests:
# pwd
/usr/ports/x11/xterm
# mkconf
CONFIGURE_ARGS="--enable-256-color%--enable-tcap-query"
# make clean
===> Cleaning for ...
===> Cleaning for ..
...
[works!]
# make configure
===>  Configuring for xterm-213
configure: error: invalid feature name: 256-color --enable-tcap-query
===>  Script "configure" failed unexpectedly.

So the '--enable-256-color' got somehow truncated ...

I added a post-extract target to x11/xterm:

post-extract:
        @${ECHO_CMD} ${CONFIGURE_ARGS}


and now when I run 'make clean && make configure' again, it's
clear that CONFIGURE_ARGS contains the expected:
===>  Extracting for xterm-213
=> MD5 Checksum OK for xterm-213.tgz.
=> SHA256 Checksum OK for xterm-213.tgz.
--enable-256-color --enable-tcap-query --enable-wide-chars 
--enable-luit --with-utempter --enable-narrowproto 
--x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include 
--prefix=/usr/X11R6 --build=i386-portbld-freebsd6.0

that is: the values set in make.conf and those added by the
port. So clearly, there's no 256-color feature being passed
to configure, but the correct '--enable-256-color'

So, who's truncating the feature name? Clearly it's not
mkconf nor your variable substitutions taking place in
/etc/make.conf ...

However, if I comment out all code for this hack from
/etc/make.conf and run this on the command line on
x11/xterm:

make configure CONFIGURE_ARGS+="--enable-256-color --enable-tcap-query"

configure goes along happily (--enable-256-color is not being
truncated) and correctly echoes: 
checking if you want 256 colors... yes

But if I add this line alone to /etc/make.conf
CONFIGURE_ARGS="--enable-256-color --disable-bold-color --enable-tcap-query"
truncation happens again.

So this makes a compelling case for something weird going on
with /etc/make.conf (just so you can see there's nothing
weird with mine, it's here:
http://genoma.unsam.edu.ar/~fernan/freebsd/make.conf)


It's also difficult to get an idea of how/why things are
being truncated. What is sure is that only the first arg in
CONFIGURE_ARGS gets truncated. But, the truncation doesn't
occur in these cases (lines from ports.conf):
x11/xterm: CONFIGURE_ARGS="-V"
x11/xterm: CONFIGURE_ARGS="--version"
x11/xterm: CONFIGURE_ARGS="-h"
x11/xterm: CONFIGURE_ARGS="--help"
x11/xterm: CONFIGURE_ARGS="--with-pcre"
x11/xterm: CONFIGURE_ARGS="--enable-256-color"

while in these cases configure fails, but the arg is not
truncated:
x11/xterm: CONFIGURE_ARGS="-V --enable-256-color"
x11/xterm: CONFIGURE_ARGS="--version --enable-256-color"
x11/xterm: CONFIGURE_ARGS="-h --enable-256-color"
x11/xterm: CONFIGURE_ARGS="--help --enable-256-color"
x11/xterm: CONFIGURE_ARGS="--yada-yada --enable-256-color"

and in these cases, configure fails and the arg IS
truncated:
x11/xterm: CONFIGURE_ARGS="--with-pcre --enable-256-color"
gets truncated to 'pcre --enable-256-color'
x11/xterm: CONFIGURE_ARGS="--enable-256-color --enable-tcap-query"
gets truncated to '256-color --enable-tcap-query'

(but why didn't --yada-yada get truncated? seems like only
--enable-x and --disable-x are truncated, but only if they
are the first configure arg, and if they're followed by
something else).

Finally, it happens with other ports also:
math/gnuplot: CONFIGURE_ARGS="--enable-datastrings --enable-histograms"
will truncate '--enable-datastrings' to 'datastrings'

[modified math/gnuplot to do CONFIGURE_ARGS+= instead of CONFIGURE_ARGS=]

Strange brew ... anyone has a clue? 

Fernan

PS: this is on FreeBSD-6.0p6 (latest cvsup was yesterday, so
/usr/ports/Mk is up to date)

my make.conf and ports.conf files
http://genoma.unsam.edu.ar/~fernan/freebsd/make.conf
http://genoma.unsam.edu.ar/~fernan/freebsd/ports.conf



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060511224530.GD80660>