1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # cross-lfs temporary perl build (for running testsuites)
|
---|
4 | # -------------------------------------------------------
|
---|
5 | # $LastChangedBy$
|
---|
6 | # $LastChangedDate$
|
---|
7 | # $LastChangedRevision$
|
---|
8 | # $HeadURL$
|
---|
9 | #
|
---|
10 |
|
---|
11 | cd ${SRC}
|
---|
12 | LOG=perl-temp.log
|
---|
13 |
|
---|
14 | # Test if the 64 script has been called.
|
---|
15 | # This should only really get called during bi-arch builds
|
---|
16 | SELF=`basename ${0}`
|
---|
17 | set_buildenv
|
---|
18 | set_libdirname
|
---|
19 | setup_multiarch
|
---|
20 |
|
---|
21 | test "${SELF}" = "temp-perl-64.sh" && LIB64=Y
|
---|
22 |
|
---|
23 | unpack_tarball perl-${PERL_VER} &&
|
---|
24 | cd ${PKGDIR}
|
---|
25 |
|
---|
26 | chmod u+w hints/linux.sh # For those not running as a root user
|
---|
27 |
|
---|
28 | #--------------------------------------------------------------------
|
---|
29 | # edit linux.sh
|
---|
30 | #--------------------------------------------------------------------
|
---|
31 | if [ ! -f hints/linux.sh-ORIG ]; then
|
---|
32 | cp hints/linux.sh hints/linux.sh-ORIG
|
---|
33 | fi
|
---|
34 |
|
---|
35 | sed -e "s@/lib/libc.so.6@${TGT_TOOLS}/${libdirname}/libc.so.6@g" \
|
---|
36 | -e "s@libc=/lib/\$libc@libc=${TGT_TOOLS}/${libdirname}/\$libc@g" \
|
---|
37 | hints/linux.sh-ORIG > hints/linux.sh
|
---|
38 |
|
---|
39 | # adjust Configure and append to linux.sh if not installing to */lib
|
---|
40 | #--------------------------------------------------------------------
|
---|
41 | if [ ! "${libdirname}" = "lib" ]; then
|
---|
42 | # We need to adjust Configure so that it understands
|
---|
43 | # installstyle=lib64/perl5 and sets up directory paths accordingly
|
---|
44 | # NOTE: may need to check how this affects vendor libs...
|
---|
45 | if [ ! -f Configure-ORIG ]; then cp Configure Configure-ORIG ;fi
|
---|
46 | sed "/\*lib\/perl5\*).*/{
|
---|
47 | h
|
---|
48 | s/\([^a-zA-Z]\)lib/\1${libdirname}/g
|
---|
49 | x
|
---|
50 | G }" Configure-ORIG > Configure
|
---|
51 |
|
---|
52 | # Now that installstyle can handle lib64, specify our
|
---|
53 | # our installstyle in linux.sh
|
---|
54 | echo "installstyle=\"${libdirname}/perl5\"" >> hints/linux.sh
|
---|
55 | fi
|
---|
56 |
|
---|
57 | echo "locincpth=\"\"
|
---|
58 | loclibpth=\"\"
|
---|
59 | glibpth=\"${TGT_TOOLS}/${libdirname}\"
|
---|
60 | static_ext=\"IO re Fcntl\"" >> hints/linux.sh
|
---|
61 | #--------------------------------------------------------------------
|
---|
62 |
|
---|
63 | cd ${SRC}/${PKGDIR}
|
---|
64 |
|
---|
65 | max_log_init Perl ${PERL_VER} "temp (shared)" ${CONFLOGS} ${LOG}
|
---|
66 | CC="${CC-gcc} ${ARCH_CFLAGS}" \
|
---|
67 | ./configure.gnu --prefix=${TGT_TOOLS} \
|
---|
68 | -Doptimize="-O2 -pipe ${TGT_CFLAGS}" \
|
---|
69 | >> ${LOGFILE} 2>&1 &&
|
---|
70 |
|
---|
71 | min_log_init ${BUILDLOGS} &&
|
---|
72 | make perl \
|
---|
73 | >> ${LOGFILE} 2>&1 &&
|
---|
74 | echo -e "${BRKLN}\n" >> ${LOGFILE} &&
|
---|
75 | make utilities \
|
---|
76 | >> ${LOGFILE} 2>&1 &&
|
---|
77 |
|
---|
78 | min_log_init ${INSTLOGS} &&
|
---|
79 | {
|
---|
80 | cp perl ${TGT_TOOLS}/bin/perl &&
|
---|
81 | cp pod/pod2man ${TGT_TOOLS}/bin &&
|
---|
82 | mkdir -p ${TGT_TOOLS}/${libdirname}/perl5/${PERL_VER} &&
|
---|
83 | cp -R lib/* ${TGT_TOOLS}/${libdirname}/perl5/${PERL_VER}
|
---|
84 | } >> ${LOGFILE} 2>&1 &&
|
---|
85 | echo " o ALL OK" || barf
|
---|
86 |
|
---|