1 | #!/bin/bash |
---|
2 | |
---|
3 | # cross-lfs target gawk build |
---|
4 | # --------------------------- |
---|
5 | # $LastChangedBy$ |
---|
6 | # $LastChangedDate$ |
---|
7 | # $LastChangedRevision$ |
---|
8 | # $HeadURL$ |
---|
9 | # |
---|
10 | |
---|
11 | cd ${SRC} |
---|
12 | LOG=gawk-cross.log |
---|
13 | |
---|
14 | unpack_tarball gawk-${GAWK_VER} && |
---|
15 | cd ${PKGDIR} |
---|
16 | |
---|
17 | set_libdirname |
---|
18 | setup_multiarch |
---|
19 | |
---|
20 | if [ "${USE_SYSROOT}" = "Y" ]; then |
---|
21 | BUILD_PREFIX=/usr |
---|
22 | INSTALL_PREFIX="${LFS}${BUILD_PREFIX}" |
---|
23 | INSTALL_OPTIONS="DESTDIR=${LFS}" |
---|
24 | else |
---|
25 | BUILD_PREFIX=${TGT_TOOLS} |
---|
26 | INSTALL_PREFIX="${TGT_TOOLS}" |
---|
27 | INSTALL_OPTIONS="" |
---|
28 | fi |
---|
29 | |
---|
30 | # if target is same as build host, adjust build slightly to avoid running |
---|
31 | # configure checks which we cannot run |
---|
32 | if [ "${TARGET}" = "${BUILD}" ]; then |
---|
33 | BUILD=`echo ${BUILD} | sed 's@\([_a-zA-Z0-9]*\)\(-[_a-zA-Z0-9]*\)\(.*\)@\1\2x\3@'` |
---|
34 | fi |
---|
35 | |
---|
36 | # gawk is braindead for setting version information |
---|
37 | # during install while cross compiling, here we will use |
---|
38 | # gawk-$(PACKAGE_VERSION) instead of trying to run gawk --version |
---|
39 | # (which cant be done when cross compiling, derr) to get version info |
---|
40 | test -f Makefile.in-ORIG || |
---|
41 | cp -p Makefile.in Makefile.in-ORIG |
---|
42 | sed 's@\(fullname=gawk-\).*\(;.*\)@\1\$(PACKAGE_VERSION) \2@g' \ |
---|
43 | Makefile.in-ORIG > Makefile.in |
---|
44 | |
---|
45 | max_log_init Gawk ${GAWK_VER} "initial (shared)" ${CONFLOGS} ${LOG} |
---|
46 | CC="${TARGET}-gcc ${ARCH_CFLAGS}" \ |
---|
47 | CFLAGS="-O2 -pipe ${TGT_CFLAGS}" \ |
---|
48 | ./configure --prefix=${BUILD_PREFIX} \ |
---|
49 | --build=${BUILD} --host=${TARGET} \ |
---|
50 | >> ${LOGFILE} 2>&1 && |
---|
51 | echo " o Configure OK" && |
---|
52 | |
---|
53 | min_log_init ${BUILDLOGS} && |
---|
54 | make ${PMFLAGS} LDFLAGS="-s" \ |
---|
55 | >> ${LOGFILE} 2>&1 && |
---|
56 | echo " o Build OK" && |
---|
57 | |
---|
58 | min_log_init ${INSTLOGS} && |
---|
59 | make ${INSTALL_OPTIONS} install \ |
---|
60 | >> ${LOGFILE} 2>&1 && |
---|
61 | echo " o ALL OK" || barf |
---|
62 | |
---|