[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: Going from config.h back to config.sh
On Wed, 19 Jan 2000 scozens@pwj.co.jp wrote:
>
> Here's my first attempt at turning a config.h file back into a config.sh
> file that will produce it. I've needed to do this while hacking around
> on miniperl, and I guess it might be useful if other people attack the
> config.h file and need to make their changes more permanent/portable.
Your case is, as you say, rather special. However, in general, I strongly
encourage folks *not* to do this. Instead, hack on config.sh and
regenerate config.h from config_h.SH and config.sh. The main reasons for
this are (off the top of my head)
1. config.h only contains a subset of the config.sh variables.
2. It is much easier to track patches if you follow the supplied
Porting/config.sh than if you try to follow the supplied Porting/config_H.
The reason is that the different sections in config_H can get almost
arbitrarily shuffled around depending on details of the underlying
metaconfig process, including such innocuous details as whether Jarkko or
I last generated Configure. config.sh, on the other hand, can be safely
sorted so that comparisons between different versions are really rather
easy.
Thus, if you're on a system with a hand-maintained configuration, it is
far far easier to keep up if you try to work with config.sh rather than
config.h.
There are also already tools in the perl distribution to do these kinds of
things: vms/munchconfig.c, for example, will read in your hand-patched
config.sh and process the standard config_h.SH file to produce a useable
config.h file for your system. The win32/ directory works similarly, but
uses a perl script. There are template config files: config.bc,
config.gc, and config.vc for different compilers; these are processed by
the config_sh.PL and config_h.PL scripts to produce the appropriate
headers. (The Makefile handles versioning and other options too.)
Still, thanks for the tool. Others may indeed find it useful. I just
wanted to give them a warning to think carefully before heading down the
config.h -> config.sh track. Still, if you indeed find yourself down that
way, it's good to have a way back.
Thanks,
Andy Dougherty doughera@lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
- References to:
-
scozens@pwj.co.jp
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]