1 | #!/bin/bash |
---|
2 | |
---|
3 | # cross-lfs target m4 build |
---|
4 | # ------------------------- |
---|
5 | # $LastChangedBy$ |
---|
6 | # $LastChangedDate$ |
---|
7 | # $LastChangedRevision$ |
---|
8 | # $HeadURL$ |
---|
9 | # |
---|
10 | |
---|
11 | cd ${SRC} |
---|
12 | LOG=m4-target.log |
---|
13 | |
---|
14 | unpack_tarball m4-${M4_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="prefix=${INSTALL_PREFIX}" |
---|
24 | else |
---|
25 | BUILD_PREFIX="${TGT_TOOLS}" |
---|
26 | INSTALL_PREFIX="${TGT_TOOLS}" |
---|
27 | INSTALL_OPTIONS="" |
---|
28 | fi |
---|
29 | |
---|
30 | # NOTE: with gcc-3.4.0, linux-libc-headers-2.6.5.1 on |
---|
31 | # biarch x86_64-pc-linux-gnu the build barfed out with |
---|
32 | # errors in lib/regex.c due to conflicting types for |
---|
33 | # malloc. removed definitions of malloc/realloc and |
---|
34 | # made it so stlib.h always gets read. |
---|
35 | # |
---|
36 | # : same results with linux-libc-headers-2.6.6.0 with |
---|
37 | # gcc-3.4.1-20040620 on x86_64-pc-linux-gnu |
---|
38 | # |
---|
39 | # TODO: check if other architecturess are affected, and for what |
---|
40 | # glibc/gcc/m4 versions. |
---|
41 | # |
---|
42 | # : same issue w powerpc... |
---|
43 | # |
---|
44 | # Get a better fix for this.... |
---|
45 | case ${TGT_ARCH} in |
---|
46 | x86_64 | ppc | powerpc | powerpc64 ) |
---|
47 | apply_patch m4-1.4-regex_c-hack |
---|
48 | ;; |
---|
49 | esac |
---|
50 | |
---|
51 | max_log_init M4 ${M4_VER} "target (shared)" ${CONFLOGS} ${LOG} |
---|
52 | CC="${TARGET}-gcc ${ARCH_CFLAGS}" AR="${TARGET}-ar" RANLIB="${TARGET}-ranlib" \ |
---|
53 | CFLAGS="-O2 -pipe ${TGT_CFLAGS}" ./configure --prefix=${BUILD_PREFIX} \ |
---|
54 | --host=${TARGET} \ |
---|
55 | >> ${LOGFILE} 2>&1 && |
---|
56 | echo " o Configure OK" && |
---|
57 | |
---|
58 | min_log_init ${BUILDLOGS} && |
---|
59 | make LDFLAGS="-s" \ |
---|
60 | >> ${LOGFILE} 2>&1 && |
---|
61 | echo " o Build OK" && |
---|
62 | |
---|
63 | min_log_init ${INSTLOGS} && |
---|
64 | make ${INSTALL_OPTIONS} install \ |
---|
65 | >> ${LOGFILE} 2>&1 && |
---|
66 | echo " o ALL OK" || barf |
---|
67 | |
---|