summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/cygwin32/perlgcc
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/cygwin32/perlgcc')
-rw-r--r--gnu/usr.bin/perl/cygwin32/perlgcc25
1 files changed, 16 insertions, 9 deletions
diff --git a/gnu/usr.bin/perl/cygwin32/perlgcc b/gnu/usr.bin/perl/cygwin32/perlgcc
index 97d7d1a8a53..202ed29a4f9 100644
--- a/gnu/usr.bin/perl/cygwin32/perlgcc
+++ b/gnu/usr.bin/perl/cygwin32/perlgcc
@@ -30,21 +30,21 @@ $libflagString = join(" ",@libFlags);
# make exports file
my $command = "echo EXPORTS > perl.def";
print "$command\n";
-system($command);
+system($command) == 0 or die "system() failed.\n";
$command ="nm $libstring | grep '^........ [TCD] _'| grep -v _impure_ptr | sed 's/[^_]*_//' >> perl.def";
print "$command\n";
-system($command);
+system($command) == 0 or die "system() failed.\n";
# Build the perl.a lib to link to:
$command ="dlltool --as=as --dllname perl.exe --def perl.def --output-lib perl.a";
print "$command\n";
-system($command);
+system($command) == 0 or die "system() failed.\n";
# change name of export lib to libperlexp so that is can be understood by ld2/perlld
$command ="mv perl.a libperlexp.a";
print "$command\n";
-system($command);
+system($command) == 0 or die "system() failed.\n";
# get the full path name of a few libs:
my $crt0 = `gcc -print-file-name=crt0.o`;
@@ -53,25 +53,32 @@ my $libdir = `gcc -print-file-name=libcygwin.a`;
chomp $libdir;
$libdir =~ s/libcygwin\.a//g;
+# when $crt0 and $libdir get used in the system calls below, the \'s
+# from the gcc -print-file-name get used to create special characters,
+# such as \n, \t. Replace the \'s with /'s so that this does not
+# happen:
+$crt0 =~ s:\\:/:g;
+$libdir =~ s:\\:/:g;
+
# Link exe:
$command = "ld --base-file perl.base -o perl.exe $crt0 $obsString $libstring -L$libdir $libflagString";
print "$command\n";
-system($command);
+system($command) == 0 or die "system() failed.\n";
$command = "dlltool --as=as --dllname perl.exe --def perl.def --base-file perl.base --output-exp perl.exp";
print "$command\n";
-system($command);
+system($command) == 0 or die "system() failed.\n";
$command = "ld --base-file perl.base perl.exp -o perl.exe $crt0 $obsString $libstring -L$libdir $libflagString";
print "$command\n";
-system($command);
+system($command) == 0 or die "system() failed.\n";
$command = "dlltool --as=as --dllname perl.exe --def perl.def --base-file perl.base --output-exp perl.exp";
print "$command\n";
-system($command);
+system($command) == 0 or die "system() failed.\n";
$command = "ld perl.exp -o perl.exe $crt0 $obsString $libstring -L$libdir $libflagString";
print "$command\n";
-system($command);
+system($command) == 0 or die "system() failed.\n";
print "perlgcc: Completed\n";