<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.26.0">
</HEAD>
<BODY>
On Fri, 2010-12-03 at 05:59 -0800, Dan Nicholson wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
<TT><FONT COLOR="#737373">> + CC C compiler command</FONT></TT><BR>
<TT><FONT COLOR="#737373">> + CFLAGS C compiler flags</FONT></TT><BR>
<TT><FONT COLOR="#737373">> + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a</FONT></TT><BR>
<TT><FONT COLOR="#737373">> + nonstandard directory <lib dir></FONT></TT><BR>
<TT><FONT COLOR="#737373">> + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if</FONT></TT><BR>
<TT><FONT COLOR="#737373">> + you have headers in a nonstandard directory <include dir></FONT></TT><BR>
<TT><FONT COLOR="#737373">> + CPP C preprocessor</FONT></TT><BR>
<TT><FONT COLOR="#737373">> CONFFLAGS: additional flags to pass to all configure scripts</FONT></TT><BR>
<TT><FONT COLOR="#737373">> CONFCFLAGS: additional compile flags to pass to all configure scripts</FONT></TT><BR>
<TT><FONT COLOR="#737373">> MAKEFLAGS: additional flags to pass to all make invocations</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#1a1a1a">If we're picking these up from the environment, then why do we need to</FONT></TT><BR>
<TT><FONT COLOR="#1a1a1a">pass them to configure?</FONT></TT><BR>
</BLOCKQUOTE>
I struggled with this question as I noticed it in the current implementation.<BR>
<BR>
I vaguely recall Automake recommending specifying it on the command line, though they make every effort to ensure it works properly.<BR>
<BR>
It makes it clearer at the top of config.log:
<PRE>
$ ./configure --prefix /home/nadon/xorg/src CFLAGS=-g3
</PRE>
The requirement comes from Timothy Meade. He is building X for an arm processor, so I thought it would perhaps be better in a cross-compile scenario which I don't fully understand.<BR>
<BR>
I could not find any reason for not including it on the command line.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<BR>
<TT><FONT COLOR="#737373">> @@ -348,7 +355,14 @@ process() {</FONT></TT><BR>
<TT><FONT COLOR="#737373">> if [ $needs_config -eq 1 ] || [ X"$NOAUTOGEN" = X ]; then</FONT></TT><BR>
<TT><FONT COLOR="#737373">> sh ${DIR_CONFIG}/${CONFCMD} --prefix=${PREFIX} ${LIB_FLAGS} \</FONT></TT><BR>
<TT><FONT COLOR="#737373">> ${QUIET:+--quiet} \</FONT></TT><BR>
<TT><FONT COLOR="#737373">> - ${CACHE:+--cache-file=}${CACHE} ${CONFFLAGS} "$CONFCFLAGS"</FONT></TT><BR>
<TT><FONT COLOR="#737373">> + ${CACHE:+--cache-file=}${CACHE} \</FONT></TT><BR>
<TT><FONT COLOR="#737373">> + ${CONFFLAGS} \</FONT></TT><BR>
<TT><FONT COLOR="#737373">> + ${CC:+CC=}${CC} \</FONT></TT><BR>
<TT><FONT COLOR="#737373">> + ${CPP:+CPP=}${CPP} \</FONT></TT><BR>
<TT><FONT COLOR="#737373">> + "${CPPFLAGS:+CPPFLAGS=}${CPPFLAGS}" \</FONT></TT><BR>
<TT><FONT COLOR="#737373">> + "${CFLAGS:+CFLAGS=}${CFLAGS}" \</FONT></TT><BR>
<TT><FONT COLOR="#737373">> + "${LDFLAGS:+LDFLAGS=}${LDFLAGS}" \</FONT></TT><BR>
<TT><FONT COLOR="#737373">> + "$CONFCFLAGS"</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#1a1a1a">Should CC and CPP not be quoted? It's quite common that people want to</FONT></TT><BR>
<TT><FONT COLOR="#1a1a1a">run CC="gcc -m32". Also, I'm not sure I understand why the brace</FONT></TT><BR>
<TT><FONT COLOR="#1a1a1a">expansion is used like this. Typically people keep the whole</FONT></TT><BR>
<TT><FONT COLOR="#1a1a1a">expression inside the braces:</FONT></TT><BR>
<BR>
<TT><FONT COLOR="#1a1a1a">${CFLAGS:+CFLAGS="$CFLAGS"}</FONT></TT><BR>
</BLOCKQUOTE>
I spent some quality time in quoting hell. I tested CFLAGS with "-g3 -O0" but I assumed CC and CPP would be a single word which is wrong. So I'll fix this.<BR>
<BLOCKQUOTE TYPE=CITE>
<BR>
<TT><FONT COLOR="#1a1a1a">The way the quoting is being used now, you'll end up with a bunch of</FONT></TT><BR>
<TT><FONT COLOR="#1a1a1a">empty arguments to configure. E.g., if LDFLAGS is empty, the whole</FONT></TT><BR>
<TT><FONT COLOR="#1a1a1a">expression will expand to "".</FONT></TT><BR>
</BLOCKQUOTE>
I will try this out. I followed the existing "$CONFCFLAGS" pattern<BR>
<BLOCKQUOTE TYPE=CITE>
<BR>
<TT><FONT COLOR="#1a1a1a">Sorry to ask one more question, but doesn't CFLAGS conflict with CONFCFLAGS?</FONT></TT><BR>
<BR>
</BLOCKQUOTE>
Yes it does, that's why it is removed from the public user interface in the next patch.<BR>
<BR>
The core role of build.sh is simply to invoke ./configure on a large number of packages. Along the way more and more options, flags or what not have been added to build.sh for propagation to all packages. The script has grown its own "proprietary" interface which the user has to map to the autoconf interface. This patch attempts to replace this proprietary interface with the autoconf package interface so the user does not have to learn 2 interfaces.<BR>
<BR>
I appreciate very much your review.<BR>
<BR>
<BR>
<BR>
<BR>
</BODY>
</HTML>