1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # cross-lfs native perl build
|
---|
4 | # ---------------------------
|
---|
5 | # $LastChangedBy$
|
---|
6 | # $LastChangedDate$
|
---|
7 | # $LastChangedRevision$
|
---|
8 | # $HeadURL$
|
---|
9 | #
|
---|
10 |
|
---|
11 | cd ${SRC}
|
---|
12 | LOG=perl-native.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}" = "native-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 | if [ ! "${libdirname}" = "lib" ]; then
|
---|
29 | # We need to adjust Configure so that it understands
|
---|
30 | # installstyle=lib64/perl5 and sets up directory paths accordingly
|
---|
31 | # NOTE: may need to check how this affects vendor libs...
|
---|
32 | if [ ! -f Configure-ORIG ]; then cp Configure Configure-ORIG ;fi
|
---|
33 | sed "/\*lib\/perl5\*).*/{
|
---|
34 | h
|
---|
35 | s/\([^a-zA-Z]\)lib/\1${libdirname}/g
|
---|
36 | x
|
---|
37 | G }" Configure-ORIG > Configure
|
---|
38 |
|
---|
39 | # edit linux.sh
|
---|
40 | if [ ! -f hints/linux.sh-ORIG ]; then
|
---|
41 | cp hints/linux.sh hints/linux.sh-ORIG
|
---|
42 | fi
|
---|
43 | sed -e "s@/lib/libc.so.6@/${libdirname}/libc.so.6@g" \
|
---|
44 | -e "s@libc=/lib/\$libc@libc=/${libdirname}/\$libc@g" \
|
---|
45 | hints/linux.sh-ORIG > hints/linux.sh
|
---|
46 |
|
---|
47 | # Now that installstyle can handle lib64, specify our
|
---|
48 | # our installstyle in linux.sh
|
---|
49 | echo "installstyle=\"${libdirname}/perl5\"" >> hints/linux.sh
|
---|
50 | # override standard glibpth
|
---|
51 | echo "glibpth=\"/${libdirname} /usr/${libdirname}\"" >> hints/linux.sh
|
---|
52 | fi
|
---|
53 |
|
---|
54 | # override loclibpth
|
---|
55 | # NOTE: by rights during this stage of the build there shouldn't be
|
---|
56 | # any libs in the local lib paths
|
---|
57 | # (ie /usr/local/lib{,64} , /opt/local/lib{,64})
|
---|
58 | # so we just clear this (as we do ch5).
|
---|
59 | #
|
---|
60 | # Other option is to set
|
---|
61 | # loclibpth=\"/usr/local/${libdir} /opt/local/${libdir}\"
|
---|
62 | # (and optionally /usr/gnu/${libdir})
|
---|
63 | #
|
---|
64 | echo "loclibpth=\"\"" >> hints/linux.sh
|
---|
65 | cd ${SRC}/${PKGDIR}
|
---|
66 |
|
---|
67 | # if not creating a shared libperl (ie useshrplib not true), still use pic
|
---|
68 | sed -i -e "s@pldlflags=''@pldlflags=\"\$cccdlflags\"@g" \
|
---|
69 | -e "s@static_target='static'@static_target='static_pic'@g" \
|
---|
70 | Makefile.SH
|
---|
71 |
|
---|
72 | max_log_init Perl ${PERL_VER} "native (shared)" ${CONFLOGS} ${LOG}
|
---|
73 | CC="${CC-gcc} ${ARCH_CFLAGS}" \
|
---|
74 | ./configure.gnu --prefix=/usr \
|
---|
75 | -Doptimize="-O2 -pipe ${TGT_CFLAGS}" \
|
---|
76 | -Dman1dir='/usr/share/man/perl/man1' \
|
---|
77 | -Dman3dir='/usr/share/man/perl/man3' \
|
---|
78 | -Dcccdlflags='-fPIC' \
|
---|
79 | >> ${LOGFILE} 2>&1 &&
|
---|
80 | echo " o Configure OK" || barf
|
---|
81 |
|
---|
82 | min_log_init ${BUILDLOGS} &&
|
---|
83 | make LDFLAGS="-s" \
|
---|
84 | >> ${LOGFILE} 2>&1 &&
|
---|
85 | echo " o Build OK" || barf
|
---|
86 |
|
---|
87 | min_log_init ${INSTLOGS} &&
|
---|
88 | make install \
|
---|
89 | >> ${LOGFILE} 2>&1 &&
|
---|
90 | echo " o Install OK" || barf
|
---|
91 |
|
---|
92 | if [ "Y" = "${MULTIARCH}" ]; then
|
---|
93 | use_wrapper /usr/bin/{perl,perl${PERL_VER}}
|
---|
94 | fi
|
---|