in reply to Re^2: makefile.mk is missing with Perl 5.34.0 distro.
in thread makefile.mk is missing with Perl 5.34.0 distro.

Hi Rob, Thank you for the revert.

Below is the patch command where it seems failing while patching, I am not sure if "GNUmakefile" is getting updated or modified here.

patch -b %PERL_BUILD_DIR%\win32\GNUmakefile %PERL_SOURCES_DIR%\configu +ration\win64\makefile.patch
Below is the content of the makefile.patch
--- C:/perl_app/sources/builds/perl-5.22.2_win64/perl-5.22.2/win32/mak +efile.mk.orig Fri Apr 08 17:45:19 2016 +++ C:/perl_app/sources/builds/perl-5.22.2_win64/perl-5.22.2/win32/mak +efile.mk Fri May 13 09:51:24 2016 @@ -27,7 +27,7 @@ # newly built perl. # INST_DRV *= c: -INST_TOP *= $(INST_DRV)\perl +INST_TOP *= $(INST_DRV)\perl_app\bin\Perl # # Uncomment if you want to build a 32-bit Perl using a 32-bit compile +r @@ -227,7 +227,7 @@ # not be quoted) # .IF "$(CCTYPE)" == "GCC" -CCHOME *= C:\MinGW +CCHOME *= C:\msys64\mingw64 .ELSE CCHOME *= $(MSVCDIR) .ENDIF @@ -292,7 +292,7 @@ # set this to your email address (perl will guess a value from # from your loginname and your hostname, which may not be right) # -#EMAIL *= +EMAIL *= customer_support@xyz.com ## ## Build configuration ends.
Can you please tell me what's going on here, do I need to modify the makefile.patch file.
Thank you.

Replies are listed 'Best First'.
Re^4: makefile.mk is missing with Perl 5.34.0 distro.
by bliako (Abbot) on Aug 25, 2021 at 06:10 UTC

    to start with, start with a freshly extracted distribution/source. Patch with a fresh, virgin GNUmakefile. Then you can edit GNUmakefile if you are sure you know what you are doing. A patch file contains line numbers, e.g. @@ -292,7 +292,7 @@. Editing the file to be patched beforehand, will confuse patch.

    bw, bliako

Re^4: makefile.mk is missing with Perl 5.34.0 distro.
by syphilis (Archbishop) on Aug 25, 2021 at 08:43 UTC
    Can you please tell me what's going on here ...

    The intention of the patch is to alter the settings of INST_TOP, CCHOME, and EMAIL.
    You could alter those settings in the GNUmakefile by hand if you like.
    However, a better solution IMO, is to leave the GNUmakefile in its original state and run:
    gmake INST_TOP=C:\perl_app\bin\Perl CCHOME=C:\msys64\mingw64 EMAIL=cus +tomer_support@xyz.com gmake test INST_TOP=C:\perl_app\bin\Perl CCHOME=C:\msys64\mingw64 EMAI +L=customer_support@xyz.com gmake install INST_TOP=C:\perl_app\bin\Perl CCHOME=C:\msys64\mingw64 E +MAIL=customer_support@xyz.com
    do I need to modify the makefile.patch file

    If you want to make your configurational changes by running patch then yes, you will need a different patch file.
    The current patch is not written for the GNUmakefile.
    For example, the line
    #EMAIL *=
    does not exist in GNUmakefile. Instead GNUmakefile contains:
    #EMAIL :=
    and that line needs to be changed to:
    EMAIL := customer_support@xyz.com
    not to:
    EMAIL *= customer_support@xyz.com
    Also, the numbers in the lines like @@ -27,7 +27,7 @@ etc. are all wrong for the GNUmakefile.

    Cheers,
    Rob
      Thank you for the reply,

      I have changed the makefile.patch file accordingly and changed the line numbers as per GNUmakefile, but not all 3 hunks are successful at a time.
      Is there any specific format I need to follow to get all 3 hunks successful?

      How can I get a new makefie.patch file for GNUmakefile?
      Thank you.

        The traditional way of creating patch files is the diff program:

        1. You copy the old file to a backup filename (say, GNUmakefile.org)
        2. You edit the GNUmakefilke
        3. You create the patch file: diff -Naur GNUmakefile.org GNUmakefile >mypatch.path
        I have changed the makefile.patch file accordingly and changed the line numbers as per GNUmakefile, but not all 3 hunks are successful at a time

        When you follow Corion's instructions then, based on your original patch file, you should end up with something like:
        --- GNUmakefile_orig 2021-08-26 10:43:41 +1000 +++ GNUmakefile 2021-08-26 10:46:03 +1000 @@ -47,7 +47,7 @@ # newly built perl. # INST_DRV := c: -INST_TOP := $(INST_DRV)\perl +INST_TOP := $(INST_DRV)\perl_app\bin\Perl # # Uncomment if you want to build a 32-bit Perl using a 32-bit compile +r @@ -254,7 +254,7 @@ # For GCC builds this should be the directory containing the bin, inc +lude, # lib directories for your compiler. # -#CCHOME := C:\MinGW +#CCHOME := C:\msys64\mingw64 # # Additional compiler flags can be specified here. @@ -289,7 +289,7 @@ # set this to your email address (perl will guess a value from # your loginname and your hostname, which may not be right) # -#EMAIL := +#EMAIL := customer_support@xyz.com ## ## Build configuration ends.
        And that should be fine for as long as the GNUmakefile that ships with the perl source does not change.

        It's best to ensure that the final GNUmakefile contains unix line endings (not windows line endings) - otherwise a couple of the t/porting test files in the perl test suite will report failures.
        I would run dos2unix GNUmakefile before building perl, just to be sure.

        It's probably also important to make sure that the line endings of the GNUmakefile you're patching (which are initially unix style) matches the line endings of the patch file, otherwise the patch might not apply.
        Perhaps patch has a switch that will ignore differences in line endings (like diff's -w switch) ... I don't know.
        Otherwise, dos2unix and unix2dos are useful friends to have.

        Cheers,
        Rob