Ok, it doesn't mention how to do this in the user guide. It doesn't say how to do this in the FAQ. It doesn't say how to do it on the website's how-to-contribute page. It doesn't say how to do this in the sources. I've searched at google. I've searched at the list archive. And the GNU standard method (CFLAGS='-g -O0' ../src/configure) doesn't work.
I found a post on the mailing list that suggests that you have to set *three* environment variables, CFLAGS, CXXFLAGS, and LDFLAGS. I tried it and it didn't quite work properly. My build logs are full of stuff like... make "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-O2 -g -O0" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=-O2 -g -O0" "LDFLAGS=" "LIBCFLAGS=-O2 -g -O0" "LIBCFLAGS_FOR_TARGET=-O2 -g -O0" "MAKE=make" "MAKEINFO=makeinfo --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/sh" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/usr/build/install" "infodir=/usr/build/install/info" "libdir=/usr/build/install/lib" "prefix=/usr/build/install" "tooldir=/usr/build/install/i686-pc-cygwin" "top_toollibdir=/usr/build/install/i686-pc-cygwin/lib" "AR=ar" "AS=as" "CC=gcc -L/usr/build/obj/i686-pc-cygwin/winsup -L/usr/build/obj/i686-pc-cygwin/winsup/cygwin -L/usr/build/obj/i686-pc-cygwin/winsup/w32api/lib -isystem /usr/build/src/winsup/include -isystem /usr/build/src/winsup/cygwin/include -isystem /usr/build/src/winsup/w32api/include -B/usr/build/obj/i686-pc-cygwin/newlib/ -isystem /usr/build/obj/i686-pc-cygwin/newlib/targ-include -isystem /usr/build/src/newlib/libc/include -L/usr/build/obj/ld" "LD=/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/bin/ld. exe" "LIBCFLAGS=-O2 -g -O0" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" all-recursive ...where you'll see that my flags have been combined with -O2 from somewhere else. Now this may well work, as the -O0 is after the -O2 on the command line, and probably overrides it, but it seems a little risky in general, and I suspect this isn't the correct way to do it, since the optimisation settings seem to be held elsewhere and combined with the CFLAGS at a late stage, and it's that somewhere-else that I really ought to be setting. So my questions are: How is this supposed to be done, where is it actually documented, and why not? Or have I just missed something in my searches? cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/