Ticket #12950: patch-perl.c.2.diff

File patch-perl.c.2.diff, 3.2 KB (added by ghosthound, 16 years ago)

patch for perl5.8 perl.c to alter @INC

  • perl.c

    old new  
    48764876    }
    48774877
    48784878/* Use the ~-expanded versions of APPLLIB (undocumented),
    4879     ARCHLIB PRIVLIB SITEARCH SITELIB VENDORARCH and VENDORLIB
     4879    original order: ARCHLIB PRIVLIB SITEARCH SITELIB VENDORARCH and VENDORLIB
     4880    macports order: SITEARCH SITELIB VENDORARCH VENDORLIB ARCHLIB and PRIVLIB
    48804881*/
    48814882#ifdef APPLLIB_EXP
    48824883    incpush(APPLLIB_EXP, TRUE, TRUE, TRUE, TRUE);
    48834884#endif
    48844885
    4885 #ifdef ARCHLIB_EXP
    4886     incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
    4887 #endif
    4888 #ifdef MACOS_TRADITIONAL
    4889     {
    4890         Stat_t tmpstatbuf;
    4891         SV * privdir = newSV(0);
    4892         char * macperl = PerlEnv_getenv("MACPERL");
    4893        
    4894         if (!macperl)
    4895             macperl = "";
    4896        
    4897         Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
    4898         if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
    4899             incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
    4900         Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
    4901         if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
    4902             incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
    4903        
    4904         SvREFCNT_dec(privdir);
    4905     }
    4906     if (!PL_tainting)
    4907         incpush(":", FALSE, FALSE, TRUE, FALSE);
    4908 #else
    4909 #ifndef PRIVLIB_EXP
    4910 #  define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
    4911 #endif
    4912 #if defined(WIN32)
    4913     incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
    4914 #else
    4915     incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
    4916 #endif
    4917 
     4886/* start site* locations */
    49184887#ifdef SITEARCH_EXP
    49194888    /* sitearch is always relative to sitelib on Windows for
    49204889     * DLL-based path intuition to work correctly */
     
    49364905    /* Search for version-specific dirs below here */
    49374906    incpush(SITELIB_STEM, FALSE, TRUE, TRUE, TRUE);
    49384907#endif
     4908/* end site* locations */
    49394909
     4910/* start vendor* locations */
    49404911#ifdef PERL_VENDORARCH_EXP
    49414912    /* vendorarch is always relative to vendorlib on Windows for
    49424913     * DLL-based path intuition to work correctly */
     
    49564927#ifdef PERL_VENDORLIB_STEM /* Search for version-specific dirs below here */
    49574928    incpush(PERL_VENDORLIB_STEM, FALSE, TRUE, TRUE, TRUE);
    49584929#endif
     4930/* end vendor* locations */
     4931
     4932#ifdef ARCHLIB_EXP
     4933    incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
     4934#endif
     4935#ifdef MACOS_TRADITIONAL
     4936    {
     4937        Stat_t tmpstatbuf;
     4938        SV * privdir = newSV(0);
     4939        char * macperl = PerlEnv_getenv("MACPERL");
     4940       
     4941        if (!macperl)
     4942            macperl = "";
     4943       
     4944        Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
     4945        if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
     4946            incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
     4947        Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
     4948        if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
     4949            incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
     4950       
     4951        SvREFCNT_dec(privdir);
     4952    }
     4953    if (!PL_tainting)
     4954        incpush(":", FALSE, FALSE, TRUE, FALSE);
     4955#else
     4956#ifndef PRIVLIB_EXP
     4957#  define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
     4958#endif
     4959#if defined(WIN32)
     4960    incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
     4961#else
     4962    incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
     4963#endif
    49594964
    49604965#ifdef PERL_OTHERLIBDIRS
    49614966    incpush(PERL_OTHERLIBDIRS, TRUE, TRUE, TRUE, TRUE);