Commit 22536fc5 authored by aelkin/andrei@mysql1000.(none)'s avatar aelkin/andrei@mysql1000.(none)
Browse files

Merge mysql1000.(none):/home/andrei/MySQL/BARE/mysql-5.1

into  mysql1000.(none):/home/andrei/MySQL/MERGE/5.1-main2rpl
parents c4813ae3 963f86f8
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -100,8 +100,10 @@ if [ "x$warning_mode" != "xpedantic" ]; then
# C warnings
  c_warnings="$warnings -Wunused-parameter"
# C++ warnings
  cxx_warnings="$warnings -Woverloaded-virtual -Wsign-promo -Wreorder"
  cxx_warnings="$warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
  cxx_warnings="$warnings"
# 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="-O1 -Wuninitialized"
else

BUILD/build_mccge.sh

0 → 100755
+1516 −0

File added.

Preview size limit exceeded, changes collapsed.

+63 −82
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@
#
# Check cpu of current machine and find the
# best compiler optimization flags for gcc
# Will return result in:
# cpu_arg        : Type of CPU
# check_cpu_args : Arguments for GCC compiler settings
#

check_cpu () {
@@ -62,36 +65,41 @@ check_cpu () {
    Alpha*EV6*)
      cpu_arg="ev6";
      ;;

    # Intel ia32
    *Intel*Core*|*X[eE][oO][nN]*)
      # a Xeon is just another pentium4 ...
      # ... unless it has the "lm" (long-mode) flag set, 
      # in that case it's a Xeon with EM64T support
      # If SSE3 support exists it is a Core2 Duo or newer
      # So is Intel Core.
      if [ -z "$cpu_flag_lm" ]; then
        cpu_arg="pentium4";
        cpu_arg="pentium4"
      else
        cpu_arg="nocona"
      fi
      if test -z "$cpu_flag_ssse3" ; then
        core2="no"
      else
        cpu_arg="nocona";
        core2="yes"
      fi
      ;;
    *Pentium*4*Mobile*)
      cpu_arg="pentium4m";
      cpu_arg="pentium4m"
      ;;
    *Pentium*4*)
      cpu_arg="pentium4";
      cpu_arg="pentium4"
      ;;
    *Pentium*III*Mobile*)
      cpu_arg="pentium3m";
      cpu_arg="pentium3m"
      ;;
    *Pentium*III*)
      cpu_arg="pentium3";
      cpu_arg="pentium3"
      ;;
    *Pentium*M*pro*)
      cpu_arg="pentium-m";
      cpu_arg="pentium-m"
    ;;
    *Celeron\(R\)*\ M*)
      cpu_arg="pentium-m";
      cpu_arg="pentium-m"
      ;;
    *Celeron*Coppermine*)
      cpu_arg="pentium3"
@@ -100,54 +108,52 @@ check_cpu () {
      cpu_arg="pentium4"
      ;;
    *Celeron*)
      cpu_arg="pentium2";
    ;;
    *Athlon*64*)
      cpu_arg="athlon64";
      cpu_arg="pentium2"
      ;;
    *Turion*)
      cpu_arg="athlon64";
      cpu_arg="athlon64"
      ;;
    *Opteron*)
      cpu_arg="athlon64";
    *Athlon*64*)
      cpu_arg="athlon64"
      ;;
    *Athlon*)
      cpu_arg="athlon";
      cpu_arg="athlon"
      ;;
    *Opteron*)
      cpu_arg="opteron";
      cpu_arg="opteron"
      ;;
    # MacOSX / Intel  
    *i386*i486*)
      cpu_arg="pentium-m";
      cpu_arg="pentium-m"
      ;;
    *i386*)
      cpu_arg="i386"
      ;;
    #Core 2 Duo  
    *Intel*Core\(TM\)2*)
      cpu_arg="nocona";
      cpu_arg="nocona"
      ;;

    # Intel ia64
    *Itanium*)
      # Don't need to set any flags for itanium(at the moment)
      cpu_arg="";
      cpu_arg="itanium"
      ;;

    #
    # Solaris Sparc
    *sparc*sun4u*)
      cpu_arg="sparc"
      ;;
    # Power PC
    *ppc*)
      cpu_arg='powerpc'
      cpu_arg="powerpc"
      ;;
   
    *powerpc*)
      cpu_arg='powerpc'
      cpu_arg="powerpc"
      ;;

    # unknown
    *)
      cpu_arg="";
      cpu_arg=""
      ;;
  esac


  if test -z "$cpu_arg" ; then
    if test "$CPUINFO" != " " ; then
      # fallback to uname if necessary
