Robert Bradshaw wrote:
> On Oct 6, 2009, at 3:12 AM, Dr. David Kirkby wrote:

>> Hence it's probably safer to have each spkg-install start with
>>
>> CFLAGS=$SAGE64_CFLAG
>>
>> and add others as needed.
>>
>> This would not be an issue if someone write
>>
>> ./configure CFLAGS="$CFLAGS -foobar"
>>
>> as the environment variable CFLAGS would not be corrupted. But I think
>> in some cases it may be necessary to export CFLAGS, in which case
>> relying on anything being there might be unwise.
> 
> Is there not a way to invoke a bash script in such a way that it  
> can't change the invoking environment? 

I do not know of one. Perhaps there is.

> Alternatively, we should just  
> set everything fresh between each spkg-install. 

I would have thought if CFLAGS was cleared in each package, then 
appended to when needed.

i.e.

# Clear CFLAGS
CFLAGS=""

# Add an option such as -m64 when building 64-bit code,
# but will not hard-code -m64, as not all compilers use this.
if [ $SAGE64="yes" ]; then
   CFLAGS="$CFLAGS $SAGE64_CFLAG"
fi

# Create position independent code only on OS X. For GNU compilers
# this will mean adding -fPIC, but this can not be assumed.

if [ `unsame` = "Darwin" ] ; then
   CFLAGS="$CFLAGS -$FPIC_FLAG"
fi


It's certainly possible that some packages might have their own ways of 
configuring for 64-bit, and those do *not* include the use of adding 
-m64. Some for example want the ABI set to 64, and will use that 
information to set their own flags.

> These kinds of  
> options seem to be exactly what the CFLAGS environment variable is  
> for. It will also increase the likelyhood of upstream makefiles just  
> working, or getting fixed makefiles upstream.
> 
> - Robert

Dave


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to