On Wed, 18 May 2005 21:31:22 -0600, archaic wrote:

> Moved the LDFLAGS option from the configure command to the make command as 
> libm wasn't being properly pulled into the environment.
> 
> Modified: trunk/BOOK/general/sysutils/gpm.xml
> ===================================================================
> --- trunk/BOOK/general/sysutils/gpm.xml       2005-05-18 21:13:28 UTC (rev 
> 4363)
> +++ trunk/BOOK/general/sysutils/gpm.xml       2005-05-19 03:31:21 UTC (rev 
> 4364)
> @@ -82,8 +82,8 @@
>  
>  <screen><userinput>patch -Np1 -i ../gpm-&gpm-version;-segfault-1.patch 
> &amp;&amp;
>  patch -Np1 -i ../gpm-&gpm-version;-silent-1.patch &amp;&amp;
> -LDFLAGS="-lm" ./configure --prefix=/usr --sysconfdir=/etc &amp;&amp;
> -make</userinput></screen>
> +./configure --prefix=/usr --sysconfdir=/etc &amp;&amp;
> +LDFLAGS="-lm" make</userinput></screen>

The above is not robust. What happens if the user already has other stuff
in their LDFLAGS? You've just clobbered them. Bad.

A useful technique in overcoming this problem is to take advantage of
`make's variable handling, in particular, the append operator. Instead of
letting `make' inherit the shell environment (like you're doing
above), place the variable directly under `make's control by
putting LDFLAGS after `make' on the command line. Something like this will
do the right thing in all circumstances ie: whether the user has
specified their own LDFLAGS or not:

  make LDFLAGS+="-s"

Note the use of `+=' ie: the append operator.

Regards
Greg
--
http://www.diy-linux.org/

-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to