autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

recording flags specified to configure scripts


From: Mike Frysinger
Subject: recording flags specified to configure scripts
Date: Tue, 10 Mar 2009 02:01:49 -0500
User-agent: KMail/1.11.1 (Linux/2.6.28; KDE/4.2.1; x86_64; ; )

i like to record the flags used when running `./configure` to be shown when 
running --version info with programs.  yes, i'm aware of option quoting issues 
and env vars not being saved and all those other fun details, but those are 
irrelevant to me.  vast majority of the time, the configure flags get me 100% 
of the way.

originally i tried the obvious -- save $* before calling any autoconf code.  
unfortunately, autoconf seems to outright delete all shell code before AC_INIT 
(probably due to the m4 language), so that didnt work.
$ cat configure.ac
saved_conf_opts="$*"
AC_PREREQ([2.61])
AC_INIT(.........)
...
AC_DEFINE_UNQUOTED([SAVED_CONF_OPTS], ["${saved_conf_opts}"], [blah])
...

so then the next step was to save it right after AC_INIT is called.  in most 
cases, this works as expected.
$ cat configure.ac
AC_PREREQ([2.61])
AC_INIT(.........)
saved_conf_opts="$*"
...
AC_DEFINE_UNQUOTED([SAVED_CONF_OPTS], ["${saved_conf_opts}"], [blah])
...

but what's biting me is config.site usage.  since these get processed before 
the first user-generated content, they might clobber the shell arguments.  is 
there any way to do what i want here ?
-mike




reply via email to

[Prev in Thread] Current Thread [Next in Thread]