From: Nick Ing-Simmons Date: Sat, 22 Nov 1997 21:18:11 +0000 (+0000) Subject: Munge pseudo-Configure stuff to add -thread to archname as X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=acbc2db62d28b1660277b33463f96f796b30a6c3;p=p5sagit%2Fp5-mst-13.2.git Munge pseudo-Configure stuff to add -thread to archname as 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 --- diff --git a/win32/config.bc b/win32/config.bc index 0a014d7..c534021 100644 --- a/win32/config.bc +++ b/win32/config.bc @@ -5,7 +5,7 @@ ## Target system: WIN32 # -archlibexp='~INST_TOP~\lib' +archlibexp='~INST_TOP~\lib\~archname~' archname='MSWin32' cc='bcc32' ccflags='-DWIN32' @@ -13,7 +13,7 @@ cppflags='-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='' @@ -46,7 +46,7 @@ afs='false' alignbytes='8' aphostname='' ar='tlib /P128' -archlib='~INST_TOP~\lib' +archlib='~INST_TOP~\lib\~archname~' archobjs='' awk='awk' baserev='5.0' diff --git a/win32/config_H.bc b/win32/config_H.bc index edd4ffc..cea8b4e 100644 --- a/win32/config_H.bc +++ b/win32/config_H.bc @@ -47,7 +47,7 @@ * 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 @@ -1466,9 +1466,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 "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 @@ -1715,7 +1714,7 @@ * 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 @@ -1771,7 +1770,7 @@ * 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. @@ -1787,7 +1786,7 @@ * 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 diff --git a/win32/config_H.vc b/win32/config_H.vc index 552d74d..87ecab8 100644 --- a/win32/config_H.vc +++ b/win32/config_H.vc @@ -47,7 +47,7 @@ * 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 @@ -1466,9 +1466,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 "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 @@ -1715,7 +1714,7 @@ * 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 @@ -1771,7 +1770,7 @@ * 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. @@ -1787,7 +1786,7 @@ * 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 diff --git a/win32/config_h.PL b/win32/config_h.PL index 5d47016..679ba99 100644 --- a/win32/config_h.PL +++ b/win32/config_h.PL @@ -37,8 +37,19 @@ while () 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; } diff --git a/win32/config_sh.PL b/win32/config_sh.PL index 0c3713c..5f3f157 100644 --- a/win32/config_sh.PL +++ b/win32/config_sh.PL @@ -5,6 +5,17 @@ while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/) 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'; diff --git a/win32/win32.c b/win32/win32.c index 26cf26f..74be770 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -55,30 +55,30 @@ IsWinNT(void) { } 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) diff --git a/win32/win32.h b/win32/win32.h index ec4faa8..2e31d0e 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -129,8 +129,7 @@ extern int my_fclose(FILE *); 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);