Add support for PERL_HASH_SEED_EXPLICIT and NO_HASH_SEED in the
[p5sagit/p5-mst-13.2.git] / win32 / makefile.mk
index 095be64..9e11fec 100644 (file)
@@ -79,7 +79,7 @@ USE_PERLIO    *= define
 # Comment this out if you don't want to enable large file support for
 # some reason.  Should normally only be changed to maintain compatibility
 # with an older release of perl.
-USE_LARGE_FILES *= define
+USE_LARGE_FILES        *= define
 
 #
 # uncomment exactly one of the following
@@ -97,10 +97,10 @@ CCTYPE              *= GCC
 
 #
 # uncomment this if your Borland compiler is older than v5.4.
-#BCCOLD = define
+#BCCOLD                *= define
 #
 # uncomment this if you want to use Borland's VCL as your CRT
-#BCCVCL = define
+#BCCVCL                *= define
 
 #
 # uncomment this if you are compiling under Windows 95/98 and command.com
@@ -155,14 +155,14 @@ CRYPT_SRC *= fcrypt.c
 # extensions if you change the default.  Currently, this cannot be enabled
 # if you ask for USE_IMP_SYS above.
 #
-PERL_MALLOC    *= define
+#PERL_MALLOC   *= define
 
 #
 # set this to enable debugging mstats
 # This must be enabled to use the Devel::Peek::mstat() function.  This cannot
 # be enabled without PERL_MALLOC as well.
 #
-DEBUG_MSTATS  = define
+#DEBUG_MSTATS  *= define
 
 #
 # set the install locations of the compiler include/libraries
@@ -186,6 +186,16 @@ CCLIBDIR   *= $(CCHOME)\lib
 #
 
 #
+# Adding -DPERL_HASH_SEED_EXPLICIT will disable randomization of Perl's
+# internal hash function unless the PERL_HASH_SEED environment variable is set.
+# Alternatively, adding -DNO_HASH_SEED will completely disable the
+# randomization feature. 
+# The latter is required to maintain binary compatibility with Perl 5.8.0.
+#
+#BUILDOPT      += -DPERL_HASH_SEED_EXPLICIT
+#BUILDOPT      += -DNO_HASH_SEED
+
+#
 # This should normally be disabled.  Adding -DPERL_POLLUTE enables support
 # for old symbols by default, at the expense of extreme pollution.  You most
 # probably just want to build modules that won't compile with
@@ -204,6 +214,7 @@ CCLIBDIR    *= $(CCHOME)\lib
 #
 # This should normally be disabled.  Enabling it causes perl to read scripts
 # in text mode (which is the 5.005 behavior) and will break ByteLoader.
+#
 #BUILDOPT      += -DPERL_TEXTMODE_SCRIPTS
 
 #
@@ -238,6 +249,7 @@ CRYPT_FLAG  = -DHAVE_DES_FCRYPT
 .ENDIF
 
 PERL_MALLOC    *= undef
+DEBUG_MSTATS   *= undef
 
 USE_MULTI      *= undef
 USE_ITHREADS   *= undef
@@ -246,24 +258,23 @@ USE_PERLIO        *= undef
 USE_LARGE_FILES        *= undef
 USE_PERLCRT    *= undef
 
-.IF "$(PERL_MALLOC)" == "undef"
+.IF "$(USE_IMP_SYS)" == "define"
 PERL_MALLOC    = undef
-DEBUG_MSTATS   = undef
 .ENDIF
 
-.IF "$(DEBUG_MSTATS)" == "undef"
-DEBUG_MSTATS   = undef
+.IF "$(PERL_MALLOC)" == "undef"
+DEBUG_MSTATS   = undef
 .ENDIF
 
 .IF "$(DEBUG_MSTATS)" == "define"
-BUILDOPT       += -DPERL_DEBUGGING_MSTATS
+BUILDOPT       += -DPERL_DEBUGGING_MSTATS
 .ENDIF
 
-.IF "$(USE_IMP_SYS)$(USE_MULTI)" == "defineundef"
+.IF "$(USE_IMP_SYS) $(USE_MULTI)" == "define undef"
 USE_MULTI      != define
 .ENDIF
 
