Ah. AC_PROG_CC adds -g to CFLAGS unless CFLAGS is already set. I don't set it explicitly, but configure sets it from $with_cflags before invoking AC_PROG_CC. I'd expected it to work the same as with the stuff configure does only when $cflags_is_set = "no", since --with-cflags is used to provide "_extra_ c compiler flags".