Hi Monty, On 6/10/2010 11:42 AM, Monty Taylor wrote: > Hey all, > > Potentially odd question... > > How would I accomplish something like what's in the subject? I have a > source file that wants to be built before other files - so including it > in BUILT_SOURCES does the right thing, but I do _not_ want to have it > included in the dist tarball. > > Files listed in BUILT_SOURCES are not taken into account wrt distribution. The distribution list is built from other primary-like constructs, such as *_SOURCES. The example in the autoconf manual shows how you would do what you want: ... nodist_foo_SOURCES = bindir.h BUILT_SOURCES = bindir.h ... In this example, BUILT_SOURCES is used only to get bindir.h built up front. The actual SOURCES variable used to list its use by a particular product carries the nodist prefix, which keeps it from being distributed. I tried removing it from BUILT_SOURCES and adding in a rule that looks like: > %.cc: drizzled/configmake.h > > But that didn't work. > > Any thoughts? > > While we're at it - this whole thing is to get expanded values of > autoconf directories into a header file where I can consume them... > which because they contain nested variables > (localstatedir=${prefix}/var}) I seemingly have to do at make time. The > dist problem above could be solved if anybody knows a decent trick to > fully expand those variables at configure time... I've tried many > combinations of eval and quoting - but nothing seems to do what I'm > trying to do. > You can't (or rather shouldn't) fully expand these variables at configure time because they may be modified at make time by the user on the make command line (e.g., make prefix=xxx). There are two widely-practiced options: 1. Replace such variables on the compiler command line for all or some sources: mylib_la_CPPFLAGS =\ -DSYSCONFDIR=\"$(sysconfdir)\"\ -DSYSLOGDIR=\"$(syslogdir)\" ... This works well for situations where you only have a few variables to replace. 2. Add some custom rules to your Makefile.am scripts that build your source files using variable replacement techniques like those used by Autoconf: EXTRA_DIST = myprog.cfg.in edit = sed \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@sysrundir[@]|$(sysrundir)|g' \ -e 's|@syslogdir[@]|$(syslogdir)|g' \ -e 's|@libexecdir[@]|$(libexecdir)|g' \ -e 's|@sbindir[@]|$(sbindir)|g'\ -e 's|@prefix[@]|$(prefix)|g' all: myprog.cfg # Build executable scripts myprog.cfg : Makefile $(edit) '$(srcdir)/$@.in' > $@ Then just format your input templates just like autoconf input templates with @variable@ where ever you want variable replacement to occur at make time. Regards, John _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf