Changeset 23b6afb for scripts/funcs
- Timestamp:
- Feb 21, 2006, 12:15:50 AM (19 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 12ba0a4
- Parents:
- eec901a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/funcs/multiarch-funcs.sh
reec901a r23b6afb 51 51 sed -e "s@lib[36][124]@lib@g" -e "s@lib@${libdirname}@g" ` 52 52 53 if [ "${MULTIARCH}" = "Y" ]; then54 export PERL=`which_func perl-${BUILDENV}`55 export PYTHON=`which_func python-${BUILDENV}`56 else57 export PERL=`which_func perl`58 export PYTHON=`which_func python`59 fi60 61 53 } 62 54 … … 156 148 if [ ! -d ${wrapperdir} ]; then mkdir -p ${wrapperdir} ; fi 157 149 158 cat > ${wrapper} <<EOF 159 #!/bin/sh 160 161 # Set to default if BUILDENV not set 162 if [ -z \${BUILDENV} ]; then BUILDENV=${DEFAULTENV} ; fi 163 export BUILDENV 164 exec \${0}-\${BUILDENV} \${@} 150 cat > wrapper.c <<"EOF" 151 /* 152 153 wrapper.c - c wrapper for cross-lfs multiarch handling 154 ------------------------------------------------------ 155 Created By: Ryan Oliver <ryan.oliver@pha.com.au> 20050606 156 157 $LastChangedBy$ 158 $LastChangedDate$ 159 $LastChangedRevision$ 160 $HeadURL$ 161 162 */ 163 164 #include <unistd.h> 165 #include <stdlib.h> 166 #include <errno.h> 167 168 /* TODO: should check for __x86_64__ , __powerpc64__ etc and set accordingly */ 169 #ifndef DEFAULTENV 170 #define DEFAULTENV "64" 171 #endif 172 173 int main(int argc, char **argv) { 174 175 char *filename; 176 char *buildenv; 177 178 if(!(buildenv = getenv("BUILDENV"))) 179 buildenv = DEFAULTENV; 180 181 filename = (char *) malloc(strlen(argv[0]) + strlen(buildenv) + 2); 182 strcpy(filename, argv[0]); 183 strcat(filename, "-"); 184 strcat(filename, buildenv); 185 186 execvp(filename, argv); 187 perror(argv[0]); 188 free(filename); 189 190 } 165 191 EOF 166 192 193 OLD_BUILDENV="${BUILDENV}" 194 BUILDENV="${DEFAULTENV}" 195 setup_multiarch 196 197 ${CC-gcc} ${ARCH_CFLAGS} -DDEFAULTENV=\"${DEFAULTENV}\" \ 198 wrapper.c -o ${wrapper} 167 199 chmod 755 ${wrapper} 200 201 BUILDENV="${OLD_BUILDENV}" 168 202 169 203 }
Note:
See TracChangeset
for help on using the changeset viewer.