-.IF "$(USE_ITHREADS)$(USE_MULTI)" == "defineundef"
+.IF "$(USE_ITHREADS) $(USE_MULTI)" == "define undef"
 USE_MULTI      != define
 .ENDIF
 
@@ -537,6 +548,17 @@ BLINK_FLAGS        = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
 #################### do not edit below this line #######################
 ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
 
+# Some dmake's built with Borland C++, including Sarathy's one at:
+# http://search.cpan.org/CPAN/authors/id/G/GS/GSAR/dmake-4.1pl1-win32.zip
+# require backslashes to be doubled-up when written to $(mktmp) files.
+# Other dmake's do not require this and would actually output a double
+# backslash if they were doubled-up.
+.IF "$(shell type $(mktmp \\))"=="\\"
+B=\\
+.ELSE
+B=\\\
+.ENDIF
+
 o *= .obj
 a *= .lib
 
@@ -627,6 +649,7 @@ UTILS               =                       \
                ..\utils\libnetcfg      \
                ..\utils\enc2xs         \
                ..\utils\piconv         \
+               ..\utils\corelist       \
                ..\utils\cpan           \
                ..\utils\xsubpp         \
                ..\utils\prove          \
@@ -678,7 +701,7 @@ PERLDLL             = ..\perl59.dll
 
 XCOPY          = xcopy /f /r /i /d
 RCOPY          = xcopy /f /r /i /e /d
-NOOP           = @echo
+NOOP           = @rem
 
 #
 # filenames given to xsubpp must have forward slashes (since it puts
@@ -776,6 +799,7 @@ CORE_NOCFG_H        =               \
                ..\perly.h      \
                ..\pp.h         \
                ..\proto.h      \
+               ..\regcomp.h    \
                ..\regexp.h     \
                ..\scope.h      \
                ..\sv.h         \
@@ -819,7 +843,7 @@ DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
                Sys/Hostname Storable Filter/Util/Call Encode \
                Digest/MD5 PerlIO/scalar MIME/Base64 Time/HiRes \
                Unicode/Normalize Win32
-STATIC_EXT     = DynaLoader
+STATIC_EXT     = 
 NONXS_EXT      = Errno
 
 DYNALOADER     = $(EXTDIR)\DynaLoader\DynaLoader
@@ -835,8 +859,8 @@ POD2TEXT    = $(PODDIR)\pod2text
 #      -- BKS 10-17-1999
 CFG_VARS       =                                       \
                INST_DRV=$(INST_DRV)            ~       \
-               INST_TOP=$(INST_TOP:s/\/\\/)    ~       \
-               INST_VER=$(INST_VER:s/\/\\/)    ~       \
+               INST_TOP=$(INST_TOP:s,\,$B,)    ~       \
+               INST_VER=$(INST_VER:s,\,$B,)    ~       \
                INST_ARCH=$(INST_ARCH)          ~       \
                archname=$(ARCHNAME)            ~       \
                cc=$(CC)                        ~       \
@@ -846,9 +870,9 @@ CFG_VARS    =                                       \
                d_crypt=$(D_CRYPT)              ~       \
                d_mymalloc=$(PERL_MALLOC)       ~       \
                libs=$(LIBFILES:f)              ~       \
-               incpath=$(CCINCDIR:s/\/\\/)     ~       \
+               incpath=$(CCINCDIR:s,\,$B,)     ~       \
                libperl=$(PERLIMPLIB:f)         ~       \
-               libpth=$(CCLIBDIR:s/\/\\/);$(EXTRALIBDIRS:s/\/\\/)      ~       \
+               libpth=$(CCLIBDIR:s,\,$B,);$(EXTRALIBDIRS:s,\,$B,)      ~       \
                libc=$(LIBC)                    ~       \
                make=dmake                      ~       \
                _o=$(o)                         ~       \
@@ -861,7 +885,7 @@ CFG_VARS    =                                       \
                usemultiplicity=$(USE_MULTI)    ~       \
                useperlio=$(USE_PERLIO)         ~       \
                uselargefiles=$(USE_LARGE_FILES)        ~       \
