1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # cross-lfs target iproute2 build
|
---|
4 | # -------------------------------
|
---|
5 | # $LastChangedBy$
|
---|
6 | # $LastChangedDate$
|
---|
7 | # $LastChangedRevision$
|
---|
8 | # $HeadURL$
|
---|
9 | #
|
---|
10 |
|
---|
11 | cd ${SRC}
|
---|
12 | LOG=iproute2-target.log
|
---|
13 | set_libdirname
|
---|
14 | setup_multiarch
|
---|
15 |
|
---|
16 | unpack_tarball iproute2-${IPROUTE2_VER}
|
---|
17 | cd ${PKGDIR}
|
---|
18 |
|
---|
19 | if [ "${USE_SYSROOT}" = "Y" ]; then
|
---|
20 | BUILD_BASEDIR=""
|
---|
21 | BUILD_PREFIX="/usr"
|
---|
22 | INSTALL_PREFIX="${LFS}${BUILD_PREFIX}"
|
---|
23 | INSTALL_OPTIONS="DESTDIR=${LFS}"
|
---|
24 | else
|
---|
25 | BUILD_BASEDIR=${TGT_TOOLS}
|
---|
26 | BUILD_PREFIX=${TGT_TOOLS}
|
---|
27 | INSTALL_PREFIX=${TGT_TOOLS}
|
---|
28 | INSTALL_OPTIONS=""
|
---|
29 | fi
|
---|
30 |
|
---|
31 | test -f tc/Makefile-ORIG || cp -p tc/Makefile tc/Makefile-ORIG
|
---|
32 | chmod 666 tc/Makefile
|
---|
33 | sed -e "s@/usr/lib@${BUILD_PREFIX}/${libdirname}@g" \
|
---|
34 | -e 's@\(install[-a-zA-Z0-9 ]*\)-s@\1@g' \
|
---|
35 | tc/Makefile-ORIG > tc/Makefile
|
---|
36 |
|
---|
37 | test -f misc/Makefile-ORIG || cp -p misc/Makefile misc/Makefile-ORIG
|
---|
38 | chmod 666 misc/Makefile
|
---|
39 | sed -e '/^TARGETS/s@arpd@@g' \
|
---|
40 | -e 's@\(install[-a-zA-Z0-9 ]*\)-s@\1@g' \
|
---|
41 | misc/Makefile-ORIG > misc/Makefile
|
---|
42 |
|
---|
43 | max_log_init iproute2 ${IPROUTE2_VER} "target (shared)" ${CONFLOGS} ${LOG}
|
---|
44 | ./configure ${INSTALL_PREFIX}/include \
|
---|
45 | >> ${LOGFILE} 2>&1 &&
|
---|
46 | echo " o Configure OK" &&
|
---|
47 |
|
---|
48 | min_log_init ${BUILDLOGS} &&
|
---|
49 | make CC="${TARGET}-gcc ${ARCH_CFLAGS} ${TGT_CFLAGS}" \
|
---|
50 | AR="${TARGET}-ar" \
|
---|
51 | SBINDIR="${BUILD_BASEDIR}/sbin" \
|
---|
52 | CONFDIR="${BUILD_BASEDIR}/etc/iproute2" \
|
---|
53 | DOCDIR="${BUILD_PREFIX}/share/doc/iproute2" \
|
---|
54 | KERNEL_INCLUDE="${BUILD_PREFIX}/include" \
|
---|
55 | >> ${LOGFILE} 2>&1 &&
|
---|
56 | echo " o Build OK" &&
|
---|
57 |
|
---|
58 | min_log_init ${INSTLOGS} &&
|
---|
59 | su -c "make CC=\"${TARGET}-gcc ${ARCH_CFLAGS}\" \
|
---|
60 | AR=\"${TARGET}-ar\" \
|
---|
61 | SBINDIR=\"${BUILD_BASEDIR}/sbin\" \
|
---|
62 | CONFDIR=\"${BUILD_BASEDIR}/etc/iproute2\" \
|
---|
63 | DOCDIR=\"${BUILD_PREFIX}/share/doc/iproute2\" \
|
---|
64 | KERNEL_INCLUDE=\"${BUILD_PREFIX}/include\" \
|
---|
65 | ${INSTALL_OPTIONS} install" \
|
---|
66 | >> ${LOGFILE} 2>&1 &&
|
---|
67 | echo " o ALL OK" || barf
|
---|
68 |
|
---|
69 | if [ ! "${USE_SYSROOT}" = "Y" ]; then
|
---|
70 | # for LFS bootscripts
|
---|
71 | if [ ! -d ${LFS}/sbin ]; then mkdir -p ${LFS}/sbin ; fi
|
---|
72 | ln -sf ..${TGT_TOOLS}/sbin/ip ${LFS}/sbin
|
---|
73 | fi
|
---|
74 |
|
---|