From: Michael G Schwern Date: Sun, 5 Mar 2000 06:31:29 +0000 (-0500) Subject: sitelib_stem and vendorlib_stem patches from Andy; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=526fdc24ad2c51ba7f2a58c871a45d948bdfe8e3;p=p5sagit%2Fp5-mst-13.2.git sitelib_stem and vendorlib_stem patches from Andy; problem reported in To: perl5-porters@perl.org Subject: [ID 20000305.001] [BUG 5.5.670 perl.c] SITELIB_EXP mangled by hack. Message-Id: <20000305113129.80DC23820@athens.arena-i.com> p4raw-id: //depot/cfgperl@5559 --- diff --git a/Configure b/Configure index f50069c..5724a60 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Sun Mar 5 19:11:56 EET 2000 [metaconfig 3.0 PL70] +# Generated on Sun Mar 5 23:53:58 EET 2000 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <&4 @@ -5467,6 +5504,7 @@ rp='Pathname for the site-specific library files?' . ./getfile sitelib="$ans" sitelibexp="$ansexp" +sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"` : Change installation prefix, if necessary. if $test X"$prefix" != X"$installprefix"; then installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"` @@ -5573,7 +5611,7 @@ $rm -f getverlist echo " " if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then $cat <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * 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. */ +/* SITELIB_STEM: + * This define is SITELIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. + */ #define SITELIB "$sitelib" /**/ #define SITELIB_EXP "$sitelibexp" /**/ +#define SITELIB_STEM "$sitelib_stem" /**/ /* Size_t: * This symbol holds the type used to declare length parameters @@ -2960,11 +2966,23 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #endif #$d_oldpthreads OLD_PTHREADS_API /**/ +/* PERL_VENDORARCH_EXP: + * This symbol contains the ~name expanded version of PERL_VENDORARCH, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +#$d_vendorarch PERL_VENDORARCH_EXP "$vendorarchexp" /**/ + /* PERL_VENDORLIB_EXP: * This symbol contains the ~name expanded version of VENDORLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ +/* PERL_VENDORLIB_STEM: + * This define is PERL_VENDORLIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. + */ #$d_vendorlib PERL_VENDORLIB_EXP "$vendorlibexp" /**/ +#$d_vendorlib PERL_VENDORLIB_STEM "$vendorlib_stem" /**/ /* VOIDFLAGS: * This symbol indicates how much support of the void type is given by this diff --git a/epoc/config.sh b/epoc/config.sh index 7131683..a3051d4 100644 --- a/epoc/config.sh +++ b/epoc/config.sh @@ -630,6 +630,7 @@ signal_t='void' sitearch='/perl/lib/site_perl/5.5.670/epoc' sitearchexp='/perl/lib/site_perl/5.5.670/epoc' sitelib='/perl/lib/site_perl/5.5.670/' +sitelib_stem='/perl/lib/site_perl' sitelibexp='/perl/lib/site_perl/5.5.670/' siteprefix='' siteprefixexp='' @@ -697,6 +698,7 @@ usevfork='' usrinc='' uuname='' vendorlib='' +vendorlib_stem='' vendorlibexp='' vendorprefix='' vendorprefixexp='' diff --git a/patchlevel.h b/patchlevel.h index 0b8d9be..7da61f0 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -68,7 +68,7 @@ applied different patches than you. */ #if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(LOCAL_PATCH_COUNT) -static char * __attribute__ ((unused)) local_patches[] = { +static char *local_patches[] = { NULL , "v5.6.0-RC1" ,NULL diff --git a/perl.c b/perl.c index 4b3b3e8..1fb05e8 100644 --- a/perl.c +++ b/perl.c @@ -3230,7 +3230,7 @@ S_init_perllib(pTHX) } /* Use the ~-expanded versions of APPLLIB (undocumented), - ARCHLIB PRIVLIB SITEARCH and SITELIB + ARCHLIB PRIVLIB SITEARCH SITELIB VENDORARCH and VENDORLIB */ #ifdef APPLLIB_EXP incpush(APPLLIB_EXP, TRUE); @@ -3240,7 +3240,7 @@ S_init_perllib(pTHX) incpush(ARCHLIB_EXP, FALSE); #endif #ifndef PRIVLIB_EXP -#define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl" +# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl" #endif #if defined(WIN32) incpush(PRIVLIB_EXP, TRUE); @@ -3248,35 +3248,54 @@ S_init_perllib(pTHX) incpush(PRIVLIB_EXP, FALSE); #endif -#if defined(WIN32) - incpush(SITELIB_EXP, TRUE); /* XXX Win32 needs inc_version_list support */ -#else +#ifdef SITEARCH_EXP +# if defined(WIN32) + incpush(SITEARCH_EXP, TRUE); +# else + incpush(SITEARCH_EXP, FALSE); +# endif +#endif + #ifdef SITELIB_EXP - { - char *path = SITELIB_EXP; +# if defined(WIN32) + incpush(SITELIB_EXP, TRUE); +# else + incpush(SITELIB_EXP, FALSE); +# endif +#endif - if (path) { - char buf[1024]; - char *ver = strrchr(path,'/'); /* XXX Hack, Configure var needed */ - if (ver && ver[1] == (STRINGIFY(PERL_REVISION))[0] - && strlen(path) < sizeof(buf)) - { - strcpy(buf,path); - buf[ver-path] = '\0'; - path = buf; - } - incpush(path, TRUE); - } - } +#ifdef SITELIB_STEM /* Search for version-specific dirs below here */ +# if defined(WIN32) + /* XXX Win32 needs inc_version_list support */ +# else + incpush(SITELIB_STEM, TRUE); +# endif #endif + +#ifdef PERL_VENDORARCH_EXP +# if defined(WIN32) + incpush(PERL_VENDORARCH_EXP, TRUE); +# else + incpush(PERL_VENDORARCH_EXP, FALSE); +# endif #endif -#if defined(PERL_VENDORLIB_EXP) -#if defined(WIN32) + +#ifdef PERL_VENDORLIB_EXP +# if defined(WIN32) incpush(PERL_VENDORLIB_EXP, TRUE); -#else +# else incpush(PERL_VENDORLIB_EXP, FALSE); +# endif #endif + +#ifdef PERL_VENDORLIB_STEM /* Search for version-specific dirs below here */ +# if defined(WIN32) + /* XXX Win32 needs inc_version_list support */ +# else + incpush(PERL_VENDORLIB_STEM, TRUE); +# endif #endif + if (!PL_tainting) incpush(".", FALSE); } diff --git a/perl.h b/perl.h index 2fbd39f..d9dcbba 100644 --- a/perl.h +++ b/perl.h @@ -151,14 +151,6 @@ functions are now member functions of the PERL_OBJECT. */ -#ifndef NEXT30_NO_ATTRIBUTE -# ifndef HASATTRIBUTE /* disable GNU-cc attribute checking? */ -# ifdef __attribute__ /* Avoid possible redefinition errors */ -# undef __attribute__ -# endif -# define __attribute__(attr) -# endif -#endif class CPerlObj; @@ -229,7 +221,7 @@ struct perl_thread; #endif #define NOOP (void)0 -#define dNOOP extern int __attribute__ ((unused)) Perl___notused +#define dNOOP extern int Perl___notused #ifndef pTHX # define pTHX void @@ -2672,6 +2664,15 @@ typedef void *Thread; # define PERL_CALLCONV #endif +#ifndef NEXT30_NO_ATTRIBUTE +# ifndef HASATTRIBUTE /* disable GNU-cc attribute checking? */ +# ifdef __attribute__ /* Avoid possible redefinition errors */ +# undef __attribute__ +# endif +# define __attribute__(attr) +# endif +#endif + #ifdef PERL_OBJECT # define PERL_DECL_PROT #endif diff --git a/vos/config.def b/vos/config.def index 7ef644d..46098b4 100644 --- a/vos/config.def +++ b/vos/config.def @@ -406,6 +406,7 @@ $sitearch='' $sitearchexp='' $sitelib='/system/ported/perl/lib/site/5.005' $sitelibexp='/system/ported/perl/lib/site/5.005' +$sitelib_stem='/system/ported/perl/lib/site' $sizetype='size_t' $socksizetype='int' $sPRIfldbl='"Lf"' @@ -448,6 +449,9 @@ $uvsize='4' $uvtype='unsigned int' $uvuformat='"u"' $uvxformat='"x"' +$vendorarch='' +$vendorarchexp='' +$vendorlib_stem='' $vendorlibexp='' $voidflags='15' $xs_apiversion='5.00563' diff --git a/vos/config.h b/vos/config.h index d163593..a145c30 100644 --- a/vos/config.h +++ b/vos/config.h @@ -1186,14 +1186,18 @@ * This macro surrounds its token with double quotes. */ #if 42 == 1 -#define CAT2(a,b)a/**/b -#define STRINGIFY(a)"a" +# define CAT2(a,b) a/**/b +# define STRINGIFY(a) "a" /* If you can get stringification with catify, tell me how! */ #endif #if 42 == 42 -#define CAT2(a,b)a ## b -#define StGiFy(a)# a -#define STRINGIFY(a)StGiFy(a) +# define PeRl_CaTiFy(a, b) a ## b +# define PeRl_StGiFy(a) #a +/* the additional level of indirection enables these macros to be + * used as arguments to other macros. See K&R 2nd ed., page 231. */ +# define CAT2(a,b) PeRl_CaTiFy(a,b) +# define StGiFy(a) PeRl_StGiFy(a) +# define STRINGIFY(a) PeRl_StGiFy(a) #endif #if 42 != 1 && 42 != 42 #include "Bletch: How does this C preprocessor catenate tokens?" @@ -2788,8 +2792,14 @@ * 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. */ +/* SITELIB_STEM: + * This define is SITELIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. + */ #define SITELIB "/system/ported/perl/lib/site/5.005" /**/ #define SITELIB_EXP "/system/ported/perl/lib/site/5.005" /**/ +#define SITELIB_STEM "/system/ported/perl/lib/site" /**/ /* Size_t: * This symbol holds the type used to declare length parameters @@ -2938,11 +2948,23 @@ #endif /*#define OLD_PTHREADS_API /**/ +/* PERL_VENDORARCH_EXP: + * This symbol contains the ~name expanded version of PERL_VENDORARCH, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +# PERL_VENDORARCH_EXP "" /**/ + /* PERL_VENDORLIB_EXP: * This symbol contains the ~name expanded version of VENDORLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ +/* PERL_VENDORLIB_STEM: + * This define is PERL_VENDORLIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. + */ #define PERL_VENDORLIB_EXP "" /**/ +#define PERL_VENDORLIB_STEM "" /**/ /* VOIDFLAGS: * This symbol indicates how much support of the void type is given by this diff --git a/vos/config_h.SH_orig b/vos/config_h.SH_orig index d452aa9..cae08f3 100755 --- a/vos/config_h.SH_orig +++ b/vos/config_h.SH_orig @@ -1204,14 +1204,18 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * This macro surrounds its token with double quotes. */ #if $cpp_stuff == 1 -#define CAT2(a,b)a/**/b -#define STRINGIFY(a)"a" +# define CAT2(a,b) a/**/b +# define STRINGIFY(a) "a" /* If you can get stringification with catify, tell me how! */ #endif #if $cpp_stuff == 42 -#define CAT2(a,b)a ## b -#define StGiFy(a)# a -#define STRINGIFY(a)StGiFy(a) +# define PeRl_CaTiFy(a, b) a ## b +# define PeRl_StGiFy(a) #a +/* the additional level of indirection enables these macros to be + * used as arguments to other macros. See K&R 2nd ed., page 231. */ +# define CAT2(a,b) PeRl_CaTiFy(a,b) +# define StGiFy(a) PeRl_StGiFy(a) +# define STRINGIFY(a) PeRl_StGiFy(a) #endif #if $cpp_stuff != 1 && $cpp_stuff != 42 #include "Bletch: How does this C preprocessor catenate tokens?" @@ -2806,8 +2810,14 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- * 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. */ +/* SITELIB_STEM: + * This define is SITELIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. + */ #define SITELIB "$sitelib" /**/ #define SITELIB_EXP "$sitelibexp" /**/ +#define SITELIB_STEM "$sitelib_stem" /**/ /* Size_t: * This symbol holds the type used to declare length parameters @@ -2956,11 +2966,23 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #endif #$d_oldpthreads OLD_PTHREADS_API /**/ +/* PERL_VENDORARCH_EXP: + * This symbol contains the ~name expanded version of PERL_VENDORARCH, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +#$d_vendorarch PERL_VENDORARCH_EXP "$vendorarchexp" /**/ + /* PERL_VENDORLIB_EXP: * This symbol contains the ~name expanded version of VENDORLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ +/* PERL_VENDORLIB_STEM: + * This define is PERL_VENDORLIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. + */ #$d_vendorlib PERL_VENDORLIB_EXP "$vendorlibexp" /**/ +#$d_vendorlib PERL_VENDORLIB_STEM "$vendorlib_stem" /**/ /* VOIDFLAGS: * This symbol indicates how much support of the void type is given by this