Changes in tools/toolchain.sh [3f7efa79:71e3289] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/toolchain.sh

    r3f7efa79 r71e3289  
    2828# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929#
    30 
    31 GMP_MAIN=<<EOF
    32 #define GCC_GMP_VERSION_NUM(a, b, c) \
    33         (((a) << 16L) | ((b) << 8) | (c))
    34 
    35 #define GCC_GMP_VERSION \
    36         GCC_GMP_VERSION_NUM(__GNU_MP_VERSION, __GNU_MP_VERSION_MINOR, __GNU_MP_VERSION_PATCHLEVEL)
    37 
    38 #if GCC_GMP_VERSION < GCC_GMP_VERSION_NUM(4,3,2)
    39         choke me
    40 #endif
    41 EOF
    42 
    43 MPFR_MAIN=<<EOF
    44 #if MPFR_VERSION < MPFR_VERSION_NUM(2, 4, 2)
    45 choke me
    46         #endif
    47 EOF
    48 
    49 MPC_MAIN=<<EOF
    50 #if MPC_VERSION < MPC_VERSION_NUM(0, 8, 1)
    51         choke me
    52 #endif
    53 EOF
    54 
    55 #
    56 # Check if the library described in the argument
    57 # exists and has acceptable version.
    58 #
    59 check_dependency() {
    60         DEPENDENCY="$1"
    61         HEADER="$2"
    62         BODY="$3"
    63        
    64         FNAME="/tmp/conftest-$$"
    65        
    66         echo "#include ${HEADER}" > "${FNAME}.c"
    67         echo >> "${FNAME}.c"
    68         echo "int main()" >> "${FNAME}.c"
    69         echo "{" >> "${FNAME}.c"
    70         echo "${BODY}" >> "${FNAME}.c"
    71         echo "  return 0;" >> "${FNAME}.c"
    72         echo "}" >> "${FNAME}.c"
    73        
    74         cc -c -o "${FNAME}.o" "${FNAME}.c" 2> "${FNAME}.log"
    75         RC="$?"
    76        
    77         if [ "$RC" -ne "0" ] ; then
    78                 echo " ${DEPENDENCY} not found, too old or compiler error."
    79                 echo " Please recheck manually the source file \"${FNAME}.c\"."
    80                 echo " The compilation of the toolchain is probably going to fail,"
    81                 echo " you have been warned."
    82                 echo
    83                 echo " ===== Compiler output ====="
    84                 cat "${FNAME}.log"
    85                 echo " ==========================="
    86                 echo
    87         else
    88                 echo " ${DEPENDENCY} found"
    89                 rm -f "${FNAME}.log" "${FNAME}.o" "${FNAME}.c"
    90         fi
    91 }
    92 
    93 check_dependecies() {
    94         echo ">>> Basic dependency check"
    95         check_dependency "GMP" "<gmp.h>" "${GMP_MAIN}"
    96         check_dependency "MPFR" "<mpfr.h>" "${MPFR_MAIN}"
    97         check_dependency "MPC" "<mpc.h>" "${MPC_MAIN}"
    98         echo
    99 }
    10030
    10131check_error() {
     
    13969        echo " sparc64    SPARC V9"
    14070        echo " all        build all targets"
    141         echo
    142         echo "The toolchain will be installed to the directory specified by"
    143         echo "the CROSS_PREFIX environment variable. If the variable is not"
    144         echo "defined, /usr/local will be used by default."
    14571        echo
    14672       
     
    192118        echo " - native C library with headers"
    193119        echo
     120       
     121        show_countdown 10
    194122}
    195123
     
    353281
    354282show_dependencies
    355 check_dependecies
    356 show_countdown 10
    357283
    358284case "$1" in
Note: See TracChangeset for help on using the changeset viewer.