title: nmake fails on building Perl module
body: <p>I am trying to build <a href="http://search.cpan.org/~jdb/Win32-Daemon-20110117/Daemon.pm" rel="nofollow">Win32::Daemon</a> by myself. The reason I not use CPAN is because I want to dig deeper into the working of Perl modules. In the end I hope to come up with a solution for another problem by seeing this working (not of importance here).</p>
  
  <p>I would see 3 options to build the module: cygwin, mingw, microsoft compiler (cl)</p>
  
  <p>On MinGW it reports that it is not supported (simple if in the Makefile.PL) which expands to more errors once I modify the check to match MinGW
  On Cygwin it complains about <code>tchar.h</code> which, as I found out, is a Windows header (MinGW does have it).</p>
  
  <p>But my real goal anyway is building it with the MS compiler, so while any compilation that does not require any special libs (like it would do with cygwin I suppose) will more.</p>
  
  <p>So now here goes my nmake output from running just <code>name /f Makefile</code>:</p>
  
  <pre><code>NMAKE : fatal error U1073: "C:/Program" could not be created.
  Stop.
  </code></pre>
  
  <p>I roughly translated the error message from german, but the statement is simple.
  What I see here seems to be a path problem (probably the spaces). I also notice the forward slash. The <code>Makefile</code> was created by the <code>Makefile.PL</code> script (I am using Active Perl v5.12.1):</p>
  
  <pre><code>use strict;
  use warnings;
  
  use Config qw(%Config);
  use ExtUtils::MakeMaker;
  
  unless ($^O eq "MSWin32" || $^O eq "cygwin") {
      die "OS unsupported\n";
  }
  
  require Win32;
  
  my %param = (
      NAME          =&gt; 'Win32::Daemon',
      VERSION_FROM  =&gt; 'Daemon.pm',
      DEFINE        =&gt; '-DPERL_NO_GET_CONTEXT',
      OBJECT        =&gt; 'CCallbackList$(OBJ_EXT) CCallbackTimer$(OBJ_EXT) Constant$(OBJ_EXT) CWinStation$(OBJ_EXT) Daemon$(OBJ_EXT) ServiceThread$(OBJ_EXT)',
      XS            =&gt; { 'Daemon.xs' =&gt; 'Daemon.cpp' },
  );
  $param{INC} .= ' -EHsc' if $Config{'cc'} =~ /^cl/i;
  $param{NO_META} = 1 if eval "$ExtUtils::MakeMaker::VERSION" &gt;= 6.10_03;
  WriteMakefile(%param);
  
  sub MY::xs_c {
      '
  .xs.cpp:
      $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs &gt;xstmp.c &amp;&amp; $(MV) xstmp.c $*.cpp
  ';
  }
  </code></pre>
  
  <p>I don't know much about the MakeMaker but I don't see anything here that I could fix and would expect that it boils down to fixing the <code>Makefile</code> itself by hand. I tried a couple of things like quoting but nothing helped.</p>
  
  <p>The thing is, I am used to problems like this when building on Windows, but normally this is for tools that were created for Unix. This one is explicitly ONLY Windows and so I would expect it to work out of the box. So I figure that <em>I</em> am doing something wrong.</p>
  
  <p>Any help on where to find the solution?
  Thanks in advance.</p>
  
  <p>Edit/Addition: I tried this on another Win7 machine with Active Perl 5.16.x and it worked like a charm. I looked at the different output from this machine and the current one which fails when running <code>perl Makefile.PL</code> and I recieve the following output:</p>
  
  <pre><code>... Detected uninstalled Perl.  Trying to continue.
  Unable to find a perl 5 (by these names: C:\Program Files\Perl64\bin\perl.exe perl.exe perl5.exe perl5.12.1.exe miniperl.exe, in these dirs: . [...] C:\Program Files\Perl64\site\bin C:\Program Files\Perl64\bin [...])
  Have \progra~1\perl64\lib
  Want \temp\perl---please-run-the-install-script---\lib
  Writing Makefile for Win32::Daemon
  </code></pre>
  
  <p>I truncated the output. Now please someone explain to me: Why can I run <code>perl Makefile.PL</code> or <code>perl -v</code> but it does not find my Perl in the exact directory it is in? I reinstalled it but it did not work...</p>