From: Gurusamy Sarathy Date: Sat, 20 Jun 1998 02:51:35 +0000 (+0000) Subject: cleanup installation of utilities on win32 X-Git-Tag: accepted/trunk/20130322.191538~37628 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a71ed0cc11f5be9a856b29b19af5c91a1bd76cb;p=platform%2Fupstream%2Fperl.git cleanup installation of utilities on win32 p4raw-id: //depot/perl@1159 --- diff --git a/installperl b/installperl index 3ec0f50..0769c03 100755 --- a/installperl +++ b/installperl @@ -6,9 +6,13 @@ BEGIN { @INC = 'lib'; $ENV{PERL5LIB} = 'lib'; $Is_VMS = $^O eq 'VMS'; + $Is_W32 = $^O eq 'MSWin32'; + $Is_OS2 = $^O eq 'os2'; if ($Is_VMS) { eval 'use VMS::Filespec;' } } +$scr_ext = ($Is_VMS ? '.Com' : $Is_W32 ? '.bat' : ''); + use File::Find; use File::Compare; use File::Copy (); @@ -37,12 +41,12 @@ while (@ARGV) { umask 022 unless $Is_VMS; -@scripts = qw( utils/c2ph utils/h2ph utils/h2xs - utils/perlbug utils/perldoc utils/pl2pm utils/splain utils/perlcc +@scripts = qw( utils/c2ph utils/h2ph utils/h2xs utils/perlbug utils/perldoc + utils/pl2pm utils/splain utils/perlcc x2p/s2p x2p/find2perl pod/pod2man pod/pod2html pod/pod2latex pod/pod2text); -if ($Is_VMS) { @scripts = map { "$_.Com" } @scripts; } +if ($scr_ext) { @scripts = map { "$_$scr_ext" } @scripts; } @pods = (); @@ -113,11 +117,11 @@ if ($d_dosuid && $>) { die "You must run as root to install suidperl\n"; } -x 'perl' . $exe_ext || die "perl isn't executable!\n"; -x 'suidperl' . $exe_ext|| die "suidperl isn't executable!\n" if $d_dosuid; --x 't/TEST' || $^O eq 'MSWin32' +-x 't/TEST' || $Is_W32 || warn "WARNING: You've never run 'make test'!!!", " (Installing anyway.)\n"; -if ($^O eq 'MSWin32') { +if ($Is_W32) { $perldll = 'perl.' . $dlext; $perldll = 'perlcore.' . $dlext if $Config{'ccflags'} =~ /PERL_OBJECT/i; @@ -218,7 +222,7 @@ if (! $versiononly && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VM $mainperl_is_instperl = 0; -if (!$versiononly && !$nonono && $^O ne 'MSWin32' && !$Is_VMS && -t STDIN && -t STDERR +if (!$versiononly && !$nonono && !$Is_W32 && !$Is_VMS && -t STDIN && -t STDERR && -w $mainperldir && ! samepath($mainperldir, $installbin)) { local($usrbinperl) = "$mainperldir/$perl$exe_ext"; local($instperl) = "$installbin/$perl$exe_ext"; @@ -282,12 +286,11 @@ if (! $versiononly) { # pstruct should be a link to c2ph if (! $versiononly) { - safe_unlink("$installscript/pstruct" . ($Is_VMS ? '.Com' : '')); + safe_unlink("$installscript/pstruct$scr_ext"); if ($^O eq 'dos' or $Is_VMS) { - copy("$installscript/c2ph" . ($Is_VMS ? '.Com' : ''), - "$installscript/pstruct" . ($Is_VMS ? '.Com' : '')); + copy("$installscript/c2ph$scr_ext", "$installscript/pstruct$scr_ext"); } else { - link("$installscript/c2ph","$installscript/pstruct"); + link("$installscript/c2ph$scr_ext", "$installscript/pstruct$scr_ext"); } } @@ -335,7 +338,7 @@ if (! $versiononly || !($installprivlib =~ m/\Q$]/)) { if (!$versiononly) { - $dirsep = ($^O eq 'os2' || $^O eq 'MSWin32') ? ';' : ':' ; + $dirsep = ($Is_OS2 || $Is_W32) ? ';' : ':' ; ($path = $ENV{"PATH"}) =~ s:\\:/:g ; @path = split(/$dirsep/, $path); if ($Is_VMS) { @@ -391,7 +394,7 @@ sub unlink { foreach $name (@names) { next unless -e $name; - chmod 0777, $name if ($^O eq 'os2' || $^O eq 'MSWin32'); + chmod 0777, $name if ($Is_OS2 || $Is_W32); print STDERR " unlink $name\n"; ( CORE::unlink($name) and ++$cnt or warn "Couldn't unlink $name: $!\n" ) unless $nonono; @@ -404,7 +407,7 @@ sub safe_unlink { local @names = @_; foreach $name (@names) { next unless -e $name; - chmod 0777, $name if ($^O eq 'os2' || $^O eq 'MSWin32'); + chmod 0777, $name if ($Is_OS2 || $Is_W32); print STDERR " unlink $name\n"; next if CORE::unlink($name); warn "Couldn't unlink $name: $!\n"; @@ -479,7 +482,7 @@ sub copy { sub samepath { local($p1, $p2) = @_; - return (lc($p1) eq lc($p2)) if ($^O eq 'MSWin32'); + return (lc($p1) eq lc($p2)) if $Is_W32; if ($p1 ne $p2) { local($dev1, $ino1, $dev2, $ino2); @@ -512,7 +515,7 @@ sub installlib { my $installlib = $installprivlib; if ($dir =~ /^auto/ || ($name =~ /^(.*)\.(?:pm|pod)$/ && $archpms{$1}) || - ($name =~ /^(.*)\.(?:h|lib)$/i && $^O eq 'MSWin32') + ($name =~ /^(.*)\.(?:h|lib)$/i && $Is_W32) ) { $installlib = $installarchlib; return unless $do_installarchlib; @@ -565,7 +568,7 @@ sub copy_if_diff { } copy($from, $to); # Restore timestamps if it's a .a library or for OS/2. - if (!$nonono && ($^O eq 'os2' || $to =~ /\.a$/)) { + if (!$nonono && ($Is_OS2 || $to =~ /\.a$/)) { my ($atime, $mtime) = (stat $from)[8,9]; utime $atime, $mtime, $to; } diff --git a/pod/Makefile b/pod/Makefile index 16f90a1..785f977 100644 --- a/pod/Makefile +++ b/pod/Makefile @@ -8,6 +8,8 @@ POD2HTML = pod2html \ all: $(CONVERTERS) man +converters: $(CONVERTERS) + PERL = ../miniperl REALPERL = ../perl diff --git a/win32/Makefile b/win32/Makefile index de36c42..d315882 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -225,6 +225,29 @@ X2P = ..\x2p\a2p.exe PL2BAT = bin\pl2bat.pl GLOBBAT = bin\perlglob.bat +UTILS = \ + ..\utils\h2ph \ + ..\utils\splain \ + ..\utils\perlbug \ + ..\utils\pl2pm \ + ..\utils\c2ph \ + ..\utils\h2xs \ + ..\utils\perldoc \ + ..\utils\pstruct \ + ..\utils\perlcc \ + ..\pod\checkpods \ + ..\pod\pod2html \ + ..\pod\pod2latex \ + ..\pod\pod2man \ + ..\pod\pod2text \ + ..\x2p\find2perl \ + ..\x2p\s2p \ + bin\www.pl \ + bin\runperl.pl \ + bin\pl2bat.pl \ + bin\perlglob.pl \ + bin\search.pl + MAKE = nmake -nologo CFGSH_TMPL = config.vc @@ -680,25 +703,18 @@ $(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs cd ..\..\win32 doc: $(PERLEXE) - cd ..\pod - $(MAKE) -f ..\win32\pod.mak checkpods pod2html pod2latex \ - pod2man pod2text - $(XCOPY) *.bat ..\win32\bin\*.* - cd ..\win32 copy ..\README.win32 ..\pod\perlwin32.pod $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \ --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML::=|)" \ --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse -utils: $(PERLEXE) +utils: $(PERLEXE) $(X2P) cd ..\utils $(MAKE) PERL=$(MINIPERL) - $(PERLEXE) -I..\lib ..\win32\$(PL2BAT) h2ph splain perlbug pl2pm c2ph - $(PERLEXE) ..\win32\$(PL2BAT) h2xs perldoc pstruct - $(XCOPY) *.bat ..\win32\bin\*.* + cd ..\pod + $(MAKE) -f ..\win32\pod.mak converters cd ..\win32 - $(PERLEXE) $(PL2BAT) bin\network.pl bin\www.pl bin\runperl.pl \ - bin\pl2bat.pl bin\perlglob.pl + $(PERLEXE) $(PL2BAT) $(UTILS) distclean: clean -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \ @@ -735,16 +751,14 @@ distclean: clean -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR) -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR) -install : all installbare installutils installhtml +install : all installbare installhtml -installbare : +installbare : utils $(PERLEXE) ..\installperl $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.* - -installutils : utils $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.* $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.* - $(XCOPY) ..\pod\*.bat $(INST_SCRIPT)\*.* + $(XCOPY) bin\network.pl $(INST_LIB)\*.* installhtml : doc $(RCOPY) html\*.* $(INST_HTML)\*.* diff --git a/win32/makefile.mk b/win32/makefile.mk index 8544b5f..090e864 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -324,6 +324,29 @@ X2P = ..\x2p\a2p.exe PL2BAT = bin\pl2bat.pl GLOBBAT = bin\perlglob.bat +UTILS = \ + ..\utils\h2ph \ + ..\utils\splain \ + ..\utils\perlbug \ + ..\utils\pl2pm \ + ..\utils\c2ph \ + ..\utils\h2xs \ + ..\utils\perldoc \ + ..\utils\pstruct \ + ..\utils\perlcc \ + ..\pod\checkpods \ + ..\pod\pod2html \ + ..\pod\pod2latex \ + ..\pod\pod2man \ + ..\pod\pod2text \ + ..\x2p\find2perl \ + ..\x2p\s2p \ + bin\www.pl \ + bin\runperl.pl \ + bin\pl2bat.pl \ + bin\perlglob.pl \ + bin\search.pl + .IF "$(CCTYPE)" == "BORLAND" CFGSH_TMPL = config.bc @@ -842,21 +865,15 @@ $(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs cd $(EXTDIR)\$(*B) && $(MAKE) doc: $(PERLEXE) - cd ..\pod && $(MAKE) -f ..\win32\pod.mak checkpods \ - pod2html pod2latex pod2man pod2text - cd ..\pod && $(XCOPY) *.bat ..\win32\bin\*.* copy ..\README.win32 ..\pod\perlwin32.pod $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \ --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML:s,:,|,)"\ --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse -utils: $(PERLEXE) +utils: $(PERLEXE) $(X2P) cd ..\utils && $(MAKE) PERL=$(MINIPERL) - cd ..\utils && $(PERLEXE) ..\win32\$(PL2BAT) h2ph splain perlbug \ - pl2pm c2ph h2xs perldoc pstruct - $(XCOPY) ..\utils\*.bat bin\*.* - $(PERLEXE) -I..\lib $(PL2BAT) bin\network.pl bin\www.pl bin\runperl.pl \ - bin\pl2bat.pl bin\perlglob.pl + cd ..\pod && $(MAKE) -f ..\win32\pod.mak converters + $(PERLEXE) $(PL2BAT) $(UTILS) distclean: clean -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \ @@ -887,18 +904,16 @@ distclean: clean -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR) -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR) -install : all installbare installutils installhtml +install : all installbare installhtml -installbare : +installbare : utils $(PERLEXE) ..\installperl .IF "$(PERL95EXE)" != "" $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.* .ENDIF - -installutils : utils $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.* $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.* - $(XCOPY) ..\pod\*.bat $(INST_SCRIPT)\*.* + $(XCOPY) bin\network.pl $(INST_LIB)\*.* installhtml : doc $(RCOPY) html\*.* $(INST_HTML)\*.* diff --git a/win32/pod.mak b/win32/pod.mak index 9881ed8..7ad153c 100644 --- a/win32/pod.mak +++ b/win32/pod.mak @@ -8,8 +8,10 @@ POD2HTML = pod2html \ all: $(CONVERTERS) html +converters: $(CONVERTERS) + PERL = ..\miniperl.exe -PL2BAT = ..\win32\bin\pl2bat.pl +REALPERL = ..\perl.exe POD = \ perl.pod \ @@ -23,6 +25,7 @@ POD = \ perlvar.pod \ perlsub.pod \ perlmod.pod \ + perlmodlib.pod \ perlform.pod \ perllocale.pod \ perlref.pod \ @@ -70,6 +73,7 @@ MAN = \ perlvar.man \ perlsub.man \ perlmod.man \ + perlmodlib.man \ perlform.man \ perllocale.man \ perlref.man \ @@ -117,6 +121,7 @@ HTML = \ perlvar.html \ perlsub.html \ perlmod.html \ + perlmodlib.html \ perlform.html \ perllocale.html \ perlref.html \ @@ -164,6 +169,7 @@ TEX = \ perlvar.tex \ perlsub.tex \ perlmod.tex \ + perlmodlib.tex \ perlform.tex \ perllocale.tex \ perlref.tex \ @@ -206,67 +212,67 @@ html: pod2html $(HTML) tex: pod2latex $(TEX) toc: - $(PERL) -I..\lib buildtoc >perltoc.pod + $(PERL) -I../lib buildtoc >perltoc.pod .SUFFIXES: .pm .pod .SUFFIXES: .man .pm.man: - $(PERL) -I..\lib pod2man $*.pm >$*.man + $(PERL) -I../lib pod2man $*.pm >$*.man .pod.man: - $(PERL) -I..\lib pod2man $*.pod >$*.man + $(PERL) -I../lib pod2man $*.pod >$*.man .SUFFIXES: .html .pm.html: - $(PERL) -I..\lib $(POD2HTML) --infile=$*.pm --outfile=$*.html + $(PERL) -I../lib $(POD2HTML) --infile=$*.pm --outfile=$*.html .pod.html: - $(PERL) -I..\lib $(POD2HTML) --infile=$*.pod --outfile=$*.html + $(PERL) -I../lib $(POD2HTML) --infile=$*.pod --outfile=$*.html .SUFFIXES: .tex .pm.tex: - $(PERL) -I..\lib pod2latex $*.pm + $(PERL) -I../lib pod2latex $*.pm .pod.tex: - $(PERL) -I..\lib pod2latex $*.pod + $(PERL) -I../lib pod2latex $*.pod clean: - del /f $(MAN) $(HTML) $(TEX) - del /f pod2html-*cache - del /f *.aux *.log + rm -f $(MAN) + rm -f $(HTML) + rm -f $(TEX) + rm -f pod2html-*cache + rm -f *.aux *.log *.exe realclean: clean - del /f $(CONVERTERS) + rm -f $(CONVERTERS) distclean: realclean check: checkpods @echo "checking..."; \ - $(PERL) -I..\lib checkpods $(POD) + $(PERL) -I../lib checkpods $(POD) # Dependencies. -pod2latex: pod2latex.PL ..\lib\Config.pm - $(PERL) -I..\lib pod2latex.PL - $(PERL) $(PL2BAT) pod2latex +pod2latex: pod2latex.PL ../lib/Config.pm + $(PERL) -I../lib pod2latex.PL -pod2html: pod2html.PL ..\lib\Config.pm - $(PERL) -I..\lib pod2html.PL - $(PERL) $(PL2BAT) pod2html +pod2html: pod2html.PL ../lib/Config.pm + $(PERL) -I ../lib pod2html.PL -pod2man: pod2man.PL ..\lib\Config.pm - $(PERL) -I..\lib pod2man.PL - $(PERL) $(PL2BAT) pod2man +pod2man: pod2man.PL ../lib/Config.pm + $(PERL) -I ../lib pod2man.PL -pod2text: pod2text.PL ..\lib\Config.pm - $(PERL) -I..\lib pod2text.PL - $(PERL) $(PL2BAT) pod2text +pod2text: pod2text.PL ../lib/Config.pm + $(PERL) -I ../lib pod2text.PL -checkpods: checkpods.PL ..\lib\Config.pm - $(PERL) -I..\lib checkpods.PL - $(PERL) $(PL2BAT) checkpods +checkpods: checkpods.PL ../lib/Config.pm + $(PERL) -I ../lib checkpods.PL +compile: all + $(REALPERL) -I../lib ../utils/perlcc -regex 's/$$/.exe/' pod2latex pod2man pod2text checkpods -prog -verbose dcf -log ../compilelog; +