Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 527 forks source link

Adding win32/GNUmakefile #14341

Closed p5pRT closed 8 years ago

p5pRT commented 9 years ago

Migrated from rt.perl.org#123440 (status was 'resolved')

Searchable as RT123440$

p5pRT commented 9 years ago

From @kmx

Created by @kmx

With ExtUtils​::MakeMaker v7 there is an option to use GNU make on MS Windows instead of traditional dmake.

I would like to ask for opinions about an idea of creating a new win32/GNUmakefile which will support building perl core on MS Windows with GNU make + gcc

If you find it a good idea I am ready to do the work.

Thanks

-- kmx

Perl Info ``` Flags: category=core severity=low Site configuration information for perl 5.20.1: Configured by strawberry-perl at Mon Sep 15 13:28:28 2014. Summary of my perl5 (revision 5 version 20 subversion 1) configuration: Platform: osname=MSWin32, osvers=6.3, archname=MSWin32-x64-multi-thread uname='Win32 strawberry-perl 5.20.1.1 #1 Mon Sep 15 13:26:45 2014 x64' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define use64bitint=define, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields', optimize='-s -O2', cppflags='-DWIN32' ccversion='', gccversion='4.8.3', gccosandvers='' intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='long long', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='g++.exe', ldflags ='-s -L"C:\tmp64\perl\lib\CORE" -L"C:\tmp64\c\lib"' libpth=C:\tmp64\c\lib C:\tmp64\c\x86_64-w64-mingw32\lib C:\tmp64\c\lib\gcc\x86_64-w64-mingw32\4.8.3 libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 libc=, so=dll, useshrplib=true, libperl=libperl520.a gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=xs.dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-mdll -s -L"C:\tmp64\perl\lib\CORE" -L"C:\tmp64\c\lib"' @INC for perl 5.20.1: C:/tmp64/perl/site/lib C:/tmp64/perl/vendor/lib C:/tmp64/perl/lib . Environment for perl 5.20.1: HOME=C:\tmp64\data LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=C:\tmp64\perl\site\bin;C:\tmp64\perl\bin;C:\tmp64\c\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem PERL_BADLANG (unset) SHELL (unset) ```
p5pRT commented 9 years ago

From @steve-m-hay

On Tue Dec 16 00​:49​:53 2014\, kmxx wrote​:

This is a bug report for perl from kmx@​atlas.cz\, generated with the help of perlbug 1.40 running under perl 5.20.1.

----------------------------------------------------------------- [Please describe your issue here]

With ExtUtils​::MakeMaker v7 there is an option to use GNU make on MS Windows instead of traditional dmake.

I would like to ask for opinions about an idea of creating a new win32/GNUmakefile which will support building perl core on MS Windows with GNU make + gcc

If you find it a good idea I am ready to do the work.

Sounds like a good idea to me\, except for slight concerns over maintenance troubles. We already have two makefiles (three if you count WinCE) in win32/\, which often both need to have similar patches applied. Would you envisage adding a third flavour to the mix\, or *replacing* the dmake makefile.mk with your new GNUmakefile?

The latter would be preferable from a maintenance viewpoint\, but I don't know how many people would be inconvenienced by dropping dmake. Probably not a huge number since it's fairly obscure and GNU make is readily available anyway.

