Changeset 5e2f0cb for final-system/multilib
- Timestamp:
- Aug 31, 2006, 1:30:34 PM (18 years ago)
- Children:
- 6b42aac
- Parents:
- 96c52ef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
final-system/multilib/perl-64bit.xml
r96c52ef r5e2f0cb 116 116 <screen os="m"><userinput>mv /usr/bin/perl{,-64}</userinput></screen> 117 117 118 <para os="n">Now we need to create a multilib wrapper that lets us choose119 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> 120 120 121 <screen os="o"><userinput>cat > perl_wrapper.c << "EOF" 122 #include <stdio.h> 123 #include <stdlib.h> 124 #include <string.h> 125 #include <unistd.h> 126 #include <errno.h> 121 <screen os="o"><userinput>ln -sv multiarch_wrapper /usr/bin/perl</userinput></screen> 127 122 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)&&(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> 166 129 167 130 </sect2>
Note:
See TracChangeset
for help on using the changeset viewer.