bug-cvs
[Top][All Lists]
Advanced

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

Re: CVS Feature Branch - Windows Build Broken 7-Oct-2004 08:30 PDT


From: Derek Robert Price
Subject: Re: CVS Feature Branch - Windows Build Broken 7-Oct-2004 08:30 PDT
Date: Thu, 07 Oct 2004 18:57:22 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616

Conrad T. Pino wrote:

>Hi Derek,
>
>Mark is right and this points to an issue "windows-NT/mkconfig.pl" script.
>It seems when #define value is "0" the script doesn't write it to output file.
>
>I've tried "#define HAVE_DECL_GETPASS 1" instead of zero value which does
>get written to output file:
>
>       H:\cvs-1.12\windows-NT>grep -n HAVE_DECL_GETPASS config.*
>       File config.h:
>       202     #define HAVE_DECL_GETPASS 1
>       File config.h.in:
>       202     #define HAVE_DECL_GETPASS 1
>       File config.h.in.in:
>       185     #define HAVE_DECL_GETPASS 1
>
>and this will compile but I can't say how it runs.
>
>What's your opinion towards a resolution?
>  
>

I've committed the attached patch, which fixes things.  The main issue
was that undef, the empty string, and 0 are all false in perl. I
switched a test from "if $val" to "if defined $val" and everything works
now.  I also tidied up a regexp or four.  The first one is the only one
that mattered - it caused some unneeded spaces in the output since empty
strings are defined.  The other two were just cosmetic.

Cheers,

Derek

Index: windows-NT/mkconfig.pl
===================================================================
RCS file: /cvs/ccvs/windows-NT/mkconfig.pl,v
retrieving revision 1.2
diff -u -p -r1.2 mkconfig.pl
--- windows-NT/mkconfig.pl      19 May 2004 21:35:52 -0000      1.2
+++ windows-NT/mkconfig.pl      7 Oct 2004 21:34:25 -0000
@@ -112,7 +112,7 @@ sub make_config_h
     my %build_macros;
     while (<FINP>)
     {
-       if (/^\s*#\s*define\s*(\w+)\s*(.*)/)
+       if (/^\s*#\s*define\s*(\w+)(\s+(.+))?$/)
        {
            if (exists $build_macros{$1})
            {
@@ -120,10 +120,10 @@ sub make_config_h
            }
            else
            {
-               $build_macros{$1} = [$., "d", $2];
+               $build_macros{$1} = [$., "d", $3];
            }
        }
-       elsif (/^\s*#\s*undef\s*(\w+)/)
+       elsif (/^\s*#\s*undef\s+(\w+)/)
        {
            if (exists $build_macros{$1})
            {
@@ -177,7 +177,7 @@ EOF
 
        my $out_line = $_;
 
-       if (/^\s*#\s*undef\s*(\w+)/)
+       if (/^\s*#\s*undef\s+(\w+)/)
        {
            if (exists $ph_macros{$1})
            {
@@ -194,7 +194,7 @@ EOF
                $out_line = "#define $1";
 
                $out_line .= " " . $build_macros{$1}[2]
-                   if $build_macros{$1}[2];
+                   if defined $build_macros{$1}[2];
 
                $out_line .= "\n";
            }

-- 
                *8^)

Email: derek@ximbiot.com

Get CVS support at <http://ximbiot.com>!





reply via email to

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