diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-02 16:38:04 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-02 16:38:04 -0300 |
commit | 5641fb64b4719774f6c4ba4c1ec85fa5312c5ecf (patch) | |
tree | 3c6e29d5a9d1f0a067dcdf4cca5b5747721aee89 /BUILD | |
parent | aa4357f3944032ab95137d52342bc7673159fc64 (diff) | |
parent | 0eb26fdfa83d2ddd5f3dc3f8cf6e372a55b4c270 (diff) | |
download | mariadb-git-5641fb64b4719774f6c4ba4c1ec85fa5312c5ecf.tar.gz |
Merge of mysql-5.1-bugteam into mysql-trunk-merge.
Diffstat (limited to 'BUILD')
-rwxr-xr-x | BUILD/SETUP.sh | 13 | ||||
-rwxr-xr-x | BUILD/check-cpu | 117 |
2 files changed, 67 insertions, 63 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 626f932e045..08ae4de2e23 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -90,22 +90,19 @@ SSL_LIBRARY=--with-ssl if [ "x$warning_mode" != "xpedantic" ]; then # Both C and C++ warnings - warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W" - warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare" - warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable" + warnings="-Wall -Wextra -Wunused -Wwrite-strings" # For more warnings, uncomment the following line -# warnings="$global_warnings -Wshadow" +# warnings="$warnings -Wshadow" # C warnings - c_warnings="$warnings -Wunused-parameter" + c_warnings="$warnings" # C++ warnings - cxx_warnings="$warnings" + cxx_warnings="$warnings -Wno-unused-parameter" # cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo" - cxx_warnings="$cxx_warnings -Wreorder" cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor" # Added unless --with-debug=full - debug_extra_cflags="-O0 -g3 -gdwarf-2" #1 -Wuninitialized" + debug_extra_cflags="-O0 -g3 -gdwarf-2" else warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE" c_warnings="$warnings" diff --git a/BUILD/check-cpu b/BUILD/check-cpu index eb001ee61ae..f9f5d423f4f 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -187,69 +187,76 @@ check_cpu () { cc=$CC fi - if test "x$compiler" = "x" ; then - cc_ver=`$cc --version | sed 1q` - cc_verno=`echo $cc_ver | sed -e 's/^.*(GCC)//g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'` + if test "x$core2" = "xyes" ; then + cpu_arg="core2" + fi + + if test "x$compiler" != "x" ; then + return 0 + fi + + # check if compiler is gcc and dump its version + cc_verno=`$cc -dumpversion 2>/dev/null` + if test "x$?" = "x0" ; then set -- `echo $cc_verno | tr '.' ' '` + cc_ver="GCC" cc_major=$1 cc_minor=$2 cc_patch=$3 cc_comp=`expr $cc_major '*' 100 '+' $cc_minor` - - case "$cc_ver--$cc_verno" in - *GCC*) - # different gcc backends (and versions) have different CPU flags - case `gcc -dumpmachine` in - i?86-* | x86_64-*) - if test "$cc_comp" -lt 304 ; then - check_cpu_cflags="-mcpu=${cpu_arg}" - elif test "$cc_comp" -ge 402 ; then - check_cpu_cflags="-mtune=native" - else - check_cpu_cflags="-mtune=${cpu_arg}" - fi - ;; - ppc-*) - check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}" - ;; - *) - check_cpu_cflags="" - return - ;; - esac - ;; - 2.95.*) - # GCC 2.95 doesn't expose its name in --version output - check_cpu_cflags="-m${cpu_arg}" - ;; - *) - check_cpu_cflags="" - return - ;; - esac - # now we check whether the compiler really understands the cpu type - touch __test.c - - while [ "$cpu_arg" ] ; do - printf "testing $cpu_arg ... " >&2 - - # compile check - eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null - if test "x$?" = "x0" ; then - echo ok >&2 - break; - fi + fi - echo failed >&2 + case "$cc_ver--$cc_verno" in + *GCC*) + # different gcc backends (and versions) have different CPU flags + case `gcc -dumpmachine` in + i?86-* | x86_64-*) + if test "$cc_comp" -lt 304 ; then + check_cpu_cflags="-mcpu=${cpu_arg}" + elif test "$cc_comp" -ge 402 ; then + check_cpu_cflags="-mtune=native" + else + check_cpu_cflags="-mtune=${cpu_arg}" + fi + ;; + ppc-*) + check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}" + ;; + *) + check_cpu_cflags="" + return + ;; + esac + ;; + 2.95.*) + # GCC 2.95 doesn't expose its name in --version output + check_cpu_cflags="-m${cpu_arg}" + ;; + *) check_cpu_cflags="" + return + ;; + esac + + # now we check whether the compiler really understands the cpu type + touch __test.c + + while [ "$cpu_arg" ] ; do + printf "testing $cpu_arg ... " >&2 + + # compile check + eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null + if test "x$?" = "x0" ; then + echo ok >&2 break; - done - rm __test.* - fi - if test "x$core2" = "xyes" ; then - cpu_arg="core2" - fi + fi + + echo failed >&2 + check_cpu_cflags="" + break; + done + rm __test.* return 0 } - + check_cpu |