From e5a95ffba7bb8798f8211d43c45c423a80fd0fa5 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Mon, 1 Jun 1998 07:43:02 +0000 Subject: [PATCH] [win32] @INC construction on win32 cleaned up - perl.dll location based paths should be much more reliable now - registry stuff unchanged - Config.pm now has all the installfoolib entries for MakeMaker et al p4raw-id: //depot/win32/perl@1069 --- win32/Makefile | 28 ++++--- win32/config.bc | 52 ++++++------ win32/config.gc | 52 ++++++------ win32/config.vc | 52 ++++++------ win32/config_H.bc | 20 ++--- win32/config_H.gc | 20 ++--- win32/config_H.vc | 20 ++--- win32/config_h.PL | 31 +++---- win32/config_sh.PL | 1 - win32/makefile.mk | 28 ++++--- win32/runperl.c | 4 +- win32/win32.c | 234 ++++++++++++++++++++--------------------------------- win32/win32.h | 4 +- 13 files changed, 255 insertions(+), 291 deletions(-) diff --git a/win32/Makefile b/win32/Makefile index aa86afc..1af0410 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -10,7 +10,16 @@ # Set these to wherever you want "nmake install" to put your # newly built perl. INST_DRV = c: -INST_TOP = $(INST_DRV)\perl\5004.5x +INST_TOP = $(INST_DRV)\perl + +# 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 +# the safest route, as perl adds the extra version directory to all the +# locations it installs files to. If you disable it, an alternative +# versioned installation can be obtained by setting INST_TOP above to a +# path that includes an arbitrary version string. +INST_VER = \5.00466 # # uncomment to enable threads-capabilities @@ -51,8 +60,6 @@ INST_TOP = $(INST_DRV)\perl\5004.5x # # set the install locations of the compiler include/libraries -# (you'll need to quote the value if it contains spaces: i.e. -# CCHOME = "f:\Program Files\vc" # #CCHOME = f:\msvc20 CCHOME = $(MSVCDIR) @@ -185,8 +192,9 @@ $(o).dll: -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL) # -INST_BIN = $(INST_TOP)\bin -INST_LIB = $(INST_TOP)\lib +INST_BIN = $(INST_TOP)$(INST_VER)\bin\$(ARCHNAME) +INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin +INST_LIB = $(INST_TOP)$(INST_VER)\lib INST_POD = $(INST_LIB)\pod INST_HTML = $(INST_POD)\html LIBDIR = ..\lib @@ -427,6 +435,7 @@ POD2TEXT = $(PODDIR)\pod2text CFG_VARS = \ "INST_DRV=$(INST_DRV)" \ "INST_TOP=$(INST_TOP)" \ + "INST_VER=$(INST_VER)" \ "archname=$(ARCHNAME)" \ "cc=$(CC)" \ "ccflags=$(OPTIMIZE) $(DEFINES) $(OBJECT)" \ @@ -483,7 +492,7 @@ regen_config_h: cd win32 -del /f $(CFGH_TMPL) -mkdir ..\lib\CORE - -perl -I..\lib config_h.PL + -perl -I..\lib config_h.PL "INST_VER=$(INST_VER)" rename config.h $(CFGH_TMPL) $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl @@ -492,7 +501,8 @@ $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl $(XCOPY) ..\*.h $(COREDIR)\*.* $(XCOPY) *.h $(COREDIR)\*.* $(RCOPY) include $(COREDIR)\*.* - $(MINIPERL) -I..\lib config_h.PL || $(MAKE) $(MAKEFLAGS) $(CONFIGPM) + $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \ + || $(MAKE) $(MAKEFLAGS) $(CONFIGPM) $(MINIPERL) : $(MINIDIR) $(MINI_OBJ) $(LINK32) -subsystem:console -out:$@ @<< @@ -730,8 +740,8 @@ installbare : installutils : utils $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.* - $(XCOPY) bin\*.bat $(INST_BIN)\*.* - $(XCOPY) ..\pod\*.bat $(INST_BIN)\*.* + $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.* + $(XCOPY) ..\pod\*.bat $(INST_SCRIPT)\*.* installhtml : doc $(RCOPY) html\*.* $(INST_HTML)\*.* diff --git a/win32/config.bc b/win32/config.bc index f0a0952..453c6fd 100644 --- a/win32/config.bc +++ b/win32/config.bc @@ -21,15 +21,15 @@ afs='false' alignbytes='8' aphostname='' ar='tlib /P128' -archlib='' -archlibexp='' +archlib='~INST_TOP~~INST_VER~\lib\~archname~' +archlibexp='~INST_TOP~~INST_VER~\lib\~archname~' archname='MSWin32' archobjs='' awk='awk' baserev='5.0' bash='' -bin='~INST_TOP~\bin' -binexp='~INST_TOP~\bin' +bin='~INST_TOP~~INST_VER~\bin\~archname~' +binexp='~INST_TOP~~INST_VER~\bin\~archname~' bison='' byacc='byacc' byteorder='1234' @@ -64,7 +64,7 @@ csh='undef' d_Gconvert='gcvt((x),(n),(b))' d_access='define' d_alarm='undef' -d_archlib='undef' +d_archlib='define' d_attribut='undef' d_bcmp='undef' d_bcopy='undef' @@ -367,14 +367,14 @@ i_varhdr='varargs.h' i_vfork='undef' incpath='' inews='' -installarchlib='~INST_TOP~\lib\~archname~' -installbin='~INST_TOP~\bin\~archname~' -installman1dir='~INST_TOP~\man\man1' -installman3dir='~INST_TOP~\man\man3' -installprivlib='~INST_TOP~\lib' -installscript='~INST_TOP~\bin' -installsitearch='~INST_TOP~\..\site\~VERSION~\lib\~archname~' -installsitelib='~INST_TOP~\..\site\~VERSION~\lib' +installarchlib='~INST_TOP~~INST_VER~\lib\~archname~' +installbin='~INST_TOP~~INST_VER~\bin\~archname~' +installman1dir='~INST_TOP~~INST_VER~\man\man1' +installman3dir='~INST_TOP~~INST_VER~\man\man3' +installprivlib='~INST_TOP~~INST_VER~\lib' +installscript='~INST_TOP~~INST_VER~\bin' +installsitearch='~INST_TOP~\site~INST_VER~\lib\~archname~' +installsitelib='~INST_TOP~\site~INST_VER~\lib' intsize='4' known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket IO attrs Thread' ksh='' @@ -410,11 +410,11 @@ make_set_make='#' mallocobj='malloc.o' mallocsrc='malloc.c' malloctype='void *' -man1dir='~INST_TOP~\man\man1' -man1direxp='~INST_TOP~\man\man1' +man1dir='~INST_TOP~~INST_VER~\man\man1' +man1direxp='~INST_TOP~~INST_VER~\man\man1' man1ext='1' -man3dir='~INST_TOP~\man\man3' -man3direxp='~INST_TOP~\man\man3' +man3dir='~INST_TOP~~INST_VER~\man\man3' +man3direxp='~INST_TOP~~INST_VER~\man\man3' man3ext='3' medium='' mips='' @@ -450,7 +450,7 @@ patchlevel='2' path_sep=';' perl='perl' perladmin='' -perlpath='~INST_TOP~\bin\~archname~\perl.exe' +perlpath='~INST_TOP~~INST_VER~\bin\~archname~\perl.exe' pg='' phostname='hostname' pidtype='int' @@ -459,8 +459,8 @@ pmake='' pr='' prefix='~INST_DRV~' prefixexp='~INST_DRV~' -privlib='~INST_TOP~\lib' -privlibexp='~INST_TOP~\lib' +privlib='~INST_TOP~~INST_VER~\lib' +privlibexp='~INST_TOP~~INST_VER~\lib' prototype='define' ptrsize='4' randbits='15' @@ -469,8 +469,8 @@ rd_nodata='-1' rm='del' rmail='' runnm='true' -scriptdir='~INST_TOP~\bin' -scriptdirexp='~INST_TOP~\bin' +scriptdir='~INST_TOP~~INST_VER~\bin' +scriptdirexp='~INST_TOP~~INST_VER~\bin' sed='sed' selecttype='Perl_fd_set *' sendmail='blat' @@ -485,10 +485,10 @@ sig_name='ZERO INT QUIT ILL FPE KILL SEGV PIPE ALRM TERM USR1 USR2 CHLD USR3 BRE sig_name_init='"ZERO", "INT", "QUIT", "ILL", "FPE", "KILL", "SEGV", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "USR3", "BREAK", "ABRT", "STOP", "CONT", "CLD", 0' sig_num='0, 2, 3, 4, 8, 9, 11, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 25, 18, 0' signal_t='void' -sitearch='' -sitearchexp='' -sitelib='~INST_TOP~\..\site\~VERSION~\lib' -sitelibexp='~INST_TOP~\..\site\~VERSION~\lib' +sitearch='~INST_TOP~\site~INST_VER~\lib\~archname~' +sitearchexp='~INST_TOP~\site~INST_VER~\lib\~archname~' +sitelib='~INST_TOP~\site~INST_VER~\lib' +sitelibexp='~INST_TOP~\site~INST_VER~\lib' sizetype='size_t' sleep='' smail='' diff --git a/win32/config.gc b/win32/config.gc index 4887698..ac5fa5f 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -21,15 +21,15 @@ afs='false' alignbytes='8' aphostname='' ar='ar' -archlib='' -archlibexp='' +archlib='~INST_TOP~~INST_VER~\lib\~archname~' +archlibexp='~INST_TOP~~INST_VER~\lib\~archname~' archname='MSWin32' archobjs='' awk='awk' baserev='5.0' bash='' -bin='~INST_TOP~\bin' -binexp='~INST_TOP~\bin' +bin='~INST_TOP~~INST_VER~\bin\~archname~' +binexp='~INST_TOP~~INST_VER~\bin\~archname~' bison='' byacc='byacc' byteorder='1234' @@ -64,7 +64,7 @@ csh='undef' d_Gconvert='sprintf((b),"%.*g",(n),(x))' d_access='define' d_alarm='undef' -d_archlib='undef' +d_archlib='define' d_attribut='define' d_bcmp='undef' d_bcopy='undef' @@ -367,14 +367,14 @@ i_varhdr='varargs.h' i_vfork='undef' incpath='' inews='' -installarchlib='~INST_TOP~\lib\~archname~' -installbin='~INST_TOP~\bin\~archname~' -installman1dir='~INST_TOP~\man\man1' -installman3dir='~INST_TOP~\man\man3' -installprivlib='~INST_TOP~\lib' -installscript='~INST_TOP~\bin' -installsitearch='~INST_TOP~\..\site\~VERSION~\lib\~archname~' -installsitelib='~INST_TOP~\..\site\~VERSION~\lib' +installarchlib='~INST_TOP~~INST_VER~\lib\~archname~' +installbin='~INST_TOP~~INST_VER~\bin\~archname~' +installman1dir='~INST_TOP~~INST_VER~\man\man1' +installman3dir='~INST_TOP~~INST_VER~\man\man3' +installprivlib='~INST_TOP~~INST_VER~\lib' +installscript='~INST_TOP~~INST_VER~\bin' +installsitearch='~INST_TOP~\site~INST_VER~\lib\~archname~' +installsitelib='~INST_TOP~\site~INST_VER~\lib' intsize='4' known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket IO attrs Thread' ksh='' @@ -410,11 +410,11 @@ make_set_make='#' mallocobj='malloc.o' mallocsrc='malloc.c' malloctype='void *' -man1dir='~INST_TOP~\man\man1' -man1direxp='~INST_TOP~\man\man1' +man1dir='~INST_TOP~~INST_VER~\man\man1' +man1direxp='~INST_TOP~~INST_VER~\man\man1' man1ext='1' -man3dir='~INST_TOP~\man\man3' -man3direxp='~INST_TOP~\man\man3' +man3dir='~INST_TOP~~INST_VER~\man\man3' +man3direxp='~INST_TOP~~INST_VER~\man\man3' man3ext='3' medium='' mips='' @@ -450,7 +450,7 @@ patchlevel='2' path_sep=';' perl='perl' perladmin='' -perlpath='~INST_TOP~\bin\~archname~\perl.exe' +perlpath='~INST_TOP~~INST_VER~\bin\~archname~\perl.exe' pg='' phostname='hostname' pidtype='int' @@ -459,8 +459,8 @@ pmake='' pr='' prefix='~INST_DRV~' prefixexp='~INST_DRV~' -privlib='~INST_TOP~\lib' -privlibexp='~INST_TOP~\lib' +privlib='~INST_TOP~~INST_VER~\lib' +privlibexp='~INST_TOP~~INST_VER~\lib' prototype='define' ptrsize='4' randbits='15' @@ -469,8 +469,8 @@ rd_nodata='-1' rm='del' rmail='' runnm='true' -scriptdir='~INST_TOP~\bin' -scriptdirexp='~INST_TOP~\bin' +scriptdir='~INST_TOP~~INST_VER~\bin' +scriptdirexp='~INST_TOP~~INST_VER~\bin' sed='sed' selecttype='Perl_fd_set *' sendmail='blat' @@ -485,10 +485,10 @@ sig_name='ZERO INT QUIT ILL FPE KILL SEGV PIPE ALRM TERM CHLD BREAK ABRT STOP CO sig_name_init='"ZERO", "INT", "QUIT", "ILL", "FPE", "KILL", "SEGV", "PIPE", "ALRM", "TERM", "CHLD", "BREAK", "ABRT", "STOP", "CONT", "CLD", 0' sig_num='0, 2, 3, 4, 8, 9, 11, 13, 14, 15, 20, 21, 22, 23, 25, 20, 0' signal_t='void' -sitearch='' -sitearchexp='' -sitelib='~INST_TOP~\..\site\~VERSION~\lib' -sitelibexp='~INST_TOP~\..\site\~VERSION~\lib' +sitearch='~INST_TOP~\site~INST_VER~\lib\~archname~' +sitearchexp='~INST_TOP~\site~INST_VER~\lib\~archname~' +sitelib='~INST_TOP~\site~INST_VER~\lib' +sitelibexp='~INST_TOP~\site~INST_VER~\lib' sizetype='size_t' sleep='' smail='' diff --git a/win32/config.vc b/win32/config.vc index a870cef..8699e29 100644 --- a/win32/config.vc +++ b/win32/config.vc @@ -21,15 +21,15 @@ afs='false' alignbytes='8' aphostname='' ar='lib' -archlib='' -archlibexp='' +archlib='~INST_TOP~~INST_VER~\lib\~archname~' +archlibexp='~INST_TOP~~INST_VER~\lib\~archname~' archname='MSWin32' archobjs='' awk='awk' baserev='5.0' bash='' -bin='~INST_TOP~\bin' -binexp='~INST_TOP~\bin' +bin='~INST_TOP~~INST_VER~\bin\~archname~' +binexp='~INST_TOP~~INST_VER~\bin\~archname~' bison='' byacc='byacc' byteorder='1234' @@ -64,7 +64,7 @@ csh='undef' d_Gconvert='sprintf((b),"%.*g",(n),(x))' d_access='define' d_alarm='undef' -d_archlib='undef' +d_archlib='define' d_attribut='undef' d_bcmp='undef' d_bcopy='undef' @@ -367,14 +367,14 @@ i_varhdr='varargs.h' i_vfork='undef' incpath='' inews='' -installarchlib='~INST_TOP~\lib\~archname~' -installbin='~INST_TOP~\bin\~archname~' -installman1dir='~INST_TOP~\man\man1' -installman3dir='~INST_TOP~\man\man3' -installprivlib='~INST_TOP~\lib' -installscript='~INST_TOP~\bin' -installsitearch='~INST_TOP~\..\site\~VERSION~\lib\~archname~' -installsitelib='~INST_TOP~\..\site\~VERSION~\lib' +installarchlib='~INST_TOP~~INST_VER~\lib\~archname~' +installbin='~INST_TOP~~INST_VER~\bin\~archname~' +installman1dir='~INST_TOP~~INST_VER~\man\man1' +installman3dir='~INST_TOP~~INST_VER~\man\man3' +installprivlib='~INST_TOP~~INST_VER~\lib' +installscript='~INST_TOP~~INST_VER~\bin' +installsitearch='~INST_TOP~\site~INST_VER~\lib\~archname~' +installsitelib='~INST_TOP~\site~INST_VER~\lib' intsize='4' known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket IO attrs Thread' ksh='' @@ -410,11 +410,11 @@ make_set_make='#' mallocobj='malloc.o' mallocsrc='malloc.c' malloctype='void *' -man1dir='~INST_TOP~\man\man1' -man1direxp='~INST_TOP~\man\man1' +man1dir='~INST_TOP~~INST_VER~\man\man1' +man1direxp='~INST_TOP~~INST_VER~\man\man1' man1ext='1' -man3dir='~INST_TOP~\man\man3' -man3direxp='~INST_TOP~\man\man3' +man3dir='~INST_TOP~~INST_VER~\man\man3' +man3direxp='~INST_TOP~~INST_VER~\man\man3' man3ext='3' medium='' mips='' @@ -450,7 +450,7 @@ patchlevel='2' path_sep=';' perl='perl' perladmin='' -perlpath='~INST_TOP~\bin\~archname~\perl.exe' +perlpath='~INST_TOP~~INST_VER~\bin\~archname~\perl.exe' pg='' phostname='hostname' pidtype='int' @@ -459,8 +459,8 @@ pmake='' pr='' prefix='~INST_DRV~' prefixexp='~INST_DRV~' -privlib='~INST_TOP~\lib' -privlibexp='~INST_TOP~\lib' +privlib='~INST_TOP~~INST_VER~\lib' +privlibexp='~INST_TOP~~INST_VER~\lib' prototype='define' ptrsize='4' randbits='15' @@ -469,8 +469,8 @@ rd_nodata='-1' rm='del' rmail='' runnm='true' -scriptdir='~INST_TOP~\bin' -scriptdirexp='~INST_TOP~\bin' +scriptdir='~INST_TOP~~INST_VER~\bin' +scriptdirexp='~INST_TOP~~INST_VER~\bin' sed='sed' selecttype='Perl_fd_set *' sendmail='blat' @@ -485,10 +485,10 @@ sig_name='ZERO INT QUIT ILL FPE KILL SEGV PIPE ALRM TERM CHLD BREAK ABRT STOP CO sig_name_init='"ZERO", "INT", "QUIT", "ILL", "FPE", "KILL", "SEGV", "PIPE", "ALRM", "TERM", "CHLD", "BREAK", "ABRT", "STOP", "CONT", "CLD", 0' sig_num='0, 2, 3, 4, 8, 9, 11, 13, 14, 15, 20, 21, 22, 23, 25, 20, 0' signal_t='void' -sitearch='' -sitearchexp='' -sitelib='~INST_TOP~\..\site\~VERSION~\lib' -sitelibexp='~INST_TOP~\..\site\~VERSION~\lib' +sitearch='~INST_TOP~\site~INST_VER~\lib\~archname~' +sitearchexp='~INST_TOP~\site~INST_VER~\lib\~archname~' +sitelib='~INST_TOP~\site~INST_VER~\lib' +sitelibexp='~INST_TOP~\site~INST_VER~\lib' sizetype='size_t' sleep='' smail='' diff --git a/win32/config_H.bc b/win32/config_H.bc index 0a0e861..ce21ebf 100644 --- a/win32/config_H.bc +++ b/win32/config_H.bc @@ -34,8 +34,8 @@ * This symbol is the filename expanded version of the BIN symbol, for * programs that do not want to deal with that at run-time. */ -#define BIN "c:\\perl\\5004.5x\\bin" /**/ -#define BIN_EXP "c:\\perl\\5004.5x\\bin" /**/ +#define BIN "c:\\perl\\5.00466\\bin\\MSWin32-x86" /**/ +#define BIN_EXP "c:\\perl\\5.00466\\bin\\MSWin32-x86" /**/ /* CPPSTDIN: * This symbol contains the first part of the string which will invoke @@ -1463,8 +1463,8 @@ * This symbol contains the ~name expanded version of ARCHLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -/*#define ARCHLIB "" /**/ -/*#define ARCHLIB_EXP "" /**/ +#define ARCHLIB "c:\\perl\\5.00466\\lib\\MSWin32-x86" /**/ +/*#define ARCHLIB_EXP "" /**/ /* CAT2: * This macro catenates 2 tokens together. @@ -1771,8 +1771,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "c:\\perl\\5004.5x\\lib" /**/ -#define PRIVLIB_EXP (win32_get_stdlib(patchlevel)) /**/ +#define PRIVLIB "c:\\perl\\5.00466\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.00466")) /**/ /* SIG_NAME: * This symbol contains a list of signal names in order of @@ -1818,8 +1818,8 @@ * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "" /**/ -#define SITEARCH_EXP "" /**/ +#define SITEARCH "c:\\perl\\site\\5.00466\\lib\\MSWin32-x86" /**/ +/*#define SITEARCH_EXP "" /**/ /* SITELIB: * This symbol contains the name of the private library for this package. @@ -1834,8 +1834,8 @@ * This symbol contains the ~name expanded version of SITELIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITELIB "c:\\perl\\5004.5x\\..\\site\\5.00466\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib(patchlevel)) /**/ +#define SITELIB "c:\\perl\\site\\5.00466\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.00466")) /**/ /* DLSYM_NEEDS_UNDERSCORE: * This symbol, if defined, indicates that we need to prepend an diff --git a/win32/config_H.gc b/win32/config_H.gc index 8ff345a..22f1258 100644 --- a/win32/config_H.gc +++ b/win32/config_H.gc @@ -34,8 +34,8 @@ * This symbol is the filename expanded version of the BIN symbol, for * programs that do not want to deal with that at run-time. */ -#define BIN "c:\\perl\\5004.5x\\bin" /**/ -#define BIN_EXP "c:\\perl\\5004.5x\\bin" /**/ +#define BIN "c:\\perl\\5.00466\\bin\\MSWin32-x86" /**/ +#define BIN_EXP "c:\\perl\\5.00466\\bin\\MSWin32-x86" /**/ /* CPPSTDIN: * This symbol contains the first part of the string which will invoke @@ -1463,8 +1463,8 @@ * This symbol contains the ~name expanded version of ARCHLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -/*#define ARCHLIB "" /**/ -/*#define ARCHLIB_EXP "" /**/ +#define ARCHLIB "c:\\perl\\5.00466\\lib\\MSWin32-x86" /**/ +/*#define ARCHLIB_EXP "" /**/ /* CAT2: * This macro catenates 2 tokens together. @@ -1771,8 +1771,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "c:\\perl\\5004.5x\\lib" /**/ -#define PRIVLIB_EXP (win32_get_stdlib(patchlevel)) /**/ +#define PRIVLIB "c:\\perl\\5.00466\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.00466")) /**/ /* SIG_NAME: * This symbol contains a list of signal names in order of @@ -1818,8 +1818,8 @@ * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "" /**/ -#define SITEARCH_EXP "" /**/ +#define SITEARCH "c:\\perl\\site\\5.00466\\lib\\MSWin32-x86" /**/ +/*#define SITEARCH_EXP "" /**/ /* SITELIB: * This symbol contains the name of the private library for this package. @@ -1834,8 +1834,8 @@ * This symbol contains the ~name expanded version of SITELIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITELIB "c:\\perl\\5004.5x\\..\\site\\5.00466\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib(patchlevel)) /**/ +#define SITELIB "c:\\perl\\site\\5.00466\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.00466")) /**/ /* DLSYM_NEEDS_UNDERSCORE: * This symbol, if defined, indicates that we need to prepend an diff --git a/win32/config_H.vc b/win32/config_H.vc index bd5ffb6..0ff8941 100644 --- a/win32/config_H.vc +++ b/win32/config_H.vc @@ -34,8 +34,8 @@ * This symbol is the filename expanded version of the BIN symbol, for * programs that do not want to deal with that at run-time. */ -#define BIN "c:\\perl\\5004.5x\\bin" /**/ -#define BIN_EXP "c:\\perl\\5004.5x\\bin" /**/ +#define BIN "c:\\perl\\5.00466\\bin\\MSWin32-x86" /**/ +#define BIN_EXP "c:\\perl\\5.00466\\bin\\MSWin32-x86" /**/ /* CPPSTDIN: * This symbol contains the first part of the string which will invoke @@ -1463,8 +1463,8 @@ * This symbol contains the ~name expanded version of ARCHLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -/*#define ARCHLIB "" /**/ -/*#define ARCHLIB_EXP "" /**/ +#define ARCHLIB "c:\\perl\\5.00466\\lib\\MSWin32-x86" /**/ +/*#define ARCHLIB_EXP "" /**/ /* CAT2: * This macro catenates 2 tokens together. @@ -1771,8 +1771,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "c:\\perl\\5004.5x\\lib" /**/ -#define PRIVLIB_EXP (win32_get_stdlib(patchlevel)) /**/ +#define PRIVLIB "c:\\perl\\5.00466\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.00466")) /**/ /* SIG_NAME: * This symbol contains a list of signal names in order of @@ -1818,8 +1818,8 @@ * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "" /**/ -#define SITEARCH_EXP "" /**/ +#define SITEARCH "c:\\perl\\site\\5.00466\\lib\\MSWin32-x86" /**/ +/*#define SITEARCH_EXP "" /**/ /* SITELIB: * This symbol contains the name of the private library for this package. @@ -1834,8 +1834,8 @@ * This symbol contains the ~name expanded version of SITELIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITELIB "c:\\perl\\5004.5x\\..\\site\\5.00466\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib(patchlevel)) /**/ +#define SITELIB "c:\\perl\\site\\5.00466\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.00466")) /**/ /* DLSYM_NEEDS_UNDERSCORE: * This symbol, if defined, indicates that we need to prepend an diff --git a/win32/config_h.PL b/win32/config_h.PL index 0a4e6ce..26a2430 100644 --- a/win32/config_h.PL +++ b/win32/config_h.PL @@ -5,6 +5,17 @@ use File::Copy qw(copy); my $OBJ = 1 if $Config{'ccflags'} =~ /PERL_OBJECT/i; my $name = $0; $name =~ s#^(.*)\.PL$#../$1.SH#; +my %opt; +while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/) + { + $opt{$1}=$2; + shift(@ARGV); + } +my $patchlevel = $opt{INST_VER}; +$patchlevel = s|^[\\/]||; +$patchlevel ||= $]; +$patchlevel = qq["$patchlevel"]; + open(SH,"<$name") || die "Cannot open $name:$!"; while () { @@ -37,26 +48,18 @@ while () munge(); s/\\\$/\$/g; s#/[ *\*]*\*/#/**/#; - # if (/^\s*#define\s+ARCHLIB_EXP/) - # { - # $_ = "#define ARCHLIB_EXP (win32_perllib_path(ARCHNAME,NULL))\t/**/\n"; - # } - if (/^\s*#define\s+PRIVLIB_EXP/) + if (/^\s*#define\s+(PRIVLIB|SITELIB)_EXP/) { - $_ = "#define PRIVLIB_EXP (win32_get_stdlib(patchlevel))\t/**/\n" + $_ = "#define ". $1 . "_EXP (win32_get_". lc($1) . "($patchlevel))\t/**/\n"; } - # if (/^\s*#define\s+SITEARCH_EXP/) - # { - # $_ = "#define SITEARCH_EXP (win32_perllib_path(\"site\",ARCHNAME,NULL))\t/**/\n"; - # } - if (/^\s*#define\s+SITELIB_EXP/) + # incpush() handles archlibs, so disable them + elsif (/^\s*#define\s+(ARCHLIB|SITEARCH)_EXP/) { - $_ = "#define SITELIB_EXP (win32_get_sitelib(patchlevel))\t/**/\n"; + $_ = "/*#define ". $1 . "_EXP \"\"\t/**/\n"; } print H; } -print H "#include -"; +print H "#include \n"; close(H); close(SH); diff --git a/win32/config_sh.PL b/win32/config_sh.PL index 8194988..0c3713c 100644 --- a/win32/config_sh.PL +++ b/win32/config_sh.PL @@ -10,7 +10,6 @@ if ($] =~ /\.(\d\d\d)?(\d\d)?$/) { # should always be true $opt{SUBVERSION} = $2 || '00'; } -$opt{VERSION} = $]; $opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'}; $opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0] unless $opt{'cf_email'}; diff --git a/win32/makefile.mk b/win32/makefile.mk index ec7226e..bb4fb40 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -13,7 +13,16 @@ # Set these to wherever you want "nmake install" to put your # newly built perl. INST_DRV *= c: -INST_TOP *= $(INST_DRV)\perl\5004.5x +INST_TOP *= $(INST_DRV)\perl + +# 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 +# the safest route, as perl adds the extra version directory to all the +# locations it installs files to. If you disable it, an alternative +# versioned installation can be obtained by setting INST_TOP above to a +# path that includes an arbitrary version string. +INST_VER *= \5.00466 # # uncomment to enable threads-capabilities @@ -57,8 +66,6 @@ CCTYPE *= BORLAND # # set the install locations of the compiler include/libraries -# (you'll need to quote the value if it contains spaces: i.e. -# CCHOME *= "f:\Program Files\vc" # #CCHOME *= f:\msdev\vc CCHOME *= C:\bc5 @@ -284,8 +291,9 @@ $(o).dll: .ENDIF # -INST_BIN = $(INST_TOP)\bin -INST_LIB = $(INST_TOP)\lib +INST_BIN = $(INST_TOP)$(INST_VER)\bin\$(ARCHNAME) +INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin +INST_LIB = $(INST_TOP)$(INST_VER)\lib INST_POD = $(INST_LIB)\pod INST_HTML = $(INST_POD)\html LIBDIR = ..\lib @@ -536,6 +544,7 @@ POD2TEXT = $(PODDIR)\pod2text CFG_VARS = \ "INST_DRV=$(INST_DRV)" \ "INST_TOP=$(INST_TOP)" \ + "INST_VER=$(INST_VER)" \ "archname=$(ARCHNAME)" \ "cc=$(CC)" \ "ccflags=$(OPTIMIZE) $(DEFINES) $(OBJECT)" \ @@ -598,7 +607,7 @@ regen_config_h: cd .. && perl configpm -del /f $(CFGH_TMPL) -mkdir ..\lib\CORE - -perl -I..\lib config_h.PL + -perl -I..\lib config_h.PL "INST_VER=$(INST_VER)" rename config.h $(CFGH_TMPL) $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl @@ -607,7 +616,8 @@ $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl $(XCOPY) ..\*.h $(COREDIR)\*.* $(XCOPY) *.h $(COREDIR)\*.* $(RCOPY) include $(COREDIR)\*.* - $(MINIPERL) -I..\lib config_h.PL || $(MAKE) $(MAKEMACROS) $(CONFIGPM) + $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \ + || $(MAKE) $(MAKEMACROS) $(CONFIGPM) $(MINIPERL) : $(MINIDIR) $(MINI_OBJ) .IF "$(CCTYPE)" == "BORLAND" @@ -886,8 +896,8 @@ installbare : installutils : utils $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.* - $(XCOPY) bin\*.bat $(INST_BIN)\*.* - $(XCOPY) ..\pod\*.bat $(INST_BIN)\*.* + $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.* + $(XCOPY) ..\pod\*.bat $(INST_SCRIPT)\*.* installhtml : doc $(RCOPY) html\*.* $(INST_HTML)\*.* diff --git a/win32/runperl.c b/win32/runperl.c index 9f2e5c1..36461bd 100644 --- a/win32/runperl.c +++ b/win32/runperl.c @@ -72,7 +72,7 @@ public: }; -extern char * g_win32_get_stdlib(char *pl); +extern char * g_win32_get_privlib(char *pl); extern char * g_win32_get_sitelib(char *pl); class CPerlEnv : public IPerlEnv { @@ -88,7 +88,7 @@ public: }; virtual char* LibPath(char *pl) { - return g_win32_get_stdlib(pl); + return g_win32_get_privlib(pl); }; virtual char* SiteLibPath(char *pl) { diff --git a/win32/win32.c b/win32/win32.c index 21da843..b22ec8a 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -77,8 +77,8 @@ int _CRT_glob = 0; #define EXECF_SPAWN_NOWAIT 3 #if defined(PERL_OBJECT) -#undef win32_get_stdlib -#define win32_get_stdlib g_win32_get_stdlib +#undef win32_get_privlib +#define win32_get_privlib g_win32_get_privlib #undef win32_get_sitelib #define win32_get_sitelib g_win32_get_sitelib #undef do_aspawn @@ -110,7 +110,7 @@ static long tokenize(char *str, char **dest, char ***destv); static BOOL has_redirection(char *ptr); static long filetime_to_clock(PFILETIME ft); static BOOL filetime_from_time(PFILETIME ft, time_t t); - +static char * get_emd_part(char *leading, char *trailing, ...); HANDLE w32_perldll_handle = INVALID_HANDLE_VALUE; static DWORD w32_platform = (DWORD)-1; @@ -168,8 +168,8 @@ GetRegStrFromKey(HKEY hkey, const char *lpszValueName, char** ptr, DWORD* lpData } retval = RegQueryValueEx(handle, lpszValueName, 0, NULL, (PBYTE)*ptr, lpDataLen); if (retval != ERROR_SUCCESS) { - Safefree(ptr); - ptr = NULL; + Safefree(*ptr); + *ptr = NULL; } } RegCloseKey(handle); @@ -188,174 +188,116 @@ GetRegStr(const char *lpszValueName, char** ptr, DWORD* lpDataLen) return *ptr; } -char * -win32_get_stdlib(char *pl) -{ - static char szStdLib[] = "lib"; - int len = 0, newSize; - char szBuffer[MAX_PATH+1]; - char szModuleName[MAX_PATH]; - int result; - DWORD dwDataLen; - char *lpPath = NULL; +static char * +get_emd_part(char *prev_path, char *trailing_path, ...) +{ + va_list ap; + char mod_name[MAX_PATH]; char *ptr; - - /* $stdlib = $HKCU{"lib-$]"} || $HKLM{"lib-$]"} || $HKCU{"lib"} || $HKLM{"lib"} || ""; */ - sprintf(szBuffer, "%s-%s", szStdLib, pl); - lpPath = GetRegStr(szBuffer, &lpPath, &dwDataLen); - if (lpPath == NULL) - lpPath = GetRegStr(szStdLib, &lpPath, &dwDataLen); - - /* $stdlib .= ";$EMD/../../lib" */ - GetModuleFileName(GetModuleHandle(NULL), szModuleName, sizeof(szModuleName)); - ptr = strrchr(szModuleName, '\\'); - if (ptr != NULL) - { + char *optr; + char *strip; + int oldsize, newsize; + + va_start(ap, trailing_path); + strip = va_arg(ap, char *); + + GetModuleFileName(GetModuleHandle(NULL), mod_name, sizeof(mod_name)); + ptr = strrchr(mod_name, '\\'); + while (ptr && strip) { + /* look for directories to skip back */ + optr = ptr; *ptr = '\0'; - ptr = strrchr(szModuleName, '\\'); - if (ptr != NULL) - { - *ptr = '\0'; - ptr = strrchr(szModuleName, '\\'); + ptr = strrchr(mod_name, '\\'); + if (!ptr || stricmp(ptr+1, strip) != 0) { + *optr = '\\'; + ptr = optr; } + strip = va_arg(ap, char *); } - if (ptr == NULL) - { - ptr = szModuleName; + if (!ptr) { + ptr = mod_name; + *ptr++ = '.'; *ptr = '\\'; } - strcpy(++ptr, szStdLib); + va_end(ap); + strcpy(++ptr, trailing_path); - /* check that this path exists */ - GetCurrentDirectory(sizeof(szBuffer), szBuffer); - result = SetCurrentDirectory(szModuleName); - SetCurrentDirectory(szBuffer); - if (result == 0) - { - GetModuleFileName(GetModuleHandle(NULL), szModuleName, sizeof(szModuleName)); - ptr = strrchr(szModuleName, '\\'); - if (ptr != NULL) - strcpy(++ptr, szStdLib); + newsize = strlen(mod_name) + 1; + if (prev_path) { + oldsize = strlen(prev_path) + 1; + newsize += oldsize; /* includes plus 1 for ';' */ + Renew(prev_path, newsize, char); + prev_path[oldsize] = ';'; + strcpy(&prev_path[oldsize], mod_name); } - - newSize = strlen(szModuleName) + 1; - if (lpPath != NULL) - { - len = strlen(lpPath); - newSize += len + 1; /* plus 1 for ';' */ - lpPath = Renew(lpPath, newSize, char); + else { + New(1311, prev_path, newsize, char); + strcpy(prev_path, mod_name); } - else - New(1310, lpPath, newSize, char); - if (lpPath != NULL) - { - if (len != 0) - lpPath[len++] = ';'; - strcpy(&lpPath[len], szModuleName); - } - return lpPath; + return prev_path; } char * -get_sitelib_part(char* lpRegStr, char* lpPathStr) -{ - char szBuffer[MAX_PATH+1]; - char szModuleName[MAX_PATH]; - DWORD dwDataLen; - int len = 0; - int result; - char *lpPath = NULL; - char *ptr; - - lpPath = GetRegStr(lpRegStr, &lpPath, &dwDataLen); - - /* $sitelib .= ";$EMD/../../../" */ - GetModuleFileName(GetModuleHandle(NULL), szModuleName, sizeof(szModuleName)); - ptr = strrchr(szModuleName, '\\'); - if (ptr != NULL) - { - *ptr = '\0'; - ptr = strrchr(szModuleName, '\\'); - if (ptr != NULL) - { - *ptr = '\0'; - ptr = strrchr(szModuleName, '\\'); - if (ptr != NULL) - { - *ptr = '\0'; - ptr = strrchr(szModuleName, '\\'); - } - } - } - if (ptr == NULL) - { - ptr = szModuleName; - *ptr = '\\'; - } - strcpy(++ptr, lpPathStr); - - /* check that this path exists */ - GetCurrentDirectory(sizeof(szBuffer), szBuffer); - result = SetCurrentDirectory(szModuleName); - SetCurrentDirectory(szBuffer); +win32_get_privlib(char *pl) +{ + char *stdlib = "lib"; + char buffer[MAX_PATH+1]; + char *path = Nullch; + DWORD datalen; - if (result) - { - int newSize = strlen(szModuleName) + 1; - if (lpPath != NULL) - { - len = strlen(lpPath); - newSize += len + 1; /* plus 1 for ';' */ - lpPath = Renew(lpPath, newSize, char); - } - else - New(1311, lpPath, newSize, char); + /* $stdlib = $HKCU{"lib-$]"} || $HKLM{"lib-$]"} || $HKCU{"lib"} || $HKLM{"lib"} || ""; */ + sprintf(buffer, "%s-%s", stdlib, pl); + path = GetRegStr(buffer, &path, &datalen); + if (path == NULL) + path = GetRegStr(stdlib, &path, &datalen); - if (lpPath != NULL) - { - if (len != 0) - lpPath[len++] = ';'; - strcpy(&lpPath[len], szModuleName); - } - } - return lpPath; + /* $stdlib .= ";$EMD/../../lib" */ + return get_emd_part(path, stdlib, ARCHNAME, "bin", Nullch); } char * win32_get_sitelib(char *pl) { - static char szSiteLib[] = "sitelib"; - char szRegStr[40]; - char szPathStr[MAX_PATH]; - char *lpPath1; - char *lpPath2; - int len, newSize; + char *sitelib = "sitelib"; + char regstr[40]; + char pathstr[MAX_PATH]; + DWORD datalen; + char *path1 = Nullch; + char *path2 = Nullch; + int len, newsize; /* $HKCU{"sitelib-$]"} || $HKLM{"sitelib-$]"} . ---; */ - sprintf(szRegStr, "%s-%s", szSiteLib, pl); - sprintf(szPathStr, "site\\%s\\lib", pl); - lpPath1 = get_sitelib_part(szRegStr, szPathStr); + sprintf(regstr, "%s-%s", sitelib, pl); + path1 = GetRegStr(regstr, &path1, &datalen); + + /* $sitelib .= + * ";$EMD/" . ((-d $EMD/../../../$]) ? "../../.." : "../.."). "/site/$]/lib"; */ + sprintf(pathstr, "site\\%s\\lib", pl); + path1 = get_emd_part(path1, pathstr, ARCHNAME, "bin", pl, Nullch); /* $HKCU{'sitelib'} || $HKLM{'sitelib'} . ---; */ - lpPath2 = get_sitelib_part(szSiteLib, "site\\lib"); - if (lpPath1 == NULL) - return lpPath2; + path2 = GetRegStr(sitelib, &path2, &datalen); - if (lpPath2 == NULL) - return lpPath1; + /* $sitelib .= + * ";$EMD/" . ((-d $EMD/../../../$]) ? "../../.." : "../.."). "/site/lib"; */ + path2 = get_emd_part(path2, "site\\lib", ARCHNAME, "bin", pl, Nullch); - len = strlen(lpPath1); - newSize = len + strlen(lpPath2) + 2; /* plus one for ';' */ + if (!path1) + return path2; - lpPath1 = Renew(lpPath1, newSize, char); - if (lpPath1 != NULL) - { - lpPath1[len++] = ';'; - strcpy(&lpPath1[len], lpPath2); - } - Safefree(lpPath2); - return lpPath1; + if (!path2) + return path1; + + len = strlen(path1); + newsize = len + strlen(path2) + 2; /* plus one for ';' */ + + Renew(path1, newsize, char); + path1[len++] = ';'; + strcpy(&path1[len], path2); + + Safefree(path2); + return path1; } diff --git a/win32/win32.h b/win32/win32.h index 032b196..5242018 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -14,7 +14,7 @@ # ifdef PERL_GLOBAL_STRUCT # error PERL_GLOBAL_STRUCT cannot be defined with PERL_OBJECT # endif -# define win32_get_stdlib PerlEnv_lib_path +# define win32_get_privlib PerlEnv_lib_path # define win32_get_sitelib PerlEnv_sitelib_path #endif @@ -212,7 +212,7 @@ extern int do_aspawn(void *really, void **mark, void **sp); extern int do_spawn(char *cmd); extern int do_spawn_nowait(char *cmd); extern char do_exec(char *cmd); -extern char * win32_get_stdlib(char *pl); +extern char * win32_get_privlib(char *pl); extern char * win32_get_sitelib(char *pl); extern int IsWin95(void); extern int IsWinNT(void); -- 1.8.3.1