msys2 / MSYS2-packages

Package scripts for MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
1.28k stars 486 forks source link

building perl fails to create the Makefile #1069

Open kubrat opened 6 years ago

kubrat commented 6 years ago
...
cflags.SH: cc       = gcc                                                                                                                          
cflags.SH: ccflags  = -march=x86-64 -mtune=generic -O2 -pipe -fwrapv -fno-strict-aliasing -fstack-protector-strong -march=x86-64 -mtune=generic -O2
 -pipe -fwrapv                                                                                                                                     
cflags.SH: stdflags =                                                                                                                              
cflags.SH: optimize = -march=x86-64 -mtune=generic -O2 -pipe                                                                                       
cflags.SH: warn     =  -Wall -Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings                                              
Extracting cflags (with variable substitutions)                                                                                                    
Extracting config.h (with variable substitutions)                                                                                                  
Extracting makedepend (with variable substitutions)                                                                                                
Extracting Makefile (with variable substitutions)                                                                                                  
./op.c: line 3: amigaos4: command not found                                                                                                        
./op.c: line 4: syntax error near unexpected token `('                                                                                             
./op.c: line 4: ` *    Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,'                                                  
./perl.c: line 3: amigaos4: command not found                                                                                                      
./perl.c: line 4: syntax error near unexpected token `('                                                                                           
./perl.c: line 4: ` *    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001'                                                       
Extracting myconfig (with variable substitutions)                                                                                                  
Extracting pod/Makefile (with variable substitutions)                                                                                              
Extracting Policy.sh (with variable substitutions)                                                                                                 
Extracting runtests (with variable substitutions)                                                                                                  
Configure done.                                                                                                                                    

If you compile perl5 on a different machine or from a different object                                                                             
directory, copy the Policy.sh file from this object directory to the                                                                               
new one before you run Configure -- this will help you with most of                                                                                
the policy defaults.                                                                                                                               

make: *** No targets specified and no makefile found.  Stop.                                                                                       
==> ERROR: A failure occurred in build().                                                                                                          
    Aborting...                                                                                                                                    
LRN commented 5 years ago

That's because NTFS is case-insensitive. Perl has two makefiles - "$firstmakefile" (which is usually detected as "makefile") and Makefile. Makefile is created first. It is then executed with make to create the main makefile, i.e. "$firstmakefile". Before creating "$firstmakefile", Makefile will run rm -f $firstmakefile.

Since NTFS is case-insensitive, "makefile" and "Makefile" are the same file, thus Makefile deletes itself.

One possible workaround for this is to rename Makefile to something else (such as MyMakefile) , and add "-f MyMakefile" to all make invocations that are expected to execute that file, since otherwise make won't know what to run.