|
From: Nicholas N. <nj...@ca...> - 2003-09-03 09:44:09
|
Hi,
I have an automake-related question. We have some C++ test files in the
test suite, memcheck/tests/{mismatches.cpp,new_override.cpp}. Even though
we have these lines in memcheck/tests/Makefile.am:
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g
AM_CXXFLAGS = $(AM_CFLAGS)
the C++ files are not being compiled with the AM_CFLAGS, viz:
[~/grind/annelid/memcheck/tests] make mismatches
g++ -Winline -Wall -Wshadow -g -g -O2 -o mismatches mismatches.o
The -O2 flag is applied here, when it shouldn't be. I want to add some
more tests, and the -O2 flag causes their output to change and thus not
work.
The problem is that the make variable $(CXXFLAGS) is being set somehow
during the configuration process to "-g -O2". If I set the environment
variable $CXXFLAGS to empty before running ./configure, then $(CXXFLAGS)
is also empty and that fixes my problem. But this doesn't seem the right
way to do it, because I want to ensure for everyone that these test files
aren't built with -O2; you shouldn't have to fiddle with environment
variables for the test suite to work properly. I think I could set
CXXFLAGS in the top level Makefile.am, but I thought you weren't supposed
to do that, and that's what AM_CXXFLAGS is for.
Does anyone know how to fix this? I'm using GNU automake 1.6.3.
Thanks.
N
|