summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-01-13 02:46:53 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-01-13 02:46:53 +0000
commitd07c2202867c84a305417e42e522ca39d055c62a (patch)
tree61abe56eb09e388c565e410cebc8a0d7778ffd11
parent2fd1c6b8c969281de42d3830c930f0cea98c16de (diff)
downloadperl-d07c2202867c84a305417e42e522ca39d055c62a.tar.gz
[win32] various tweaks to build support (NOTE: meant for 5.004_57)
- build and install x2p - fix installperl warnings on win32 - `make install` now does puts the archlibs in right places - makefiles don't default to USE_THREADS anymore - sync config.{b,g,v}c - sync makefile.mk -> Makefile p4raw-id: //depot/win32/perl@416
-rwxr-xr-xinstallperl8
-rw-r--r--win32/Makefile74
-rw-r--r--win32/config.bc1
-rw-r--r--win32/config.gc7
-rw-r--r--win32/config.vc7
-rw-r--r--win32/config_sh.PL11
-rw-r--r--win32/makefile.mk90
-rw-r--r--x2p/a2p.h25
-rw-r--r--x2p/a2py.c14
9 files changed, 164 insertions, 73 deletions
diff --git a/installperl b/installperl
index ee00cd16a5..150b334f8c 100755
--- a/installperl
+++ b/installperl
@@ -2,6 +2,7 @@
BEGIN {
require 5.004;
+ chdir '..' if !-d 'lib' and -d '..\lib';
@INC = 'lib';
$ENV{PERL5LIB} = 'lib';
}
@@ -87,8 +88,9 @@ 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' || warn "WARNING: You've never run 'make test'!!!",
- " (Installing anyway.)\n";
+-x 't/TEST' || $^O eq 'MSWin32'
+ || warn "WARNING: You've never run 'make test'!!!",
+ " (Installing anyway.)\n";
if ($^O eq 'MSWin32') {
@@ -160,7 +162,7 @@ foreach $file (@corefiles) {
$mainperl_is_instperl = 0;
-if (!$versiononly && !$nonono && -t STDIN && -t STDERR
+if (!$versiononly && !$nonono && $^O ne 'MSWin32' && -t STDIN && -t STDERR
&& -w $mainperldir && ! samepath($mainperldir, $installbin)) {
local($usrbinperl) = "$mainperldir/perl$exe_ext";
local($instperl) = "$installbin/perl$exe_ext";
diff --git a/win32/Makefile b/win32/Makefile
index 12410e21fb..1aa5747376 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -11,10 +11,10 @@
# newly built perl.
INST_DRV=c:
INST_TOP=$(INST_DRV)\perl5004.5x
-BUILDOPT=-DUSE_THREADS
-#BUILDOPT=-DMULTIPLICITY
-#BUILDOPT=-DMULTIPLICITY -DUSE_THREADS
-#BUILDOPT=-DPERL_GLOBAL_STRUCT -DMULTIPLICITY
+
+#
+# uncomment to enable threads-capabilities
+#USE_THREADS=-DUSE_THREADS
#
# uncomment next line if you are using Visual C++ 2.x
@@ -55,6 +55,24 @@ D_CRYPT=define
CRYPT_FLAG=-DHAVE_DES_FCRYPT
!ENDIF
+BUILDOPT = $(USE_THREADS)
+#BUILDOPT = $(USE_THREADS) -DMULTIPLICITY
+#BUILDOPT = $(USE_THREADS) -DPERL_GLOBAL_STRUCT -DMULTIPLICITY
+# -DUSE_PERLIO -D__STDC__=1 -DUSE_SFIO -DI_SFIO -I\sfio97\include
+
+!IF "$(PROCESSOR_ARCHITECTURE)" == ""
+PROCESSOR_ARCHITECTURE = x86
+!ENDIF
+
+!IF "$(USE_THREADS)" == ""
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
+!ELSE
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
+!ENDIF
+
+ARCHDIR = ..\lib\$(ARCHNAME)
+COREDIR = ..\lib\CORE
+
#
# Programs to compile, build .lib files and link
#
@@ -121,12 +139,15 @@ o = .obj
.SUFFIXES : .c $(o) .dll .lib .exe
.c$(o):
- $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $<
+ $(CC) -c -I$(<D) $(CFLAGS) $(OBJOUT_FLAG)$@ $<
$(o).dll:
$(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
-out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
+.y.c:
+ $(NOOP)
+
#
INST_BIN=$(INST_TOP)\bin
INST_LIB=$(INST_TOP)\lib
@@ -146,6 +167,7 @@ PERLEXE=..\perl.exe
GLOBEXE=..\perlglob.exe
CONFIGPM=..\lib\Config.pm
MINIMOD=..\lib\ExtUtils\Miniperl.pm
+X2P=..\x2p\a2p.exe
PL2BAT=bin\pl2bat.pl
GLOBBAT = bin\perlglob.bat
@@ -156,6 +178,7 @@ CFGH_TMPL = config_H.vc
PERL95EXE=..\perl95.exe
XCOPY=xcopy /f /r /i /d
RCOPY=xcopy /f /r /i /e /d
+NOOP=@echo
NULL=
!IF "$(CRYPT_SRC)" != ""
@@ -241,6 +264,12 @@ PERL95_OBJ = perl95$(o) \
DLL_OBJ = perllib$(o) $(DYNALOADER)$(o)
+X2P_OBJ = ..\x2p\a2p$(o) \
+ ..\x2p\hash$(o) \
+ ..\x2p\str$(o) \
+ ..\x2p\util$(o) \
+ ..\x2p\walk$(o)
+
CORE_H = ..\av.h \
..\cop.h \
..\cv.h \
@@ -317,7 +346,8 @@ POD2TEXT=$(PODDIR)\pod2text
# Top targets
#
-all: $(PERLEXE) $(PERL95EXE) $(GLOBEXE) $(DYNALOADMODULES) $(MINIMOD) $(GLOBBAT)
+all: $(PERLEXE) $(PERL95EXE) $(GLOBEXE) $(DYNALOADMODULES) $(MINIMOD) \
+ $(X2P) $(GLOBBAT)
$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
@@ -345,6 +375,7 @@ config.w32 : $(CFGSH_TMPL)
$(MINIPERL) -I..\lib config_sh.PL \
"INST_DRV=$(INST_DRV)" \
"INST_TOP=$(INST_TOP)" \
+ "archname=$(ARCHNAME)" \
"cc=$(CC)" \
"ccflags=$(OPTIMIZE) $(DEFINES)" \
"cf_email=$(EMAIL)" \
@@ -362,9 +393,9 @@ config.w32 : $(CFGSH_TMPL)
$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
cd .. && miniperl configpm
if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
- $(XCOPY) ..\*.h ..\lib\CORE\*.*
- $(XCOPY) *.h ..\lib\CORE\*.*
- $(RCOPY) include ..\lib\CORE\*.*
+ $(XCOPY) ..\*.h $(COREDIR)\*.*
+ $(XCOPY) *.h $(COREDIR)\*.*
+ $(RCOPY) include $(COREDIR)\*.*
$(MINIPERL) -I..\lib config_h.PL || $(MAKE) CCTYPE=$(CCTYPE) \
RUNTIME=$(RUNTIME) CFG=$(CFG) $(CONFIGPM)
@@ -377,6 +408,7 @@ $(WIN32_OBJ) : $(CORE_H)
$(CORE_OBJ) : $(CORE_H)
$(DLL_OBJ) : $(CORE_H)
$(PERL95_OBJ) : $(CORE_H)
+$(X2P_OBJ) : $(CORE_H)
perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl
$(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) \
@@ -386,7 +418,7 @@ $(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
$(LINK32) -dll -def:perldll.def -out:$@ @<<
$(LINK_FLAGS) $(LIBFILES) $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
<<
- $(XCOPY) $(PERLIMPLIB) ..\lib\CORE
+ $(XCOPY) $(PERLIMPLIB) $(COREDIR)
perl.def : $(MINIPERL) makeperldef.pl
$(MINIPERL) -I..\lib makeperldef.pl $(NULL) > perl.def
@@ -394,6 +426,11 @@ perl.def : $(MINIPERL) makeperldef.pl
$(MINIMOD) : $(MINIPERL) ..\minimod.pl
cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
+$(X2P) : $(X2P_OBJ)
+ $(LINK32) -subsystem:console -out:$@ @<<
+ $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ)
+<<
+
perlmain.c : runperl.c
copy runperl.c perlmain.c
@@ -486,14 +523,14 @@ doc: $(PERLEXE)
$(XCOPY) *.bat ..\win32\bin\*.*
cd ..\win32
copy ..\README.win32 ..\pod\perlwin32.pod
- $(PERLEXE) ..\installhtml --podroot=.. --htmldir=./html \
+ $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
--podpath=pod:lib:ext:utils --htmlroot="//$(INST_HTML::=|)" \
--libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
utils: $(PERLEXE)
cd ..\utils
nmake PERL=$(MINIPERL)
- $(PERLEXE) ..\win32\$(PL2BAT) h2ph splain perlbug pl2pm c2ph
+ $(PERLEXE) -I..\lib ..\win32\$(PL2BAT) h2ph splain perlbug pl2pm c2ph
$(PERLEXE) ..\win32\$(PL2BAT) h2xs perldoc pstruct
$(XCOPY) *.bat ..\win32\bin\*.*
cd ..\win32
@@ -513,23 +550,18 @@ distclean: clean
-del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c \
config.h.new perl95.c
-del /f bin\*.bat
- -rmdir /s /q ..\lib\auto
- -rmdir /s /q ..\lib\CORE
+ -rmdir /s /q ..\lib\auto || rmdir /s ..\lib\auto
+ -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
cd $(EXTDIR)
-del /s *.lib *.def *.map *.bs Makefile *$(o) pm_to_blib
cd ..\win32
install : all doc utils
- if not exist $(INST_TOP) mkdir $(INST_TOP)
- echo I $(INST_TOP) L $(LIBDIR)
- $(XCOPY) $(PERLEXE) $(INST_BIN)\*.*
+ $(PERLEXE) ..\installperl
$(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
$(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
- $(XCOPY) $(PERLDLL) $(INST_BIN)\*.*
$(XCOPY) bin\*.bat $(INST_BIN)\*.*
- $(RCOPY) ..\lib $(INST_LIB)\*.*
$(XCOPY) ..\pod\*.bat $(INST_BIN)\*.*
- $(XCOPY) ..\pod\*.pod $(INST_POD)\*.*
$(RCOPY) html\*.* $(INST_HTML)\*.*
inst_lib : $(CONFIGPM)
@@ -575,8 +607,10 @@ clean :
-@erase $(CORE_OBJ)
-@erase $(WIN32_OBJ)
-@erase $(DLL_OBJ)
+ -@erase $(X2P_OBJ)
-@erase ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp
-@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
+ -@erase ..\x2p\*.exe ..\x2p\*.bat
-@erase *.ilk
-@erase *.pdb
diff --git a/win32/config.bc b/win32/config.bc
index 97cee6a476..e76928eb48 100644
--- a/win32/config.bc
+++ b/win32/config.bc
@@ -369,6 +369,7 @@ ldflags=''
less='less'
lib_ext='.lib'
libc='cw32mti.lib'
+libperl='perl.lib'
libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x'
line='line'
lint=''
diff --git a/win32/config.gc b/win32/config.gc
index 3c9acbeda6..decfbffecd 100644
--- a/win32/config.gc
+++ b/win32/config.gc
@@ -5,7 +5,7 @@
## Target system: WIN32
#
-archlibexp='~INST_TOP~\lib'
+archlibexp='~INST_TOP~\lib\~archname~'
archname='MSWin32'
cc='gcc'
ccflags='-DWIN32'
@@ -13,7 +13,7 @@ cppflags='-DWIN32'
dlsrc='dl_win32.xs'
dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs Thread'
extensions='~static_ext~ ~dynamic_ext~'
-installarchlib='~INST_TOP~\lib'
+installarchlib='~INST_TOP~\lib\~archname~'
installprivlib='~INST_TOP~\lib'
libpth=''
libs=' '
@@ -46,7 +46,7 @@ afs='false'
alignbytes='8'
aphostname=''
ar='ar'
-archlib='~INST_TOP~\lib'
+archlib='~INST_TOP~\lib\~archname~'
archobjs=''
awk='awk'
baserev='5.0'
@@ -369,6 +369,7 @@ ldflags=''
less='less'
lib_ext='.lib'
libc='msvcrt.lib'
+libperl='libperl.a'
libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x'
line='line'
lint=''
diff --git a/win32/config.vc b/win32/config.vc
index 09573225fb..3866681113 100644
--- a/win32/config.vc
+++ b/win32/config.vc
@@ -5,7 +5,7 @@
## Target system: WIN32
#
-archlibexp='~INST_TOP~\lib'
+archlibexp='~INST_TOP~\lib\~archname~'
archname='MSWin32'
cc='cl'
ccflags='-MD -DWIN32'
@@ -13,7 +13,7 @@ cppflags='-DWIN32'
dlsrc='dl_win32.xs'
dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs Thread'
extensions='~static_ext~ ~dynamic_ext~'
-installarchlib='~INST_TOP~\lib'
+installarchlib='~INST_TOP~\lib\~archname~'
installprivlib='~INST_TOP~\lib'
libpth=''
libs=''
@@ -46,7 +46,7 @@ afs='false'
alignbytes='8'
aphostname=''
ar='lib'
-archlib='~INST_TOP~\lib'
+archlib='~INST_TOP~\lib\~archname~'
archobjs=''
awk='awk'
baserev='5.0'
@@ -369,6 +369,7 @@ ldflags='-nologo -subsystem:windows'
less='less'
lib_ext='.lib'
libc='msvcrt.lib'
+libperl='perl.lib'
libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x'
line='line'
lint=''
diff --git a/win32/config_sh.PL b/win32/config_sh.PL
index 5f3f157a0c..0c3713cb2e 100644
--- a/win32/config_sh.PL
+++ b/win32/config_sh.PL
@@ -5,17 +5,6 @@ while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/)
shift(@ARGV);
}
-$opt{'archname'} = 'MSWin32';
-if (defined $ENV{'PROCESSOR_ARCHITECTURE'})
- {
- $opt{'archname'} .= '-'.$ENV{'PROCESSOR_ARCHITECTURE'};
- }
-
-if ($opt{'ccflags'} =~ /USE_THREADS/)
- {
- $opt{'archname'} .= '-thread';
- }
-
if ($] =~ /\.(\d\d\d)?(\d\d)?$/) { # should always be true
$opt{PATCHLEVEL} = int($1 || 0);
$opt{SUBVERSION} = $2 || '00';
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 916d73c526..c83f4986f0 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -16,13 +16,8 @@ INST_DRV *= c:
INST_TOP *= $(INST_DRV)\perl5004.5x
#
-#
-BUILDOPT *= -DUSE_THREADS
-#BUILDOPT *= -DMULTIPLICITY
-#BUILDOPT *=-DMULTIPLICITY -DUSE_THREADS
-#BUILDOPT *=-DPERL_GLOBAL_STRUCT -DMULTIPLICITY
-
-# -DUSE_PERLIO -D__STDC__=1 -DUSE_SFIO -DI_SFIO -I\sfio97\include
+# uncomment to enable threads-capabilities
+#USE_THREADS *= -DUSE_THREADS
#
# uncomment one
@@ -72,6 +67,24 @@ D_CRYPT=define
CRYPT_FLAG=-DHAVE_DES_FCRYPT
.ENDIF
+BUILDOPT *= $(USE_THREADS)
+#BUILDOPT *= $(USE_THREADS) -DMULTIPLICITY
+#BUILDOPT *= $(USE_THREADS) -DPERL_GLOBAL_STRUCT -DMULTIPLICITY
+# -DUSE_PERLIO -D__STDC__=1 -DUSE_SFIO -DI_SFIO -I\sfio97\include
+
+.IMPORT .IGNORE : PROCESSOR_ARCHITECTURE
+
+PROCESSOR_ARCHITECTURE *= x86
+
+.IF "$(USE_THREADS)" == ""
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
+.ELSE
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
+.ENDIF
+
+ARCHDIR = ..\lib\$(ARCHNAME)
+COREDIR = ..\lib\CORE
+
#
# Programs to compile, build .lib files and link
#
@@ -189,10 +202,6 @@ OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
LINK_DBG = -release
.ENDIF
-.IMPORT .IGNORE : PROCESSOR_ARCHITECTURE
-
-PROCESSOR_ARCHITECTURE *= x86
-
# we don't add LIBC here, the compiler do it based on -MD/-MT
LIBFILES = $(CRYPT_LIB) oldnames.lib kernel32.lib user32.lib gdi32.lib \
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib \
@@ -218,7 +227,10 @@ o *= .obj
.SUFFIXES : .c $(o) .dll .lib .exe .a
.c$(o):
- $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $<
+ $(CC) -c -I$(<:d) $(CFLAGS) $(OBJOUT_FLAG)$@ $<
+
+.y.c:
+ $(NOOP)
$(o).dll:
.IF "$(CCTYPE)" == "BORLAND"
@@ -251,6 +263,7 @@ PERLEXE=..\perl.exe
GLOBEXE=..\perlglob.exe
CONFIGPM=..\lib\Config.pm
MINIMOD=..\lib\ExtUtils\Miniperl.pm
+X2P=..\x2p\a2p.exe
PL2BAT=bin\pl2bat.pl
GLOBBAT = bin\perlglob.bat
@@ -276,6 +289,7 @@ PERL95EXE=..\perl95.exe
XCOPY=xcopy /f /r /i /d
RCOPY=xcopy /f /r /i /e /d
+NOOP=@echo
#NULL=
.IF "$(CRYPT_SRC)" != ""
@@ -361,6 +375,12 @@ PERL95_OBJ = perl95$(o) \
DLL_OBJ = perllib$(o) $(DYNALOADER)$(o)
+X2P_OBJ = ..\x2p\a2p$(o) \
+ ..\x2p\hash$(o) \
+ ..\x2p\str$(o) \
+ ..\x2p\util$(o) \
+ ..\x2p\walk$(o)
+
CORE_H = ..\av.h \
..\cop.h \
..\cv.h \
@@ -437,7 +457,8 @@ POD2TEXT=$(PODDIR)\pod2text
# Top targets
#
-all: $(PERLEXE) $(PERL95EXE) $(GLOBEXE) $(DYNALOADMODULES) $(MINIMOD) $(GLOBBAT)
+all: $(PERLEXE) $(PERL95EXE) $(GLOBEXE) $(DYNALOADMODULES) $(MINIMOD) \
+ $(X2P) $(GLOBBAT)
$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
@@ -473,6 +494,7 @@ config.w32 : $(CFGSH_TMPL)
$(MINIPERL) -I..\lib config_sh.PL \
"INST_DRV=$(INST_DRV)" \
"INST_TOP=$(INST_TOP)" \
+ "archname=$(ARCHNAME)" \
"cc=$(CC)" \
"ccflags=$(OPTIMIZE) $(DEFINES)" \
"cf_email=$(EMAIL)" \
@@ -490,9 +512,9 @@ config.w32 : $(CFGSH_TMPL)
$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
cd .. && miniperl configpm
if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
- $(XCOPY) ..\*.h ..\lib\CORE\*.*
- $(XCOPY) *.h ..\lib\CORE\*.*
- $(RCOPY) include ..\lib\CORE\*.*
+ $(XCOPY) ..\*.h $(COREDIR)\*.*
+ $(XCOPY) *.h $(COREDIR)\*.*
+ $(RCOPY) include $(COREDIR)\*.*
$(MINIPERL) -I..\lib config_h.PL || $(MAKE) CCTYPE=$(CCTYPE) \
CFG=$(CFG) $(CONFIGPM)
@@ -503,7 +525,7 @@ $(MINIPERL) : ..\miniperlmain$(o) $(CORE_OBJ) $(WIN32_OBJ)
.IF "$(CCTYPE)" == "BORLAND"
$(LINK32) -Tpe -ap $(LINK_FLAGS) \
@$(mktmp c0x32$(o) ..\miniperlmain$(o) \
- $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\),$@,,$(LIBFILES),)
+ $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
.ELIF "$(CCTYPE)" == "GCC"
$(LINK32) -v -o $@ $(LINK_FLAGS) \
$(mktmp $(LKPRE) ..\miniperlmain$(o) \
@@ -517,6 +539,7 @@ $(MINIPERL) : ..\miniperlmain$(o) $(CORE_OBJ) $(WIN32_OBJ)
$(WIN32_OBJ) : $(CORE_H)
$(CORE_OBJ) : $(CORE_H)
$(DLL_OBJ) : $(CORE_H)
+$(X2P_OBJ) : $(CORE_H)
perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl
$(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) \
@@ -548,7 +571,7 @@ $(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
@$(mktmp $(LINK_FLAGS) $(LIBFILES) $(CORE_OBJ:s,\,\\) \
$(WIN32_OBJ:s,\,\\) $(DLL_OBJ:s,\,\\))
.ENDIF
- $(XCOPY) $(PERLIMPLIB) ..\lib\CORE
+ $(XCOPY) $(PERLIMPLIB) $(COREDIR)
perl.def : $(MINIPERL) makeperldef.pl
$(MINIPERL) -I..\lib makeperldef.pl $(NULL) > perl.def
@@ -556,6 +579,20 @@ perl.def : $(MINIPERL) makeperldef.pl
$(MINIMOD) : $(MINIPERL) ..\minimod.pl
cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
+$(X2P) : $(X2P_OBJ)
+ $(MINIPERL) ..\x2p\find2perl.PL
+ $(MINIPERL) ..\x2p\s2p.PL
+.IF "$(CCTYPE)" == "BORLAND"
+ $(LINK32) -Tpe -ap $(LINK_FLAGS) \
+ @$(mktmp c0x32$(o) $(X2P_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
+.ELIF "$(CCTYPE)" == "GCC"
+ $(LINK32) -v -o $@ $(LINK_FLAGS) \
+ $(mktmp $(LKPRE) $(X2P_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
+.ELSE
+ $(LINK32) -subsystem:console -out:$@ \
+ @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\)
+.ENDIF
+
perlmain.c : runperl.c
copy runperl.c perlmain.c
@@ -649,7 +686,7 @@ doc: $(PERLEXE)
pod2html pod2latex pod2man pod2text
cd ..\pod && $(XCOPY) *.bat ..\win32\bin\*.*
copy ..\README.win32 ..\pod\perlwin32.pod
- $(PERLEXE) ..\installhtml --podroot=.. --htmldir=./html \
+ $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
--podpath=pod:lib:ext:utils --htmlroot="//$(INST_HTML:s,:,|,)" \
--libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
@@ -658,7 +695,7 @@ utils: $(PERLEXE)
cd ..\utils && $(PERLEXE) ..\win32\$(PL2BAT) h2ph splain perlbug \
pl2pm c2ph h2xs perldoc pstruct
$(XCOPY) ..\utils\*.bat bin\*.*
- $(PERLEXE) $(PL2BAT) bin\network.pl bin\www.pl bin\runperl.pl \
+ $(PERLEXE) -I..\lib $(PL2BAT) bin\network.pl bin\www.pl bin\runperl.pl \
bin\pl2bat.pl
distclean: clean
@@ -677,22 +714,17 @@ distclean: clean
.ENDIF
-del /f bin\*.bat
-cd $(EXTDIR) && del /s *.lib *.def *.map *.bs Makefile *$(o) pm_to_blib
- -rmdir /s /q ..\lib\auto
- -rmdir /s /q ..\lib\CORE
+ -rmdir /s /q ..\lib\auto || rmdir /s ..\lib\auto
+ -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
install : all doc utils
- if not exist $(INST_TOP) mkdir $(INST_TOP)
- echo I $(INST_TOP) L $(LIBDIR)
- $(XCOPY) $(PERLEXE) $(INST_BIN)\*.*
+ $(PERLEXE) ..\installperl
.IF "$(PERL95EXE)" != ""
$(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
.ENDIF
$(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
- $(XCOPY) $(PERLDLL) $(INST_BIN)\*.*
$(XCOPY) bin\*.bat $(INST_BIN)\*.*
- $(RCOPY) ..\lib $(INST_LIB)\*.*
$(XCOPY) ..\pod\*.bat $(INST_BIN)\*.*
- $(XCOPY) ..\pod\*.pod $(INST_POD)\*.*
$(RCOPY) html\*.* $(INST_HTML)\*.*
inst_lib : $(CONFIGPM)
@@ -741,8 +773,10 @@ clean :
-@erase $(CORE_OBJ)
-@erase $(WIN32_OBJ)
-@erase $(DLL_OBJ)
+ -@erase $(X2P_OBJ)
-@erase ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp
-@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
+ -@erase ..\x2p\*.exe ..\x2p\*.bat
-@erase *.ilk
-@erase *.pdb
diff --git a/x2p/a2p.h b/x2p/a2p.h
index 085935d98f..a7cbcb68b3 100644
--- a/x2p/a2p.h
+++ b/x2p/a2p.h
@@ -9,12 +9,37 @@
*/
#define VOIDUSED 1
+
+#ifdef WIN32
+#define _INC_WIN32_PERL5 /* kludge around win32 stdio layer */
+#endif
+
#ifdef VMS
# include "config.h"
#else
# include "../config.h"
#endif
+#ifdef WIN32
+#undef USE_STDIO_PTR /* XXX fast gets won't work, must investigate */
+# ifndef STANDARD_C
+# define STANDARD_C
+# endif
+# if defined(__BORLANDC__)
+# pragma warn -ccc
+# pragma warn -rch
+# pragma warn -sig
+# pragma warn -pia
+# pragma warn -par
+# pragma warn -aus
+# pragma warn -use
+# pragma warn -csu
+# pragma warn -pro
+# elif defined(_MSC_VER)
+# elif defined(__MINGW32__)
+# endif
+#endif
+
#if defined(__STDC__) || defined(vax11c) || defined(_AIX) || defined(__stdc__) || defined(__cplusplus)
# define STANDARD_C 1
#endif
diff --git a/x2p/a2py.c b/x2p/a2py.c
index 202d5921e0..fefa81da7e 100644
--- a/x2p/a2py.c
+++ b/x2p/a2py.c
@@ -8,7 +8,7 @@
* $Log: a2py.c,v $
*/
-#ifdef OS2
+#if defined(OS2) || defined(WIN32)
#include "../patchlevel.h"
#endif
#include "util.h"
@@ -26,7 +26,9 @@ int oper4(int type, int arg1, int arg2, int arg3, int arg4);
int oper5(int type, int arg1, int arg2, int arg3, int arg4, int arg5);
STR *walk(int useval, int level, register int node, int *numericptr, int minprec);
-#ifdef OS2
+#if defined(OS2) || defined(WIN32)
+static void usage(void);
+
static void
usage()
{
@@ -86,9 +88,11 @@ main(register int argc, register char **argv, register char **env)
case 0:
break;
default:
- fatal("Unrecognized switch: %s\n",argv[0]);
-#ifdef OS2
+#if defined(OS2) || defined(WIN32)
+ fprintf(stderr, "Unrecognized switch: %s\n",argv[0]);
usage();
+#else
+ fatal("Unrecognized switch: %s\n",argv[0]);
#endif
}
}
@@ -97,7 +101,7 @@ main(register int argc, register char **argv, register char **env)
/* open script */
if (argv[0] == Nullch) {
-#ifdef OS2
+#if defined(OS2) || defined(WIN32)
if ( isatty(fileno(stdin)) )
usage();
#endif