perl.patch 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. By default, the "vendor" area is not used, so Perl's installation
  2. procedure forgot to create its top-level paths, too. In OpenPKG we use
  3. the "vendor" area, so make sure it is created the same way the "site"
  4. area is.
  5. Index: installperl
  6. --- installperl.orig 2003-09-02 15:40:21.000000000 +0200
  7. +++ installperl 2003-09-26 09:23:15.000000000 +0200
  8. @@ -189,6 +189,8 @@
  9. my $installarchlib = "$destdir$Config{installarchlib}";
  10. my $installsitelib = "$destdir$Config{installsitelib}";
  11. my $installsitearch = "$destdir$Config{installsitearch}";
  12. +my $installvendorlib = "$destdir$Config{installvendorlib}";
  13. +my $installvendorarch = "$destdir$Config{installvendorarch}";
  14. my $installman1dir = "$destdir$Config{installman1dir}";
  15. my $man1ext = $Config{man1ext};
  16. my $libperl = $Config{libperl};
  17. @@ -379,6 +381,8 @@
  18. mkpath($installarchlib, $verbose, 0777);
  19. mkpath($installsitelib, $verbose, 0777) if ($installsitelib);
  20. mkpath($installsitearch, $verbose, 0777) if ($installsitearch);
  21. +mkpath($installvendorlib, $verbose, 0777) if ($installvendorlib);
  22. +mkpath($installvendorarch, $verbose, 0777) if ($installvendorarch);
  23. if (chdir "lib") {
  24. $do_installarchlib = ! samepath($installarchlib, '.');
  25. -----------------------------------------------------------------------------
  26. By default, the Perl module search order is "use lib, -I, PERL[5]LIB,
  27. perl, site, vendor, other". This means that in OpenPKG both the modules
  28. installed via CPAN shell (in "site" area) and the "perl-xxx" packages
  29. (in "vendor" area) cannot override the (sometimes obsoleted) module
  30. versions distributed with Perl (in "perl" area). Hence, we change
  31. the search order to a more reasonable one for OpenPKG: "use lib, -I,
  32. PERL[5]LIB, site, vendor, perl, other".
  33. Index: perl.c
  34. --- perl.c.orig 2003-09-11 23:42:33.000000000 +0200
  35. +++ perl.c 2003-09-26 09:25:11.000000000 +0200
  36. @@ -3978,39 +3978,6 @@
  37. incpush(APPLLIB_EXP, TRUE, TRUE, TRUE);
  38. #endif
  39. -#ifdef ARCHLIB_EXP
  40. - incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE);
  41. -#endif
  42. -#ifdef MACOS_TRADITIONAL
  43. - {
  44. - Stat_t tmpstatbuf;
  45. - SV * privdir = NEWSV(55, 0);
  46. - char * macperl = PerlEnv_getenv("MACPERL");
  47. -
  48. - if (!macperl)
  49. - macperl = "";
  50. -
  51. - Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
  52. - if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
  53. - incpush(SvPVX(privdir), TRUE, FALSE, TRUE);
  54. - Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
  55. - if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
  56. - incpush(SvPVX(privdir), TRUE, FALSE, TRUE);
  57. -
  58. - SvREFCNT_dec(privdir);
  59. - }
  60. - if (!PL_tainting)
  61. - incpush(":", FALSE, FALSE, TRUE);
  62. -#else
  63. -#ifndef PRIVLIB_EXP
  64. -# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
  65. -#endif
  66. -#if defined(WIN32)
  67. - incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE);
  68. -#else
  69. - incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE);
  70. -#endif
  71. -
  72. #ifdef SITEARCH_EXP
  73. /* sitearch is always relative to sitelib on Windows for
  74. * DLL-based path intuition to work correctly */
  75. @@ -4052,6 +4019,39 @@
  76. incpush(PERL_VENDORLIB_STEM, FALSE, TRUE, TRUE);
  77. #endif
  78. +#ifdef ARCHLIB_EXP
  79. + incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE);
  80. +#endif
  81. +#ifdef MACOS_TRADITIONAL
  82. + {
  83. + Stat_t tmpstatbuf;
  84. + SV * privdir = NEWSV(55, 0);
  85. + char * macperl = PerlEnv_getenv("MACPERL");
  86. +
  87. + if (!macperl)
  88. + macperl = "";
  89. +
  90. + Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
  91. + if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
  92. + incpush(SvPVX(privdir), TRUE, FALSE, TRUE);
  93. + Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
  94. + if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
  95. + incpush(SvPVX(privdir), TRUE, FALSE, TRUE);
  96. +
  97. + SvREFCNT_dec(privdir);
  98. + }
  99. + if (!PL_tainting)
  100. + incpush(":", FALSE, FALSE, TRUE);
  101. +#else
  102. +#ifndef PRIVLIB_EXP
  103. +# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
  104. +#endif
  105. +#if defined(WIN32)
  106. + incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE);
  107. +#else
  108. + incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE);
  109. +#endif
  110. +
  111. #ifdef PERL_OTHERLIBDIRS
  112. incpush(PERL_OTHERLIBDIRS, TRUE, TRUE, TRUE);
  113. #endif
  114. -----------------------------------------------------------------------------
  115. Port to [Open]Darwin 6.6.2:
  116. 1. In OpenPKG, Perl does not use the vendor GCC and our GCC does not
  117. understand "-no-cpp-precomp", so remove this build option.
  118. 2. The <sys/mman.h> indirectly includes system specific headers
  119. which in turn have fields named "environ" while Perl uses
  120. a define of "environ" internally. So wrap the inclusion.
  121. 3. Darwin 6 no longer accepts the non-standard "#import" statements,
  122. so replace with "#include" and circumvent some header problem
  123. related to the non-standard "__private_extern__" attribute.
  124. Index: hints/darwin.sh
  125. --- hints/darwin.sh.orig 2003-09-02 15:40:19.000000000 +0200
  126. +++ hints/darwin.sh 2003-10-28 16:40:57.000000000 +0100
  127. @@ -121,9 +121,6 @@
  128. *-2147483648) ccflags="${ccflags} -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN" ;;
  129. esac
  130. -# Avoid Apple's cpp precompiler, better for extensions
  131. -cppflags="${cppflags} -no-cpp-precomp"
  132. -
  133. # This is necessary because perl's build system doesn't
  134. # apply cppflags to cc compile lines as it should.
  135. ccflags="${ccflags} ${cppflags}"
  136. Index: perlio.c
  137. --- perlio.c.orig 2003-09-24 22:50:22.000000000 +0200
  138. +++ perlio.c 2003-10-28 17:03:59.000000000 +0100
  139. @@ -432,7 +432,14 @@
  140. #include <unistd.h>
  141. #endif
  142. #ifdef HAS_MMAP
  143. +#ifdef PERL_DARWIN
  144. +#define environ_safe environ
  145. +#undef environ
  146. #include <sys/mman.h>
  147. +#define environ environ_safe
  148. +#else
  149. +#include <sys/mman.h>
  150. +#endif
  151. #endif
  152. /*
  153. Index: ext/DynaLoader/dl_dyld.xs
  154. --- ext/DynaLoader/dl_dyld.xs.orig 2003-09-02 15:39:27.000000000 +0200
  155. +++ ext/DynaLoader/dl_dyld.xs 2003-10-28 17:07:31.000000000 +0100
  156. @@ -45,7 +45,13 @@
  157. #undef environ
  158. #undef bool
  159. +#ifdef PERL_DARWIN
  160. +#define __private_extern__ extern
  161. +#include <mach-o/dyld.h>
  162. +#undef __private_extern__
  163. +#else
  164. #import <mach-o/dyld.h>
  165. +#endif
  166. static char *dlerror()
  167. {
  168. -----------------------------------------------------------------------------
  169. Port to Tru64 5.1:
  170. Under Tru64 our gcc has to be built without binutils and the system
  171. ld(1) does not accept a "-O" option, so remove the whole passing of
  172. optimization flags to ld(1). Under a brain-dead platform like Tru64 we
  173. really don't need any more optimization because we are already happy if
  174. it works at all.
  175. Index: hints/dec_osf.sh
  176. --- hints/dec_osf.sh.orig 2004-03-24 23:59:53.000000000 +0100
  177. +++ hints/dec_osf.sh 2004-04-22 09:58:40.000000000 +0200
  178. @@ -237,15 +237,6 @@
  179. *) if $test "X$optimize" = "X$undef"; then
  180. lddlflags="$lddlflags -msym"
  181. else
  182. - case "$myosvers" in
  183. - *4.0D*)
  184. - # QAR 56761: -O4 + .so may produce broken code,
  185. - # fixed in 4.0E or better.
  186. - ;;
  187. - *)
  188. - lddlflags="$lddlflags $optimize"
  189. - ;;
  190. - esac
  191. # -msym: If using a sufficiently recent /sbin/loader,
  192. # keep the module symbols with the modules.
  193. lddlflags="$lddlflags -msym -std"