diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-10 04:28:38 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-10-10 04:28:38 +0000 |
commit | 8ec448833410aa8e65370beaffc968d46272417a (patch) | |
tree | f0954fc25b65478a13e22e0c70ba7778ab2c4c14 /win32 | |
parent | 0655b981bb492c08abff4ec3ef984eda8c2af724 (diff) | |
download | perl-8ec448833410aa8e65370beaffc968d46272417a.tar.gz |
rudimentary support for building under Windows 95/98 (from
Benjamin Stuhl <sho_pi@hotmail.com>)
p4raw-id: //depot/perl@4329
Diffstat (limited to 'win32')
-rw-r--r-- | win32/genmk95.pl | 81 | ||||
-rw-r--r-- | win32/makefile.mk | 24 |
2 files changed, 104 insertions, 1 deletions
diff --git a/win32/genmk95.pl b/win32/genmk95.pl new file mode 100644 index 0000000000..74788ff3cb --- /dev/null +++ b/win32/genmk95.pl @@ -0,0 +1,81 @@ +# genmk95.pl - uses miniperl to generate a makefile that command.com +# (and dmake) will understand given one that cmd.exe will understand + +# Author: Benjamin K. Stuhl +# Date: 8-18-1999 + +# how it works: +# dmake supports an alternative form for its recipes, called "group +# recipes", in which all elements of a recipe are run with only one +# shell. This program converts the standard dmake makefile.mk to +# one using group recipes. This is done so that lines using && or +# || (which command.com doesn't understand) may be split into two +# lines. + +my ($filein, $fileout) = @ARGV; + +chomp (my $loc = `cd`); + +open my $in, $filein or die "Error opening input file: $!"; +open my $out, "> $fileout" or die "Error opening output file: $!"; + +print $out <<_EOH_; +# *** Warning: this file is autogenerated from $filein by $0 *** +# *** Do not edit this file - edit $filein instead *** + +_EOH_ + +my $inrec = 0; + +while (<$in>) +{ + chomp; + if (/^[^#.\t][^#=]*?:/) + { + if (! $inrec) + { + print $out "$_\n"; + while (/\\$/) + { + chomp($_ = <$in>); + print $out "$_\n"; + } + print $out "@[\n"; + $inrec = 1; + next; + } + else { + seek ($out, -3, 2); # no recipe, so back up and undo grouping + print $out "$_\n"; + $inrec = 0; + next; + } + } + if ((/^\s*$/ || /^[^#.\t][^#=]*?:/) && $inrec) + { + print $out "]\n"; + print $out "$_\n"; + $inrec = 0; + next; + } + if (/^(.*?)(&&|\|\|)(.*)$/) # two commands separated by && or || + { + my ($one, $sep, $two) = ($1, $2, $3); +LINE_CONT: + if ($two =~ /\\\s*$/) + { + chomp ($two .= "\n" . scalar <$in>); + goto LINE_CONT; + } + s/^\s*// for ($one, $two); + print $out "\t$one\n\t$two\n" if ($sep eq "&&"); + print $out "\t$one\n\tif errorlevel 1 $two\n" if ($sep eq "||"); + print $out "\tcd $loc\n"; + next; + } + # fall through - no need for special handling + print $out "$_\n"; +} +print $out "]\n" if ($inrec); + +close $in; close $out; diff --git a/win32/makefile.mk b/win32/makefile.mk index 034ae3d6f7..5bf44152bb 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -25,6 +25,11 @@ INST_DRV *= c: INST_TOP *= $(INST_DRV)\perl # +# Uncomment this if you are compiling under Windows 95/98 and command.com +# (not needed if you're running under 4DOS/NT 6.01 or later) +#IS_WIN95 *= define + +# # 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 @@ -308,7 +313,9 @@ LOCDEFS = -DPERLDLL -DPERL_CORE SUBSYS = console CXX_FLAG = -xc++ -LIBC = -lcrtdll +# crtdll doesn't define _wopen and friends +#LIBC = -lcrtdll +LIBC = -lmsvcrt LIBFILES = $(CRYPT_LIB) -ladvapi32 -luser32 -lnetapi32 -lwsock32 \ -lmingw32 -lgcc -lmoldname $(LIBC) -lkernel32 @@ -765,13 +772,28 @@ CFG_VARS = \ # Top targets # +.IF "$(IS_WIN95)" != "" +MK2 = .\makew95.mk + +all : .\config.h $(GLOBEXE) $(MINIMOD) $(MK2) +all2 : $(CONFIGPM) $(PERLEXE) $(PERL95EXE) $(X2P) $(EXTENSION_DLL) \ + $(EXTENSIOM_PM) +.ELSE all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \ $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM) +.ENDIF $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c #------------------------------------------------------------ +# This target is used to generate the makew95.mk for Win95 +.IF "$(IS_WIN95)" != "" +$(MK2): makefile.mk + $(MINIPERL) genmk95.pl makefile.mk $(MK2) + $(MAKE) -f $(MK2) all2 +.ENDIF + $(GLOBEXE) : perlglob$(o) .IF "$(CCTYPE)" == "BORLAND" $(CC) -c -w -v -tWM -I"$(CCINCDIR)" perlglob.c |