Malcolm seems to think that is way to test for threads.
Update @INC stuffing hackery to have traditional @INC
search order archlib, privlib, sitearch, site.
p4raw-id: //depot/ansiperl@282
## Target system: WIN32
#
-archlibexp='~INST_TOP~\lib'
+archlibexp='~INST_TOP~\lib\~archname~'
archname='MSWin32'
cc='bcc32'
ccflags='-DWIN32'
dlsrc='dl_win32.xs'
dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs Thread'
extensions='~static_ext~ ~dynamic_ext~'
-installarchlib='~INST_TOP~\lib'
+installarchlib='~INST_TOP~\lib\~archname~'
installprivlib='~INST_TOP~\lib'
libpth=''
libs=''
alignbytes='8'
aphostname=''
ar='tlib /P128'
-archlib='~INST_TOP~\lib'
+archlib='~INST_TOP~\lib\~archname~'
archobjs=''
awk='awk'
baserev='5.0'
* where library files may be held under a private library, for
* instance.
*/
-#define ARCHNAME "MSWin32" /**/
+#define ARCHNAME "MSWin32-x86-thread" /**/
/* BIN:
* This symbol holds the path of the bin directory where the package will
* 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 "c:\\perl\\lib" /**/
-#define ARCHLIB_EXP (win32PerlLibPath()) /**/
-#define APPLLIB_EXP (win32SiteLibPath()) /**/
+#define ARCHLIB "c:\\perl\\lib\\MSWin32-x86-thread" /**/
+#define ARCHLIB_EXP (win32PerlLibPath(ARCHNAME,NULL)) /**/
/* BINCOMPAT3:
* This symbol, if defined, indicates that Perl 5.004 should be
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
#define PRIVLIB "c:\\perl\\lib" /**/
-#define PRIVLIB_EXP "c:\\perl\\lib" /**/
+#define PRIVLIB_EXP (win32PerlLibPath(NULL)) /**/
/* SH_PATH:
* This symbol contains the full pathname to the shell used on this
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
#define SITEARCH "c:\\perl\\lib\\site" /**/
-#define SITEARCH_EXP "c:\\perl\\lib\\site" /**/
+#define SITEARCH_EXP (win32PerlLibPath("site",ARCHNAME,NULL)) /**/
/* SITELIB:
* This symbol contains the name of the private library for this package.
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
#define SITELIB "c:\\perl\\lib\\site" /**/
-#define SITELIB_EXP "c:\\perl\\lib\\site" /**/
+#define SITELIB_EXP (win32PerlLibPath("site",NULL)) /**/
/* STARTPERL:
* This variable contains the string to put in front of a perl
* where library files may be held under a private library, for
* instance.
*/
-#define ARCHNAME "MSWin32" /**/
+#define ARCHNAME "MSWin32-x86-thread" /**/
/* BIN:
* This symbol holds the path of the bin directory where the package will
* 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 "c:\\perl\\lib" /**/
-#define ARCHLIB_EXP (win32PerlLibPath()) /**/
-#define APPLLIB_EXP (win32SiteLibPath()) /**/
+#define ARCHLIB "c:\\perl\\lib\\MSWin32-x86-thread" /**/
+#define ARCHLIB_EXP (win32PerlLibPath(ARCHNAME,NULL)) /**/
/* BINCOMPAT3:
* This symbol, if defined, indicates that Perl 5.004 should be
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
#define PRIVLIB "c:\\perl\\lib" /**/
-#define PRIVLIB_EXP "c:\\perl\\lib" /**/
+#define PRIVLIB_EXP (win32PerlLibPath(NULL)) /**/
/* SH_PATH:
* This symbol contains the full pathname to the shell used on this
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
#define SITEARCH "c:\\perl\\lib\\site" /**/
-#define SITEARCH_EXP "c:\\perl\\lib\\site" /**/
+#define SITEARCH_EXP (win32PerlLibPath("site",ARCHNAME,NULL)) /**/
/* SITELIB:
* This symbol contains the name of the private library for this package.
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
#define SITELIB "c:\\perl\\lib\\site" /**/
-#define SITELIB_EXP "c:\\perl\\lib\\site" /**/
+#define SITELIB_EXP (win32PerlLibPath("site",NULL)) /**/
/* STARTPERL:
* This variable contains the string to put in front of a perl
s#/[ *\*]*\*/#/**/#;
if (/^\s*#define\s+ARCHLIB_EXP/)
{
- $_ = "#define ARCHLIB_EXP (win32PerlLibPath())\t/**/\n"
- . "#define APPLLIB_EXP (win32SiteLibPath())\t/**/\n";
+ $_ = "#define ARCHLIB_EXP (win32PerlLibPath(ARCHNAME,NULL))\t/**/\n";
+ }
+ if (/^\s*#define\s+PRIVLIB_EXP/)
+ {
+ $_ = "#define PRIVLIB_EXP (win32PerlLibPath(NULL))\t/**/\n"
+ }
+ if (/^\s*#define\s+SITEARCH_EXP/)
+ {
+ $_ = "#define SITEARCH_EXP (win32PerlLibPath(\"site\",ARCHNAME,NULL))\t/**/\n";
+ }
+ if (/^\s*#define\s+SITELIB_EXP/)
+ {
+ $_ = "#define SITELIB_EXP (win32PerlLibPath(\"site\",NULL))\t/**/\n";
}
print H;
}
shift(@ARGV);
}
+$opt{'archname'} = 'MSWin32';
+if (defined $ENV{'PROCESSOR_ARCHITECTURE'})
+ {
+ $opt{'archname'} .= '-'.$ENV{'PROCESSOR_ARCHITECTURE'};
+ }
+
+if ($opt{'ccflags'} =~ /USE_THREADS/)
+ {
+ $opt{'archname'} .= '-thread';
+ }
+
if ($] =~ /\.(\d\d\d)?(\d\d)?$/) { # should always be true
$opt{PATCHLEVEL} = int($1 || 0);
$opt{SUBVERSION} = $2 || '00';
}
char *
-win32PerlLibPath(void)
+win32PerlLibPath(char *sfx,...)
{
+ va_list ap;
char *end;
+ va_start(ap,sfx);
GetModuleFileName((PerlDllHandle == INVALID_HANDLE_VALUE)
? GetModuleHandle(NULL)
: PerlDllHandle,
szPerlLibRoot,
sizeof(szPerlLibRoot));
-
*(end = strrchr(szPerlLibRoot, '\\')) = '\0';
if (stricmp(end-4,"\\bin") == 0)
end -= 4;
strcpy(end,"\\lib");
+ while (sfx)
+ {
+ strcat(end,"\\");
+ strcat(end,sfx);
+ sfx = va_arg(ap,char *);
+ }
+ va_end(ap);
return (szPerlLibRoot);
}
-char *
-win32SiteLibPath(void)
-{
- static char szPerlSiteLib[MAX_PATH+1];
- strcpy(szPerlSiteLib, win32PerlLibPath());
- strcat(szPerlSiteLib, "\\site");
- return (szPerlSiteLib);
-}
BOOL
HasRedirection(char *ptr)
extern int do_aspawn(void* really, void ** mark, void ** arglast);
extern int do_spawn(char *cmd);
extern char do_exec(char *cmd);
-extern char * win32PerlLibPath(void);
-extern char * win32SiteLibPath(void);
+extern char * win32PerlLibPath(char *sfx,...);
extern int IsWin95(void);
extern int IsWinNT(void);