make-w32
[Top][All Lists]
Advanced

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

Re: make 3.81 MinGW port and testsuite working with MSYS


From: Eli Zaretskii
Subject: Re: make 3.81 MinGW port and testsuite working with MSYS
Date: Sat, 26 Feb 2005 15:55:35 +0200

> Date: Sat, 26 Feb 2005 00:50:02 +0000
> From: "J. Grant" <address@hidden>
> Cc: address@hidden, address@hidden, address@hidden

Thanks.  I have a few comments:

> diff -uNr make-3.81beta2.base/main.c make-3.81beta2.MinGW/main.c
> --- make-3.81beta2.base/main.c        2005-02-16 05:03:42.000000000 +0000
> +++ make-3.81beta2.MinGW/main.c       2005-02-24 20:10:28.000000000 +0000
> @@ -1026,6 +1026,25 @@
>        if (program == 0 && argv[0][1] == ':')
>       program = argv[0] + 1;
>  #endif
> +
> +#ifdef WINDOWS32
> +      if(program == 0)
> +      {
> +        /* Extract program from full path */
> +        char * p = strrchr (argv[0], '\\');
> +        int argv0_len = strlen(p);
> +        if(argv0_len > 4)
> +        {
> +          if(p[argv0_len - 4] == '.' && p[argv0_len - 3] == 'e' && 
> p[argv0_len - 2] == 'x' && p[argv0_len - 1] == 'e')
> +          {
> +           /* Remove .exe extension */
> +           p[argv0_len - 4] = '\0';
> +           /* Increment past the initial '\' */
> +           program = p + 1;
> +          }
> +        }
> +      }
> +#endif

I don't understand this hunk of the patches.  Why cannot you use the
similar code that the __MSDOS__ and __EMX__ builds use?

And why do you need to remove the ".exe" extension?  The MSDOS port
leaves the extension, and I have yet to see any problems with that.

Anyway, the patch is not very reliable in what it tries to do: it
doesn't handle the "d:make.exe" case, and it will fail if it gets
something like "C:\foo\bar\MAKE.EXE" (i.e., if ".EXE" is in upper
case).

> -  print "Comparing Output ........ " if $debug;
> +  print "Comparing Output ........\n" if $debug;
> +  print "logfile: $logfile\n" if $debug;
> +
> +  # All reference output is LF format, so convert CRLF to LF if we are 
> testing W32
> +  if ($osname =~ /MINGW32/i)
> +  {
> +     print "mingw matched, will run dos2unix on output log\n" if($debug);
> +     run_command("dos2unix $logfile");
> +  }

This assumes the availability of the dos2unix program, which is not
part of the standard Windows tools.  If running dos2unix is the only
way to solve this problem, the requirement to have dos2unix installed
should be mentioned in README.W32, at the very least.




reply via email to

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