Hi Ed, * Ed Hartnett wrote on Fri, Nov 04, 2005 at 02:57:44PM CET: > > Is there any way to set an automake variable in the top-level automake > file? (That is, the file which contains SUBDIRS = ...) > > I find myself setting AM_CFLAGS=-g in many subdirectories. Also I am > setting AM_LDFLAGS everywhere to point to a library directory that the > user can specify at configure time. > > Surely there is an easier way?
Why not just put AC_SUBST([AM_CFLAGS], [-g]) in configure.ac? Automake will end put in all Makefile.in's AM_CFLAGS = @AM_CFLAGS@ then and configure will substitute @AM_FLAGS@ with -g then. Note though that many compilers cannot mix -g and optimization options; you should allow the user the override with CFLAGS without breaking this. Cheers, Ralf