[Openal-devel] How to set CFLAGS for specific files?

Sven Panne sven.panne at aedion.de
Fri Oct 27 00:22:01 PDT 2006


Am Freitag, 27. Oktober 2006 07:31 schrieb Prakash Punnoor:
> I changed the SIMD enabling routines in CMake to make it possible to
> generate portable code with gcc. For that it was needed that the SIMD
> CFLAGS only get applied to the c source files which contain SIMD and not to
> the rest of the source files. Because otherwise (esp with SSE2) gcc could
> emit SSE code for float maths...  Now I want to do the same for the
> autotools project, but I don't know an easy way. Any advise?

The relevant documentation is here: 
http://sources.redhat.com/automake/automake.html#Program-and-Library-Variables

In a nutshell: If you want special CFLAGS for foo.c, add

   foo_CFLAGS = -my -special -CFLAGS

to the Makefile.am in question. Note that the global AM_CFLAGS are not used in 
this case, so depending on what you want to achieve, you'd better use

   foo_CFLAGS = $(AM_CFLAGS) -my -special -CFLAGS

Just a small remark: src/arch/i386/Makefile.am looks a little bit complicated, 
why e.g. are the COMPILE/LTCOMPILE/CCLD/LINK definitions necessary?

Cheers,
   S.


More information about the Openal-devel mailing list