I was about to commit the attached patch to add support for
USE_SITECUSTOMIZE to the Win32 makefiles, but it doesn't seem to be working.
Have I done everything that I need to do?
Running "perl -V" shows "-DUSE_SITECUSTOMIZE" in the "cflags" and
"USE_SITECUSTOMIZE" in the "Compile-time options". "perl
-V:usesitecustomize" says "define".
I've created a script called sitecustomize.pl in c:\perl\site\lib (which
is the path output by "perl -V:sitelibexp"), but the script doesn't seem
to be getting run. For example, if I have
print STDERR "Hello, world.\n";
in the script, then I would expect to see that message output when I run
"perl -e 1", but this doesn't happen.
I walked through S_parse_body() in a debugger and the new chunk of code
there is being run:
#ifdef USE_SITECUSTOMIZE
if (!minus_f) {
if (!PL_preambleav)
PL_preambleav = newAV();
av_unshift(PL_preambleav, 1);
(void)av_store(PL_preambleav, 0, Perl_newSVpvf(aTHX_ "BEGIN { do
'%s/sitecustomize.pl' }", SITELIB_EXP));
}
#endif
The only strange thing that I noticed is that SITELIB_EXP, as returned
by PerlEnvSiteLibPath(), was ";C:/perl/site/lib". Is that leading
semi-colon to be expected?
If that's OK then why is the script not being run?
- Steve
------------------------------------------------
Radan Computational Ltd.
The information contained in this message and any files transmitted with it are
confidential and intended for the addressee(s) only. If you have received this
message in error or there are any problems, please notify the sender
immediately. The unauthorized use, disclosure, copying or alteration of this
message is strictly forbidden. Note that any views or opinions presented in
this email are solely those of the author and do not necessarily represent
those of Radan Computational Ltd. The recipient(s) of this message should
check it and any attached files for viruses: Radan Computational will accept no
liability for any damage caused by any virus transmitted by this email.
==== //depot/perl/perl.c#591 - C:\p5p\bleadperl\perl.c ====
==== //depot/perl/win32/Makefile#259 - C:\p5p\bleadperl\win32\Makefile ====
@@ -46,6 +46,14 @@
#INST_ARCH = \$(ARCHNAME)
#
+# Uncomment this if you want perl to run
+# $Config{sitelibexp}\sitecustomize.pl
+# before anything else. This script can then be set up, for example,
+# to add additional entries to @INC.
+#
+#USE_SITECUST = define
+
+#
# uncomment to enable multiple interpreters. This is need for fork()
# emulation and for thread support.
#
@@ -160,6 +168,7 @@
# Additional compiler flags can be specified here.
#
+#
# 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
@@ -234,6 +243,10 @@
BUILDOPT = $(BUILDOPT) -DPERL_DEBUGGING_MSTATS
!ENDIF
+!IF "$(USE_SITECUST)" == ""
+USE_SITECUST = undef
+!ENDIF
+
!IF "$(USE_MULTI)" == ""
USE_MULTI = undef
!ENDIF
@@ -266,6 +279,10 @@
USE_MULTI = define
!ENDIF
+!IF "$(USE_SITECUST)" == "define"
+BUILDOPT = $(BUILDOPT) -DUSE_SITECUSTOMIZE
+!ENDIF
+
!IF "$(USE_MULTI)" != "undef"
BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT
!ENDIF
@@ -835,6 +852,7 @@
"usemultiplicity=$(USE_MULTI)" \
"useperlio=$(USE_PERLIO)" \
"uselargefiles=$(USE_LARGE_FILES)" \
+ "usesitecustomize=$(USE_SITECUST)" \
"LINK_FLAGS=$(LINK_FLAGS:"=\")" \
"optimize=$(OPTIMIZE:"=\")"
==== //depot/perl/win32/config.bc#140 - C:\p5p\bleadperl\win32\config.bc ====
@@ -923,6 +923,7 @@
usereentrant='undef'
usesfio='false'
useshrplib='yes'
+usesitecustomize='~USE_SITECUST~'
usesocks='undef'
usethreads='undef'
usevendorprefix='undef'
==== //depot/perl/win32/config.gc#140 - C:\p5p\bleadperl\win32\config.gc ====
@@ -922,6 +922,7 @@
usereentrant='undef'
usesfio='false'
useshrplib='yes'
+usesitecustomize='~USE_SITECUST~'
usesocks='undef'
usethreads='undef'
usevendorprefix='undef'
==== //depot/perl/win32/config.vc#147 - C:\p5p\bleadperl\win32\config.vc ====
@@ -922,6 +922,7 @@
usereentrant='undef'
usesfio='false'
useshrplib='yes'
+usesitecustomize='~USE_SITECUST~'
usesocks='undef'
usethreads='undef'
usevendorprefix='undef'
==== //depot/perl/win32/config.vc64#16 - C:\p5p\bleadperl\win32\config.vc64 ====
@@ -922,6 +922,7 @@
usereentrant='undef'
usesfio='false'
useshrplib='yes'
+usesitecustomize='~USE_SITECUST~'
usesocks='undef'
usethreads='undef'
usevendorprefix='undef'
==== //depot/perl/win32/makefile.mk#294 - C:\p5p\bleadperl\win32\makefile.mk
====
@@ -48,6 +48,14 @@
#INST_ARCH *= \$(ARCHNAME)
#
+# Uncomment this if you want perl to run
+# $Config{sitelibexp}\sitecustomize.pl
+# before anything else. This script can then be set up, for example,
+# to add additional entries to @INC.
+#
+#USE_SITECUST *= define
+
+#
# uncomment to enable multiple interpreters. This is need for fork()
# emulation and for thread support.
#
@@ -251,6 +259,7 @@
PERL_MALLOC *= undef
DEBUG_MSTATS *= undef
+USE_SITECUST *= undef
USE_MULTI *= undef
USE_ITHREADS *= undef
USE_IMP_SYS *= undef
@@ -278,6 +287,10 @@
USE_MULTI != define
.ENDIF
+.IF "$(USE_SITECUST)" == "define"
+BUILDOPT += -DUSE_SITECUSTOMIZE
+.ENDIF
+
.IF "$(USE_MULTI)" != "undef"
BUILDOPT += -DPERL_IMPLICIT_CONTEXT
.ENDIF
@@ -885,6 +898,7 @@
usemultiplicity=$(USE_MULTI) ~ \
useperlio=$(USE_PERLIO) ~ \
uselargefiles=$(USE_LARGE_FILES) ~ \
+ usesitecustomize=$(USE_SITECUST) ~ \
LINK_FLAGS=$(LINK_FLAGS:s,\,$B,) ~ \
optimize=$(OPTIMIZE)