Sunday, March 13, 2011

Adventures in CFLAGS

For those who don't know what CFLAGS is, it is a variable in Makefile, that is the file that appears in every directory of your program that lists the flags gcc uses, such as -Wall or -g . In this case, I want the debugger flag -g, but unfortunetly, I have to go and edit the 25-30 or so different Makefiles by hand to change the CFLAGS. I figure there has to be a better way to get the debugger to work, but every time I run ./configure even when I try to change the enviroment variable by adding something like ./configure $CFLAGS = "-g" or something, it doesn't work. I tried it forwards, backwards, with export, and still the configure keeps giving me the same makefiles with nothing added for the CFLAGS. I'm going to read through the entire autoconf and automake file. I've already been looking through them trying to understand what the various macros do in the configure.ac, I'm still not 100% sure what all those different configure files do yet. I'll probably have to run autotools and rebuild the configure again. I was hoping there would be some simple command line thing I could do, but for some reason this does not appear to be the case. I've also heard about changing enviroment variables, but I have no idea how to do that.

No comments: