pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Pkgsrc fails to use system compiler if locale is set



* On 2012-07-17 at 08:53 BST, David Holland wrote:

> On Mon, Jul 16, 2012 at 08:44:58PM +0100, Jonathan Perkin wrote:
>  > Index: gcc.mk
>  > ===================================================================
>  > RCS file: /cvsroot/pkgsrc/mk/compiler/gcc.mk,v
>  > retrieving revision 1.124
>  > diff -u -r1.124 gcc.mk
>  > --- gcc.mk 13 Jul 2012 16:11:29 -0000      1.124
>  > +++ gcc.mk 16 Jul 2012 19:42:32 -0000
>  > @@ -144,17 +144,8 @@
>  >  .endif
>  >  
>  >  .if !defined(_GCC_VERSION)
>  > -# FIXME: ALL_ENV is not set at this point, so LC_ALL must be set
>  > -# explicitly. In the show-all and show-var targets, it appears
>  > -# nevertheless because "References to undefined variables are not
>  > -# expanded" when using the := operator.
>  > -.  if defined(SETENV)
>  >  _GCC_VERSION_STRING!=     \
>  > -  ( ${PKGSRC_SETENV} ${ALL_ENV} LC_ALL=C ${_CC} -v 2>&1 | ${GREP} 'gcc 
> version') 2>/dev/null || ${ECHO} 0
>  > -.  else
>  > -_GCC_VERSION_STRING!=     \
>  > -  ( ${_CC} -v 2>&1 | ${GREP} 'gcc version') 2>/dev/null || ${ECHO} 0
>  > -.  endif
>  > +  ( env LC_ALL=C ${_CC} -v 2>&1 | ${GREP} 'gcc version') 2>/dev/null || 
> ${ECHO} 0
>  >  .  if !empty(_GCC_VERSION_STRING:Megcs*)
>  >  _GCC_VERSION=     2.8.1           # egcs is considered to be gcc-2.8.1.
>  >  .  elif !empty(_GCC_VERSION_STRING:Mgcc*)
> 
> Shouldn't that still use ${PKGSRC_SETENV}?

No, the problem is that SETENV isn't set up at that point, so all
using PKGSRC_SETENV will result in is users who have:

  PKGSRC_SETENV= ${SETENV} -i

in their mk.conf getting "-i: not found" or similar - actually, they
won't, because it'll get sent to /dev/null and the reason gcc isn't
being found on their system will become even more obscure.

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com


Home | Main Index | Thread Index | Old Index