diff options
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 8fb3e986b11..be6b625878a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -642,6 +642,151 @@ fi AC_MSG_RESULT($ac_cv_conv_longlong_to_float) ]) +AC_DEFUN(MYSQL_CHECK_CPU, +AC_CACHE_CHECK([if compiler supports optimizations for current cpu], mysql_cv_cpu,[ + +ac_save_CFLAGS="$CFLAGS" +if test -r /proc/cpuinfo ; then + cpuinfo="cat /proc/cpuinfo" + cpu_family=`$cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` + cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` +fi +if test "$cpu_vendor" = "AuthenticAMD"; then + if test $cpu_family>=6; then + cpu_set="athlon pentiumpro k5 pentium i486 i386"; + elif test $cpu_family=5; then + cpu_set="k5 pentium i486 i386"; + elif test $cpu_family=4; then + cpu_set="i486 i386" + else + cpu_set="i386" + fi +elif test "$cpu_vendor" = "GenuineIntel"; then + if test $cpu_family>=6; then + cpu_set=" pentiumpro pentium i486 i386"; + elif test $cpu_family=5; then + cpu_set="pentium i486 i386"; + elif test $cpu_family=4; then + cpu_set="i486 i386" + else + cpu_set="i386" + fi +fi + +for ac_arg in $cpu_set; +do + CFLAGS="$ac_save_CFLAGS -mcpu=$ac_arg -march=$ac_arg" + echo "trying $ac_arg"; + AC_TRY_COMPILE([],[int i],mysql_cv_cpu=$ac_arg; break;, mysql_cv_cpu="unknown") +done + +if test "$mysql_cv_cpu" = "unknown" +then + CFLAGS="$ac_save_CFLAGS" + AC_MSG_RESULT(none) +else + AC_MSG_RESULT($mysql_cv_cpu) +fi +])) + +AC_DEFUN(MYSQL_CHECK_VIO, [ + AC_ARG_WITH([vio], + [\ + --with-vio Include the Virtual IO support], + [vio="$withval"], + [vio=no]) + + if test "$vio" = "yes" + then + vio_dir="vio" + vio_libs="../vio/libvio.la" + AC_DEFINE(HAVE_VIO) + else + vio_dir="" + vio_libs="" + fi + AC_SUBST([vio_dir]) + AC_SUBST([vio_libs]) +]) + + +AC_DEFUN(MYSQL_CHECK_OPENSSL, [ +AC_MSG_CHECKING(for OpenSSL) + AC_ARG_WITH([openssl], + [\ + --with-openssl Include the OpenSSL support], + [openssl="$withval"], + [openssl=no]) + + if test "$openssl" = "yes" + then + if test -n "$vio_dir" + then + AC_MSG_RESULT(yes) + openssl_libs="-lssl -lcrypto -L/usr/local/ssl/lib" + openssl_includes="-I/usr/local/ssl/include" + else + AC_MSG_ERROR([OpenSSL requires Virtual IO support (--with-vio)]) + fi + AC_DEFINE(HAVE_OPENSSL) + else + AC_MSG_RESULT(no) + openssl_libs="" + openssl_includes="" + fi + NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs" + AC_SUBST(openssl_libs) + AC_SUBST(openssl_includes) +]) + + +AC_DEFUN(MYSQL_CHECK_MYSQLFS, [ + AC_ARG_WITH([mysqlfs], + [\ + --with-mysqlfs Include the corba-based MySQL file system], + [mysqlfs="$withval"], + [mysqlfs=no]) + +dnl Call MYSQL_CHECK_ORBIT even if mysqlfs == no, so that @orbit_*@ +dnl get substituted. + MYSQL_CHECK_ORBIT + + if test "$mysqlfs" = "yes" + then + if test -n "$orbit_exec_prefix" + then + fs_dirs=fs + else + AC_MSG_ERROR([mysqlfs requires ORBit, the CORBA ORB]) + fi + else + fs_dirs= + fi + AC_SUBST([fs_dirs]) +]) + +AC_DEFUN(MYSQL_CHECK_ORBIT, [ +AC_MSG_CHECKING(for ORBit) +if test `which orbit-config` +then + orbit_exec_prefix=`orbit-config --exec-prefix` + orbit_includes=`orbit-config --cflags server` + orbit_libs=`orbit-config --libs server` + orbit_idl="$orbit_exec_prefix/bin/orbit-idl" + AC_MSG_RESULT(found!) + AC_DEFINE(HAVE_ORBIT) +else + orbit_exec_prefix= + orbit_includes= + orbit_libs= + orbit_idl= + AC_MSG_RESULT(not found) +fi +AC_SUBST(orbit_includes) +AC_SUBST(orbit_libs) +AC_SUBST(orbit_idl) +]) + dnl --------------------------------------------------------------------------- dnl Macro: MYSQL_CHECK_BDB dnl Sets HAVE_BERKELEY_DB if inst library is found |