-               LINK_FLAGS=$(LINK_FLAGS:s/\/\\/)        ~       \
+               LINK_FLAGS=$(LINK_FLAGS:s,\,$B,)        ~       \
                optimize=$(OPTIMIZE)
 
 #
@@ -871,7 +895,6 @@ CFG_VARS    =                                       \
 .IF "$(IS_WIN95)" == "define"
 MK2            = .\makefile.95
 RIGHTMAKE      = __switch_makefiles
-NOOP           = @rem
 .ELSE
 MK2            = __not_needed
 RIGHTMAKE      =
@@ -987,13 +1010,13 @@ $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
 $(MINIPERL) : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS)
 .IF "$(CCTYPE)" == "BORLAND"
        $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
-           @$(mktmp c0x32$(o) $(MINI_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
+           @$(mktmp c0x32$(o) $(MINI_OBJ:s,\,$B,),$(@:s,\,$B,),,$(LIBFILES),)
 .ELIF "$(CCTYPE)" == "GCC"
        $(LINK32) -v -mconsole -o $@ $(BLINK_FLAGS) \
-           $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
+           $(mktmp $(LKPRE) $(MINI_OBJ:s,\,$B,) $(LIBFILES) $(LKPOST))
 .ELSE
        $(LINK32) -subsystem:console -out:$@ \
-           @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
+           @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,$B,))
 .ENDIF
 
 $(MINIDIR) :
@@ -1030,34 +1053,37 @@ $(DLL_OBJ)      : $(CORE_H)
 $(X2P_OBJ)     : $(CORE_H)
 
 perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
-       $(MINIPERL) -I..\lib buildext.pl --create-perllibst-h $(STATIC_EXT)
+       $(MINIPERL) -I..\lib buildext.pl --create-perllibst-h
        $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
        $(BUILDOPT) CCTYPE=$(CCTYPE) > perldll.def
 
 $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static
 .IF "$(CCTYPE)" == "BORLAND"
        $(LINK32) -Tpd -ap $(BLINK_FLAGS) \
-           @$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
+           @$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,$B,)\n \
                $@,\n \
                $(LIBFILES)\n \
                perldll.def\n)
        $(IMPLIB) $*.lib $@
 .ELIF "$(CCTYPE)" == "GCC"
        $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(BLINK_FLAGS) \
-           $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
+           $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,$B,) \
+               $(shell $(MINIPERL) -I..\lib buildext.pl --list-static-libs|tr \\\\ /) \
+               $(LIBFILES) $(LKPOST))
        dlltool --output-lib $(PERLIMPLIB) \
                --dllname $(PERLDLL:b).dll \
                --def perldll.def \
                --base-file perl.base \
                --output-exp perl.exp
        $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \
-           $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) \
-               perl.exp $(LKPOST))
+           $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,$B,) \
+               $(shell $(MINIPERL) -I..\lib buildext.pl --list-static-libs|tr \\\\ /) \
+               $(LIBFILES) perl.exp $(LKPOST))
 .ELSE
        $(LINK32) -dll -def:perldll.def -out:$@ \
            $(shell $(MINIPERL) -I..\lib buildext.pl --list-static-libs) \
            @$(mktmp -base:0x28000000 $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) \
-               $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,\\))
+               $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,$B,))
 .ENDIF
        $(XCOPY) $(PERLIMPLIB) $(COREDIR)
 
@@ -1090,13 +1116,13 @@ $(X2P) : $(MINIPERL) $(X2P_OBJ)
        $(MINIPERL) ..\x2p\s2p.PL
 .IF "$(CCTYPE)" == "BORLAND"
        $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
