1 | #!/bin/bash |
---|
2 | # |
---|
3 | # functions for cross-lfs binutils build |
---|
4 | # ----------------------------------------- |
---|
5 | # $LastChangedBy$ |
---|
6 | # $LastChangedDate$ |
---|
7 | # $LastChangedRevision$ |
---|
8 | # $HeadURL$ |
---|
9 | # |
---|
10 | |
---|
11 | check_binutils () { |
---|
12 | # This should be run immediately after unpack_tarballs for binutils |
---|
13 | # so PKGDIR is set to the right directory |
---|
14 | |
---|
15 | # Check if this version of binutils requires |
---|
16 | # 'make configure-host' |
---|
17 | echo -e "Checking Binutils features...\n${BRKLN}" |
---|
18 | grep configure-host ${SRC}/${PKGDIR}/Makefile.in > /dev/null 2>&1 && |
---|
19 | export BINUTILS_CONF_HOST=Y || |
---|
20 | export BINUTILS_CONF_HOST=N |
---|
21 | echo -e " o Requires 'make configure-host' ........... ${BINUTILS_CONF_HOST}" |
---|
22 | |
---|
23 | # Do we have --with-lib-path option to ld/configure |
---|
24 | grep with-lib-path ${SRC}/${PKGDIR}/ld/configure > /dev/null 2>&1 && |
---|
25 | export BINUTILS_WITH_LIB_PATH=Y || |
---|
26 | export BINUTILS_WITH_LIB_PATH=N |
---|
27 | echo -e " o Has '--with-lib-path=' configure option .. ${BINUTILS_WITH_LIB_PATH}\n" |
---|
28 | |
---|
29 | # Modify ld/Makefile.in if necessary |
---|
30 | grep "GENSCRIPTS = LIB_PATH" ${SRC}/${PKGDIR}/ld/Makefile.in \ |
---|
31 | > /dev/null 2>&1 || |
---|
32 | { |
---|
33 | echo " o adding 'LIB_PATH = \$(LIB_PATH)' to GENSCRIPTS definition" |
---|
34 | echo " in ld/Makefile.in" |
---|
35 | echo " ( Passes value of LIB_PATH to genscripts.sh environment" |
---|
36 | echo -e " for ldscript creation. )\n" |
---|
37 | |
---|
38 | test -f ${SRC}/${PKGDIR}/ld/Makefile.in-ORIG || |
---|
39 | cp ${SRC}/${PKGDIR}/ld/Makefile.in \ |
---|
40 | ${SRC}/${PKGDIR}/ld/Makefile.in-ORIG |
---|
41 | |
---|
42 | #TODO: fix this sed |
---|
43 | sed 's@^GENSCRIPTS = @GENSCRIPTS = LIB_PATH=\$\(LIB_PATH\) @g' \ |
---|
44 | ${SRC}/${PKGDIR}/ld/Makefile.in-ORIG \ |
---|
45 | > ${SRC}/${PKGDIR}/ld/Makefile.in |
---|
46 | } |
---|
47 | } |
---|
48 | |
---|
49 | # Export functions |
---|
50 | export -f check_binutils |
---|
51 | |
---|