Ignore:
Timestamp:
Aug 31, 2006, 1:30:34 PM (18 years ago)
Author:
Joe Ciccone <jciccone@…>
Children:
6b42aac
Parents:
96c52ef
Message:

Applied r2511 from trunk to the clfs-1.0 branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • final-system/multilib/perl-64bit.xml

    r96c52ef r5e2f0cb  
    116116<screen os="m"><userinput>mv /usr/bin/perl{,-64}</userinput></screen>
    117117
    118     <para os="n">Now we need to create a multilib wrapper that lets us choose
    119     which perl installation to use:</para>
     118    <para os="n">Now we need to create a link to the multiarch wrapper that
     119    lets us choose which perl installation to use:</para>
    120120
    121 <screen os="o"><userinput>cat &gt; perl_wrapper.c &lt;&lt; "EOF"
    122 #include &lt;stdio.h&gt;
    123 #include &lt;stdlib.h&gt;
    124 #include &lt;string.h&gt;
    125 #include &lt;unistd.h&gt;
    126 #include &lt;errno.h&gt;
     121<screen os="o"><userinput>ln -sv multiarch_wrapper /usr/bin/perl</userinput></screen>
    127122
    128 int main (int argc, char *argv[])
    129 {
    130   char *perl_arch;
    131   if ((perl_arch = getenv("PERL_ARCH")) == NULL)
    132     perl_arch = "64";
    133 
    134   char *filename = malloc(strlen(argv[0]) + strlen(perl_arch) + 2);
    135   strcpy(filename, argv[0]);
    136   strcat(filename, "-");
    137   strcat(filename, perl_arch);
    138 
    139   int ret = 0;
    140   ret = execvp(filename, argv);
    141   if ((ret != 0)&amp;&amp;(errno != 0))
    142   {
    143     char *errmsg = malloc(strlen(filename) + 19);
    144     strcpy(errmsg, "Unable to execute ");
    145     strcat(errmsg, filename);
    146     perror(errmsg);
    147     free(errmsg);
    148   }
    149 
    150   free(filename);
    151 
    152   return ret;
    153 }
    154 EOF
    155 gcc ${BUILD64} perl_wrapper.c -o /usr/bin/perl</userinput></screen>
    156 
    157     <para os="p">This multilib wrapper makes it possible to build perl
    158     extensions other then 64-bit. The PERL_ARCH environment variable controls
    159     which perl binary to execute. Some packages that may attempt to build
    160     against perl will run <command>perl -V:cc</command> to get the command
    161     that was used to build perl. If you're building a 32-bit extension but you
    162     only have a 64-bit perl this is not desired. By setting PERL_ARCH=32 you
    163     will be able to build the 32-bit extension because
    164     <command>perl -V:cc</command> will return the command used to build the
    165     32-bit perl installation.</para>
     123    <para os="p">The value of the <envar>USE_ARCH</envar> enviornment variable
     124    will decide which perl binary to execute.
     125    <command>USE_ARCH=32 perl -V:cc</command> will give the value of CC used to
     126    build the 32bit perl. The multiarch_wrapper will help later with building
     127    perl extensions and bindings. Without the multiarch_wrapper it is very hard
     128    to setup a 32bit extenstion or binding.</para>
    166129
    167130  </sect2>
Note: See TracChangeset for help on using the changeset viewer.