If there was any way to have some means of (re)generating the two makefiles from some common code (I'm thinking of a "regen" step that porters can run when making changes to makefiles; perl distros would still be shipped with both versions in them) then that would be great (and conceivably we could then even keep on dmake support since it *might* not be such an extra overhead). I've always wanted to have a look at doing this\, but I've never found the time. If this was part of your plan then that would be awesome; if not then it's not a problem if we end up with two makefiles like we have now -- the "regen" idea can still be done sometime in the future.

p5pRT commented 9 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 9 years ago

From @kmx

On 16.12.2014 10​:23\, Steve Hay via RT wrote​:

On Tue Dec 16 00​:49​:53 2014\, kmxx wrote​:

This is a bug report for perl from kmx@​atlas.cz\, generated with the help of perlbug 1.40 running under perl 5.20.1.

----------------------------------------------------------------- [Please describe your issue here]

With ExtUtils​::MakeMaker v7 there is an option to use GNU make on MS Windows instead of traditional dmake.

I would like to ask for opinions about an idea of creating a new win32/GNUmakefile which will support building perl core on MS Windows with GNU make + gcc

If you find it a good idea I am ready to do the work.

Sounds like a good idea to me\, except for slight concerns over maintenance troubles. We already have two makefiles (three if you count WinCE) in win32/\, which often both need to have similar patches applied. Would you envisage adding a third flavour to the mix\, or *replacing* the dmake makefile.mk with your new GNUmakefile?

The latter would be preferable from a maintenance viewpoint\, but I don't know how many people would be inconvenienced by dropping dmake. Probably not a huge number since it's fairly obscure and GNU make is readily available anyway.

If there was any way to have some means of (re)generating the two makefiles from some common code (I'm thinking of a "regen" step that porters can run when making changes to makefiles; perl distros would still be shipped with both versions in them) then that would be great (and conceivably we could then even keep on dmake support since it *might* not be such an extra overhead). I've always wanted to have a look at doing this\, but I've never found the time. If this was part of your plan then that would be awesome; if not then it's not a problem if we end up with two makefiles like we have now -- the "regen" idea can still be done sometime in the future.

My suggestion is to​: 1/ have both GNUmakefile + makefile.mk in 5.22 (May 2015) 2/ (maybe) drop makefile.mk in 5.24 (May 2016)

The other thing is that makefile.mk supports also msvc whereas my plan for GNUmakefile is to support gcc only.

I am not sure if I can say something about "regen" idea. Maybe let's first have "some" GNUmakefile then we can analyse if some parts may be generated or not.

-- kmx

p5pRT commented 9 years ago

From @steve-m-hay

On 16 December 2014 at 09​:39\, kmx \kmx@​atlas\.cz wrote​:

On 16.12.2014 10​:23\, Steve Hay via RT wrote​:

On Tue Dec 16 00​:49​:53 2014\, kmxx wrote​:

This is a bug report for perl from kmx@​atlas.cz\, generated with the help of perlbug 1.40 running under perl 5.20.1.

----------------------------------------------------------------- [Please describe your issue here]

With ExtUtils​::MakeMaker v7 there is an option to use GNU make on MS Windows instead of traditional dmake.

I would like to ask for opinions about an idea of creating a new win32/GNUmakefile which will support building perl core on MS Windows with GNU make + gcc

If you find it a good idea I am ready to do the work.

Sounds like a good idea to me\, except for slight concerns over maintenance troubles. We already have two makefiles (three if you count WinCE) in win32/\, which often both need to have similar patches applied. Would you envisage adding a third flavour to the mix\, or *replacing* the dmake makefile.mk with your new GNUmakefile?

The latter would be preferable from a maintenance viewpoint\, but I don't know how many people would be inconvenienced by dropping dmake. Probably not a huge number since it's fairly obscure and GNU make is readily available anyway.

If there was any way to have some means of (re)generating the two makefiles from some common code (I'm thinking of a "regen" step that porters can run when making changes to makefiles; perl distros would still be shipped with both versions in them) then that would be great (and conceivably we could then even keep on dmake support since it *might* not be such an extra overhead). I've always wanted to have a look at doing this\, but I've never found the time. If this was part of your plan then that would be awesome; if not then it's not a problem if we end up with two makefiles like we have now -- the "regen" idea can still be done sometime in the future.

My suggestion is to​: 1/ have both GNUmakefile + makefile.mk in 5.22 (May 2015) 2/ (maybe) drop makefile.mk in 5.24 (May 2016)

Ok\, sounds reasonable to me. It means that we'll have three makefiles to maintain for a while\, but it won't be for too long.

The other thing is that makefile.mk supports also msvc whereas my plan for GNUmakefile is to support gcc only.

I think that's reasonable too. Unless we ever switch over to GNU make entirely and drop nmake support (which I don't see happening any time soon\, if at all\, since nmake is the obvious choice for VC++ users) then there's little point in GNUmakefile also supporting VC++. In theory it might occasionally be useful to try a VC++ build with a different make tool in case of some suspected problem with nmake\, but in practice I can't think of an occasion that I've ever done that with the existing dmake makefile.mk. I've only ever built using VC++/nmake and gcc/dmake.

I am not sure if I can say something about "regen" idea. Maybe let's first have "some" GNUmakefile then we can analyse if some parts may be generated or not.

Yes\, creating a regen script will be much easier when we can see the GNUmakefile that we're trying to generate :-)

p5pRT commented 9 years ago

From @Leont

On Tue\, Dec 16\, 2014 at 9​:49 AM\, kmx \perlbug\-followup@​perl\.org wrote​:

With ExtUtils​::MakeMaker v7 there is an option to use GNU make on MS Windows instead of traditional dmake.

I would like to ask for opinions about an idea of creating a new win32/GNUmakefile which will support building perl core on MS Windows with GNU make + gcc

If you find it a good idea I am ready to do the work.

I had proposed just that in #121214. Given the state of dmake I'd prefer this happening yesterday. I suspect making it support both gcc and msvc would be feasable\, given we already have the logic (it just needs translation).

Leon

p5pRT commented 9 years ago

From @jandubois

On Tue\, Dec 16\, 2014 at 7​:14 AM\, Leon Timmermans \fawaka@​gmail\.com wrote​:

On Tue\, Dec 16\, 2014 at 9​:49 AM\, kmx \perlbug\-followup@​perl\.org wrote​:

I would like to ask for opinions about an idea of creating a new win32/GNUmakefile which will support building perl core on MS Windows with GNU make + gcc

I had proposed just that in #121214. Given the state of dmake I'd prefer this happening yesterday.

+1

I suspect making it support both gcc and msvc would be feasable\, given we already have the logic (it just needs translation).

Is there any benefit to it? I actually prefer to limit the variation in build tools\, i.e. either use VC/nmake\, or GCC/GNUmake for building Perl and modules. Supporting different make utilities with different compilers just adds complexities in modules down the toolchain with no obvious (to me) benefit.

Cheers\, -Jan

p5pRT commented 9 years ago

From @kmx

On 16.12.2014 20​:08\, Jan Dubois wrote​:

On Tue\, Dec 16\, 2014 at 7​:14 AM\, Leon Timmermans \fawaka@​gmail\.com wrote​:

On Tue\, Dec 16\, 2014 at 9​:49 AM\, kmx \perlbug\-followup@​perl\.org wrote​:

I would like to ask for opinions about an idea of creating a new win32/GNUmakefile which will support building perl core on MS Windows with GNU make + gcc

I had proposed just that in #121214. Given the state of dmake I'd prefer this happening yesterday. +1

Sorry\, I should have done better research. These tickets can be merged.

I suspect making it support both gcc and msvc would be feasable\, given we already have the logic (it just needs translation). Is there any benefit to it? I actually prefer to limit the variation in build tools\, i.e. either use VC/nmake\, or GCC/GNUmake for building Perl and modules. Supporting different make utilities with different compilers just adds complexities in modules down the toolchain with no obvious (to me) benefit.

I agree with keeping separate makefiles for 1/ VC+nmake and 2/ GCC+GNUmake.

Here is the first version - https://gist.github.com/kmx/b5805847b6485c5c3a65 Just save it as perl-src-dir/win32/GNUmakefile and run gmake from win32 subdir. It seems to work but definitely needs thorough testing.

-- kmx

p5pRT commented 9 years ago

From @sisyphus

-----Original Message----- From​: kmx Sent​: Thursday\, December 18\, 2014 2​:07 AM To​: perl5-porters@​perl.org Subject​: Re​: [perl #123440] Adding win32/GNUmakefile

Just save it as perl-src-dir/win32/GNUmakefile and run gmake from win32 subdir. It seems to work but definitely needs thorough testing.

Nice !! I'll certainly be using this makefile to build 5.21.7 (and various perl extensions) when it comes out.

I take it that the GNU make utility must be named 'gmake' - that using a GNU make utility of any other name (eg 'mingw32-make' or 'make') is disallowed. I think this should be spelled out clearly somewhere .... that is\, of course\, if it hasn't *already* been done :-)

Cheers\, Rob

p5pRT commented 9 years ago

From @Leont

On Wed\, Dec 17\, 2014 at 4​:07 PM\, kmx \kmx@​atlas\.cz wrote​:

Here is the first version - https://gist.github.com/kmx/b5805847b6485c5c3a65 Just save it as perl-src-dir/win32/GNUmakefile and run gmake from win32 subdir. It seems to work but definitely needs thorough testing.

Line 323 is wrong (should be a ifneq)\, other than that it looks good to me.

Leon

p5pRT commented 9 years ago

From @jandubois

On Wed\, Dec 17\, 2014 at 3​:06 PM\, \sisyphus1@​optusnet\.com\.au wrote​:

I take it that the GNU make utility must be named 'gmake' - that using a GNU make utility of any other name (eg 'mingw32-make' or 'make') is disallowed.

I see that 'gmake' is hard-coded in one place\, but replacing that with $(MAKE) should make it work for any name\, no?

Cheers\, -Jan

p5pRT commented 9 years ago

From @Leont

On Thu\, Dec 18\, 2014 at 12​:30 AM\, Jan Dubois \jand@​activestate\.com wrote​:

On Wed\, Dec 17\, 2014 at 3​:06 PM\, \sisyphus1@​optusnet\.com\.au wrote​:

I take it that the GNU make utility must be named 'gmake' - that using a GNU make utility of any other name (eg 'mingw32-make' or 'make') is disallowed.

I see that 'gmake' is hard-coded in one place\, but replacing that with $(MAKE) should make it work for any name\, no?

That's just the configuration value. It's telling MakeMaker what brand of make you're using (on Unix it's always "make")\, but shouldn't be used otherwise AFAIK.

Leon

p5pRT commented 9 years ago

From @craigberry

On Wed\, Dec 17\, 2014 at 5​:40 PM\, Leon Timmermans \fawaka@​gmail\.com wrote​:

On Thu\, Dec 18\, 2014 at 12​:30 AM\, Jan Dubois \jand@​activestate\.com wrote​:

On Wed\, Dec 17\, 2014 at 3​:06 PM\, \sisyphus1@​optusnet\.com\.au wrote​:

I take it that the GNU make utility must be named 'gmake' - that using a GNU make utility of any other name (eg 'mingw32-make' or 'make') is disallowed.

I see that 'gmake' is hard-coded in one place\, but replacing that with $(MAKE) should make it work for any name\, no?

That's just the configuration value. It's telling MakeMaker what brand of make you're using (on Unix it's always "make")\, but shouldn't be used otherwise AFAIK.

It looks to me like $(MAKE) is a built-in variable and will expand to whatever make you're actually running​:

$ make -p | grep MAKE_COMMAND make​: *** No targets specified and no makefile found. Stop. MAKE = $(MAKE_COMMAND) MAKE_COMMAND := /Applications/Xcode.app/Contents/Developer/usr/bin/make

That's GNU make 3.81.

p5pRT commented 9 years ago

From @jandubois

On Wed\, Dec 17\, 2014 at 8​:44 PM\, Craig A. Berry \craig\.a\.berry@​gmail\.com wrote​:

It looks to me like $(MAKE) is a built-in variable and will expand to whatever make you're actually running​:

Yes\, it is make's equivalent of perl's $^X.

I misunderstood the issue; I assumed the problem was that the top-level Makefile needed to pass the name of the make utility to $Config{make}\, and thought $(MAKE) would be a way to do this. Maybe this is still the issue\, and the value is hard-coded in some other place. I've only searched kmx's gist for occurances of 'gmake'\, and that was the only one I spotted; I haven't looked any deeper.

Cheers\, -Jan

p5pRT commented 9 years ago

From @kmx

On 18.12.2014 0​:14\, Leon Timmermans via RT wrote​:

On Wed\, Dec 17\, 2014 at 4​:07 PM\, kmx \kmx@​atlas\.cz wrote​:

Here is the first version - https://gist.github.com/kmx/b5805847b6485c5c3a65 Just save it as perl-src-dir/win32/GNUmakefile and run gmake from win32 subdir. It seems to work but definitely needs thorough testing.

Line 323 is wrong (should be a ifneq)\, other than that it looks good to me.

You are right\, fixed.

https://gist.github.com/kmx/b5805847b6485c5c3a65#file-gnumakefile-L323

-- kmx

p5pRT commented 9 years ago

From @kmx

On 18.12.2014 6​:39\, Jan Dubois via RT wrote​:

On Wed\, Dec 17\, 2014 at 8​:44 PM\, Craig A. Berry \craig\.a\.berry@​gmail\.com wrote​:

It looks to me like $(MAKE) is a built-in variable and will expand to whatever make you're actually running​: Yes\, it is make's equivalent of perl's $^X.

I misunderstood the issue; I assumed the problem was that the top-level Makefile needed to pass the name of the make utility to $Config{make}\, and thought $(MAKE) would be a way to do this. Maybe this is still the issue\, and the value is hard-coded in some other place. I've only searched kmx's gist for occurances of 'gmake'\, and that was the only one I spotted; I haven't looked any deeper.

I have changed it to $(MAKE) https://gist.github.com/kmx/b5805847b6485c5c3a65#file-gnumakefile-L691

Yes\, it is used for setting $Config{make} value\, it overrides predefined "make='dmake'" line from win32\config.gc. The only downside of using $(MAKE) is that it might happen that absolute path to gmake.exe is stored in $Config{make}.

Other thing I am not sure about is whether the GNUmakefile is correctly using recursively expanded (= assignment) and simply expanded variables (​:= assignment).

-- kmx

p5pRT commented 9 years ago

From @bulk88

On Tue Dec 16 00​:49​:53 2014\, kmxx wrote​:

This is a bug report for perl from kmx@​atlas.cz\, generated with the help of perlbug 1.40 running under perl 5.20.1.

----------------------------------------------------------------- [Please describe your issue here]

With ExtUtils​::MakeMaker v7 there is an option to use GNU make on MS Windows instead of traditional dmake.

I would like to ask for opinions about an idea of creating a new win32/GNUmakefile which will support building perl core on MS Windows with GNU make + gcc

I dont like the name "GNUmakefile". Too much to type. Can it please be all lowercase or "makefile.g" or "gmakefile"?

-- bulk88 ~ bulk88 at hotmail.com

p5pRT commented 9 years ago

From @Leont

On Thu\, Dec 18\, 2014 at 11​:06 PM\, bulk88 via RT \perlbug\-followup@​perl\.org wrote​:

I dont like the name "GNUmakefile". Too much to type. Can it please be all lowercase or "makefile.g" or "gmakefile"?

It's a GNUism. GNU make will try to run GNUmakefile before makefile or Makefile.

Leon

p5pRT commented 9 years ago

From @bulk88

On Thu Dec 18 14​:11​:20 2014\, LeonT wrote​:

On Thu\, Dec 18\, 2014 at 11​:06 PM\, bulk88 via RT \perlbug\-followup@​perl\.org wrote​:

I dont like the name "GNUmakefile". Too much to type. Can it please be all lowercase or "makefile.g" or "gmakefile"?

It's a GNUism. GNU make will try to run GNUmakefile before makefile or Makefile.

Leon

NVM then. It is less typing\, much less.

-- bulk88 ~ bulk88 at hotmail.com

p5pRT commented 9 years ago

From @kmx

On 18.12.2014 23​:10\, Leon Timmermans wrote​:

On Thu\, Dec 18\, 2014 at 11​:06 PM\, bulk88 via RT \<perlbug-followup@​perl.org \mailto&#8203;:perlbug\-followup@&#8203;perl\.org> wrote​:

I dont like the name "GNUmakefile"\. Too much to type\. Can it please
be all lowercase or "makefile\.g" or "gmakefile"?

It's a GNUism. GNU make will try to run GNUmakefile before makefile or Makefile.

Exactly\, here is the relevant GNU make doc part​:

https://www.gnu.org/software/make/manual/html_node/Makefile-Names.html

-- kmx

p5pRT commented 9 years ago

From @sisyphus

-----Original Message----- From​: kmx Sent​: Thursday\, December 18\, 2014 2​:07 AM To​: perl5-porters@​perl.org Subject​: Re​: [perl #123440] Adding win32/GNUmakefile

Here is the first version - https://gist.github.com/kmx/b5805847b6485c5c3a65 Just save it as perl-src-dir/win32/GNUmakefile and run gmake from win32 subdir.

Sorry for the dumb question\, but how does one get a usable copy of that file ? I first tried copy'n'paste from the IE8 browser window\, but that wants to make every second line a blank line (which buggers up "\" line continuations). So I fired up Ubuntu and copy'n'pasted from the FF browser window\, but that fails to reproduce leading tabs which also makes the file nonsensical in the eyes of gmake.

Is there a direct link to the file ? (I tried "saving target as" from the kmx directory\, but that just gave me the whole lot - html and all.)

I guess there's some simple procedure for grabbing it .... if not\, then I think there needs to be ;-)

Cheers\, Rob

p5pRT commented 9 years ago

From @kmx

On 21.12.2014 5​:01\, sisyphus1@​optusnet.com.au wrote​:

-----Original Message----- From​: kmx Sent​: Thursday\, December 18\, 2014 2​:07 AM To​: perl5-porters@​perl.org Subject​: Re​: [perl #123440] Adding win32/GNUmakefile

Here is the first version - https://gist.github.com/kmx/b5805847b6485c5c3a65 Just save it as perl-src-dir/win32/GNUmakefile and run gmake from win32 subdir.

Sorry for the dumb question\, but how does one get a usable copy of that file ? I first tried copy'n'paste from the IE8 browser window\, but that wants to make every second line a blank line (which buggers up "\" line continuations). So I fired up Ubuntu and copy'n'pasted from the FF browser window\, but that fails to reproduce leading tabs which also makes the file nonsensical in the eyes of gmake.

Is there a direct link to the file ? (I tried "saving target as" from the kmx directory\, but that just gave me the whole lot - html and all.)

I guess there's some simple procedure for grabbing it .... if not\, then I think there needs to be ;-)

Click "Raw" button or go to​: https://gist.githubusercontent.com/kmx/b5805847b6485c5c3a65/raw/c8d64aa2c4b51edb6b47a5a1023976d04eda91e4/GNUmakefile then "save as" should work (perhaps use something else than IE as IE converts newlines to CRLF)

Or try "Download Gist" button or go to​: https://gist.github.com/kmx/b5805847b6485c5c3a65/download then extract the file from downloaded tarball

-- kmx

p5pRT commented 9 years ago

From @sisyphus

Hi\,

(cc'ing p5p again)

In an offlist discussion\, we found that gmake will use sh.exe if it's found anywhere in the path - and this results in failure. This will happen if (eg) msys or Cygwin are in the path.

It's apparently a feature of gmake\, and kmx dug up this link​: https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html

As regards the implication of this for EU​::MM\, I've submitted​: https://rt.cpan.org/Ticket/Display.html?id=101132

But it also has implications for the building of perl itself - and I propose (something like) the attached patch to the GNUmakefile that kmx posted at the start of this thread (at https://gist.github.com/kmx/b5805847b6485c5c3a65).

There was already a (commented out) SHELL entry in that GNUmakefile\, so I changed that to specify​: SHELL := cmd.exe

However\, I then found it necessary to move it to the beginning of the GNUmakefile. Leaving it where it was worked ok\, but resulted in some confusing output at the start (iff sh.exe was in the path)​:

C​:\_32\comp\perl-5.21.7\win32>gmake /usr/bin/sh​: -c​: line 0​: syntax error near unexpected token `"delims=. tokens=1\,2\,3"' /usr/bin/sh​: -c​: line 0​: `for /f "delims=. tokens=1\,2\,3" %%i in ('gcc -dumpversion') do echo %%i' /usr/bin/sh​: -c​: line 0​: syntax error near unexpected token `"delims=. tokens=1\,2\,3"' /usr/bin/sh​: -c​: line 0​: `for /f "delims=. tokens=1\,2\,3" %%i in ('gcc -dumpversion') do echo %%j' /usr/bin/sh​: -c​: line 0​: syntax error near unexpected token `"delims=. tokens=1\,2\,3"' /usr/bin/sh​: -c​: line 0​: `for /f "delims=. tokens=1\,2\,3" %%i in ('gcc -dumpversion') do echo %%k' # GCCBIN=gcc [all fine from then until the building of Archive​::Tar - which fails iff sh.exe is in PATH && EU​::MM has not been corrected]

Cheers\, Rob

p5pRT commented 9 years ago

From @sisyphus

Inline Patch ```diff --- GNUmakefile.orig 2014-12-26 12:29:14 +1100 +++ GNUmakefile 2014-12-26 12:35:31 +1100 @@ -12,7 +12,12 @@ ## ## Make sure you read README.win32 *before* you mess with anything here! ## - + +# +# We set this to point to cmd.exe in case GNU Make finds sh.exe in the ```

path. +# Comment this line out if necessary +# +SHELL := cmd.exe

# define whether you want to use native gcc compiler or cross-compiler # possible values​: gcc @​@​ -237\,12 +242\,6 @​@​ EXTRALIBDIRS :=

# -# set this to point to cmd.exe (only needed if you use some -# alternate shell that doesn't grok cmd.exe style commands) -# -#SHELL := g​:\winnt\system32\cmd.exe - -# # set this to your email address (perl will guess a value from # from your loginname and your hostname\, which may not be right) #

p5pRT commented 9 years ago

From @kmx

On 26.12.2014 3​:58\, sisyphus1@​optusnet.com.au wrote​:

Hi\,

(cc'ing p5p again)

In an offlist discussion\, we found that gmake will use sh.exe if it's found anywhere in the path - and this results in failure. This will happen if (eg) msys or Cygwin are in the path.

It's apparently a feature of gmake\, and kmx dug up this link​: https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html

As regards the implication of this for EU​::MM\, I've submitted​: https://rt.cpan.org/Ticket/Display.html?id=101132

But it also has implications for the building of perl itself - and I propose (something like) the attached patch to the GNUmakefile that kmx posted at the start of this thread (at https://gist.github.com/kmx/b5805847b6485c5c3a65).

There was already a (commented out) SHELL entry in that GNUmakefile\, so
I changed that to specify​: SHELL := cmd.exe

However\, I then found it necessary to move it to the beginning of the GNUmakefile. Leaving it where it was worked ok\, but resulted in some confusing output at the start (iff sh.exe was in the path)​:

C​:\_32\comp\perl-5.21.7\win32>gmake /usr/bin/sh​: -c​: line 0​: syntax error near unexpected token `"delims=. tokens=1\,2\,3"' /usr/bin/sh​: -c​: line 0​: `for /f "delims=. tokens=1\,2\,3" %%i in ('gcc -dumpversion') do echo %%i' /usr/bin/sh​: -c​: line 0​: syntax error near unexpected token `"delims=. tokens=1\,2\,3"' /usr/bin/sh​: -c​: line 0​: `for /f "delims=. tokens=1\,2\,3" %%i in ('gcc -dumpversion') do echo %%j' /usr/bin/sh​: -c​: line 0​: syntax error near unexpected token `"delims=. tokens=1\,2\,3"' /usr/bin/sh​: -c​: line 0​: `for /f "delims=. tokens=1\,2\,3" %%i in ('gcc -dumpversion') do echo %%k' # GCCBIN=gcc [all fine from then until the building of Archive​::Tar - which fails iff sh.exe is in PATH && EU​::MM has not been corrected]

Cheers\, Rob

I have updated my gist with Rob's patch

-- kmx

p5pRT commented 9 years ago

From @kmx

Any chance to have win32/GNUmakefile in 5.22?

-- kmx

p5pRT commented 8 years ago

From @tonycoz

On Tue Dec 16 11​:08​:31 2014\, jdb wrote​:

Is there any benefit to it? I actually prefer to limit the variation in build tools\, i.e. either use VC/nmake\, or GCC/GNUmake for building Perl and modules. Supporting different make utilities with different compilers just adds complexities in modules down the toolchain with no obvious (to me) benefit.

gmake can do parallel builds. nmake can't.

Given bulk88's work in #123867 it would be nice if we had a way to do parallel builds for MSVC.

Tony

p5pRT commented 8 years ago

From @bulk88

On Sun May 24 23​:07​:07 2015\, tonyc wrote​:

On Tue Dec 16 11​:08​:31 2014\, jdb wrote​:

Is there any benefit to it? I actually prefer to limit the variation in build tools\, i.e. either use VC/nmake\, or GCC/GNUmake for building Perl and modules. Supporting different make utilities with different compilers just adds complexities in modules down the toolchain with no obvious (to me) benefit.

gmake can do parallel builds. nmake can't.

Given bulk88's work in #123867 it would be nice if we had a way to do parallel builds for MSVC.

Tony

I think the best plan is to get a non-parallel gnu makefile into the repo for 5.23\, and Ill try to modify it the same way as the parallel dmake makefile.

long part​:

The architecture (dep tree\, order of operations\, what each target makes) of the dmake parallel makefile is wildly different from regular dmake makefile. I dont think that gnu makefile will run in parallel as written on gist. config.h target would be broken which means no miniperl.

all : info .\config.h ..\git_version.h $(GLOBEXE) $(MINIPERL) \ $(CONFIGPM) $(UNIDATAFILES) MakePPPort \ $(PERLEXE) Extensions Extensions_nonxs $(PERLSTATIC)

For example\, ..\git_version.h deps on miniperl\, so why have $(MINIPERL) as a dep in target all? The gnu makefile makes as much sense as the non parallel dmake makefile today (little) which it is based off of. I think the best plan is to get a non-parallel gnu makefile into the repo for 5.23\, and Ill try to modify it the same way as the parallel dmake makefile.

My parallel dmake makefile builds Extensions and Extensions_nonxs in parallel. In the legacy dmake (and nmake) makefile\, Extensions deps on DynaLoader which deps on Extensions_nonxs so there is nothing to do in parallel since its specifically coded to be serial. You can't get perl522.dll without running the very long (relatively) Extensions_nonxs target to allow the DynaLoader target to run. I fixed that in parallel dmake file. There are just so many many flaws in the existing makefiles.

The build process in my parallel makefile is

NO_Perl_interp_available(non Perl C programs and win32 batch lang 1 liners) ->raw_miniperl_available(aka buildcustomize.pl) -> Category​:no Config.pm needed targets   there is like 1 or 2 of these I dont remember them off my head Category​:Config.pm needed   XS headers/ppport.h needed   Dynaloader   static_exts   DLL_extensions   PP_extensions   fullperl core .c files   utils & pod

linking miniperl and generating Config.pm are the main serialized/choke points\, since the moment Config.pm is created there is an explosion of work available to do in parallel. The next performance problem is targets that take orders of magnitude different times to build (av.c takes less than 1/2 second\, but it is built in parallel with DynaLoader which takes 5 seconds to build\, limiting perl522.dll linking target to 5 seconds. Most of the 5 second delay is how slow EUMM is in generating a Makefile.PL\, and EUMM doing "%EUMMConfig =%Config" which means that tied %Config lazy FETCH feature is useless because of what EUMM does.

-- bulk88 ~ bulk88 at hotmail.com

p5pRT commented 8 years ago

From @bulk88

On Sun May 24 23​:07​:07 2015\, tonyc wrote​:

On Tue Dec 16 11​:08​:31 2014\, jdb wrote​:

Is there any benefit to it? I actually prefer to limit the variation in build tools\, i.e. either use VC/nmake\, or GCC/GNUmake for building Perl and modules. Supporting different make utilities with different compilers just adds complexities in modules down the toolchain with no obvious (to me) benefit.

gmake can do parallel builds. nmake can't.

Given bulk88's work in #123867 it would be nice if we had a way to do parallel builds for MSVC.

Tony

I think the best plan is to get a non-parallel gnu makefile into the repo for 5.23\, and Ill try to modify it the same way as the parallel dmake makefile.

long part​:

The architecture (dep tree\, order of operations\, what each target makes) of the dmake parallel makefile is wildly different from regular dmake makefile. I dont think that gnu makefile will run in parallel as written on gist. config.h target would be broken which means no miniperl.

all : info .\config.h ..\git_version.h $(GLOBEXE) $(MINIPERL) \ $(CONFIGPM) $(UNIDATAFILES) MakePPPort \ $(PERLEXE) Extensions Extensions_nonxs $(PERLSTATIC)

For example\, ..\git_version.h deps on miniperl\, so why have $(MINIPERL) as a dep in target all? The gnu makefile makes as much sense as the non parallel dmake makefile today (little) which it is based off of. I think the best plan is to get a non-parallel gnu makefile into the repo for 5.23\, and Ill try to modify it the same way as the parallel dmake makefile.

My parallel dmake makefile builds Extensions and Extensions_nonxs in parallel. In the legacy dmake (and nmake) makefile\, Extensions deps on DynaLoader which deps on Extensions_nonxs so there is nothing to do in parallel since its specifically coded to be serial. You can't get perl522.dll without running the very long (relatively) Extensions_nonxs target to allow the DynaLoader target to run. I fixed that in parallel dmake file. There are just so many many flaws in the existing makefiles.

The build process in my parallel makefile is

NO_Perl_interp_available(non Perl C programs and win32 batch lang 1 liners) ->raw_miniperl_available(aka buildcustomize.pl) -> Category​:no Config.pm needed targets   there is like 1 or 2 of these I dont remember them off my head Category​:Config.pm needed   XS headers/ppport.h needed   Dynaloader   static_exts   DLL_extensions   PP_extensions   fullperl core .c files   utils & pod

linking miniperl and generating Config.pm are the main serialized/choke points\, since the moment Config.pm is created there is an explosion of work available to do in parallel. The next performance problem is targets that take orders of magnitude different times to build (av.c takes less than 1/2 second\, but it is built in parallel with DynaLoader which takes 5 seconds to build\, limiting perl522.dll linking target to 5 seconds. Most of the 5 second delay is how slow EUMM is in generating a Makefile.PL\, and EUMM doing "%EUMMConfig =%Config" which means that tied %Config lazy FETCH feature is useless because of what EUMM does.

-- bulk88 ~ bulk88 at hotmail.com

p5pRT commented 8 years ago

From @tonycoz

On Mon May 25 09​:37​:28 2015\, bulk88 wrote​:

On Sun May 24 23​:07​:07 2015\, tonyc wrote​:

On Tue Dec 16 11​:08​:31 2014\, jdb wrote​:

Is there any benefit to it? I actually prefer to limit the variation in build tools\, i.e. either use VC/nmake\, or GCC/GNUmake for building Perl and modules. Supporting different make utilities with different compilers just adds complexities in modules down the toolchain with no obvious (to me) benefit.

gmake can do parallel builds. nmake can't.

Given bulk88's work in #123867 it would be nice if we had a way to do parallel builds for MSVC.

Tony

I think the best plan is to get a non-parallel gnu makefile into the repo for 5.23\, and Ill try to modify it the same way as the parallel dmake makefile.

Here's patches for the the original file\, and backported updates from blead.

Tony

p5pRT commented 8 years ago

From @tonycoz

0001-kmx-s-original-GNUmakefile.patch ```diff From a5334c1005832d3736d23e48e2969de3a595c74e Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Tue, 26 May 2015 11:53:50 +1000 Subject: [PATCH 1/2] kmx's original GNUmakefile --- MANIFEST | 1 + win32/GNUmakefile | 1379 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1380 insertions(+) create mode 100644 win32/GNUmakefile diff --git a/MANIFEST b/MANIFEST index 4278740..52f87f0 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5606,6 +5606,7 @@ win32/create_perllibst_h.pl creates perllibst.h file for inclusion from perllib. win32/distclean.bat Remove _ALL_ files not listed here in MANIFEST win32/fcrypt.c crypt() implementation win32/FindExt.pm Scan for extensions +win32/GNUmakefile Win32 makefile for GNU make win32/include/arpa/inet.h Win32 port win32/include/dirent.h Win32 port win32/include/netdb.h Win32 port diff --git a/win32/GNUmakefile b/win32/GNUmakefile new file mode 100644 index 0000000..928672c --- /dev/null +++ b/win32/GNUmakefile @@ -0,0 +1,1379 @@ +# +# Makefile to build perl on Windows using GNU make + gcc + MinGW. +# +# This is set up to build a perl.exe that runs off a shared library +# (perl521.dll). Also makes individual DLLs for the XS extensions. +# +# The easiest way to customize the build process is to use parameters like this: +# +# c:\dev\perlsrc\win32> gmake INST_TOP=c:\sw\perl CCHOME=c:\sw\mingw USE_64_BIT_INT=define + + +## +## Make sure you read README.win32 *before* you mess with anything here! +## + +# +# We set this to point to cmd.exe in case GNU Make finds sh.exe in the path. +# Comment this line out if necessary +# +SHELL := cmd.exe + +# define whether you want to use native gcc compiler or cross-compiler +# possible values: gcc +# i686-w64-mingw32-gcc +# x86_64-w64-mingw32-gcc +GCCBIN := gcc + +ifeq ($(GCCBIN),x86_64-w64-mingw32-gcc) +GCCCROSS := x86_64-w64-mingw32 +endif +ifeq ($(GCCBIN),i686-w64-mingw32-gcc) +GCCCROSS := i686-w64-mingw32 +endif + +GCCTARGET := $(shell $(GCCBIN) -dumpmachine) +GCCVER1 := $(shell for /f "delims=. tokens=1,2,3" %%i in ('gcc -dumpversion') do echo %%i) +GCCVER2 := $(shell for /f "delims=. tokens=1,2,3" %%i in ('gcc -dumpversion') do echo %%j) +GCCVER3 := $(shell for /f "delims=. tokens=1,2,3" %%i in ('gcc -dumpversion') do echo %%k) + +ifeq ($(GCCTARGET),x86_64-w64-mingw32) +WIN64 := define +ARCHITECTURE := x64 +endif +ifeq ($(GCCTARGET),i686-w64-mingw32) +WIN64 := undef +ARCHITECTURE := x86 +endif + +## +## Build configuration. Edit the values below to suit your needs. +## + +# +# Set these to wherever you want "gmake install" to put your +# newly built perl. +# +INST_DRV := c: +INST_TOP := $(INST_DRV)\perl + +# +# Comment this out if you DON'T want your perl installation to be versioned. +# This means that the new installation will overwrite any files from the +# old installation at the same INST_TOP location. Leaving it enabled is +# the safest route, as perl adds the extra version directory to all the +# locations it installs files to. If you disable it, an alternative +# versioned installation can be obtained by setting INST_TOP above to a +# path that includes an arbitrary version string. +# +#INST_VER := \5.21.7 + +# +# Comment this out if you DON'T want your perl installation to have +# architecture specific components. This means that architecture- +# specific files will be installed along with the architecture-neutral +# files. Leaving it enabled is safer and more flexible, in case you +# want to build multiple flavors of perl and install them together in +# the same location. Commenting it out gives you a simpler +# installation that is easier to understand for beginners. +# +#INST_ARCH := \$(ARCHNAME) + +# +# Uncomment this if you want perl to run +# $Config{sitelibexp}\sitecustomize.pl +# before anything else. This script can then be set up, for example, +# to add additional entries to @INC. +# +#USE_SITECUST := define + +# +# uncomment to enable multiple interpreters. This is needed for fork() +# emulation and for thread support, and is auto-enabled by USE_IMP_SYS +# and USE_ITHREADS below. +# +USE_MULTI := define + +# +# Interpreter cloning/threads; now reasonably complete. +# This should be enabled to get the fork() emulation. This needs (and +# will auto-enable) USE_MULTI above. +# +USE_ITHREADS := define + +# +# uncomment to enable the implicit "host" layer for all system calls +# made by perl. This is also needed to get fork(). This needs (and +# will auto-enable) USE_MULTI above. +# +USE_IMP_SYS := define + +# +# Comment out next assign to disable perl's I/O subsystem and use compiler's +# stdio for IO - depending on your compiler vendor and run time library you may +# then get a number of fails from make test i.e. bugs - complain to them not us ;-). +# You will also be unable to take full advantage of perl5.8's support for multiple +# encodings and may see lower IO performance. You have been warned. +# +USE_PERLIO := define + +# +# Comment this out if you don't want to enable large file support for +# some reason. Should normally only be changed to maintain compatibility +# with an older release of perl. +# +USE_LARGE_FILES := define + +# +# Uncomment this if you're building a 32-bit perl and want 64-bit integers. +# (If you're building a 64-bit perl then you will have 64-bit integers whether +# or not this is uncommented.) +# Note: This option is not supported in 32-bit MSVC60 builds. +# +#USE_64_BIT_INT := define + +# +# Uncomment this if you want to support the use of long doubles. +# +#USE_LONG_DOUBLE :=define + +# +# uncomment next line if you want debug version of perl (big,slow) +# If not enabled, we automatically try to use maximum optimization +# with all compilers that are known to have a working optimizer. +# +#CFG := Debug + +# +# uncomment to enable linking with setargv.obj under the Visual C +# compiler. Setting this options enables perl to expand wildcards in +# arguments, but it may be harder to use alternate methods like +# File::DosGlob that are more powerful. This option is supported only with +# Visual C. +# +#USE_SETARGV := define + +# +# set this if you wish to use perl's malloc +# WARNING: Turning this on/off WILL break binary compatibility with extensions +# you may have compiled with/without it. Be prepared to recompile all +# extensions if you change the default. Currently, this cannot be enabled +# if you ask for USE_IMP_SYS above. +# +#PERL_MALLOC := define + +# +# set this to enable debugging mstats +# This must be enabled to use the Devel::Peek::mstat() function. This cannot +# be enabled without PERL_MALLOC as well. +# +#DEBUG_MSTATS := define + +# +# set this to additionally provide a statically linked perl-static.exe. +# Note that dynamic loading will not work with this perl, so you must +# include required modules statically using the STATIC_EXT or ALL_STATIC +# variables below. A static library perl521s.lib will also be created. +# Ordinary perl.exe is not affected by this option. +# +#BUILD_STATIC := define + +# +# in addition to BUILD_STATIC the option ALL_STATIC makes *every* +# extension get statically built +# This will result in a very large perl executable, but the main purpose +# is to have proper linking set so as to be able to create miscellaneous +# executables with different built-in extensions +# +#ALL_STATIC := define + +# +# set the install locations of the compiler include/libraries +# Running VCVARS32.BAT is *required* when using Visual C. +# Some versions of Visual C don't define MSVCDIR in the environment, +# so you may have to set CCHOME explicitly (spaces in the path name should +# not be quoted) +# +CCHOME := C:\MinGW + +# +# Following sets $Config{incpath} and $Config{libpth} +# + +ifneq ($(GCCCROSS),) +CCINCDIR := $(CCHOME)\$(GCCCROSS)\include +CCLIBDIR := $(CCHOME)\$(GCCCROSS)\lib +CCDLLDIR := $(CCLIBDIR) +ARCHPREFIX := $(GCCCROSS)- +else +CCINCDIR := $(CCHOME)\include +CCLIBDIR := $(CCHOME)\lib +CCDLLDIR := $(CCHOME)\bin +ARCHPREFIX := +endif + +# +# Additional compiler flags can be specified here. +# +BUILDOPT := $(BUILDOPTEXTRA) + +# +# This should normally be disabled. Enabling it will disable the File::Glob +# implementation of CORE::glob. +# +#BUILDOPT += -DPERL_EXTERNAL_GLOB + +# +# Perl needs to read scripts in text mode so that the DATA filehandle +# works correctly with seek() and tell(), or around auto-flushes of +# all filehandles (e.g. by system(), backticks, fork(), etc). +# +# The current version on the ByteLoader module on CPAN however only +# works if scripts are read in binary mode. But before you disable text +# mode script reading (and break some DATA filehandle functionality) +# please check first if an updated ByteLoader isn't available on CPAN. +# +BUILDOPT += -DPERL_TEXTMODE_SCRIPTS + +# +# specify semicolon-separated list of extra directories that modules will +# look for libraries (spaces in path names need not be quoted) +# +EXTRALIBDIRS := + +# +# set this to your email address (perl will guess a value from +# from your loginname and your hostname, which may not be right) +# +#EMAIL := + +## +## Build configuration ends. +## + +##################### CHANGE THESE ONLY IF YOU MUST ##################### + +PERL_MALLOC ?= undef +DEBUG_MSTATS ?= undef + +USE_SITECUST ?= undef +USE_MULTI ?= undef +USE_ITHREADS ?= undef +USE_IMP_SYS ?= undef +USE_PERLIO ?= undef +USE_LARGE_FILES ?= undef +USE_64_BIT_INT ?= undef +USE_LONG_DOUBLE ?= undef + +ifeq ($(USE_IMP_SYS),define) +PERL_MALLOC = undef +endif + +ifeq ($(PERL_MALLOC),undef) +DEBUG_MSTATS = undef +endif + +ifeq ($(DEBUG_MSTATS),define) +BUILDOPT += -DPERL_DEBUGGING_MSTATS +endif + +ifeq ("$(USE_IMP_SYS) $(USE_MULTI)","define undef") +USE_MULTI = define +endif + +ifeq ("$(USE_ITHREADS) $(USE_MULTI)","define undef") +USE_MULTI = define +endif + +ifeq ($(USE_SITECUST),define) +BUILDOPT += -DUSE_SITECUSTOMIZE +endif + +ifneq ($(USE_MULTI),undef) +BUILDOPT += -DPERL_IMPLICIT_CONTEXT +endif + +ifneq ($(USE_IMP_SYS),undef) +BUILDOPT += -DPERL_IMPLICIT_SYS +endif + +ifeq ($(WIN64),define) +USE_64_BIT_INT = define +endif + +ifeq ($(USE_MULTI),define) +ARCHNAME = MSWin32-$(ARCHITECTURE)-multi +else +ifeq ($(USE_PERLIO),define) +ARCHNAME = MSWin32-$(ARCHITECTURE)-perlio +else +ARCHNAME = MSWin32-$(ARCHITECTURE) +endif +endif + +ifeq ($(USE_PERLIO),define) +BUILDOPT += -DUSE_PERLIO +endif + +ifeq ($(USE_ITHREADS),define) +ARCHNAME := $(ARCHNAME)-thread +endif + +ifneq ($(WIN64),define) +ifeq ($(USE_64_BIT_INT),define) +ARCHNAME := $(ARCHNAME)-64int +endif +endif + +ifeq ($(USE_LONG_DOUBLE),define) +ARCHNAME := $(ARCHNAME)-ld +endif + +ARCHDIR = ..\lib\$(ARCHNAME) +COREDIR = ..\lib\CORE +AUTODIR = ..\lib\auto +LIBDIR = ..\lib +EXTDIR = ..\ext +DISTDIR = ..\dist +CPANDIR = ..\cpan +PODDIR = ..\pod +HTMLDIR = .\html + +# +INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin +INST_BIN = $(INST_SCRIPT)$(INST_ARCH) +INST_LIB = $(INST_TOP)$(INST_VER)\lib +INST_ARCHLIB = $(INST_LIB)$(INST_ARCH) +INST_COREDIR = $(INST_ARCHLIB)\CORE +INST_HTML = $(INST_TOP)$(INST_VER)\html + +# +# Programs to compile, build .lib files and link +# + +MINIBUILDOPT := + +CC = $(ARCHPREFIX)gcc +LINK32 = $(ARCHPREFIX)g++ +LIB32 = $(ARCHPREFIX)ar rc +IMPLIB = $(ARCHPREFIX)dlltool +RSC = $(ARCHPREFIX)windres + +ifeq ($(USE_LONG_DOUBLE),define) +BUILDOPT += -D__USE_MINGW_ANSI_STDIO +MINIBUILDOPT += -D__USE_MINGW_ANSI_STDIO +endif + +# If you are using GCC, 4.3 or later by default we add the -fwrapv option. +# See https://rt.perl.org/Ticket/Display.html?id=121505 +# +GCCWRAPV := $(shell if "$(GCCVER1)"=="4" (if "$(GCCVER2)" geq "3" echo define) else if "$(GCCVER1)" geq "5" (echo define)) + +ifeq ($(GCCWRAPV),define) +BUILDOPT += -fwrapv +MINIBUILDOPT += -fwrapv +endif + +i = .i +o = .o +a = .a + +# +# Options +# + +INCLUDES = -I.\include -I. -I.. -I$(COREDIR) +DEFINES = -DWIN32 +ifeq ($(WIN64),define) +DEFINES += -DWIN64 -DCONSERVATIVE +endif +LOCDEFS = -DPERLDLL -DPERL_CORE +SUBSYS = console +CXX_FLAG = -xc++ +LIBC = +LIBFILES = $(LIBC) \ + -lmoldname -lkernel32 -luser32 -lgdi32 \ + -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \ + -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr \ + -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 + +ifeq ($(CFG),Debug) +OPTIMIZE = -g -O2 -DDEBUGGING +LINK_DBG = -g +else +OPTIMIZE = -s -O2 +LINK_DBG = -s +endif + +EXTRACFLAGS = +CFLAGS = $(EXTRACFLAGS) $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE) +LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)" +OBJOUT_FLAG = -o +EXEOUT_FLAG = -o +LIBOUT_FLAG = + +BUILDOPT += -fno-strict-aliasing -mms-bitfields +CFLAGS_O = $(CFLAGS) $(BUILDOPT) + +# used to allow local linking flags that are not propogated into Config.pm, +# currently unused +# -- BKS, 12-12-1999 +PRIV_LINK_FLAGS = +BLINK_FLAGS = $(PRIV_LINK_FLAGS) $(LINK_FLAGS) + +#################### do not edit below this line ####################### +############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ############## + +%$(o): %.c + $(CC) -c -I$($@ + +%.c: %.y + $(NOOP) + +%.dll: %$(o) + $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES) + $(IMPLIB) --input-def $(*F).def --output-lib $(*F).a $@ + +%.res: %.rc + $(RSC) --use-temp-file --include-dir=. --include-dir=.. -O COFF -D INCLUDE_MANIFEST -i $< -o $@ + +# +# various targets +MINIPERL = ..\miniperl.exe +MINIDIR = mini +PERLEXE = ..\perl.exe +WPERLEXE = ..\wperl.exe +PERLEXESTATIC = ..\perl-static.exe +STATICDIR = .\static.tmp +GLOBEXE = ..\perlglob.exe +CONFIGPM = ..\lib\Config.pm ..\lib\Config_heavy.pl +GENUUDMAP = ..\generate_uudmap.exe +ifeq ($(BUILD_STATIC),define) +PERLSTATIC = static +else +ifeq ($(ALL_STATIC),define) +PERLSTATIC = static +else +PERLSTATIC = +endif +endif + +# Unicode data files generated by mktables +UNIDATAFILES = ..\lib\unicore\Decomposition.pl ..\lib\unicore\TestProp.pl \ + ..\lib\unicore\CombiningClass.pl ..\lib\unicore\Name.pl \ + ..\lib\unicore\UCD.pl ..\lib\unicore\Name.pm \ + ..\lib\unicore\Heavy.pl ..\lib\unicore\mktables.lst + +# Directories of Unicode data files generated by mktables +UNIDATADIR1 = ..\lib\unicore\To +UNIDATADIR2 = ..\lib\unicore\lib + +PERLEXE_MANIFEST= .\perlexe.manifest +PERLEXE_ICO = .\perlexe.ico +PERLEXE_RES = .\perlexe.res +PERLDLL_RES = + +# Nominate a target which causes extensions to be re-built +# This used to be $(PERLEXE), but at worst it is the .dll that they depend +# on and really only the interface - i.e. the .def file used to export symbols +# from the .dll +PERLDEP = perldll.def + + +PL2BAT = bin\pl2bat.pl + +UTILS = \ + ..\utils\h2ph \ + ..\utils\splain \ + ..\utils\perlbug \ + ..\utils\pl2pm \ + ..\utils\c2ph \ + ..\utils\pstruct \ + ..\utils\h2xs \ + ..\utils\perldoc \ + ..\utils\perlivp \ + ..\utils\libnetcfg \ + ..\utils\enc2xs \ + ..\utils\piconv \ + ..\utils\corelist \ + ..\utils\cpan \ + ..\utils\xsubpp \ + ..\utils\pod2html \ + ..\utils\prove \ + ..\utils\ptar \ + ..\utils\ptardiff \ + ..\utils\ptargrep \ + ..\utils\zipdetails \ + ..\utils\shasum \ + ..\utils\instmodsh \ + ..\utils\json_pp \ + bin\exetype.pl \ + bin\runperl.pl \ + bin\pl2bat.pl \ + bin\perlglob.pl \ + bin\search.pl + +CFGSH_TMPL = config.gc +CFGH_TMPL = config_H.gc +PERLIMPLIB = ..\libperl521$(a) +PERLSTATICLIB = ..\libperl521s$(a) +INT64 = long long + +# makedef.pl must be updated if this changes, and this should normally +# only change when there is an incompatible revision of the public API. +PERLDLL = ..\perl521.dll + +XCOPY = xcopy /f /r /i /d /y +RCOPY = xcopy /f /r /i /e /d /y +NOOP = @rem + +MICROCORE_SRC = \ + ..\av.c \ + ..\caretx.c \ + ..\deb.c \ + ..\doio.c \ + ..\doop.c \ + ..\dump.c \ + ..\globals.c \ + ..\gv.c \ + ..\mro.c \ + ..\hv.c \ + ..\locale.c \ + ..\keywords.c \ + ..\mathoms.c \ + ..\mg.c \ + ..\numeric.c \ + ..\op.c \ + ..\pad.c \ + ..\perl.c \ + ..\perlapi.c \ + ..\perly.c \ + ..\pp.c \ + ..\pp_ctl.c \ + ..\pp_hot.c \ + ..\pp_pack.c \ + ..\pp_sort.c \ + ..\pp_sys.c \ + ..\reentr.c \ + ..\regcomp.c \ + ..\regexec.c \ + ..\run.c \ + ..\scope.c \ + ..\sv.c \ + ..\taint.c \ + ..\toke.c \ + ..\universal.c \ + ..\utf8.c \ + ..\util.c + +EXTRACORE_SRC += perllib.c + +ifeq ($(PERL_MALLOC),define) +EXTRACORE_SRC += ..\malloc.c +endif + +EXTRACORE_SRC += ..\perlio.c + +WIN32_SRC = \ + .\win32.c \ + .\win32sck.c \ + .\win32thread.c \ + .\fcrypt.c + +# We need this for miniperl build unless we override canned +# config.h #define building mini\* +#ifeq ($(USE_PERLIO)" == "define" +WIN32_SRC += .\win32io.c +#endif + +CORE_NOCFG_H = \ + ..\av.h \ + ..\cop.h \ + ..\cv.h \ + ..\dosish.h \ + ..\embed.h \ + ..\form.h \ + ..\gv.h \ + ..\handy.h \ + ..\hv.h \ + ..\hv_func.h \ + ..\iperlsys.h \ + ..\mg.h \ + ..\nostdio.h \ + ..\op.h \ + ..\opcode.h \ + ..\perl.h \ + ..\perlapi.h \ + ..\perlsdio.h \ + ..\perly.h \ + ..\pp.h \ + ..\proto.h \ + ..\regcomp.h \ + ..\regexp.h \ + ..\scope.h \ + ..\sv.h \ + ..\thread.h \ + ..\unixish.h \ + ..\utf8.h \ + ..\util.h \ + ..\warnings.h \ + ..\XSUB.h \ + ..\EXTERN.h \ + ..\perlvars.h \ + ..\intrpvar.h \ + .\include\dirent.h \ + .\include\netdb.h \ + .\include\sys\errno2.h \ + .\include\sys\socket.h \ + .\win32.h + +CORE_H = $(CORE_NOCFG_H) .\config.h ..\git_version.h + +UUDMAP_H = ..\uudmap.h +BITCOUNT_H = ..\bitcount.h +MG_DATA_H = ..\mg_data.h +GENERATED_HEADERS = $(UUDMAP_H) $(BITCOUNT_H) $(MG_DATA_H) + +MICROCORE_OBJ = $(MICROCORE_SRC:.c=.o) +CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:.c=.o) +WIN32_OBJ = $(WIN32_SRC:.c=.o) + +MINICORE_OBJ = $(subst ..\,mini\,$(MICROCORE_OBJ)) \ + $(MINIDIR)\miniperlmain$(o) \ + $(MINIDIR)\perlio$(o) +MINIWIN32_OBJ = $(subst .\,mini\,$(WIN32_OBJ)) +MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ) +DLL_OBJ = $(DYNALOADER) +GENUUDMAP_OBJ = $(GENUUDMAP:.exe=.o) + +PERLDLL_OBJ = $(CORE_OBJ) +PERLEXE_OBJ = perlmain$(o) +PERLEXEST_OBJ = perlmainst$(o) + +PERLDLL_OBJ += $(WIN32_OBJ) $(DLL_OBJ) + +ifneq ($(USE_SETARGV),) +SETARGV_OBJ = setargv$(o) +endif + +ifeq ($(ALL_STATIC),define) +# some exclusions, unfortunately, until fixed: +# - MakeMaker isn't capable enough for SDBM_File (small bug) +STATIC_EXT = * !SDBM_File +else +# specify static extensions here, for example: +# (be sure to include Win32CORE to load Win32 on demand) +#STATIC_EXT = Win32CORE Cwd Compress/Raw/Zlib +STATIC_EXT = Win32CORE +endif + +DYNALOADER = ..\DynaLoader$(o) + +# vars must be separated by "\t+~\t+", since we're using the tempfile +# version of config_sh.pl (we were overflowing someone's buffer by +# trying to fit them all on the command line) +# -- BKS 10-17-1999 +CFG_VARS = \ + "INST_TOP=$(INST_TOP)" \ + "INST_VER=$(INST_VER)" \ + "INST_ARCH=$(INST_ARCH)" \ + "archname=$(ARCHNAME)" \ + "cc=$(CC)" \ + "ld=$(LINK32)" \ + "ccflags=$(EXTRACFLAGS) $(OPTIMIZE) $(DEFINES) $(BUILDOPT)" \ + "cf_email=$(EMAIL)" \ + "d_mymalloc=$(PERL_MALLOC)" \ + "libs=$(LIBFILES)" \ + "incpath=$(CCINCDIR)" \ + "libperl=$(subst ..\,,$(PERLIMPLIB))" \ + "libpth=$(CCLIBDIR);$(EXTRALIBDIRS)" \ + "libc=$(LIBC)" \ + "make=$(MAKE)" \ + "_o=$(o)" \ + "obj_ext=$(o)" \ + "_a=$(a)" \ + "lib_ext=$(a)" \ + "static_ext=$(STATIC_EXT)" \ + "usethreads=$(USE_ITHREADS)" \ + "useithreads=$(USE_ITHREADS)" \ + "usemultiplicity=$(USE_MULTI)" \ + "useperlio=$(USE_PERLIO)" \ + "use64bitint=$(USE_64_BIT_INT)" \ + "uselongdouble=$(USE_LONG_DOUBLE)" \ + "uselargefiles=$(USE_LARGE_FILES)" \ + "usesitecustomize=$(USE_SITECUST)" \ + "LINK_FLAGS=$(LINK_FLAGS)" \ + "optimize=$(OPTIMIZE)" \ + "ARCHPREFIX=$(ARCHPREFIX)" \ + "WIN64=$(WIN64)" + +# +# Top targets +# + +.PHONY: all info + +all : info .\config.h ..\git_version.h $(GLOBEXE) $(MINIPERL) \ + $(CONFIGPM) $(UNIDATAFILES) MakePPPort \ + $(PERLEXE) Extensions Extensions_nonxs $(PERLSTATIC) + +info : + @echo # GCCBIN=$(GCCBIN) + @echo # GCCVER=$(GCCVER1).$(GCCVER2).$(GCCVER3) + @echo # GCCTARGET=$(GCCTARGET) + @echo # GCCCROSS=$(GCCCROSS) + @echo # WIN64=$(WIN64) + @echo # ARCHITECTURE=$(ARCHITECTURE) + @echo # ARCHNAME=$(ARCHNAME) + @echo # MAKE=$(MAKE) +ifeq ($(GCCTARGET),) + @echo Unable to detect gcc and/or architecture! + @exit 1 +endif + + +regnodes : ..\regnodes.h + +..\regcomp$(o) : ..\regnodes.h ..\regcharclass.h + +..\regexec$(o) : ..\regnodes.h ..\regcharclass.h + +reonly : regnodes .\config.h ..\git_version.h $(GLOBEXE) $(MINIPERL) \ + $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE) \ + Extensions_reonly + +static: $(PERLEXESTATIC) + +#---------------------------------------------------------------- + +$(GLOBEXE) : perlglob$(o) + $(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES) + +perlglob$(o) : perlglob.c + +config.w32 : $(CFGSH_TMPL) + copy $(CFGSH_TMPL) config.w32 + +# +# Copy the template config.h and set configurables at the end of it +# as per the options chosen and compiler used. +# Note: This config.h is only used to build miniperl.exe anyway, but +# it's as well to have its options correct to be sure that it builds +# and so that it's "-V" options are correct for use by makedef.pl. The +# real config.h used to build perl.exe is generated from the top-level +# config_h.SH by config_h.PL (run by miniperl.exe). +# +.\config.h : $(CFGH_TMPL) $(CORE_NOCFG_H) + -del /f config.h + copy $(CFGH_TMPL) config.h + @echo.>>$@ + @echo #ifndef _config_h_footer_>>$@ + @echo #define _config_h_footer_>>$@ + @echo #undef Off_t>>$@ + @echo #undef LSEEKSIZE>>$@ + @echo #undef Off_t_size>>$@ + @echo #undef PTRSIZE>>$@ + @echo #undef SSize_t>>$@ + @echo #undef HAS_ATOLL>>$@ + @echo #undef HAS_STRTOLL>>$@ + @echo #undef HAS_STRTOULL>>$@ + @echo #undef Size_t_size>>$@ + @echo #undef IVTYPE>>$@ + @echo #undef UVTYPE>>$@ + @echo #undef IVSIZE>>$@ + @echo #undef UVSIZE>>$@ + @echo #undef NV_PRESERVES_UV>>$@ + @echo #undef NV_PRESERVES_UV_BITS>>$@ + @echo #undef IVdf>>$@ + @echo #undef UVuf>>$@ + @echo #undef UVof>>$@ + @echo #undef UVxf>>$@ + @echo #undef UVXf>>$@ + @echo #undef USE_64_BIT_INT>>$@ + @echo #undef Gconvert>>$@ + @echo #undef HAS_FREXPL>>$@ + @echo #undef HAS_ISNANL>>$@ + @echo #undef HAS_MODFL>>$@ + @echo #undef HAS_MODFL_PROTO>>$@ + @echo #undef HAS_SQRTL>>$@ + @echo #undef HAS_STRTOLD>>$@ + @echo #undef PERL_PRIfldbl>>$@ + @echo #undef PERL_PRIgldbl>>$@ + @echo #undef PERL_PRIeldbl>>$@ + @echo #undef PERL_SCNfldbl>>$@ + @echo #undef NVTYPE>>$@ + @echo #undef NVSIZE>>$@ + @echo #undef LONG_DOUBLESIZE>>$@ + @echo #undef NV_OVERFLOWS_INTEGERS_AT>>$@ + @echo #undef NVef>>$@ + @echo #undef NVff>>$@ + @echo #undef NVgf>>$@ + @echo #undef USE_LONG_DOUBLE>>$@ +ifeq ($(USE_LARGE_FILES),define) + @echo #define Off_t $(INT64)>>$@ + @echo #define LSEEKSIZE ^8>>$@ + @echo #define Off_t_size ^8>>$@ +else + @echo #define Off_t long>>$@ + @echo #define LSEEKSIZE ^4>>$@ + @echo #define Off_t_size ^4>>$@ +endif +ifeq ($(WIN64),define) + @echo #define PTRSIZE ^8>>$@ + @echo #define SSize_t $(INT64)>>$@ + @echo #define HAS_ATOLL>>$@ + @echo #define HAS_STRTOLL>>$@ + @echo #define HAS_STRTOULL>>$@ + @echo #define Size_t_size ^8>>$@ +else + @echo #define PTRSIZE ^4>>$@ + @echo #define SSize_t int>>$@ + @echo #undef HAS_ATOLL>>$@ + @echo #undef HAS_STRTOLL>>$@ + @echo #undef HAS_STRTOULL>>$@ + @echo #define Size_t_size ^4>>$@ +endif +ifeq ($(USE_64_BIT_INT),define) + @echo #define IVTYPE $(INT64)>>$@ + @echo #define UVTYPE unsigned $(INT64)>>$@ + @echo #define IVSIZE ^8>>$@ + @echo #define UVSIZE ^8>>$@ +ifeq ($(USE_LONG_DOUBLE),define) + @echo #define NV_PRESERVES_UV>>$@ + @echo #define NV_PRESERVES_UV_BITS 64>>$@ +else + @echo #undef NV_PRESERVES_UV>>$@ + @echo #define NV_PRESERVES_UV_BITS 53>>$@ +endif + @echo #define IVdf "I64d">>$@ + @echo #define UVuf "I64u">>$@ + @echo #define UVof "I64o">>$@ + @echo #define UVxf "I64x">>$@ + @echo #define UVXf "I64X">>$@ + @echo #define USE_64_BIT_INT>>$@ +else + @echo #define IVTYPE long>>$@ + @echo #define UVTYPE unsigned long>>$@ + @echo #define IVSIZE ^4>>$@ + @echo #define UVSIZE ^4>>$@ + @echo #define NV_PRESERVES_UV>>$@ + @echo #define NV_PRESERVES_UV_BITS 32>>$@ + @echo #define IVdf "ld">>$@ + @echo #define UVuf "lu">>$@ + @echo #define UVof "lo">>$@ + @echo #define UVxf "lx">>$@ + @echo #define UVXf "lX">>$@ + @echo #undef USE_64_BIT_INT>>$@ +endif +ifeq ($(USE_LONG_DOUBLE),define) + @echo #define Gconvert(x,n,t,b) sprintf((b),"%%.*""Lg",(n),(x))>>$@ + @echo #define HAS_FREXPL>>$@ + @echo #define HAS_ISNANL>>$@ + @echo #define HAS_MODFL>>$@ + @echo #define HAS_MODFL_PROTO>>$@ + @echo #define HAS_SQRTL>>$@ + @echo #define HAS_STRTOLD>>$@ + @echo #define PERL_PRIfldbl "Lf">>$@ + @echo #define PERL_PRIgldbl "Lg">>$@ + @echo #define PERL_PRIeldbl "Le">>$@ + @echo #define PERL_SCNfldbl "Lf">>$@ + @echo #define NVTYPE long double>>$@ +ifeq ($(WIN64),define) + @echo #define NVSIZE ^16>>$@ + @echo #define LONG_DOUBLESIZE ^16>>$@ +else + @echo #define NVSIZE ^12>>$@ + @echo #define LONG_DOUBLESIZE ^12>>$@ +endif + @echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0>>$@ + @echo #define NVef "Le">>$@ + @echo #define NVff "Lf">>$@ + @echo #define NVgf "Lg">>$@ + @echo #define USE_LONG_DOUBLE>>$@ +else + @echo #define Gconvert(x,n,t,b) sprintf((b),"%%.*g",(n),(x))>>$@ + @echo #undef HAS_FREXPL>>$@ + @echo #undef HAS_ISNANL>>$@ + @echo #undef HAS_MODFL>>$@ + @echo #undef HAS_MODFL_PROTO>>$@ + @echo #undef HAS_SQRTL>>$@ + @echo #undef HAS_STRTOLD>>$@ + @echo #undef PERL_PRIfldbl>>$@ + @echo #undef PERL_PRIgldbl>>$@ + @echo #undef PERL_PRIeldbl>>$@ + @echo #undef PERL_SCNfldbl>>$@ + @echo #define NVTYPE double>>$@ + @echo #define NVSIZE ^8>>$@ + @echo #define LONG_DOUBLESIZE ^8>>$@ + @echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0>>$@ + @echo #define NVef "e">>$@ + @echo #define NVff "f">>$@ + @echo #define NVgf "g">>$@ + @echo #undef USE_LONG_DOUBLE>>$@ +endif + @echo #endif>>$@ + +..\git_version.h : $(MINIPERL) ..\make_patchnum.pl + cd .. && miniperl -Ilib make_patchnum.pl + +# make sure that we recompile perl.c if the git version changes +..\perl$(o) : ..\git_version.h + +..\config.sh : config.w32 $(MINIPERL) config_sh.PL FindExt.pm + $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh + +# This target is for when changes to the main config.sh happen. +# Edit config.gc, then make perl using GCC in a minimal configuration (i.e. +# with MULTI, ITHREADS, IMP_SYS, LARGE_FILES and PERLIO off), then make +# this target to regenerate config_H.gc. +regen_config_h: + $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS)) $(CFGSH_TMPL) > ..\config.sh + $(MINIPERL) -I..\lib ..\configpm --chdir=.. + -del /f $(CFGH_TMPL) + -$(MINIPERL) -I..\lib config_h.PL "ARCHPREFIX=$(ARCHPREFIX)" + rename config.h $(CFGH_TMPL) + +$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL + $(MINIPERL) -I..\lib ..\configpm --chdir=.. + if exist lib\* $(RCOPY) "lib\*.*" ..\lib\$(NULL) + $(XCOPY) "..\*.h" $(COREDIR)\$(NULL) + $(XCOPY) "*.h" $(COREDIR)\$(NULL) + $(RCOPY) include $(COREDIR)\$(NULL) + $(MINIPERL) -I..\lib config_h.PL "ARCHPREFIX=$(ARCHPREFIX)" \ + || $(MAKE) $(MAKEMACROS) $(CONFIGPM) $(MAKEFILE) + +# See the comment in Makefile.SH explaining this seemingly cranky ordering +$(MINIPERL) : ..\lib\buildcustomize.pl + +..\lib\buildcustomize.pl : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS) ..\write_buildcustomize.pl + $(LINK32) -mconsole -o $(MINIPERL) $(BLINK_FLAGS) $(MINI_OBJ) $(LIBFILES) + $(MINIPERL) -I..\lib -f ..\write_buildcustomize.pl .. + +$(MINIDIR) : + if not exist "$(MINIDIR)" mkdir "$(MINIDIR)" + +$(MINICORE_OBJ) : $(CORE_NOCFG_H) + $(CC) -c $(CFLAGS) $(MINIBUILDOPT) -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ ..\$(*F).c + +$(MINIWIN32_OBJ) : $(CORE_NOCFG_H) + $(CC) -c $(CFLAGS) $(MINIBUILDOPT) -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ $(*F).c + +# -DPERL_IMPLICIT_SYS needs C++ for perllib.c +# rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless +# unless the .IF is true), so instead we use a else with the default. +# This is the only file that depends on perlhost.h, vmem.h, and vdir.h + +perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h +ifeq ($(USE_IMP_SYS),define) + $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c +else + $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c +endif + +# 1. we don't want to rebuild miniperl.exe when config.h changes +# 2. we don't want to rebuild miniperl.exe with non-default config.h +# 3. we can't have miniperl.exe depend on git_version.h, as miniperl creates it +$(MINI_OBJ) : $(CORE_NOCFG_H) + +$(WIN32_OBJ) : $(CORE_H) + +$(CORE_OBJ) : $(CORE_H) + +$(DLL_OBJ) : $(CORE_H) + +perldll.def : $(MINIPERL) $(CONFIGPM) ..\embed.fnc ..\makedef.pl create_perllibst_h.pl + $(MINIPERL) -I..\lib create_perllibst_h.pl + $(MINIPERL) -I..\lib -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \ + $(BUILDOPT) CCTYPE=GCC TARG_DIR=..\ > perldll.def + +$(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static + $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(BLINK_FLAGS) \ + $(PERLDLL_OBJ) $(shell type Extensions_static) $(LIBFILES) + $(IMPLIB) --output-lib $(PERLIMPLIB) \ + --dllname $(PERLDLL) \ + --def perldll.def \ + --base-file perl.base \ + --output-exp perl.exp + $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \ + $(PERLDLL_OBJ) $(shell type Extensions_static) $(LIBFILES) perl.exp + $(XCOPY) $(PERLIMPLIB) $(COREDIR) + +$(PERLSTATICLIB): $(PERLDLL_OBJ) Extensions_static + $(LIB32) $(LIB_FLAGS) $@ $(PERLDLL_OBJ) + if exist $(STATICDIR) rmdir /s /q $(STATICDIR) + for %%i in ($(shell type Extensions_static)) do \ + @mkdir $(STATICDIR) && cd $(STATICDIR) && \ + $(ARCHPREFIX)ar x ..\%%i && \ + $(ARCHPREFIX)ar q ..\$@ *$(o) && \ + cd .. && rmdir /s /q $(STATICDIR) + $(XCOPY) $(PERLSTATICLIB) $(COREDIR) + +$(PERLEXE_RES): perlexe.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO) + +$(MINIDIR)\globals$(o) : $(GENERATED_HEADERS) + +$(UUDMAP_H) $(MG_DATA_H) : $(BITCOUNT_H) + +$(BITCOUNT_H) : $(GENUUDMAP) + $(GENUUDMAP) $(GENERATED_HEADERS) + +$(GENUUDMAP_OBJ) : ..\mg_raw.h + +$(GENUUDMAP) : $(GENUUDMAP_OBJ) + $(LINK32) -o $@ $(BLINK_FLAGS) $(GENUUDMAP_OBJ) $(LIBFILES) + +perlmain.c : runperl.c + copy runperl.c perlmain.c + +perlmain$(o) : perlmain.c + $(CC) $(subst -DPERLDLL,-UPERLDLL,$(CFLAGS_O)) $(OBJOUT_FLAG)$@ -c perlmain.c + +perlmainst.c : runperl.c + copy runperl.c perlmainst.c + +perlmainst$(o) : perlmainst.c + $(CC) $(CFLAGS_O) $(OBJOUT_FLAG)$@ -c perlmainst.c + +$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) + $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \ + $(PERLEXE_OBJ) $(PERLEXE_RES) $(PERLIMPLIB) $(LIBFILES) + copy $(PERLEXE) $(WPERLEXE) + $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS + +$(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES) + $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \ + $(PERLEXEST_OBJ) $(PERLEXE_RES) $(PERLSTATICLIB) $(LIBFILES) + +MakePPPort: $(MINIPERL) $(CONFIGPM) Extensions_nonxs + $(MINIPERL) -I..\lib ..\mkppport + +#------------------------------------------------------------------------------- +# There's no direct way to mark a dependency on +# DynaLoader.pm, so this will have to do +Extensions : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER) + $(XCOPY) "..\*.h" $(COREDIR)\$(NULL) + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic + +Extensions_reonly : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER) + $(XCOPY) "..\*.h" $(COREDIR)\$(NULL) + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re + +Extensions_static : ..\make_ext.pl ..\lib\buildcustomize.pl list_static_libs.pl $(PERLDEP) $(CONFIGPM) Extensions_nonxs + $(XCOPY) "..\*.h" $(COREDIR)\$(NULL) + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static + $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static + +Extensions_nonxs : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) ..\pod\perlfunc.pod + $(XCOPY) "..\*.h" $(COREDIR)\$(NULL) + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs + +$(DYNALOADER) : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) Extensions_nonxs + $(XCOPY) "..\*.h" $(COREDIR)\$(NULL) + $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --dynaloader + +Extensions_clean : + -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=clean + +Extensions_realclean : + -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=realclean + +#------------------------------------------------------------------------------- + +doc: $(PERLEXE) ..\pod\perltoc.pod + $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=$(HTMLDIR) \ + --podpath=pod:lib:utils --htmlroot="file://$(subst :,|,$(INST_HTML))"\ + --recurse + +..\utils\Makefile: $(CONFIGPM) ..\utils\Makefile.PL + $(MINIPERL) -I..\lib ..\utils\Makefile.PL .. + +# Note that this next section is parsed (and regenerated) by pod/buildtoc +# so please check that script before making structural changes here +utils: $(PERLEXE) ..\utils\Makefile + cd ..\utils && $(MAKE) PERL=$(MINIPERL) + copy ..\README.aix ..\pod\perlaix.pod + copy ..\README.amiga ..\pod\perlamiga.pod + copy ..\README.android ..\pod\perlandroid.pod + copy ..\README.bs2000 ..\pod\perlbs2000.pod + copy ..\README.ce ..\pod\perlce.pod + copy ..\README.cn ..\pod\perlcn.pod + copy ..\README.cygwin ..\pod\perlcygwin.pod + copy ..\README.dos ..\pod\perldos.pod + copy ..\README.freebsd ..\pod\perlfreebsd.pod + copy ..\README.haiku ..\pod\perlhaiku.pod + copy ..\README.hpux ..\pod\perlhpux.pod + copy ..\README.hurd ..\pod\perlhurd.pod + copy ..\README.irix ..\pod\perlirix.pod + copy ..\README.jp ..\pod\perljp.pod + copy ..\README.ko ..\pod\perlko.pod + copy ..\README.linux ..\pod\perllinux.pod + copy ..\README.macos ..\pod\perlmacos.pod + copy ..\README.macosx ..\pod\perlmacosx.pod + copy ..\README.netware ..\pod\perlnetware.pod + copy ..\README.openbsd ..\pod\perlopenbsd.pod + copy ..\README.os2 ..\pod\perlos2.pod + copy ..\README.os390 ..\pod\perlos390.pod + copy ..\README.os400 ..\pod\perlos400.pod + copy ..\README.plan9 ..\pod\perlplan9.pod + copy ..\README.qnx ..\pod\perlqnx.pod + copy ..\README.riscos ..\pod\perlriscos.pod + copy ..\README.solaris ..\pod\perlsolaris.pod + copy ..\README.symbian ..\pod\perlsymbian.pod + copy ..\README.synology ..\pod\perlsynology.pod + copy ..\README.tru64 ..\pod\perltru64.pod + copy ..\README.tw ..\pod\perltw.pod + copy ..\README.vos ..\pod\perlvos.pod + copy ..\README.win32 ..\pod\perlwin32.pod + copy ..\pod\perldelta.pod ..\pod\perl5217delta.pod + $(PERLEXE) $(PL2BAT) $(UTILS) + $(MINIPERL) -I..\lib ..\autodoc.pl .. + $(MINIPERL) -I..\lib ..\pod\perlmodlib.PL -q .. + +..\pod\perltoc.pod: $(PERLEXE) Extensions Extensions_nonxs + $(PERLEXE) -f ..\pod\buildtoc -q + +# Note that the pod cleanup in this next section is parsed (and regenerated +# by pod/buildtoc so please check that script before making changes here + +distclean: realclean + -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \ + $(PERLIMPLIB) ..\miniperl$(a) $(PERLEXESTATIC) $(PERLSTATICLIB) + -del /f $(LIBDIR)\Encode.pm $(LIBDIR)\encoding.pm $(LIBDIR)\Errno.pm + -del /f $(LIBDIR)\Config.pod $(LIBDIR)\POSIX.pod $(LIBDIR)\threads.pm + -del /f $(LIBDIR)\.exists $(LIBDIR)\attributes.pm $(LIBDIR)\DynaLoader.pm + -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm + -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm + -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm + -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm + -del /f $(LIBDIR)\File\Glob.pm + -del /f $(LIBDIR)\Storable.pm + -del /f $(LIBDIR)\Sys\Hostname.pm + -del /f $(LIBDIR)\Time\HiRes.pm + -del /f $(LIBDIR)\Unicode\Normalize.pm + -del /f $(LIBDIR)\Math\BigInt\FastCalc.pm + -del /f $(LIBDIR)\Win32.pm + -del /f $(LIBDIR)\Win32CORE.pm + -del /f $(LIBDIR)\Win32API\File.pm + -del /f $(LIBDIR)\Win32API\File\cFile.pc + -del /f $(LIBDIR)\buildcustomize.pl + -del /f $(DISTDIR)\XSLoader\XSLoader.pm + -del /f *.def *.map + -if exist $(LIBDIR)\App rmdir /s /q $(LIBDIR)\App + -if exist $(LIBDIR)\Archive rmdir /s /q $(LIBDIR)\Archive + -if exist $(LIBDIR)\Attribute rmdir /s /q $(LIBDIR)\Attribute + -if exist $(LIBDIR)\autodie rmdir /s /q $(LIBDIR)\autodie + -if exist $(LIBDIR)\Carp rmdir /s /q $(LIBDIR)\Carp + -if exist $(LIBDIR)\Compress rmdir /s /q $(LIBDIR)\Compress + -if exist $(LIBDIR)\Config\Perl rmdir /s /q $(LIBDIR)\Config\Perl + -if exist $(LIBDIR)\CPAN rmdir /s /q $(LIBDIR)\CPAN + -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data + -if exist $(LIBDIR)\Devel rmdir /s /q $(LIBDIR)\Devel + -if exist $(LIBDIR)\Digest rmdir /s /q $(LIBDIR)\Digest + -if exist $(LIBDIR)\Encode rmdir /s /q $(LIBDIR)\Encode + -if exist $(LIBDIR)\encoding rmdir /s /q $(LIBDIR)\encoding + -if exist $(LIBDIR)\Exporter rmdir /s /q $(LIBDIR)\Exporter + -if exist $(LIBDIR)\ExtUtils\CBuilder rmdir /s /q $(LIBDIR)\ExtUtils\CBuilder + -if exist $(LIBDIR)\ExtUtils\Command rmdir /s /q $(LIBDIR)\ExtUtils\Command + -if exist $(LIBDIR)\ExtUtils\Constant rmdir /s /q $(LIBDIR)\ExtUtils\Constant + -if exist $(LIBDIR)\ExtUtils\Liblist rmdir /s /q $(LIBDIR)\ExtUtils\Liblist + -if exist $(LIBDIR)\ExtUtils\MakeMaker rmdir /s /q $(LIBDIR)\ExtUtils\MakeMaker + -if exist $(LIBDIR)\ExtUtils\ParseXS rmdir /s /q $(LIBDIR)\ExtUtils\ParseXS + -if exist $(LIBDIR)\ExtUtils\Typemaps rmdir /s /q $(LIBDIR)\ExtUtils\Typemaps + -if exist $(LIBDIR)\File\Spec rmdir /s /q $(LIBDIR)\File\Spec + -if exist $(LIBDIR)\Filter rmdir /s /q $(LIBDIR)\Filter + -if exist $(LIBDIR)\Hash rmdir /s /q $(LIBDIR)\Hash + -if exist $(LIBDIR)\HTTP rmdir /s /q $(LIBDIR)\HTTP + -if exist $(LIBDIR)\I18N rmdir /s /q $(LIBDIR)\I18N + -if exist $(LIBDIR)\IO rmdir /s /q $(LIBDIR)\IO + -if exist $(LIBDIR)\IPC rmdir /s /q $(LIBDIR)\IPC + -if exist $(LIBDIR)\JSON rmdir /s /q $(LIBDIR)\JSON + -if exist $(LIBDIR)\List rmdir /s /q $(LIBDIR)\List + -if exist $(LIBDIR)\Locale rmdir /s /q $(LIBDIR)\Locale + -if exist $(LIBDIR)\Math rmdir /s /q $(LIBDIR)\Math + -if exist $(LIBDIR)\Memoize rmdir /s /q $(LIBDIR)\Memoize + -if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME + -if exist $(LIBDIR)\Module rmdir /s /q $(LIBDIR)\Module + -if exist $(LIBDIR)\Net\FTP rmdir /s /q $(LIBDIR)\Net\FTP + -if exist $(LIBDIR)\Params rmdir /s /q $(LIBDIR)\Params + -if exist $(LIBDIR)\Parse rmdir /s /q $(LIBDIR)\Parse + -if exist $(LIBDIR)\Perl rmdir /s /q $(LIBDIR)\Perl + -if exist $(LIBDIR)\PerlIO rmdir /s /q $(LIBDIR)\PerlIO + -if exist $(LIBDIR)\Pod\Perldoc rmdir /s /q $(LIBDIR)\Pod\Perldoc + -if exist $(LIBDIR)\Pod\Simple rmdir /s /q $(LIBDIR)\Pod\Simple + -if exist $(LIBDIR)\Pod\Text rmdir /s /q $(LIBDIR)\Pod\Text + -if exist $(LIBDIR)\Scalar rmdir /s /q $(LIBDIR)\Scalar + -if exist $(LIBDIR)\Search rmdir /s /q $(LIBDIR)\Search + -if exist $(LIBDIR)\Sub rmdir /s /q $(LIBDIR)\Sub + -if exist $(LIBDIR)\Sys rmdir /s /q $(LIBDIR)\Sys + -if exist $(LIBDIR)\TAP rmdir /s /q $(LIBDIR)\TAP + -if exist $(LIBDIR)\Term rmdir /s /q $(LIBDIR)\Term + -if exist $(LIBDIR)\Test rmdir /s /q $(LIBDIR)\Test + -if exist $(LIBDIR)\Text rmdir /s /q $(LIBDIR)\Text + -if exist $(LIBDIR)\Thread rmdir /s /q $(LIBDIR)\Thread + -if exist $(LIBDIR)\threads rmdir /s /q $(LIBDIR)\threads + -if exist $(LIBDIR)\Tie\Hash rmdir /s /q $(LIBDIR)\Tie\Hash + -if exist $(LIBDIR)\Unicode\Collate rmdir /s /q $(LIBDIR)\Unicode\Collate + -if exist $(LIBDIR)\Unicode\Collate\Locale rmdir /s /q $(LIBDIR)\Unicode\Collate\Locale + -if exist $(LIBDIR)\version rmdir /s /q $(LIBDIR)\version + -if exist $(LIBDIR)\VMS rmdir /s /q $(LIBDIR)\VMS + -if exist $(LIBDIR)\Win32API rmdir /s /q $(LIBDIR)\Win32API + -if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS + -cd $(PODDIR) && del /f *.html *.bat roffitall \ + perl5217delta.pod perlaix.pod perlamiga.pod perlandroid.pod \ + perlapi.pod perlbs2000.pod perlce.pod perlcn.pod perlcygwin.pod \ + perldos.pod perlfreebsd.pod perlhaiku.pod perlhpux.pod \ + perlhurd.pod perlintern.pod perlirix.pod perljp.pod perlko.pod \ + perllinux.pod perlmacos.pod perlmacosx.pod perlmodlib.pod \ + perlnetware.pod perlopenbsd.pod perlos2.pod perlos390.pod \ + perlos400.pod perlplan9.pod perlqnx.pod perlriscos.pod \ + perlsolaris.pod perlsymbian.pod perlsynology.pod perltoc.pod \ + perltru64.pod perltw.pod perluniprops.pod perlvos.pod \ + perlwin32.pod + -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \ + perldoc perlivp libnetcfg enc2xs piconv cpan *.bat \ + xsubpp pod2html instmodsh json_pp prove ptar ptardiff ptargrep shasum corelist zipdetails + -del /f ..\config.sh perlmain.c dlutils.c config.h.new \ + perlmainst.c + -del /f $(CONFIGPM) + -del /f ..\lib\Config_git.pl + -del /f "bin\*.bat" + -del /f perllibst.h + -del /f $(PERLEXE_RES) perl.base + -cd .. && del /s *$(a) *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib ppport.h + -cd $(EXTDIR) && del /s *.def Makefile Makefile.old + -cd $(DISTDIR) && del /s *.def Makefile Makefile.old + -cd $(CPANDIR) && del /s *.def Makefile Makefile.old + -del /s ..\utils\Makefile + -if exist $(AUTODIR) rmdir /s /q $(AUTODIR) + -if exist $(COREDIR) rmdir /s /q $(COREDIR) + -if exist pod2htmd.tmp del pod2htmd.tmp + -if exist $(HTMLDIR) rmdir /s /q $(HTMLDIR) + -del /f ..\t\test_state + +install : all installbare installhtml + +installbare : utils ..\pod\perltoc.pod + $(PERLEXE) ..\installperl + if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\$(NULL) + if exist $(PERLEXESTATIC) $(XCOPY) $(PERLEXESTATIC) $(INST_BIN)\$(NULL) + $(XCOPY) $(GLOBEXE) $(INST_BIN)\$(NULL) + if exist ..\perl*.pdb $(XCOPY) ..\perl*.pdb $(INST_BIN)\$(NULL) + $(XCOPY) "bin\*.bat" $(INST_SCRIPT)\$(NULL) + +installhtml : doc + $(RCOPY) $(HTMLDIR)\*.* $(INST_HTML)\$(NULL) + +inst_lib : $(CONFIGPM) + $(RCOPY) ..\lib $(INST_LIB)\$(NULL) + +$(UNIDATAFILES) ..\pod\perluniprops.pod .UPDATEALL : $(MINIPERL) $(CONFIGPM) ..\lib\unicore\mktables Extensions_nonxs + cd ..\lib\unicore && \ + ..\$(MINIPERL) -I.. -I..\..\dist\Cwd\lib -I..\..\dist\Cwd mktables -P ..\..\pod -maketest -makelist -p + +minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) $(UNIDATAFILES) utils + $(XCOPY) $(MINIPERL) ..\t\$(NULL) + if exist ..\t\perl.exe del /f ..\t\perl.exe + rename ..\t\miniperl.exe perl.exe + $(XCOPY) $(GLOBEXE) ..\t\$(NULL) + attrib -r "..\t\*.*" + cd ..\t && \ + $(MINIPERL) -I..\lib harness base/*.t comp/*.t cmd/*.t io/*.t opbasic/*.t op/*.t pragma/*.t + +test-prep : all utils ..\pod\perltoc.pod + $(XCOPY) $(PERLEXE) ..\t\$(NULL) + $(XCOPY) $(PERLDLL) ..\t\$(NULL) + $(XCOPY) $(GLOBEXE) ..\t\$(NULL) +# If building with gcc versions 4.x.x or greater, then +# the GCC helper DLL will also need copied to the test directory. +# The name of the dll can change, depending upon which vendor has supplied +# your compiler, and upon the values of "x". +# libstdc++-6.dll is copied if it exists as it, too, may then be needed. +# Without this copying, the op/taint.t test script will fail. + if exist $(CCDLLDIR)\libgcc_s_seh-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_seh-1.dll ..\t\$(NULL) + if exist $(CCDLLDIR)\libgcc_s_sjlj-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_sjlj-1.dll ..\t\$(NULL) + if exist $(CCDLLDIR)\libgcc_s_dw2-1.dll $(XCOPY) $(CCDLLDIR)\libgcc_s_dw2-1.dll ..\t\$(NULL) + if exist $(CCDLLDIR)\libstdc++-6.dll $(XCOPY) $(CCDLLDIR)\libstdc++-6.dll ..\t\$(NULL) + if exist $(CCDLLDIR)\libwinpthread-1.dll $(XCOPY) $(CCDLLDIR)\libwinpthread-1.dll ..\t\$(NULL) + +test : test-prep + set PERL_STATIC_EXT=$(STATIC_EXT) && \ + cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES) + +test_porting : test-prep + set PERL_STATIC_EXT=$(STATIC_EXT) && \ + cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) porting\*.t ..\lib\diagnostics.t + +test-reonly : reonly utils + $(XCOPY) $(PERLEXE) ..\t\$(NULL) + $(XCOPY) $(PERLDLL) ..\t\$(NULL) + $(XCOPY) $(GLOBEXE) ..\t\$(NULL) + cd ..\t && \ + $(PERLEXE) -I..\lib harness $(OPT) -re \bpat\\/ $(EXTRA) && \ + cd ..\win32 + +regen : + cd .. && regen.pl && cd win32 + +test-notty : test-prep + set PERL_STATIC_EXT=$(STATIC_EXT) && \ + set PERL_SKIP_TTY_TEST=1 && \ + cd ..\t && $(PERLEXE) -I.\lib harness $(TEST_SWITCHES) $(TEST_FILES) + +_test : + $(XCOPY) $(PERLEXE) ..\t\$(NULL) + $(XCOPY) $(PERLDLL) ..\t\$(NULL) + $(XCOPY) $(GLOBEXE) ..\t\$(NULL) + set PERL_STATIC_EXT=$(STATIC_EXT) && \ + cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES) + +_clean : + -@erase miniperlmain$(o) + -@erase $(MINIPERL) + -@erase perlglob$(o) + -@erase perlmain$(o) + -@erase perlmainst$(o) + -@erase config.w32 + -@erase /f config.h + -@erase /f ..\git_version.h + -@erase $(GLOBEXE) + -@erase $(PERLEXE) + -@erase $(WPERLEXE) + -@erase $(PERLEXESTATIC) + -@erase $(PERLSTATICLIB) + -@erase $(PERLDLL) + -@erase $(CORE_OBJ) + -@erase $(GENUUDMAP) $(GENUUDMAP_OBJ) $(GENERATED_HEADERS) + -if exist $(MINIDIR) rmdir /s /q $(MINIDIR) + -if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1) + -if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2) + -@erase $(UNIDATAFILES) + -@erase $(WIN32_OBJ) + -@erase $(DLL_OBJ) + -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res + -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat + -@erase *.ilk + -@erase *.pdb + -@erase Extensions_static + +clean : Extensions_clean _clean + +realclean : Extensions_realclean _clean + +# Handy way to run perlbug -ok without having to install and run the +# installed perlbug. We don't re-run the tests here - we trust the user. +# Please *don't* use this unless all tests pass. +# If you want to report test failures, use "gmake nok" instead. +ok: utils + $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" + +okfile: utils + $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok + +nok: utils + $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" + +nokfile: utils + $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok -- 1.9.5.msysgit.0 ```
p5pRT commented 8 years ago

From @tonycoz

0002-update-to-5.22.0-and-update-with-changes-from-the-ot.patch ```diff From 5b808537142bce731ef8abbd0b8fa1d81978463c Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Tue, 26 May 2015 11:54:23 +1000 Subject: [PATCH 2/2] update to 5.22.0 and update with changes from the other makefiles --- win32/GNUmakefile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/win32/GNUmakefile b/win32/GNUmakefile index 928672c..3335a99 100644 --- a/win32/GNUmakefile +++ b/win32/GNUmakefile @@ -2,7 +2,7 @@ # Makefile to build perl on Windows using GNU make + gcc + MinGW. # # This is set up to build a perl.exe that runs off a shared library -# (perl521.dll). Also makes individual DLLs for the XS extensions. +# (perl522.dll). Also makes individual DLLs for the XS extensions. # # The easiest way to customize the build process is to use parameters like this: # @@ -66,7 +66,7 @@ INST_TOP := $(INST_DRV)\perl # versioned installation can be obtained by setting INST_TOP above to a # path that includes an arbitrary version string. # -#INST_VER := \5.21.7 +#INST_VER := \5.22.0 # # Comment this out if you DON'T want your perl installation to have @@ -173,7 +173,7 @@ USE_LARGE_FILES := define # set this to additionally provide a statically linked perl-static.exe. # Note that dynamic loading will not work with this perl, so you must # include required modules statically using the STATIC_EXT or ALL_STATIC -# variables below. A static library perl521s.lib will also be created. +# variables below. A static library perl522s.lib will also be created. # Ordinary perl.exe is not affected by this option. # #BUILD_STATIC := define @@ -413,6 +413,7 @@ EXEOUT_FLAG = -o LIBOUT_FLAG = BUILDOPT += -fno-strict-aliasing -mms-bitfields +MINIBUILDOPT += -fno-strict-aliasing CFLAGS_O = $(CFLAGS) $(BUILDOPT) # used to allow local linking flags that are not propogated into Config.pm, @@ -518,13 +519,13 @@ UTILS = \ CFGSH_TMPL = config.gc CFGH_TMPL = config_H.gc -PERLIMPLIB = ..\libperl521$(a) -PERLSTATICLIB = ..\libperl521s$(a) +PERLIMPLIB = ..\libperl522$(a) +PERLSTATICLIB = ..\libperl522s$(a) INT64 = long long # makedef.pl must be updated if this changes, and this should normally # only change when there is an incompatible revision of the public API. -PERLDLL = ..\perl521.dll +PERLDLL = ..\perl522.dll XCOPY = xcopy /f /r /i /d /y RCOPY = xcopy /f /r /i /e /d /y @@ -539,7 +540,7 @@ MICROCORE_SRC = \ ..\dump.c \ ..\globals.c \ ..\gv.c \ - ..\mro.c \ + ..\mro_core.c \ ..\hv.c \ ..\locale.c \ ..\keywords.c \ @@ -1127,7 +1128,7 @@ utils: $(PERLEXE) ..\utils\Makefile copy ..\README.tw ..\pod\perltw.pod copy ..\README.vos ..\pod\perlvos.pod copy ..\README.win32 ..\pod\perlwin32.pod - copy ..\pod\perldelta.pod ..\pod\perl5217delta.pod + copy ..\pod\perldelta.pod ..\pod\perl5220delta.pod $(PERLEXE) $(PL2BAT) $(UTILS) $(MINIPERL) -I..\lib ..\autodoc.pl .. $(MINIPERL) -I..\lib ..\pod\perlmodlib.PL -q .. @@ -1222,7 +1223,7 @@ distclean: realclean -if exist $(LIBDIR)\Win32API rmdir /s /q $(LIBDIR)\Win32API -if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS -cd $(PODDIR) && del /f *.html *.bat roffitall \ - perl5217delta.pod perlaix.pod perlamiga.pod perlandroid.pod \ + perl5220delta.pod perlaix.pod perlamiga.pod perlandroid.pod \ perlapi.pod perlbs2000.pod perlce.pod perlcn.pod perlcygwin.pod \ perldos.pod perlfreebsd.pod perlhaiku.pod perlhpux.pod \ perlhurd.pod perlintern.pod perlirix.pod perljp.pod perlko.pod \ -- 1.9.5.msysgit.0 ```
p5pRT commented 8 years ago

From @tonycoz

On Thu Dec 25 22​:29​:01 2014\, kmx@​atlas.cz wrote​:

I have updated my gist with Rob's patch

GNUmakefile is now in blead.

Your original GNUmakefile was added as 342634f3c8ce34b27ed1ba93ae7eb1c52ca438b2 and patches to bring it to 5.23.0 and some backported changes are in 16d5aac12f61ea3658d20dd0963c60867513408e.

Tony

p5pRT commented 8 years ago

@tonycoz - Status changed from 'open' to 'pending release'

p5pRT commented 8 years ago

From @bulk88

On Sun Jun 07 19​:19​:26 2015\, tonyc wrote​:

On Thu Dec 25 22​:29​:01 2014\, kmx@​atlas.cz wrote​:

I have updated my gist with Rob's patch

GNUmakefile is now in blead.

Your original GNUmakefile was added as 342634f3c8ce34b27ed1ba93ae7eb1c52ca438b2 and patches to bring it to 5.23.0 and some backported changes are in 16d5aac12f61ea3658d20dd0963c60867513408e.

Tony

TonyC\, did you ever try building Win32 gmake perl before you committed that code? And did the gmake build\, build to completion? I have a problem with blead's EUMM that prevents any EUMM Win32 gmake makefiles from being able to build anything since the EUMM fixes mentioned in https://rt-archive.perl.org/perl5/Ticket/Display.html?id=123440#txn-1324040 never made it into blead due to EUMM's development stall on CPAN.

-- bulk88 ~ bulk88 at hotmail.com

p5pRT commented 8 years ago

From @steve-m-hay

On 7 Nov 2015 23​:02\, "bulk88 via RT" \perlbug\-followup@&#8203;perl\.org wrote​:

On Sun Jun 07 19​:19​:26 2015\, tonyc wrote​:

On Thu Dec 25 22​:29​:01 2014\, kmx@​atlas.cz wrote​:

I have updated my gist with Rob's patch

GNUmakefile is now in blead.

Your original GNUmakefile was added as 342634f3c8ce34b27ed1ba93ae7eb1c52ca438b2 and patches to bring it to 5.23.0 and some backported changes are in 16d5aac12f61ea3658d20dd0963c60867513408e.

Tony

TonyC\, did you ever try building Win32 gmake perl before you committed that code? And did the gmake build\, build to completion? I have a problem with blead's EUMM that prevents any EUMM Win32 gmake makefiles from being able to build anything since the EUMM fixes mentioned in https://rt-archive.perl.org/perl5/Ticket/Display.html?id=123440#txn-1324040 never made it into blead due to EUMM's development stall on CPAN.

I tested the gmake build only the other day when I pushed 771d08d04402e3fb2c253e6bf8b46524b761a020\, and it built to completion ok.

p5pRT commented 8 years ago

From @bulk88

On Sat Nov 07 15​:31​:51 2015\, shay wrote​:

On 7 Nov 2015 23​:02\, "bulk88 via RT" \perlbug\-followup@&#8203;perl\.org wrote​:

On Sun Jun 07 19​:19​:26 2015\, tonyc wrote​:

On Thu Dec 25 22​:29​:01 2014\, kmx@​atlas.cz wrote​:

I have updated my gist with Rob's patch

GNUmakefile is now in blead.

Your original GNUmakefile was added as 342634f3c8ce34b27ed1ba93ae7eb1c52ca438b2 and patches to bring it to 5.23.0 and some backported changes are in 16d5aac12f61ea3658d20dd0963c60867513408e.

Tony

TonyC\, did you ever try building Win32 gmake perl before you committed that code? And did the gmake build\, build to completion? I have a problem with blead's EUMM that prevents any EUMM Win32 gmake makefiles from being able to build anything since the EUMM fixes mentioned in https://rt-archive.perl.org/perl5/Ticket/Display.html?id=123440#txn-1324040 never made it into blead due to EUMM's development stall on CPAN.

I tested the gmake build only the other day when I pushed 771d08d04402e3fb2c253e6bf8b46524b761a020\, and it built to completion ok.

Do you allow gmake/your build console's PATH to see (msys) git.exe (and therefore sh.exe) when you build with gmake? I always have git in my path so t/porting tests like cmp_version.t run instead of being skipped.

-- bulk88 ~ bulk88 at hotmail.com

p5pRT commented 8 years ago

From @tonycoz

On Sat\, Nov 07\, 2015 at 03​:02​:40PM -0800\, bulk88 via RT wrote​:

On Sun Jun 07 19​:19​:26 2015\, tonyc wrote​:

On Thu Dec 25 22​:29​:01 2014\, kmx@​atlas.cz wrote​:

I have updated my gist with Rob's patch

GNUmakefile is now in blead.

Your original GNUmakefile was added as 342634f3c8ce34b27ed1ba93ae7eb1c52ca438b2 and patches to bring it to 5.23.0 and some backported changes are in 16d5aac12f61ea3658d20dd0963c60867513408e.

Tony

TonyC\, did you ever try building Win32 gmake perl before you   committed that code? And did the gmake build\, build to completion? I   have a problem with blead's EUMM that prevents any EUMM Win32 gmake   makefiles from being able to build anything since the EUMM fixes   mentioned in   https://rt-archive.perl.org/perl5/Ticket/Display.html?id=123440#txn-1324040 never   made it into blead due to EUMM's development stall on CPAN.

Yes\, and git is in my PATH.

Tony

p5pRT commented 8 years ago

From @sisyphus

-----Original Message----- From​: bulk88 via RT Sent​: Sunday\, November 08\, 2015 11​:22 AM To​: OtherRecipients of perl Ticket #123440​: Cc​: perl5-porters@​perl.org Subject​: [perl #123440] Adding win32/GNUmakefile

Do you allow gmake/your build console's PATH to see (msys) git.exe (and therefore sh.exe) when you build with gmake? I always have git in my path so t/porting tests like cmp_version.t run instead of being skipped.

Near the beginning of GNUmakefile you'll find​:

SHELL := cmd.exe

That should take care of the impasse that would otherwise arise if sh.exe is in your path. Are you overriding that "SHELL" setting ?

Cheers\, Rob

p5pRT commented 8 years ago

From @bulk88

On Sun Nov 08 16​:33​:18 2015\, sisyphus wrote​:

Near the beginning of GNUmakefile you'll find​:

SHELL := cmd.exe

That should take care of the impasse that would otherwise arise if sh.exe is in your path. Are you overriding that "SHELL" setting ?

Cheers\, Rob

I am using


C​:\p523\src\win32>gmake -v GNU Make 4.0.90 Built for Windows32 Copyright (C) 1988-2013 Free Software Foundation\, Inc. License GPLv3+​: GNU GPL version 3 or later \<http​://gnu.org/licenses/gpl.html> This is free software​: you are free to change and redistribute it. There is NO WARRANTY\, to the extent permitted by law.

C​:\p523\src\win32>


from Strawberry 5.20.

I am not overriding SHELL env var and it is not set in my env vars\, that line in the makefile seems to only applies to the ROOT makefile\, not all the EUMM makefiles running from make_ext.pl. I dont think the SHELL mkf var is passed on the children processes through env vars.

Msys git comes with a [ba]"sh.exe" next to "git.exe" and per gmake's docs gmake always prefers sh.exe instead of cmd.exe https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html


C​:\p523\src\win32>"C​:/Program Files/Git/bin/sh.exe" -c "echo $BASH_VERSION" 3.1.23(6)-release

C​:\p523\src\win32>


If I have git in my win32 cmd console PATH and try to build perl I get a failure as the EUMM gmake finds and launches sh.exe.


..\miniperl.exe -I..\lib create_perllibst_h.pl ..\miniperl.exe -I..\lib -w ..\makedef.pl PLATFORM=win32 -s -O2 -DWIN32 \ -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLI O -fwrapv -fno-strict-aliasing -mms-bitfields CCTYPE=GCC TARG_DIR=..\ > perldll. def Options​: (HAS_TIMES HAVE_INTERP_INTERN PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DIS ABLE_PMC PERL_DONT_CREATE_GVSV PERL_EXTERNAL_GLOB PERL_HASH_FUNC_ONE_AT_A_TIME_H ARD PERL_IS_MINIPERL PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_LOCALE USE_LOCALE_C OLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_NO_REGISTRY USE_P ERLIO USE_PERL_ATOF USE_SITECUSTOMIZE) Defines​: (HAS_ACCESS HAS_ALARM HAS_CHSIZE HAS_CRYPT HAS_DBL_DIG HAS_DIFFTIME HAS _DLERROR HAS_DUP2 HAS_FAST_STDIO HAS_FD_SET HAS_FGETPOS HAS_FLOCK HAS_FLOCK_PROT O HAS_FSETPOS HAS_GETCWD HAS_GETHOSTBYADDR HAS_GETHOSTBYNAME HAS_GETHOSTNAME HAS _GETHOST_PROTOS HAS_GETLOGIN HAS_GETPROTOBYNAME HAS_GETPROTOBYNUMBER HAS_GETPROT O_PROTOS HAS_GETSERVBYNAME HAS_GETSERVBYPORT HAS_GETSERV_PROTOS HAS_GETTIMEOFDAY HAS_HTONL HAS_HTONS HAS_ISASCII HAS_ISNAN HAS_KILLPG HAS_LDBL_DIG HAS_LINK HAS_ LOCALECONV HAS_LONG_DOUBLE HAS_LONG_LONG HAS_LSEEK_PROTO HAS_MBLEN HAS_MBSTOWCS HAS_MBTOWC HAS_MEMCHR HAS_MEMCMP HAS_MEMCPY HAS_MEMMOVE HAS_MEMSET HAS_MKDIR HAS _MKTIME HAS_NTOHL HAS_NTOHS HAS_PAUSE HAS_PIPE HAS_PSEUDOFORK HAS_PTRDIFF_T HAS_ QUAD HAS_READDIR HAS_RENAME HAS_REWINDDIR HAS_RMDIR HAS_SANE_MEMCMP HAS_SEEKDIR HAS_SELECT HAS_SETLOCALE HAS_SETVBUF HAS_SIN6_SCOPE_ID HAS_SNPRINTF HAS_SOCKET H AS_STAT HAS_STATIC_INLINE HAS_STRCHR HAS_STRCOLL HAS_STRERROR HAS_STRFTIME HAS_S TRTOD HAS_STRTOL HAS_STRTOUL HAS_STRXFRM HAS_SYSTEM HAS_SYS_ERRLIST HAS_TELLDIR HAS_TELLDIR_PROTO HAS_TIME HAS_TIMES HAS_TZNAME HAS_UMASK HAS_UNAME HAS_UNION_SE MUN HAS_VPRINTF HAS_VSNPRINTF HAS_WAITPID HAS_WCSCMP HAS_WCSTOMBS HAS_WCSXFRM HA S_WCTOMB HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_D ISABLE_PMC PERL_DONT_CREATE_GVSV PERL_EXTERNAL_GLOB PERL_HASH_FUNC_ONE_AT_A_TIME _HARD PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_IS_MINIPERL PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PERL_RELOCATABLE_INC PERL_STATIC_INLINE PERL_TARGETARCH PERL_ TEXTMODE_SCRIPTS SPRINTF_RETURNS_STRLEN USE_DYNAMIC_LOADING USE_ITHREADS USE_LAR GE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_L OCALE_TIME USE_NO_REGISTRY USE_PERLIO USE_PERL_ATOF USE_SITECUSTOMIZE USE_STDIO_ BASE USE_STDIO_PTR USE_STRUCT_COPY USE_THREADS WIN32) xcopy /f /r /i /d /y "..\*.h" ..\lib\CORE\ 0 File(s) copied ..\miniperl.exe -I..\lib ..\make_ext.pl "MAKE=gmake" --dir=..\cpan --dir=..\dist --dir=..\ext --nonxs Generating a gmake-style Makefile Writing Makefile for Archive​::Tar gmake[1]​: Entering directory 'C​:/p523/src/cpan/Archive-Tar' "C​:/Program Files/Git/bin/sh.exe"​: C​:p523srcminiperl.exe​: command not found Makefile​:334​: recipe for target '..\..\lib\Archive/.exists' failed gmake[1]​: *** [..\..\lib\Archive/.exists] Error 127 gmake[1]​: Leaving directory 'C​:/p523/src/cpan/Archive-Tar' gmake[1]​: Entering directory 'C​:/p523/src/cpan/Archive-Tar' "C​:/Program Files/Git/bin/sh.exe"​: C​:p523srcminiperl.exe​: command not found Makefile​:334​: recipe for target '..\..\lib\Archive/.exists' failed gmake[1]​: *** [..\..\lib\Archive/.exists] Error 127 gmake[1]​: Leaving directory 'C​:/p523/src/cpan/Archive-Tar' Unsuccessful make(cpan/Archive-Tar)​: code=512 at ..\make_ext.pl line 578. GNUmakefile​:1070​: recipe for target 'Extensions_nonxs' failed gmake​: *** [Extensions_nonxs] Error 25

C​:\p523\src\win32>set path Path=C​:\sp520\c\bin;C​:\Windows\system32;C​:\Program Files\Microsoft Visual Studio 12.0\VC\BIN;C​:\Program Files\Windows Kits\8.1\bin\x86;C​:\Windows;C​:\Program Files\ActiveState Komodo Edit 9;C​:\Program Files\Git\bin;


If I remove git from my path\, everything works fine.


..\miniperl.exe -I..\lib create_perllibst_h.pl ..\miniperl.exe -I..\lib -w ..\makedef.pl PLATFORM=win32 -s -O2 -DWIN32 \ -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLI O -fwrapv -fno-strict-aliasing -mms-bitfields CCTYPE=GCC TARG_DIR=..\ > perldll. def Options​: (HAS_TIMES HAVE_INTERP_INTERN PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DIS ABLE_PMC PERL_DONT_CREATE_GVSV PERL_EXTERNAL_GLOB PERL_HASH_FUNC_ONE_AT_A_TIME_H ARD PERL_IS_MINIPERL PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_LOCALE USE_LOCALE_C OLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_NO_REGISTRY USE_P ERLIO USE_PERL_ATOF USE_SITECUSTOMIZE) Defines​: (HAS_ACCESS HAS_ALARM HAS_CHSIZE HAS_CRYPT HAS_DBL_DIG HAS_DIFFTIME HAS _DLERROR HAS_DUP2 HAS_FAST_STDIO HAS_FD_SET HAS_FGETPOS HAS_FLOCK HAS_FLOCK_PROT O HAS_FSETPOS HAS_GETCWD HAS_GETHOSTBYADDR HAS_GETHOSTBYNAME HAS_GETHOSTNAME HAS _GETHOST_PROTOS HAS_GETLOGIN HAS_GETPROTOBYNAME HAS_GETPROTOBYNUMBER HAS_GETPROT O_PROTOS HAS_GETSERVBYNAME HAS_GETSERVBYPORT HAS_GETSERV_PROTOS HAS_GETTIMEOFDAY HAS_HTONL HAS_HTONS HAS_ISASCII HAS_ISNAN HAS_KILLPG HAS_LDBL_DIG HAS_LINK HAS_ LOCALECONV HAS_LONG_DOUBLE HAS_LONG_LONG HAS_LSEEK_PROTO HAS_MBLEN HAS_MBSTOWCS HAS_MBTOWC HAS_MEMCHR HAS_MEMCMP HAS_MEMCPY HAS_MEMMOVE HAS_MEMSET HAS_MKDIR HAS _MKTIME HAS_NTOHL HAS_NTOHS HAS_PAUSE HAS_PIPE HAS_PSEUDOFORK HAS_PTRDIFF_T HAS_ QUAD HAS_READDIR HAS_RENAME HAS_REWINDDIR HAS_RMDIR HAS_SANE_MEMCMP HAS_SEEKDIR HAS_SELECT HAS_SETLOCALE HAS_SETVBUF HAS_SIN6_SCOPE_ID HAS_SNPRINTF HAS_SOCKET H AS_STAT HAS_STATIC_INLINE HAS_STRCHR HAS_STRCOLL HAS_STRERROR HAS_STRFTIME HAS_S TRTOD HAS_STRTOL HAS_STRTOUL HAS_STRXFRM HAS_SYSTEM HAS_SYS_ERRLIST HAS_TELLDIR HAS_TELLDIR_PROTO HAS_TIME HAS_TIMES HAS_TZNAME HAS_UMASK HAS_UNAME HAS_UNION_SE MUN HAS_VPRINTF HAS_VSNPRINTF HAS_WAITPID HAS_WCSCMP HAS_WCSTOMBS HAS_WCSXFRM HA S_WCTOMB HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_D ISABLE_PMC PERL_DONT_CREATE_GVSV PERL_EXTERNAL_GLOB PERL_HASH_FUNC_ONE_AT_A_TIME _HARD PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_IS_MINIPERL PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PERL_RELOCATABLE_INC PERL_STATIC_INLINE PERL_TARGETARCH PERL_ TEXTMODE_SCRIPTS SPRINTF_RETURNS_STRLEN USE_DYNAMIC_LOADING USE_ITHREADS USE_LAR GE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_L OCALE_TIME USE_NO_REGISTRY USE_PERLIO USE_PERL_ATOF USE_SITECUSTOMIZE USE_STDIO_ BASE USE_STDIO_PTR USE_STRUCT_COPY USE_THREADS WIN32) xcopy /f /r /i /d /y "..\*.h" ..\lib\CORE\ 0 File(s) copied ..\miniperl.exe -I..\lib ..\make_ext.pl "MAKE=gmake" --dir=..\cpan --dir=..\dist --dir=..\ext --nonxs Generating a gmake-style Makefile Writing Makefile for Archive​::Tar gmake[1]​: Entering directory 'C​:/p523/src/cpan/Archive-Tar' gmake[1]​: Leaving directory 'C​:/p523/src/cpan/Archive-Tar' Generating a gmake-style Makefile Writing Makefile for CPAN gmake[1]​: Entering directory 'C​:/p523/src/cpan/CPAN' gmake[1]​: Leaving directory 'C​:/p523/src/cpan/CPAN' Generating a gmake-style Makefile Writing Makefile for Errno gmake[1]​: Entering directory 'C​:/p523/src/ext/Errno' Terminating on signal SIGINT(2) Terminating on signal SIGINT(2) GNUmakefile​:1070​: recipe for target 'Extensions_nonxs' failed Makefile​:355​: recipe for target 'blib\script/.exists' failed gmake​: *** [Extensions_nonxs] Error 2 gmake[1]​: *** [blib\script/.exists] Error 2

C​:\p523\src\win32>set path Path=C​:\sp520\c\bin;C​:\Windows\system32;C​:\Program Files\Microsoft Visual Studio 12.0\VC\BIN;C​:\Program Files\Windows Kits\8.1\bin\x86;C​:\Windows;C​:\Program Fil es\ActiveState Komodo Edit 9;


I've included 4 procmon logs showing gmake finding or not finding sh.exe\, and launching sh.exe (wrong) or cmd.exe (correct) while building a core module. If sh.exe is launches\, everything breaks\,

IDK how you tonyc dont see this problem\, unless you have a git.exe without a sh.exe next to it or you copied git.exe to a non-standard location like "C​:/Windows" from its "Program Files" location.

-- bulk88 ~ bulk88 at hotmail.com

p5pRT commented 8 years ago

From @bulk88

gmakelaunch-via-cmd.CSV

p5pRT commented 8 years ago

From @bulk88

gmakeshlaunch.CSV

p5pRT commented 8 years ago

From @bulk88

gmakeshsearch.CSV

p5pRT commented 8 years ago

From @bulk88

gmaketrystofind-sh-butfails.CSV

p5pRT commented 8 years ago

From @tonycoz

On Sun\, Nov 08\, 2015 at 11​:40​:14PM -0800\, bulk88 via RT wrote​:

IDK how you tonyc dont see this problem\, unless you have a git.exe without a sh.exe next to it or you copied git.exe to a non-standard location like "C​:/Windows" from its "Program Files" location.

J​:\dev\perl\git\perl\win32>bash 'bash' is not recognized as an internal or external command\, operable program or batch file.

J​:\dev\perl\git\perl\win32>sh 'sh' is not recognized as an internal or external command\, operable program or batch file.

J​:\dev\perl\git\perl\win32>git --version git version 1.9.5.msysgit.0

When I installed git I chose to have only git in PATH\, not all the tools.

I didn't reorganize any of the msysgit files.

Tony

p5pRT commented 8 years ago

From @steve-m-hay

On 8 November 2015 at 00​:22\, bulk88 via RT \perlbug\-followup@&#8203;perl\.org wrote​:

On Sat Nov 07 15​:31​:51 2015\, shay wrote​:

On 7 Nov 2015 23​:02\, "bulk88 via RT" \perlbug\-followup@&#8203;perl\.org wrote​:

On Sun Jun 07 19​:19​:26 2015\, tonyc wrote​:

On Thu Dec 25 22​:29​:01 2014\, kmx@​atlas.cz wrote​:

I have updated my gist with Rob's patch

GNUmakefile is now in blead.

Your original GNUmakefile was added as 342634f3c8ce34b27ed1ba93ae7eb1c52ca438b2 and patches to bring it to 5.23.0 and some backported changes are in 16d5aac12f61ea3658d20dd0963c60867513408e.

Tony

TonyC\, did you ever try building Win32 gmake perl before you committed that code? And did the gmake build\, build to completion? I have a problem with blead's EUMM that prevents any EUMM Win32 gmake makefiles from being able to build anything since the EUMM fixes mentioned in https://rt-archive.perl.org/perl5/Ticket/Display.html?id=123440#txn-1324040 never made it into blead due to EUMM's development stall on CPAN.

I tested the gmake build only the other day when I pushed 771d08d04402e3fb2c253e6bf8b46524b761a020\, and it built to completion ok.

Do you allow gmake/your build console's PATH to see (msys) git.exe (and therefore sh.exe) when you build with gmake? I always have git in my path so t/porting tests like cmp_version.t run instead of being skipped.

Yes\, git is in the path\, but as with Tony's setup\, I also chose to have only git in PATH\, not all the tools\, i.e. C​:\Program Files (x86)\Git\cmd but not C​:\Program Files (x86)\Git\bin . (I think in the first instance I did this to avoid ending up with the wrong 'find' program in the path\, which I've also had trouble with in the past.)

p5pRT commented 8 years ago

From @sisyphus

-----Original Message----- From​: Steve Hay via perl5-porters Sent​: Monday\, November 09\, 2015 7​:21 PM To​: bulk88 via RT Cc​: perl5-porters@​perl.org Subject​: Re​: [perl #123440] Adding win32/GNUmakefile

Do you allow gmake/your build console's PATH to see (msys) git.exe (and therefore sh.exe) when you build with gmake? I always have git in my path so t/porting tests like cmp_version.t run instead of being skipped.

Yes\, git is in the path\, but as with Tony's setup\, I also chose to have only git in PATH\, not all the tools\, i.e. C​:\Program Files (x86)\Git\cmd but not C​:\Program Files (x86)\Git\bin . (I think in the first instance I did this to avoid ending up with the wrong 'find' program in the path\, which I've also had trouble with in the past.)

But surely it should be allowable to have sh.exe in your path ? That's why the "SHELL := cmd.exe" entry was placed in GNUmakefile in the first place - and I'm sure that used to work. But I've just checked (for the first time in a while) whether I can build recent perl if I have sh.exe in the path\, and I can't !!

..\miniperl.exe -I..\lib -f ..\write_buildcustomize.pl .. Use of uninitialized value $pwd in scalar chomp at dist/PathTools/Cwd.pm line 623. Use of uninitialized value $pwd in substitution (s///) at dist/PathTools/Cwd.pm line 624. Use of uninitialized value $pwd in scalar chomp at dist/PathTools/Cwd.pm line 623. Use of uninitialized value $pwd in substitution (s///) at dist/PathTools/Cwd.pm line 624. Use of uninitialized value $path in pattern match (m//) at dist/PathTools/lib/File/Spec/Win32.pm line 214. . . Use of uninitialized value $pwd in substitution (s///) at dist/PathTools/Cwd.pm line 624. Use of uninitialized value $path in pattern match (m//) at dist/PathTools/lib/File/Spec/Win32.pm line 214. Use of uninitialized value $pwd in scalar chomp at dist/PathTools/Cwd.pm line 623. Use of uninitialized value $pwd in substitution (s///) at dist/PathTools/Cwd.pm line 624. Use of uninitialized value $path in pattern match (m//) at dist/PathTools/lib/File/Spec/Win32.pm line 214. Can't locate strict.pm in @​INC (you may need to install the strict module) (@​INC contains​: \lib \cpan\AutoLoader\lib \dist\Carp\lib \dist\PathTools \dist\PathTools\lib \cpan\ExtUtils-Install\lib \cpan\ExtUtils-MakeMaker\lib \cpan\ExtUtils-Manifest\lib \cpan\File-Path\lib \ext\re \dist\Term-ReadLine\lib \dist\Exporter\lib \ext\File-Find\lib \cpan\Text-Tabs\lib \dist\constant\lib \cpan\Text-ParseWords\lib \dist\ExtUtils-ParseXS\lib \cpan\Getopt-Long\lib \cpan\parent\lib \cpan\ExtUtils-Constant\lib .) at make_patchnum.pl line 3. BEGIN failed--compilation aborted at make_patchnum.pl line 3. GNUmakefile​:923​: recipe for target '..\git_version.h' failed make​: *** [..\git_version.h] Error 2

That's with last month's perl-5.23.4.

Is there a POV that justifies this breakaqge ?

Cheers\, Rob

p5pRT commented 8 years ago

From @kmx

Use of uninitialized value $pwd in scalar chomp at dist/PathTools/Cwd.pm line 623.

The trouble is IMO here​: http​://perl5.git.perl.org/perl.git/blob/28aaeb3b24f750f72f0505fc311412e0fa8a29f4​:/dist/PathTools/Cwd.pm#l621

The command `cd` gives different output under cmd.exe and sh.exe

-- kmx

p5pRT commented 8 years ago

From @sisyphus

-----Original Message----- From​: kmx Sent​: Monday\, November 09\, 2015 9​:21 PM To​: perlbug-followup@​perl.org Subject​: Re​: [perl #123440] Adding win32/GNUmakefile

Use of uninitialized value $pwd in scalar chomp at dist/PathTools/Cwd.pm line 623.

The trouble is IMO here​: http​://perl5.git.perl.org/perl.git/blob/28aaeb3b24f750f72f0505fc311412e0fa8a29f4​:/dist/PathTools/Cwd.pm#l621

The command `cd` gives different output under cmd.exe and sh.exe

Yes - and it arises because I placed sh.exe fairly early on in the PATH ... which can perhaps be considered to be a PEBCAK. I'm not so sure that we should expect perl to build if sh.exe's "cd" gets found ahead of cmd.exe's version.

However\, even if I place msys/bin (and hence sh.exe) at the end of the path\, I still get​:

C​:\comp\blead\win32>make ..... .... ..\miniperl.exe -I..\lib ..\make_ext.pl "MAKE=make" --dir=..\cpan --dir=..\dis --dir=..\ext --nonxs Generating a make-style Makefile Writing Makefile for Archive​::Tar make[1]​: Entering directory 'C​:/comp/blead/cpan/Archive-Tar' /usr/bin/sh​: C​:compbleadminiperl.exe​: command not found Makefile​:334​: recipe for target '..\..\lib\Archive/.exists' failed make[1]​: *** [..\..\lib\Archive/.exists] Error 127 make[1]​: Leaving directory 'C​:/comp/blead/cpan/Archive-Tar' make[1]​: Entering directory 'C​:/comp/blead/cpan/Archive-Tar' /usr/bin/sh​: C​:compbleadminiperl.exe​: command not found Makefile​:334​: recipe for target '..\..\lib\Archive/.exists' failed make[1]​: *** [..\..\lib\Archive/.exists] Error 127 make[1]​: Leaving directory 'C​:/comp/blead/cpan/Archive-Tar' Unsuccessful make(cpan/Archive-Tar)​: code=512 at ..\make_ext.pl line 578. GNUmakefile​:1070​: recipe for target 'Extensions_nonxs' failed make​: *** [Extensions_nonxs] Error 25

Am I still in PEBCAK territory ?

(This is now with current blead as source.)

Cheers\, Rob

p5pRT commented 8 years ago

From @kmx

Perhaps patching "sub _win32_cwd_simple" (in dist/PathTools/Cwd.pm) like this​:

- my $pwd = `cd`; + my $pwd = `cmd /c cd`; # stolen from _os2_cwd

might do the trick.

-- kmx