diff options
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 274 |
1 files changed, 224 insertions, 50 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 83cc01cc127..fda4f4bf7d5 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -635,6 +635,214 @@ 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 \ +/usr/include/ssl /opt/ssl/include /opt/openssl/include \ +/usr/local/ssl/include /usr/local/include ; do + if test -f $d/openssl/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 /usr/local/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" + # Don't set openssl_includes to /usr/include as this gives us a lot of + # compiler warnings when using gcc 3.x + if test "$OPENSSL_INCLUDE" != "/usr/include" + then + openssl_includes="-I$OPENSSL_INCLUDE" + fi + 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" -a $? = 0 +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 @@ -907,9 +1115,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,53 +1187,6 @@ dnl --------------------------------------------------------------------------- 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 --------------------------------------------------------------------------- - dnl By default, many hosts won't let programs access large files; dnl one must use special compiler options to get large-file access to work. dnl For more details about this brain damage please see: @@ -1088,7 +1249,6 @@ AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE, [AC_CACHE_CHECK([for $1], $2, [$2=no changequote(, )dnl - $4 for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do case "$ac_flag" in -D$1) @@ -1097,6 +1257,7 @@ changequote(, )dnl $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; esac done + $4 changequote([, ])dnl ]) if test "[$]$2" != no; then @@ -1127,6 +1288,7 @@ AC_DEFUN(MYSQL_SYS_LARGEFILE, done AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS") AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS") + AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, ac_cv_sys_file_offset_bits, [Number of bits in a file offset, on hosts where this is settable.], @@ -1134,6 +1296,14 @@ AC_DEFUN(MYSQL_SYS_LARGEFILE, # HP-UX 10.20 and later hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) ac_cv_sys_file_offset_bits=64 ;; + # We can't declare _FILE_OFFSET_BITS here as this will cause + # compile errors as AC_PROG_CC adds include files in confdefs.h + # We solve this (until autoconf is fixed) by instead declaring it + # as define instead + solaris2.[8,9]) + CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" + CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64" + ac_cv_sys_file_offset_bits=no ;; esac]) AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, ac_cv_sys_largefile_source, @@ -1154,6 +1324,7 @@ AC_DEFUN(MYSQL_SYS_LARGEFILE, fi ]) + # Local version of _AC_PROG_CXX_EXIT_DECLARATION that does not # include #stdlib.h as this breaks things on Solaris # (Conflicts with pthreads and big file handling) @@ -1183,3 +1354,6 @@ if test -n "$ac_declaration"; then echo '#endif' >>confdefs.h fi ])# _AC_PROG_CXX_EXIT_DECLARATION + +dnl --------------------------------------------------------------------------- + |