# Makefile to build perl on Windows NT using Microsoft NMAKE.
#
# This is set up to build a perl.exe that runs off a shared library
-# (perl.dll). Also makes individual DLLs for the XS extensions.
+# (perl56.dll). Also makes individual DLLs for the XS extensions.
#
##
# versioned installation can be obtained by setting INST_TOP above to a
# path that includes an arbitrary version string.
#
-INST_VER = \5.00563
+INST_VER = \5.6.0
#
# Comment this out if you DON'T want your perl installation to have
INST_ARCH = \$(ARCHNAME)
#
-# XXX WARNING! This option currently undergoing changes. May be broken.
+# uncomment to enable multiple interpreters. This is need for fork()
+# emulation.
#
-# uncomment to enable threads-capabilities
-#
-#USE_THREADS = define
+#USE_MULTI = define
#
-# XXX WARNING! This option currently undergoing changes. May be broken.
-#
-# uncomment to enable multiple interpreters
+# Beginnings of interpreter cloning/threads; still very incomplete.
+# This should be enabled to get the fork() emulation. This needs
+# USE_MULTI as well.
#
-#USE_MULTI = define
+#USE_ITHREADS = define
#
-# XXX WARNING! This option currently undergoing changes. May be broken.
-#
-# uncomment next line if you want to use the perl object
-# Currently, this cannot be enabled if you ask for threads above
+# uncomment to enable the implicit "host" layer for all system calls
+# made by perl. This needs USE_MULTI above. This is also needed to
+# get fork().
#
-#USE_OBJECT = define
+#USE_IMP_SYS = define
#
-# XXX WARNING! This option currently undergoing changes. May be broken.
+# WARNING! This option is deprecated and will eventually go away (enable
+# USE_ITHREADS instead).
#
-# Beginnings of interpreter cloning/threads: still rather rough, fails
-# tests. This should be enabled to get the fork() emulation. Do not
-# enable unless you know what you're doing!
+# uncomment to enable threads-capabilities. This is incompatible with
+# USE_ITHREADS, and is only here for people who may have come to rely
+# on the experimental Thread support that was in 5.005.
#
-#USE_ITHREADS = define
+#USE_5005THREADS= define
#
-# uncomment to enable the implicit "host" layer for all system calls
-# made by perl. This is needed and auto-enabled by USE_OBJECT above.
-# This is also needed to get fork().
+# WARNING! This option is deprecated and will eventually go away (enable
+# USE_MULTI instead).
#
-#USE_IMP_SYS = define
+# uncomment next line if you want to use the PERL_OBJECT build option.
+# DO NOT ENABLE unless you have legacy code that relies on the C++
+# CPerlObj class that was available in 5.005. This cannot be enabled
+# if you ask for USE_5005THREADS above.
+#
+#USE_OBJECT = define
#
# uncomment one of the following lines if you are using either
# Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/
# and follow the directions in the package to install.
#
+# Not recommended if you have VC 6.x and you're not running Windows 9x.
+#
#USE_PERLCRT = define
-#BUILD_FOR_WIN95 = define
#
# uncomment to enable linking with setargv.obj under the Visual C
# WARNING: Turning this on/off WILL break binary compatibility with extensions
# you may have compiled with/without it. Be prepared to recompile all
# extensions if you change the default. Currently, this cannot be enabled
-# if you ask for USE_OBJECT above.
+# if you ask for USE_IMP_SYS above.
#
#PERL_MALLOC = define
#BUILDOPT = $(BUILDOPT) -DPERL_TEXTMODE_SCRIPTS
#
-# This should normally be disabled. Enabling it runs a cloned toplevel
-# interpreter (*EXPERIMENTAL*, fails tests)
-#BUILDOPT = $(BUILDOPT) -DTOP_CLONE
-
-#
# specify semicolon-separated list of extra directories that modules will
# look for libraries (spaces in path names need not be quoted)
#
!IF "$(USE_OBJECT)" == "define"
PERL_MALLOC = undef
-USE_THREADS = undef
+USE_5005THREADS = undef
USE_MULTI = undef
USE_IMP_SYS = define
!ENDIF
PERL_MALLOC = undef
!ENDIF
-!IF "$(USE_THREADS)" == ""
-USE_THREADS = undef
+!IF "$(USE_5005THREADS)" == ""
+USE_5005THREADS = undef
!ENDIF
-!IF "$(USE_THREADS)" == "define"
+!IF "$(USE_5005THREADS)" == "define"
USE_ITHREADS = undef
!ENDIF
+!IF "$(USE_IMP_SYS)" == "define"
+PERL_MALLOC = undef
+!ENDIF
+
!IF "$(USE_MULTI)" == ""
USE_MULTI = undef
!ENDIF
USE_IMP_SYS = undef
!ENDIF
-!IF "$(USE_MULTI)$(USE_THREADS)$(USE_OBJECT)" != "undefundefundef"
-BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT
+!IF "$(USE_PERLCRT)" == ""
+USE_PERLCRT = undef
!ENDIF
-!IF "$(USE_ITHREADS)" != "undef"
-BUILDOPT = $(BUILDOPT) -DUSE_ITHREADS
+!IF "$(USE_IMP_SYS)$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" == "defineundefundefundef"
+USE_MULTI = define
+!ENDIF
+
+!IF "$(USE_ITHREADS)$(USE_MULTI)$(USE_OBJECT)" == "defineundefundef"
+USE_MULTI = define
+USE_5005THREADS = undef
+!ENDIF
+
+!IF "$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" != "undefundefundef"
+BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT
!ENDIF
!IF "$(USE_IMP_SYS)" != "undef"
!IF "$(USE_OBJECT)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-object
!ELSE
-!IF "$(USE_THREADS)" == "define"
+!IF "$(USE_5005THREADS)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
!ELSE
!IF "$(USE_MULTI)" == "define"
!ENDIF
!ENDIF
+!IF "$(USE_ITHREADS)" == "define"
+ARCHNAME = $(ARCHNAME)-thread
+!ENDIF
+
# Visual Studio 98 specific
!IF "$(CCTYPE)" == "MSVC60"
# VC 6.0 can load the socket dll on demand. Makes the test suite
# run in about 10% less time.
-DELAYLOAD = -DELAYLOAD:wsock32.dll delayimp.lib
+DELAYLOAD = -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
# VC 6.0 seems capable of compiling perl correctly with optimizations
# enabled. Anything earlier fails tests.
# Options
#
-RUNTIME = -MD
INCLUDES = -I$(COREDIR) -I.\include -I. -I..
#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG)
SUBSYS = console
CXX_FLAG = -TP -GX
-!IF "$(USE_PERLCRT)" == ""
-! IF "$(CFG)" == "Debug"
-PERLCRTLIBC = msvcrtd.lib
-! ELSE
-PERLCRTLIBC = msvcrt.lib
-! ENDIF
+!IF "$(USE_PERLCRT)" != "define"
+LIBC = msvcrt.lib
!ELSE
-! IF "$(CFG)" == "Debug"
-PERLCRTLIBC = PerlCRTD.lib
-! ELSE
-PERLCRTLIBC = PerlCRT.lib
-! ENDIF
+LIBC = PerlCRT.lib
!ENDIF
PERLEXE_RES =
PERLDLL_RES =
-!IF "$(RUNTIME)" == "-MD"
-LIBC = $(PERLCRTLIBC)
-!ELSE
-LIBC = libcmt.lib
-!ENDIF
-
!IF "$(CFG)" == "Debug"
! IF "$(CCTYPE)" == "MSVC20"
-OPTIMIZE = -Od $(RUNTIME) -Z7 -D_DEBUG -DDEBUGGING
+OPTIMIZE = -Od -MD -Z7 -DDEBUGGING
! ELSE
-OPTIMIZE = -Od $(RUNTIME)d -Zi -D_DEBUG -DDEBUGGING
+OPTIMIZE = -Od -MD -Zi -DDEBUGGING
! ENDIF
LINK_DBG = -debug -pdb:none
!ELSE
! IF "$(CFG)" == "Optimize"
# -O1 yields smaller code, which turns out to be faster than -O2
-#OPTIMIZE = -O2 $(RUNTIME) -DNDEBUG
-OPTIMIZE = -O1 $(RUNTIME) -DNDEBUG
+#OPTIMIZE = -O2 -MD -DNDEBUG
+OPTIMIZE = -O1 -MD -DNDEBUG
! ELSE
-OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
+OPTIMIZE = -Od -MD -DNDEBUG
! ENDIF
LINK_DBG = -release
!ENDIF
BUILDOPT = $(BUILDOPT) -DPERL_OBJECT
!ENDIF
-LIBBASEFILES = $(DELAYLOAD) $(CRYPT_LIB) \
- oldnames.lib kernel32.lib user32.lib gdi32.lib \
- winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib \
- oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
+!IF "$(USE_PERLCRT)" != "define"
+BUILDOPT = $(BUILDOPT) -DPERL_MSVCRT_READFIX
+!ENDIF
+
+LIBBASEFILES = $(CRYPT_LIB) \
+ oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
+ comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
+ netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
version.lib odbc32.lib odbccp32.lib
# we add LIBC here, since we may be using PerlCRT.dll
-out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
.rc.res:
- $(RSC) $<
+ $(RSC) -i.. $<
#
# various targets
-!IF "$(USE_OBJECT)" == "define"
PERLIMPLIB = ..\perl56.lib
PERLDLL = ..\perl56.dll
-!ELSE
-PERLIMPLIB = ..\perl.lib
-PERLDLL = ..\perl.dll
-!ENDIF
MINIPERL = ..\miniperl.exe
MINIDIR = .\mini
..\pod\podselect \
..\x2p\find2perl \
..\x2p\s2p \
+ bin\exetype.pl \
bin\runperl.pl \
bin\pl2bat.pl \
bin\perlglob.pl \
CFGSH_TMPL = config.vc
CFGH_TMPL = config_H.vc
-!IF "$(BUILD_FOR_WIN95)" == "define"
-PERL95EXE = ..\perl95.exe
-!ENDIF
-
XCOPY = xcopy /f /r /i /d
RCOPY = xcopy /f /r /i /e /d
NOOP = @echo
WIN32_SRC = \
.\win32.c \
- .\win32sck.c
-
-!IF "$(USE_THREADS)" == "define"
-WIN32_SRC = $(WIN32_SRC) .\win32thread.c
-!ENDIF
+ .\win32sck.c \
+ .\win32thread.c
!IF "$(CRYPT_SRC)" != ""
WIN32_SRC = $(WIN32_SRC) .\$(CRYPT_SRC)
!ENDIF
-PERL95_SRC = \
- perl95.c \
- win32mt.c \
- win32sckmt.c
-
-!IF "$(CRYPT_SRC)" != ""
-PERL95_SRC = $(PERL95_SRC) .\$(CRYPT_SRC)
-!ENDIF
-
DLL_SRC = $(DYNALOADER).c
X2P_SRC = \
.\include\dirent.h \
.\include\netdb.h \
.\include\sys\socket.h \
- .\win32.h \
- .\perlhost.h \
- .\vdir.h \
- .\vmem.h
+ .\win32.h
CORE_H = $(CORE_NOCFG_H) .\config.h
$(MINIDIR)\perlio$(o)
MINIWIN32_OBJ = $(WIN32_OBJ:.\=.\mini\)
MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
-PERL95_OBJ = $(PERL95_SRC:.c=.obj)
DLL_OBJ = $(DLL_SRC:.c=.obj)
X2P_OBJ = $(X2P_SRC:.c=.obj)
PERLDLL_OBJ = $(PERLDLL_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
#PERLEXE_OBJ = $(PERLEXE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
-#PERL95_OBJ = $(PERL95_OBJ) DynaLoadmt$(o)
!IF "$(USE_SETARGV)" != ""
SETARGV_OBJ = setargv$(o)
!ENDIF
DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
- Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob
+ Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
+ Sys/Hostname
STATIC_EXT = DynaLoader
NONXS_EXT = Errno
BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader
DPROF = $(EXTDIR)\Devel\DProf\DProf
GLOB = $(EXTDIR)\File\Glob\Glob
+HOSTNAME = $(EXTDIR)\Sys\Hostname\Hostname
SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll
DPROF_DLL = $(AUTODIR)\Devel\DProf\DProf.dll
GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll
+HOSTNAME_DLL = $(AUTODIR)\Sys\Hostname\Hostname.dll
ERRNO_PM = $(LIBDIR)\Errno.pm
$(B).c \
$(BYTELOADER).c \
$(DPROF).c \
- $(GLOB).c
+ $(GLOB).c \
+ $(HOSTNAME).c
EXTENSION_DLL = \
$(SOCKET_DLL) \
$(THREAD_DLL) \
$(BYTELOADER_DLL) \
$(DPROF_DLL) \
- $(GLOB_DLL)
+ $(GLOB_DLL) \
+ $(HOSTNAME_DLL)
EXTENSION_PM = \
$(ERRNO_PM)
"static_ext=$(STATIC_EXT)" \
"dynamic_ext=$(DYNAMIC_EXT)" \
"nonxs_ext=$(NONXS_EXT)" \
- "usethreads=$(USE_THREADS)" \
+ "use5005threads=$(USE_5005THREADS)" \
+ "useithreads=$(USE_ITHREADS)" \
+ "usethreads=$(USE_5005THREADS)" \
"usemultiplicity=$(USE_MULTI)" \
"LINK_FLAGS=$(LINK_FLAGS:"=\")" \
"optimize=$(OPTIMIZE:"=\")"
# Top targets
#
-all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \
+all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) \
$(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
$(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*F).c
# -DPERL_IMPLICIT_SYS needs C++ for perllib.c
+# This is the only file that depends on perlhost.h, vmem.h, and vdir.h
!IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef"
-perllib$(o) : perllib.c
+perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h
$(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
!ENDIF
$(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 ..\pp.sym ..\makedef.pl
CCTYPE=$(CCTYPE) > perldll.def
$(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
- $(LINK32) -dll -def:perldll.def -out:$@ @<<
- $(LINK_FLAGS) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES)
+ $(LINK32) -dll -def:perldll.def -base:0x28000000 -out:$@ @<<
+ $(LINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES)
<<
$(XCOPY) $(PERLIMPLIB) $(COREDIR)
$(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
- $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
- $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
+ $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(LINK_FLAGS) \
+ $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
copy $(PERLEXE) $(WPERLEXE)
- editbin /subsystem:windows $(WPERLEXE)
+ $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
copy splittree.pl ..
$(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
-!IF "$(BUILD_FOR_WIN95)" == "define"
-
-perl95.c : runperl.c
- copy runperl.c perl95.c
-
-perl95$(o) : perl95.c
- $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c perl95.c
-
-win32sckmt$(o) : win32sck.c
- $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
- $(OBJOUT_FLAG)win32sckmt$(o) win32sck.c
-
-win32mt$(o) : win32.c
- $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
- $(OBJOUT_FLAG)win32mt$(o) win32.c
-
-DynaLoadmt$(o) : $(DYNALOADER).c
- $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
- $(OBJOUT_FLAG)DynaLoadmt$(o) $(DYNALOADER).c
-
-$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
- $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(LINK_FLAGS) \
- $(LIBBASEFILES) $(PERL95_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) \
- libcmt.lib
-
-!ENDIF
-
$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
if not exist $(AUTODIR) mkdir $(AUTODIR)
cd $(EXTDIR)\$(*B)
$(MAKE)
cd ..\..\win32
+$(HOSTNAME_DLL): $(PERLEXE) $(HOSTNAME).xs
+ cd $(EXTDIR)\Sys\$(*B)
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\..\win32
+
$(BYTELOADER_DLL): $(PERLEXE) $(BYTELOADER).xs
cd $(EXTDIR)\$(*B)
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
cd ..\utils
$(MAKE) PERL=$(MINIPERL)
cd ..\pod
+ copy ..\README.amiga .\perlamiga.pod
+ copy ..\README.cygwin .\perlcygwin.pod
+ copy ..\README.dos .\perldos.pod
+ copy ..\README.hpux .\perlhpux.pod
+ copy ..\README.machten .\perlmachten.pod
+ copy ..\README.os2 .\perlos2.pod
+ copy ..\vms\perlvms.pod .\perlvms.pod
copy ..\README.win32 .\perlwin32.pod
$(MAKE) -f ..\win32\pod.mak converters
+ cd ..\lib
+ $(PERLEXE) lib_pm.PL
cd ..\win32
$(PERLEXE) $(PL2BAT) $(UTILS)
distclean: clean
- -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \
+ -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
$(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
-del /f *.def *.map
-del /f $(EXTENSION_DLL) $(EXTENSION_PM)
cd ..\win32
-del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
-del /f $(CONFIGPM)
- -del /f perl95.c
-del /f bin\*.bat
cd $(EXTDIR)
-del /s *.lib *.def *.map *.pdb *.bs Makefile *$(o) pm_to_blib
installbare : utils
$(PERLEXE) ..\installperl
-!IF "$(BUILD_FOR_WIN95)" == "define"
- $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
-!ENDIF
if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
$(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
$(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
$(PERLEXE) -I..\lib harness
cd ..\win32
+test-wide : test-prep
+ set HARNESS_PERL_SWITCHES=-C
+ cd ..\t
+ $(PERLEXE) -I..\lib harness
+ cd ..\win32
+
+test-wide-notty : test-prep
+ set PERL_SKIP_TTY_TEST=1
+ set HARNESS_PERL_SWITCHES=-C
+ cd ..\t
+ $(PERLEXE) -I..\lib harness
+ cd ..\win32
+
clean :
-@erase miniperlmain$(o)
-@erase $(MINIPERL)
-@erase ..\x2p\*.exe ..\x2p\*.bat
-@erase *.ilk
-@erase *.pdb
+
+# Handy way to run perlbug -ok without having to install and run the
+# installed perlbug. We don't re-run the tests here - we trust the user.
+# Please *don't* use this unless all tests pass.
+# If you want to report test failures, use "nmake nok" instead.
+ok: utils
+ $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)"
+
+okfile: utils
+ $(PERLEXE) -I..\lib ..\utils\perlbug -ok -s "(UNINSTALLED)" -F perl.ok
+
+nok: utils
+ $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)"
+
+nokfile: utils
+ $(PERLEXE) -I..\lib ..\utils\perlbug -nok -s "(UNINSTALLED)" -F perl.nok