#!/bin/sh if test ! -f sql/mysqld.cc then echo "You must run this script from the MySQL top-level directory" exit 1 fi prefix_configs="--prefix=/usr/local/mysql" just_print= just_configure= full_debug= if test -n "$MYSQL_BUILD_PREFIX" then prefix_configs="--prefix=$MYSQL_BUILD_PREFIX" fi while test $# -gt 0 do case "$1" in --prefix=* ) prefix_configs="$1"; shift ;; --with-debug=full ) full_debug="=full"; shift ;; -c | --just-configure ) just_configure=1; shift ;; -n | --just-print | --print ) just_print=1; shift ;; -h | --help ) cat < /dev/null 2>&1 then make=gmake else make=make fi if test -z "$CC" ; then CC=gcc fi if test -z "$CXX" ; then CXX=gcc fi # If ccache (a compiler cache which reduces build time) # (http://samba.org/ccache) is installed, use it. # We use 'grep' and hope 'grep' will work as expected # (returns 0 if finds lines) if ccache -V > /dev/null 2>&1 then echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC" echo "$CXX" | grep "ccache" > /dev/null || CXX="ccache $CXX" fi # gcov # The -fprofile-arcs and -ftest-coverage options cause GCC to instrument the # code with profiling information used by gcov. # The -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl. # The -DHAVE_gcov enables code to write out coverage info even when crashing. gcov_compile_flags="-fprofile-arcs -ftest-coverage" gcov_compile_flags="$gcov_compile_flags -DDISABLE_TAO_ASM" gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov" # GCC4 needs -fprofile-arcs -ftest-coverage on the linker command line (as well # as on the compiler command line), and this requires setting LDFLAGS for BDB. gcov_link_flags="-fprofile-arcs -ftest-coverage" gcov_configs="--disable-shared" # gprof gprof_compile_flags="-O2 -pg -g" gprof_link_flags="--disable-shared $static_link"