1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # cross-lfs target flex build
|
---|
4 | # ---------------------------
|
---|
5 | # $LastChangedBy$
|
---|
6 | # $LastChangedDate$
|
---|
7 | # $LastChangedRevision$
|
---|
8 | # $HeadURL$
|
---|
9 | #
|
---|
10 |
|
---|
11 | cd ${SRC}
|
---|
12 | LOG=flex-target.build
|
---|
13 |
|
---|
14 | unpack_tarball flex-${FLEX_VER} &&
|
---|
15 | cd ${PKGDIR}
|
---|
16 |
|
---|
17 | #if we are building multi-arch, only build for the default env
|
---|
18 | set_libdirname
|
---|
19 | setup_multiarch
|
---|
20 |
|
---|
21 | if [ "${USE_SYSROOT}" = "Y" ]; then
|
---|
22 | BUILD_PREFIX=/usr
|
---|
23 | INSTALL_PREFIX="${LFS}${BUILD_PREFIX}"
|
---|
24 | INSTALL_OPTIONS="DESTDIR=${LFS}"
|
---|
25 | else
|
---|
26 | BUILD_PREFIX=${TGT_TOOLS}
|
---|
27 | INSTALL_PREFIX="${TGT_TOOLS}"
|
---|
28 | INSTALL_OPTIONS=""
|
---|
29 | fi
|
---|
30 |
|
---|
31 | if [ ! "${LIBDIRNAME}" = "lib" ]; then
|
---|
32 | extra_conf="--libdir=${BUILD_PREFIX}/${libdirname}"
|
---|
33 | fi
|
---|
34 |
|
---|
35 | case ${FLEX_VER} in
|
---|
36 | 2.5.31 )
|
---|
37 | # Fix brokenness in flex-2.5.31
|
---|
38 | apply_patch flex-2.5.31-debian_fixes-2
|
---|
39 | # do not regen doc (triggered by above patch)
|
---|
40 | touch ./doc/flex.1
|
---|
41 | ;;
|
---|
42 | esac
|
---|
43 |
|
---|
44 | max_log_init Flex ${FLEX_VER} "target (shared)" ${CONFLOGS} ${LOG}
|
---|
45 | CC="${TARGET}-gcc ${ARCH_CFLAGS}" \
|
---|
46 | CFLAGS="-O2 -pipe ${TGT_CFLAGS}" \
|
---|
47 | ./configure --prefix=${BUILD_PREFIX} \
|
---|
48 | --host=${TARGET} ${extra_conf} \
|
---|
49 | --disable-nls \
|
---|
50 | >> ${LOGFILE} 2>&1 &&
|
---|
51 | echo " o Configure OK" &&
|
---|
52 |
|
---|
53 | min_log_init ${BUILDLOGS} &&
|
---|
54 | #make ${PMFLAGS} LDFLAGS="-s" \
|
---|
55 | make ${PMFLAGS} LDFLAGS="-s" \
|
---|
56 | >> ${LOGFILE} 2>&1 &&
|
---|
57 | echo " o Build OK" &&
|
---|
58 |
|
---|
59 | min_log_init ${INSTLOGS} &&
|
---|
60 | make ${INSTALL_OPTIONS} install \
|
---|
61 | >> ${LOGFILE} 2>&1 &&
|
---|
62 | echo " o ALL OK" || barf
|
---|
63 |
|
---|
64 | # Create lex wrapper
|
---|
65 | cat > ${INSTALL_PREFIX}/bin/lex << "EOF"
|
---|
66 | #!/bin/sh
|
---|
67 | # Begin ${BUILD_PREFIX}/bin/lex
|
---|
68 |
|
---|
69 | exec ${BUILD_PREFIX}/bin/flex -l "$@"
|
---|
70 |
|
---|
71 | # End ${BUILD_PREFIX}/bin/lex
|
---|
72 | EOF
|
---|
73 |
|
---|
74 | chmod 755 ${INSTALL_PREFIX}/bin/lex
|
---|
75 |
|
---|