@@ -181,24 +187,17 @@ check_cpu () {
    *GCC*)
        # different gcc backends (and versions) have different CPU flags
        case `gcc -dumpmachine` in
          i?86-*)
	    if test "$cc_comp" -lt 304
            then
                            check_cpu_args='-mcpu=$cpu_arg'
          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_args='-mtune=$cpu_arg'
              check_cpu_cflags="-mtune=${cpu_arg}"
            fi
            ;;
          ppc-*)
                    check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg'
            ;;
          x86_64-*)
	    if test "$cc_comp" -lt 304
            then
                            check_cpu_args='-mcpu=$cpu_arg'
            else
                            check_cpu_args='-mtune=$cpu_arg'
            fi
              check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}"
            ;;
          *)
            check_cpu_cflags=""
@@ -208,7 +207,7 @@ check_cpu () {
      ;;
    2.95.*)
      # GCC 2.95 doesn't expose its name in --version output
      check_cpu_args='-m$cpu_arg'
      check_cpu_cflags="-m${cpu_arg}"
      ;;
    *)
      check_cpu_cflags=""
@@ -219,41 +218,23 @@ check_cpu () {
  # now we check whether the compiler really understands the cpu type
  touch __test.c

  if test "x$core2" = "xyes" ; then
    cpu_arg="core2"
  fi
  while [ "$cpu_arg" ] ; do
    printf "testing $cpu_arg ... " >&2
          
    # compile check
    check_cpu_cflags=`eval echo $check_cpu_args`
    if $cc -c $check_cpu_cflags __test.c 2>/dev/null; then
    eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null
    if test "x$?" = "x0" ; then
      echo ok >&2
      break;
    fi

    echo failed >&2
    check_cpu_cflags=""

    # if compile failed: check whether it supports a predecessor of this CPU
    # this list is not complete, feel free to add further entries
    case "$cpu_arg" in
      # Intel ia32
      nocona)     cpu_arg=pentium4    ;; 
      prescott)   cpu_arg=pentium4    ;;
      pentium4m)  cpu_arg=pentium4    ;;
      pentium4)   cpu_arg=pentium3    ;;
      pentium3m)  cpu_arg=pentium3    ;;
      pentium3)   cpu_arg=pentium2    ;;
      pentium2)   cpu_arg=pentiumpro  ;;
      pentiumpro) cpu_arg=pentium     ;;
      pentium)    cpu_arg=i486        ;;
      i486)       cpu_arg=i386        ;;

      # power / powerPC
      7450)       cpu_arg=7400        ;;

      *)          cpu_arg=""          ;;
    esac
    break;
  done

  rm __test.*
}
 
+12 −0
Original line number Diff line number Diff line
@@ -104,6 +104,10 @@ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDBUG_OFF")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")

#TODO: update the code and remove the disabled warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805")

IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
    SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996")
    SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996")
@@ -153,6 +157,14 @@ IF(WIN32)
  ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
ENDIF(WIN32)

# This definition is necessary to work around a bug with Intellisense described
# here: http://tinyurl.com/2cb428.  Syntax highlighting is important for proper
# debugger functionality.
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
    MESSAGE(STATUS "Detected 64-bit platform.")
    ADD_DEFINITIONS("-D_WIN64")
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 8)

IF(EMBED_MANIFESTS)
    # Search for the tools (mt, makecat, signtool) necessary for embedding
    # manifests and signing executables with the MySQL AB authenticode cert.
+1 −0
Original line number Diff line number Diff line
@@ -1126,6 +1126,7 @@ int main(int argc,char *argv[])
  if (mysql_server_init(embedded_server_arg_count, embedded_server_args, 
                        (char**) embedded_server_groups))
  {
    put_error(NULL);
    free_defaults(defaults_argv);
    my_end(0);
    exit(1);
Loading