From: Gurusamy Sarathy Date: Sun, 22 Jun 1997 05:34:00 +0000 (+1200) Subject: Win32 sitelib intuition from DLL location X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b4793f7f58b137d8b2f6d505d6c77dee2cd8cb25;p=p5sagit%2Fp5-mst-13.2.git Win32 sitelib intuition from DLL location There is code for win32 that determines archlib from the location of PERL.DLL. This is only 50% effective, as any sitelib at the same location is not found. This simple patch adds that feature. It is needed for the win32 binary distribution to work in a relocatable fashion. [editor's note: perhaps only partially applied] p5p-msgid: 199706231647.MAA23260@aatma.engin.umich.edu --- diff --git a/win32/config_h.PL b/win32/config_h.PL index 98b474a..5d47016 100644 --- a/win32/config_h.PL +++ b/win32/config_h.PL @@ -37,7 +37,8 @@ while () s#/[ *\*]*\*/#/**/#; if (/^\s*#define\s+ARCHLIB_EXP/) { - $_ = "#define ARCHLIB_EXP (win32PerlLibPath())\t/**/\n"; + $_ = "#define ARCHLIB_EXP (win32PerlLibPath())\t/**/\n" + . "#define APPLLIB_EXP (win32SiteLibPath())\t/**/\n"; } print H; } diff --git a/win32/win32.c b/win32/win32.c index 653cdf7..4663f86 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -86,6 +86,15 @@ win32PerlLibPath(void) return (szPerlLibRoot); } +char * +win32SiteLibPath(void) +{ + static char szPerlSiteLib[MAXPATH+1]; + strcpy(szPerlSiteLib, win32PerlLibPath()); + strcat(szPerlSiteLib, "\\site"); + return (szPerlSiteLib); +} + BOOL HasRedirection(char *ptr) { diff --git a/win32/win32.h b/win32/win32.h index 344ddab..d295a75 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -99,6 +99,7 @@ struct tms { unsigned int sleep(unsigned int); char *win32PerlLibPath(void); +char *win32SiteLibPath(void); int mytimes(struct tms *timebuf); unsigned int myalarm(unsigned int sec); int do_aspawn(void* really, void** mark, void** arglast);