diff options
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 248 |
1 files changed, 205 insertions, 43 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index b8d46b25db2..85149d64dc7 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -634,6 +634,209 @@ 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 -ge 6; then + cpu_set="athlon pentiumpro k5 pentium i486 i386"; + elif test $cpu_family -eq 5; then + cpu_set="k5 pentium i486 i386"; + elif test $cpu_family -eq 4; then + cpu_set="i486 i386" + else + cpu_set="i386" + fi +elif test "$cpu_vendor" = "GenuineIntel"; then + if test $cpu_family -ge 6; then + cpu_set="pentiumpro pentium i486 i386"; + elif test $cpu_family -eq 5; then + cpu_set="pentium i486 i386"; + elif test $cpu_family -eq 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 -DCPU=$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_FIND_OPENSSL, [ + for d in /usr/ssl/include /usr/local/ssl/include /usr/include/openssl \ +/usr/include/ssl /opt/ssl/include /opt/openssl/include \ +/usr/local/ssl/include/openssl ; do + if test -f $d/ssl.h ; then + OPENSSL_INCLUDE=$d + fi + done + + for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \ +/usr/lib /opt/ssl/lib /opt/openssl/lib ; do + if test -f $d/libssl.a ; then + OPENSSL_LIB=$d + fi + done + + if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INCLUDE" ; then + echo "Could not find an installation of OpenSSL" + if test -n "$OPENSSL_LIB" ; then + if test "$IS_LINUX" = "true"; then + echo "Looks like you've forgotted to install OpenSSL development RPM" + fi + fi + exit 1 + fi + +]) + +AC_DEFUN(MYSQL_CHECK_OPENSSL, [ +AC_MSG_CHECKING(for OpenSSL) + AC_ARG_WITH([openssl], + [ --with-openssl Include the OpenSSL support], + [openssl="$withval"], + [openssl=no]) + + openssl_libs="" + openssl_includes="" + if test "$openssl" = "yes" + then + MYSQL_FIND_OPENSSL + #force VIO use + vio_dir="vio" + vio_libs="../vio/libvio.la" + AC_DEFINE(HAVE_VIO) + AC_MSG_RESULT(yes) + openssl_libs="-L$OPENSSL_LIB -lssl -lcrypto" + openssl_includes="-I$OPENSSL_INCLUDE" + AC_DEFINE(HAVE_OPENSSL) + + # openssl-devel-0.9.6 requires dlopen() and we can't link staticly + # on many platforms (We should actually test this here, but it's quite + # hard) to do as we are doing libtool for linking. + using_static="" + case "$CLIENT_EXTRA_LDFLAGS $MYSQLD_EXTRA_LDFLAGS" in + *-all-static*) using_static="yes" ;; + esac + if test $using_static = "yes" + then + echo "You can't use the --all-static link option when using openssl." + exit 1 + fi + AC_MSG_RESULT(no) + 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 + + AC_MSG_CHECKING(if we should build MySQLFS) + fs_dirs="" + if test "$mysqlfs" = "yes" + then + if test -n "$orbit_exec_prefix" + then + fs_dirs=fs + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT(disabled because ORBIT, the CORBA ORB, was not found) + fi + else + AC_MSG_RESULT([no]) + fi + AC_SUBST([fs_dirs]) +]) + +AC_DEFUN(MYSQL_CHECK_ORBIT, [ +AC_MSG_CHECKING(for ORBit) +orbit_config_path=`which orbit-config` +if test -n "$orbit_config_path" +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) +]) + +AC_DEFUN([MYSQL_CHECK_ISAM], [ + AC_ARG_WITH([isam], [\ + --without-isam Disable the ISAM table type], + [with_isam="$withval"], + [with_isam=yes]) + + isam_libs= + if test X"$with_isam" = X"yes" + then + AC_DEFINE(HAVE_ISAM) + isam_libs="\$(top_builddir)/isam/libnisam.a\ + \$(top_builddir)/merge/libmerge.a" + fi + AC_SUBST(isam_libs) +]) + + dnl --------------------------------------------------------------------------- dnl Macro: MYSQL_CHECK_BDB dnl Sets HAVE_BERKELEY_DB if inst library is found @@ -906,9 +1109,9 @@ dnl --------------------------------------------------------------------------- AC_DEFUN([MYSQL_CHECK_INNODB], [ AC_ARG_WITH([innodb], [ - --with-innodb Use Innodb], + --without-innodb Do not include the InnoDB table handler], [innodb="$withval"], - [innodb=no]) + [innodb=yes]) AC_MSG_CHECKING([for Innodb]) @@ -979,48 +1182,7 @@ dnl END OF MYSQL_CHECK_INNODB SECTION dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_CHECK_GEMINI -dnl Sets HAVE_GEMINI_DB if --with-gemini is used -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_CHECK_GEMINI], [ - AC_ARG_WITH([gemini], - [ - --with-gemini[=DIR] Use Gemini DB located in DIR], - [gemini="$withval"], - [gemini=no]) - - AC_MSG_CHECKING([for Gemini DB]) - -dnl SORT OUT THE SUPPLIED ARGUMENTS TO DETERMINE WHAT TO DO -dnl echo "DBG_GEM1: gemini='$gemini'" - have_gemini_db=no - gemini_includes= - gemini_libs= - case "$gemini" in - no) - AC_MSG_RESULT([Not using Gemini DB]) - ;; - yes | default | *) - have_gemini_db="yes" - gemini_includes="-I../gemini/incl -I../gemini" - gemini_libs="\ - ../gemini/api/libapi.a\ - ../gemini/db/libdb.a\ - ../gemini/dbut/libdbut.a" - AC_MSG_RESULT([Using Gemini DB]) - ;; - esac - - AC_SUBST(gemini_includes) - AC_SUBST(gemini_libs) -]) - -dnl --------------------------------------------------------------------------- -dnl END OF MYSQL_CHECK_GEMINI SECTION -dnl --------------------------------------------------------------------------- -dnl --------------------------------------------------------------------------- dnl Got this from the GNU tar 1.13.11 distribution dnl by Paul Eggert <eggert@twinsun.com> dnl --------------------------------------------------------------------------- |