-           @$(mktmp c0x32$(o) $(X2P_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
+           @$(mktmp c0x32$(o) $(X2P_OBJ:s,\,$B,),$(@:s,\,$B,),,$(LIBFILES),)
 .ELIF "$(CCTYPE)" == "GCC"
        $(LINK32) -v -o $@ $(BLINK_FLAGS) \
-           $(mktmp $(LKPRE) $(X2P_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
+           $(mktmp $(LKPRE) $(X2P_OBJ:s,\,$B,) $(LIBFILES) $(LKPOST))
 .ELSE
        $(LINK32) -subsystem:console -out:$@ \
-           @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
+           @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,$B,))
 .ENDIF
 
 perlmain.c : runperl.c
@@ -1108,8 +1134,8 @@ perlmain$(o) : perlmain.c
 $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
 .IF "$(CCTYPE)" == "BORLAND"
        $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
-           @$(mktmp c0x32$(o) $(PERLEXE_OBJ:s,\,\\)\n \
-           $(@:s,\,\\),\n \
+           @$(mktmp c0x32$(o) $(PERLEXE_OBJ:s,\,$B,)\n \
+           $(@:s,\,$B,),\n \
            $(PERLIMPLIB) $(LIBFILES)\n)
 .ELIF "$(CCTYPE)" == "GCC"
        $(LINK32) -mconsole -o $@ $(BLINK_FLAGS)  \
@@ -1263,6 +1289,10 @@ distclean: realclean
        -if exist $(LIBDIR)\List rmdir /s $(LIBDIR)\List
        -if exist $(LIBDIR)\Scalar rmdir /s /q $(LIBDIR)\Scalar
        -if exist $(LIBDIR)\Scalar rmdir /s $(LIBDIR)\Scalar
+       -if exist $(LIBDIR)\Sys rmdir /s /q $(LIBDIR)\Sys
+       -if exist $(LIBDIR)\Sys rmdir /s $(LIBDIR)\Sys
+       -if exist $(LIBDIR)\threads rmdir /s /q $(LIBDIR)\threads
+       -if exist $(LIBDIR)\threads rmdir /s $(LIBDIR)\threads
        -if exist $(LIBDIR)\XS rmdir /s /q $(LIBDIR)\XS
        -if exist $(LIBDIR)\XS rmdir /s $(LIBDIR)\XS
        -cd $(PODDIR) && del /f *.html *.bat checkpods \
@@ -1280,7 +1310,7 @@ distclean: realclean
            podchecker podselect
        -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph pstruct h2xs \
            perldoc perlivp dprofpp perlcc libnetcfg enc2xs piconv cpan *.bat \
-           xsubpp instmodsh prove
+           xsubpp instmodsh prove corelist
        -cd ..\x2p && del /f find2perl s2p psed *.bat
        -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
        -del /f $(CONFIGPM)
@@ -1312,12 +1342,7 @@ inst_lib : $(CONFIGPM)
        $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
        $(RCOPY) ..\lib $(INST_LIB)\*.*
 
-# Move the rule for making $(UNIDATAFILES) into a separate target and leave the
-# actual rule here blank because dmake runs the rule here once for each of the
-# files listed in $(UNIDATAFILES)
-$(UNIDATAFILES) : make_unidatafiles
-
-make_unidatafiles : $(MINIPERL) $(CONFIGPM) ..\lib\unicore\mktables
+$(UNIDATAFILES) .UPDATEALL : $(MINIPERL) $(CONFIGPM) ..\lib\unicore\mktables
        cd ..\lib\unicore && \
        ..\$(MINIPERL) -I.. mktables
 
@@ -1344,11 +1369,11 @@ test-prep : all utils
 .ENDIF
 
 test : $(RIGHTMAKE) test-prep
-       cd ..\t && $(PERLEXE) -I..\lib harness
+       cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
 
 test-notty : test-prep
        set PERL_SKIP_TTY_TEST=1 && \
-           cd ..\t && $(PERLEXE) -I.\lib harness
+           cd ..\t && $(PERLEXE) -I.\lib harness $(TEST_SWITCHES) $(TEST_FILES)
 
 _test : $(RIGHTMAKE)
        $(XCOPY) $(PERLEXE) ..\t\$(NULL)
@@ -1358,7 +1383,7 @@ _test : $(RIGHTMAKE)
 .ELSE
        $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
 .ENDIF
-       cd ..\t && $(PERLEXE) -I..\lib harness
+       cd ..\t && $(PERLEXE) -I..\lib harness $(TEST_SWITCHES) $(TEST_FILES)
 
 # the doubled rmdir calls are needed because older cmd shells
 # don't understand /q