This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Only copy op.c to opmini.c if op.c is a symlink, else use a symlink.
authorNicholas Clark <nick@ccl4.org>
Mon, 16 Aug 2010 21:12:13 +0000 (23:12 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 16 Aug 2010 21:15:24 +0000 (23:15 +0200)
Similarly for perl.c to perlmini.c

This avoids the work of a file copy if a symlink would do the job, but ensures
that we don't create a symlink to a symlink to a file, which (comments suggest)
upsets gcc.

Makefile.SH

index e90b51f..51529f4 100644 (file)
@@ -586,18 +586,30 @@ utilities:        $(MINIPERL_EXE) $(CONFIGPM) $(plextract) FORCE
 .PHONY: FORCE
 FORCE:
        @sh -c true
-
-# We do a copy of the op.c instead of a symlink because gcc gets huffy
-# if we have a symlink forest to another disk (it complains about too many
-# levels of symbolic links, even if we have only two)
 !NO!SUBS!
 
 for file in op perl; do
-    $spitshell >>$Makefile <<!GROK!THIS!
+    if $issymlink $file.c; then
+        $spitshell >>$Makefile <<!GROK!THIS!
+
+# We do a copy of the $file.c instead of a symlink because gcc gets huffy
+# if we have a symlink forest to another disk (it complains about too many
+# levels of symbolic links, even if we have only two)
 
 ${file}mini.c: $file.c
        \$(RMS) ${file}mini.c
        \$(CPS) ${file}.c ${file}mini.c
+!GROK!THIS!
+    else
+        $spitshell >>$Makefile <<!GROK!THIS!
+
+${file}mini.c: $file.c
+       \$(RMS) ${file}mini.c
+       \$(LNS) ${file}.c ${file}mini.c
+!GROK!THIS!
+    fi
+
+    $spitshell >>$Makefile <<!GROK!THIS!
 
 ${file}mini\$(OBJ_EXT): ${file}mini.c
        \$(CCCMD) \$(PLDLFLAGS) $DPERL_IS_MINIPERL $DPERL_EXTERNAL_GLOB ${file}mini.c