文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Check gcc and its version

Check gcc and its version

时间:2009-08-13  来源:creatory

#!/bin/bash
#
#this script is used to check gcc on your os
#it will be called by another script and action according to its return value
#
printf "Beging to check gcc...\n"
case $CC in
    *gcc*)
        ;;
    *)
        printf "Not found.\n"
        exit 0
        ;;
esac

if ( $CC -dumpversion > /dev/null 2>&1 );then
    GCC_VERSION=`$CC -dumpversion`
elif( $CC --version > /dev/null 2>&1 );then
    GCC_VERSION=`$CC --version`
else
    GCC_VERSION=unknown
fi
printf "${GCC_VERSION}\n"

case $GCC_VERSION in
    unknown|2.*)
        printf "$GCC version too old.\n"
        printf "To perform the compilation,we need gcc>=3.x.x!\n"
        printf "Or you can run \"make NO_GCC_CHECK=1\" to ignore it.\n"
        exit 1
        ;;
    *)
        printf "OK(`basename $CC` version:$GCC_VERSION)\n"
        exit 0;
        ;;
esac
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载