bug-cvs
[Top][All Lists]
Advanced

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

Re: Questions: ./config.h.in & ./windows-NT/config.h.in


From: Derek Robert Price
Subject: Re: Questions: ./config.h.in & ./windows-NT/config.h.in
Date: Sun, 16 May 2004 16:22:07 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Conrad T. Pino wrote:

>>   1. Again, the entire config.h.in is copied to
>>      windows-NT/config.h.in, including your conditional constructs.
>
>
>This is out of order if implemented as stated.  I plan:
>
>    1. Read "windows-NT/config.h.in" to:


This should be config.h.in.in or somesuch.  This script should be
generating config.h.in which can later be processed by the build to
substitute in the version numbers.  As mentioned earlier, the
alternative is generating one of the source files for the script with
the correct version numbers but I'd rather not do things in this order
since configure can be editied and run by non-maintainers without
needing Perl installed and this script will not be usable without Perl.

>        1.1 Collect list of #define/#undef statements.
>
>        1.2 Report duplicate #define/#undef statements.
>
>    2. Copy "config.h.in" to temporary file "windows-NT/config.h.tmp"
>    while doing:
>
>        2.1 Collect list of #define/#undef statements.
>
>        2.2 Report duplicate #define/#undef statements.


I wouldn't worry about multiple #defines in this file.  They would
almost certainly be part of one of the conditionals we discussed earlier:

#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
# define FILESYSTEM_PREFIX_LEN(Filename) \
  ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
#else
# define FILESYSTEM_PREFIX_LEN(Filename) 0
#endif


Anything that the configure script might define will exist only as an
#undef in config.h.in.

>        2.3 Replace #undef with #define collected in Step 1.
>
>    3. Append optional "windows-NT/config.h.end" to temporary file
>    "windows-NT/config.h.tmp" and close temporary file.
>
>    4. Compare temporary file "windows-NT/config.h.tmp" to output
>    file "windows-NT/config.h" stopping on first difference.


to windows-NT/config.h.in...

>>   2. #defines in windows-NT/config.h.in.in are search/replaced over
>>      #undefs in the new windows-NT/config.h.in with a warning if
>>      there is no #undef to replace.
>>   3. #undefs in config.h.in without corresponding #defines or #undefs
>>      in windows-NT/config.h.in.in cause warnings.  (Note that #undefs
>>      in windows-NT/config.h.in.in are ignored until this step.  They
>>      are intended to be used to suppress warnings if config.h.in
>>      happens to ever contain a conditional with an #undef inside.)
>
>
>"(Note..." in your Step 3 was very helpful.  Thank you.  I continue:
>
>    5. Sort lists from Steps 1 and 2.1 and issue warnings per your
>    Steps 2 & 3 using a single pass comparing both lists.
>
>    6. Replace output file with temporary file *only* if different.
>
>>The rule I know that you might not is that if the configure script is
>>going to set a #define (or not) at configure time, it will always be
>>#undefined in config.h.in.
>
>
>Definitely helpful.  Thank you.
>========================================================
>Note tracking conditional nesting level is required to perform my
>Steps 1.2 and 2.2 accurately as *helpful* developer aid.
>========================================================
>I believe we both know there's *no way* we can produce correct output
>using the current "windows-NT/config.h.in" as input.  Too much stuff
>will be dropped that is *only* in "windows-NT/config.h.in" file.
>
>I assume you have a plan for revising *something* and I'd appreciate
>at least an outline.  Perhaps I could contribute if I had a clue.
>
>I'm bet hedging with my Step 3 for a "windows-NT/config.h.end" file
>to hold the extra stuff until a better plan is revealed.


Hrm.  Sure.  Call it config.h.in.footer, though, please.  I think that
is more consistent with usages elsewhere.

>I'm bet hedging by copying #define/#undef statements and skipping my
>Steps 1.1, 1.2, 2.1 and 2.2 when conditional nesting level > 0 until
>the better plan is revealed.


I think you are getting way too complicated here.  There should be no
nesting in windows-NT/config.h.in.in - we can control that, and you
should be able to search-replace any #undef in config.h.in with a
define in windows-NT/config.h.in.in without a problem.  You should be
able to completely ignore any nesting since it simply won't happen,
outside of the few conditionals you already spotted, and those will
not contain any #defines for variables #undefed elsewhere.

Derek

- --
                *8^)

Email: address@hidden

Get CVS support at <http://ximbiot.com>!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAp81uLD1OTBfyMaQRApLoAJ9m2VIiPQOpvQCRv4U/Ls2LLA19nACbBJU5
Pr0ZkRWN14yD0MpkoyzCebo=
=0Tvm
-----END PGP SIGNATURE-----





reply via email to

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