autoconf
[Top][All Lists]
Advanced

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

Re: configure sets CFLAGS or how to disable default CFLAGS='-g -O2' for


From: Ed Hartnett
Subject: Re: configure sets CFLAGS or how to disable default CFLAGS='-g -O2' for gcc?
Date: Sat, 08 Apr 2006 12:14:23 -0600
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Ralf Corsepius <address@hidden> writes:

> The problem is: all Ed does is in his snippet (From his earlier mail) is:
>
>> AC_MSG_CHECKING([whether configure should try to set CFLAGS])
>> if test "x${CFLAGS+set}" = xset; then
>>    enable_cflags_setting=no
>> else
>>    enable_cflags_setting=yes
>> fi
>> AC_MSG_RESULT($enable_cflags_setting)
>> 
>> then later...
>> 
>>         test "x$enable_cflags_setting" = xyes && CFLAGS="$CFLAGS -q64"
>
> I.e. he adds -q64 to CFLAGS if the user doesn't specify CFLAGS.

Nah, I just cut out the rest of the code. That CFLAGS setting only
happens on one platform, when using the native compiler. (I forget
which one).

>
> This is problematic, because he doesn't
> 1. Check if the compiler supports -q64
> 2. Doesn't check if -q64 actually does what he wants it to do.

This is true. If the vendor makes sudden changes in how their compiler
works, then my configure script will not work correctly. In practice
this is rare, and just puts the user back in charge of the flags, so
nothing is lost by trying to set flags for users in cases where it can
work.

In any case, all that only happens if the user specifies
--enable-64bit on the configure command line, which leads my configure
script to turn on the correct flags for AIX, Irix, and Sun
platforms. (On other platforms it does nothing.)

As I've said, it's an imperfect solution, but, given that we have no
support staff, and our main support question was always something
like:

"How do I build netCDF in 64-bit mode with a PathScale compiler."

So I set the flags.

It would be better to tear apart cfortran.h (which is a third party
tool used to wrap C functions in fortran), and make it feature based
instead of platform based. But that is a huge job I just can't
handle given other commitments.

>
> -q64 might do what he wants on those platforms he uses as development
> environment, but that's it:
> * Compilers might not support -q64.
> * -q64 might have different meanings for different compilers.
> * -q64 could have different meanings for different architectures.
>
> This will cause errors when building his package.
>

Yep.

Ed
-- 
Ed Hartnett  -- address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]