Commit 6b3a9cae authored by unknown's avatar unknown
Browse files

Make storage engines "pluggable", handlerton work


Makefile.am:
  Changes to autoconf subst
config/ac-macros/ha_berkeley.m4:
  simplify
config/ac-macros/ha_ndbcluster.m4:
  simplify
config/ac-macros/ha_partition.m4:
  simplify
configure.in:
  strip configure of storage engine specific cruft and simplify
extra/Makefile.am:
  changes to autoconf/automake subst
libmysqld/Makefile.am:
  only compile storage engines if required.
  make find object file a little smarter
libmysqld/examples/Makefile.am:
  changes to autoconf subst
mysql-test/Makefile.am:
  remove storage engine specific cruft
mysql-test/r/ps_1general.result:
  cannot gaurantee order of results from 'show storage engines'
mysql-test/r/show_check.result:
  fix test - frm file fails to be deleted if it is invalid
mysql-test/r/sql_mode.result:
  isam does not exist, test may need to be redone/fixed in 5.0
mysql-test/r/warnings.result:
  isam no longer exists
mysql-test/t/ps_1general.test:
  cannot gaurantee order of results from 'show storage engines'
mysql-test/t/show_check.test:
  fix test - frm file fails to be deleted if it is invalid
mysql-test/t/sql_mode.test:
  isam does not exist, test may need to be redone/fixed in 5.0
mysql-test/t/system_mysql_db_fix.test:
  change isam to myisam
mysql-test/t/view.test:
  change isam to myisam
mysql-test/t/warnings.test:
  isam no longer exists
sql/Makefile.am:
  Make storage engines "pluggable" stage 1
  only compile storage engines if included
sql/examples/ha_example.cc:
  handlerton work
sql/examples/ha_example.h:
  handlerton work
sql/examples/ha_tina.cc:
  handlerton work
sql/examples/ha_tina.h:
  handlerton work
sql/ha_archive.cc:
  handlerton work
sql/ha_archive.h:
  handlerton work
sql/ha_berkeley.cc:
  handlerton work
sql/ha_berkeley.h:
  handlerton work
sql/ha_blackhole.cc:
  handlerton work
sql/ha_federated.cc:
  handlerton work
sql/ha_federated.h:
  handlerton work
sql/ha_heap.cc:
  handlerton work
sql/ha_innodb.cc:
  handlerton work
sql/ha_innodb.h:
  handlerton work
sql/ha_myisam.cc:
  handlerton work
sql/ha_myisammrg.cc:
  handlerton work
sql/ha_ndbcluster.cc:
  handlerton work
sql/ha_ndbcluster.h:
  handlerton work
sql/ha_partition.cc:
  handlerton work
sql/handler.cc:
  start removing storage engine specific cruft
sql/handler.h:
  start removing storage engine specific cruft
  db_type for binlog handlerton
  handlerton flag for not-user-selectable storage engines
sql/lex.h:
  start removing storage engine specific cruft
sql/log.cc:
  handlerton work
  give binlog handlerton a 'real' db_type
sql/mysql_priv.h:
  start removing storage engine specific cruft
sql/mysqld.cc:
  start removing storage engine specific cruft
sql/set_var.cc:
  start removing storage engine specific cruft
sql/sp_head.cc:
  start removing storage engine specific cruft
sql/sql_class.cc:
  start removing storage engine specific cruft
sql/sql_class.h:
  start removing storage engine specific cruft
sql/sql_lex.h:
  start removing storage engine specific cruft
sql/sql_manager.cc:
  start removing storage engine specific cruft
sql/sql_manager.h:
  start removing storage engine specific cruft
sql/sql_parse.cc:
  start removing storage engine specific cruft
sql/sql_partition.cc:
  start removing storage engine specific cruft
sql/sql_prepare.cc:
  start removing storage engine specific cruft
sql/sql_show.cc:
  start removing storage engine specific cruft
sql/sql_table.cc:
  changed define from HAVE_PARTITION_DB to WITH_PARTITION_STORAGE_ENGINE
  start removing storage engine specific cruft
sql/sql_update.cc:
  changed define from HAVE_PARTITION_DB to WITH_PARTITION_STORAGE_ENGINE
sql/sql_yacc.yy:
  start removing storage engine specific cruft
  test if we should throw error
sql/table.cc:
  changed define from HAVE_PARTITION_DB to WITH_PARTITION_STORAGE_ENGINE
sql/table.h:
  changed define from HAVE_PARTITION_DB to WITH_PARTITION_STORAGE_ENGINE
sql/unireg.cc:
  changed define from HAVE_PARTITION_DB to WITH_PARTITION_STORAGE_ENGINE
storage/ndb/include/kernel/kernel_types.h:
  added my_config.h
storage/ndb/include/ndb_global.h.in:
  added my_config.h
storage/ndb/include/ndb_types.h.in:
  added my_config.h
config/ac-macros/storage.m4:
  New BitKeeper file ``config/ac-macros/storage.m4''
sql/handlerton.cc.in:
  New BitKeeper file ``sql/handlerton.cc.in''
parent df33aacd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -23,7 +23,8 @@ EXTRA_DIST = INSTALL-SOURCE README COPYING EXCEPTIONS-CLIENT
SUBDIRS =		. include @docs_dirs@ @zlib_dir@ @yassl_dir@ \
			@readline_topdir@ sql-common \
			@thread_dirs@ pstack \
			@sql_union_dirs@ scripts @man_dirs@ tests \
			@sql_union_dirs@ @mysql_se_dirs@ \
			@sql_server@ scripts @man_dirs@ tests \
			netware @libmysqld_dirs@ \
			@bench_dirs@ support-files @tools_dirs@

+56 −54
Original line number Diff line number Diff line
@@ -5,13 +5,14 @@ dnl Makes sure db version is correct.
dnl Looks in $srcdir for Berkeley distribution if not told otherwise
dnl ---------------------------------------------------------------------------

AC_DEFUN([MYSQL_CHECK_BDB], [

AC_DEFUN([MYSQL_SETUP_BERKELEY_DB], [
  AC_ARG_WITH([berkeley-db],
              [
  --with-berkeley-db[=DIR]
                          Use BerkeleyDB located in DIR],
              [bdb="$withval"],
              [bdb=no])
              [bdb=yes])

  AC_ARG_WITH([berkeley-db-includes],
              [
@@ -27,45 +28,27 @@ AC_DEFUN([MYSQL_CHECK_BDB], [
              [bdb_libs="$withval"],
              [bdb_libs=default])

  AC_MSG_CHECKING([for BerkeleyDB])

dnl     SORT OUT THE SUPPLIED ARGUMENTS TO DETERMINE WHAT TO DO
dnl echo "DBG1: bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'"
  have_berkeley_db=no
	#  echo " bdb $bdb  $bdb_includes---$bdb_libs "
  case "$bdb" in
    no )
      mode=no
      AC_MSG_RESULT([no])
      ;;
    yes | default )
    yes )
      case "$bdb_includes---$bdb_libs" in
        default---default )
          mode=search-$bdb
          AC_MSG_RESULT([searching...])
          ;;
        default---* | *---default | yes---* | *---yes )
          AC_MSG_ERROR([if either 'includes' or 'libs' is specified, both must be specified])
          ;;
        * )
          mode=supplied-two
          AC_MSG_RESULT([supplied])
          ;;
      esac
      ;;
    * )
      mode=supplied-one
      AC_MSG_RESULT([supplied])
      ;;
  esac

dnl echo "DBG2: [$mode] bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'"

  case $mode in
    no )
      bdb_includes=
      bdb_libs=
      bdb_libs_with_path=
      ;;
    supplied-two )
      MYSQL_CHECK_INSTALLED_BDB([$bdb_includes], [$bdb_libs])
      case $bdb_dir_ok in
@@ -86,16 +69,7 @@ dnl echo "DBG2: [$mode] bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'"
      case $bdb_dir_ok in
        source ) mode=compile ;;
        installed ) mode=yes ;;
        * )
          # not found
          case $mode in
            *-yes ) AC_MSG_ERROR([no suitable BerkeleyDB found]) ;;
            * ) mode=no ;;
          esac
         bdb_includes=
         bdb_libs=
	 bdb_libs_with_path=
          ;;
        * ) AC_MSG_ERROR([no suitable BerkeleyDB found]) ;;
      esac
      ;;
    *)
@@ -103,11 +77,7 @@ dnl echo "DBG2: [$mode] bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'"
      ;;
  esac

dnl echo "DBG3: [$mode] bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'"
  case $mode in
    no )
      AC_MSG_RESULT([Not using Berkeley DB])
      ;;
    yes )
      have_berkeley_db="yes"
      AC_MSG_RESULT([Using Berkeley DB in '$bdb_includes'])
@@ -121,9 +91,41 @@ dnl echo "DBG3: [$mode] bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'"
      ;;
  esac

      bdb_conf_flags="--disable-shared --build=$build_alias"
      if test $with_debug = "yes"
      then
        bdb_conf_flags="$bdb_conf_flags --enable-debug --enable-diagnostic"
      fi
      # NOTICE: if you're compiling BDB, it needs to be a SUBDIR
      # of $srcdir (i.e., you can 'cd $srcdir/$bdb').  It won't
      # work otherwise.
      if test -d "$bdb"; then :
      else
        # This should only happen when doing a VPATH build
        echo "NOTICE: I have to make the BDB directory: `pwd`:$bdb"
        mkdir "$bdb" || exit 1
      fi
      if test -d "$bdb"/build_unix; then :
      else
        # This should only happen when doing a VPATH build
        echo "NOTICE: I have to make the build_unix directory: `pwd`:$bdb/build_unix"
        mkdir "$bdb/build_unix" || exit 1
      fi
      rel_srcdir=
      case "$srcdir" in
        /* ) rel_srcdir="$srcdir" ;;
        * )  rel_srcdir="../../../$srcdir" ;;
      esac
      (cd $bdb/build_unix && \
       sh $rel_srcdir/$bdb/dist/configure $bdb_conf_flags) || \
        AC_MSG_ERROR([could not configure Berkeley DB])
 
  mysql_se_libs="$mysql_se_libs $bdb_libs_with_path" 

  AC_SUBST(bdb_includes)
  AC_SUBST(bdb_libs)
  AC_SUBST(bdb_libs_with_path)
  AC_CONFIG_FILES(storage/bdb/Makefile)
])

AC_DEFUN([MYSQL_CHECK_INSTALLED_BDB], [
@@ -217,29 +219,29 @@ AC_DEFUN([MYSQL_CHECK_BDB_VERSION], [
  test -z "$db_minor" && db_minor=0
  test -z "$db_patch" && db_patch=0

  # This is ugly, but about as good as it can get
#  mysql_bdb=
#  if test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 3
#  then
#    mysql_bdb=h
#  elif test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 9
#  then
#    want_bdb_version="3.2.9a"	# hopefully this will stay up-to-date
#    mysql_bdb=a
#  fi
dnl   # This is ugly, but about as good as it can get
dnl #  mysql_bdb=
dnl #  if test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 3
dnl #  then
dnl #    mysql_bdb=h
dnl #  elif test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 9
dnl #  then
dnl #    want_bdb_version="3.2.9a"	# hopefully this will stay up-to-date
dnl #    mysql_bdb=a
dnl #  fi

dnl RAM:
want_bdb_version="4.1.24"
bdb_version_ok=yes

#  if test -n "$mysql_bdb" && \
#	grep "DB_VERSION_STRING.*:.*$mysql_bdb: " [$1] > /dev/null
#  then
#    bdb_version_ok=yes
#  else
#    bdb_version_ok="invalid version $db_major.$db_minor.$db_patch"
#    bdb_version_ok="$bdb_version_ok (must be version 3.2.3h or $want_bdb_version)"
#  fi
dnl #  if test -n "$mysql_bdb" && \
dnl #	grep "DB_VERSION_STRING.*:.*$mysql_bdb: " [$1] > /dev/null
dnl #  then
dnl #    bdb_version_ok=yes
dnl #  else
dnl #    bdb_version_ok="invalid version $db_major.$db_minor.$db_patch"
dnl #    bdb_version_ok="$bdb_version_ok (must be version 3.2.3h or $want_bdb_version)"
dnl #  fi
])

AC_DEFUN([MYSQL_TOP_BUILDDIR], [
+205 −31
Original line number Diff line number Diff line
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_NDBCLUSTER
dnl Sets HAVE_NDBCLUSTER_DB if --with-ndbcluster is used
dnl ---------------------------------------------------------------------------

NDB_VERSION_MAJOR=`echo $VERSION | cut -d. -f1`
NDB_VERSION_MINOR=`echo $VERSION | cut -d. -f2`
NDB_VERSION_BUILD=`echo $VERSION | cut -d. -f3 | cut -d- -f1`
NDB_VERSION_STATUS=`echo $VERSION | cut -d- -f2`
# if there was now -suffix, $NDB_VERSION_STATUS will be the same as $VERSION
if test "$NDB_VERSION_STATUS" = "$VERSION"
then
  NDB_VERSION_STATUS=""
fi
TEST_NDBCLUSTER=""

dnl for build ndb docs

AC_PATH_PROG(DOXYGEN, doxygen, no)
AC_PATH_PROG(PDFLATEX, pdflatex, no)
AC_PATH_PROG(MAKEINDEX, makeindex, no)

AC_SUBST(DOXYGEN)
AC_SUBST(PDFLATEX)
AC_SUBST(MAKEINDEX)


AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
  AC_ARG_WITH([ndb-sci],
              AC_HELP_STRING([--with-ndb-sci=DIR],
@@ -122,43 +143,196 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
  AC_MSG_RESULT([done.])
])

AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [
  AC_ARG_WITH([ndbcluster],
              [
  --with-ndbcluster        Include the NDB Cluster table handler],
              [ndbcluster="$withval"],
              [ndbcluster=no])
AC_DEFUN([NDBCLUSTER_WORKAROUNDS], [

  AC_MSG_CHECKING([for NDB Cluster])
  #workaround for Sun Forte/x86 see BUG#4681
  case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc in
    *solaris*-i?86-no)
      CFLAGS="$CFLAGS -DBIG_TABLES"
      CXXFLAGS="$CXXFLAGS -DBIG_TABLES"
      ;;
    *)
      ;;
  esac

  # workaround for Sun Forte compile problem for ndb
  case $SYSTEM_TYPE-$ac_cv_prog_gcc in
    *solaris*-no)
      ndb_cxxflags_fix="$ndb_cxxflags_fix -instances=static"
      ;;
    *)
      ;;
  esac

  # ndb fail for whatever strange reason to link Sun Forte/x86
  # unless using incremental linker
  case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc-$have_ndbcluster in
    *solaris*-i?86-no-yes)
      CXXFLAGS="$CXXFLAGS -xildon"
      ;;
    *)
      ;;
  esac
])

AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [

  with_partition="yes"
  ndb_cxxflags_fix=""
  TEST_NDBCLUSTER="--ndbcluster"

  have_ndbcluster=no
  ndbcluster_includes=
  ndbcluster_libs=
  ndb_mgmclient_libs=
  case "$ndbcluster" in
    yes )
      AC_MSG_RESULT([Using NDB Cluster and Partitioning])
      AC_DEFINE([HAVE_NDBCLUSTER_DB], [1], [Using Ndb Cluster DB])
      AC_DEFINE([HAVE_PARTITION_DB], [1], [Builds Partition DB])
      have_ndbcluster="yes"
  ndbcluster_includes="-I\$(top_builddir)/storage/ndb/include -I\$(top_builddir)/storage/ndb/include/ndbapi -I\$(top_builddir)/storage/ndb/include/mgmapi"
  ndbcluster_libs="\$(top_builddir)/storage/ndb/src/.libs/libndbclient.a"
  ndbcluster_system_libs=""
  ndb_mgmclient_libs="\$(top_builddir)/storage/ndb/src/mgmclient/libndbmgmclient.la"

  MYSQL_CHECK_NDB_OPTIONS
      ;;
    * )
      AC_MSG_RESULT([Not using NDB Cluster])
      ;;
  esac
  NDBCLUSTER_WORKAROUNDS

  MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"

  # CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)"
  if test "$have_ndb_debug" = "default"
  then
    have_ndb_debug=$with_debug
  fi

  if test "$have_ndb_debug" = "yes"
  then
    # Medium debug.
    NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
  elif test "$have_ndb_debug" = "full"
  then
    NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
  else
    # no extra ndb debug but still do asserts if debug version
    if test "$with_debug" = "yes" -o "$with_debug" = "full"
    then
      NDB_DEFS=""
    else
      NDB_DEFS="-DNDEBUG"
    fi
  fi

  if test X"$ndb_port" = Xdefault
  then
    ndb_port="1186"
  fi
  
  ndb_transporter_opt_objs=""
  if test "$ac_cv_func_shmget" = "yes" &&
     test "$ac_cv_func_shmat" = "yes" &&
     test "$ac_cv_func_shmdt" = "yes" &&
     test "$ac_cv_func_shmctl" = "yes" &&
     test "$ac_cv_func_sigaction" = "yes" &&
     test "$ac_cv_func_sigemptyset" = "yes" &&
     test "$ac_cv_func_sigaddset" = "yes" &&
     test "$ac_cv_func_pthread_sigmask" = "yes"
  then
     AC_DEFINE([NDB_SHM_TRANSPORTER], [1],
               [Including Ndb Cluster DB shared memory transporter])
     AC_MSG_RESULT([Including ndb shared memory transporter])
     ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo"
  else
     AC_MSG_RESULT([Not including ndb shared memory transporter])
  fi
  
  if test X"$have_ndb_sci" = Xyes
  then
    ndb_transporter_opt_objs="$ndb_transporter_opt_objs SCI_Transporter.lo"
  fi
  
  ndb_opt_subdirs=
  ndb_bin_am_ldflags="-static"
  if test X"$have_ndb_test" = Xyes
  then
    ndb_opt_subdirs="test"
    ndb_bin_am_ldflags=""
  fi

  if test X"$have_ndb_docs" = Xyes
  then
    ndb_opt_subdirs="$ndb_opt_subdirs docs"
    ndb_bin_am_ldflags=""
  fi

  mysql_se_libs="$mysql_se_libs $ndbcluster_libs $ndbcluster_system_libs"
  mysql_se_libs="$mysql_se_libs $NDB_SCI_LIBS"

  AC_SUBST(NDB_VERSION_MAJOR)
  AC_SUBST(NDB_VERSION_MINOR)
  AC_SUBST(NDB_VERSION_BUILD)
  AC_SUBST(NDB_VERSION_STATUS)
  AC_DEFINE_UNQUOTED([NDB_VERSION_MAJOR], [$NDB_VERSION_MAJOR],
                     [NDB major version])
  AC_DEFINE_UNQUOTED([NDB_VERSION_MINOR], [$NDB_VERSION_MINOR],
                     [NDB minor version])
  AC_DEFINE_UNQUOTED([NDB_VERSION_BUILD], [$NDB_VERSION_BUILD],
                     [NDB build version])
  AC_DEFINE_UNQUOTED([NDB_VERSION_STATUS], ["$NDB_VERSION_STATUS"],
                     [NDB status version])

  AM_CONDITIONAL([HAVE_NDBCLUSTER_DB], [ test "$have_ndbcluster" = "yes" ])
  AC_SUBST(ndbcluster_includes)
  AC_SUBST(ndbcluster_libs)
  AC_SUBST(ndbcluster_system_libs)
  AC_SUBST(ndb_mgmclient_libs)

  AC_SUBST(ndb_transporter_opt_objs)
  AC_SUBST(ndb_port)
  AC_SUBST(ndb_bin_am_ldflags)
  AC_SUBST(ndb_opt_subdirs)

  AC_SUBST(NDB_DEFS)
  AC_SUBST(ndb_cxxflags_fix)

  AC_CONFIG_FILES(storage/ndb/Makefile storage/ndb/include/Makefile dnl
   storage/ndb/src/Makefile storage/ndb/src/common/Makefile dnl
   storage/ndb/docs/Makefile dnl
   storage/ndb/tools/Makefile dnl
   storage/ndb/src/common/debugger/Makefile dnl
   storage/ndb/src/common/debugger/signaldata/Makefile dnl
   storage/ndb/src/common/portlib/Makefile dnl
   storage/ndb/src/common/util/Makefile dnl
   storage/ndb/src/common/logger/Makefile dnl
   storage/ndb/src/common/transporter/Makefile dnl
   storage/ndb/src/common/mgmcommon/Makefile dnl
   storage/ndb/src/kernel/Makefile dnl
   storage/ndb/src/kernel/error/Makefile dnl
   storage/ndb/src/kernel/blocks/Makefile dnl
   storage/ndb/src/kernel/blocks/cmvmi/Makefile dnl
   storage/ndb/src/kernel/blocks/dbacc/Makefile dnl
   storage/ndb/src/kernel/blocks/dbdict/Makefile dnl
   storage/ndb/src/kernel/blocks/dbdih/Makefile dnl
   storage/ndb/src/kernel/blocks/dblqh/Makefile dnl
   storage/ndb/src/kernel/blocks/dbtc/Makefile dnl
   storage/ndb/src/kernel/blocks/dbtup/Makefile dnl
   storage/ndb/src/kernel/blocks/ndbfs/Makefile dnl
   storage/ndb/src/kernel/blocks/ndbcntr/Makefile dnl
   storage/ndb/src/kernel/blocks/qmgr/Makefile dnl
   storage/ndb/src/kernel/blocks/trix/Makefile dnl
   storage/ndb/src/kernel/blocks/backup/Makefile dnl
   storage/ndb/src/kernel/blocks/dbutil/Makefile dnl
   storage/ndb/src/kernel/blocks/suma/Makefile dnl
   storage/ndb/src/kernel/blocks/dbtux/Makefile dnl
   storage/ndb/src/kernel/vm/Makefile dnl
   storage/ndb/src/mgmapi/Makefile dnl
   storage/ndb/src/ndbapi/Makefile dnl
   storage/ndb/src/mgmsrv/Makefile dnl
   storage/ndb/src/mgmclient/Makefile dnl
   storage/ndb/src/cw/Makefile dnl
   storage/ndb/src/cw/cpcd/Makefile dnl
   storage/ndb/test/Makefile dnl
   storage/ndb/test/src/Makefile dnl
   storage/ndb/test/ndbapi/Makefile dnl
   storage/ndb/test/ndbapi/bank/Makefile dnl
   storage/ndb/test/tools/Makefile dnl
   storage/ndb/test/run-test/Makefile dnl
   storage/ndb/include/ndb_version.h storage/ndb/include/ndb_global.h dnl
   storage/ndb/include/ndb_types.h dnl
  )
])

AC_SUBST(TEST_NDBCLUSTER)                                                                                
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_NDBCLUSTER SECTION
dnl ---------------------------------------------------------------------------
+11 −8
Original line number Diff line number Diff line
@@ -11,17 +11,20 @@ AC_DEFUN([MYSQL_CHECK_PARTITIONDB], [
              [partitiondb=no])
  AC_MSG_CHECKING([for partition])

  case "$partitiondb" in
    yes )
dnl  case "$partitiondb" in
dnl    yes )
dnl      AC_DEFINE([HAVE_PARTITION_DB], [1], [Builds Partition DB])
dnl      AC_MSG_RESULT([yes])
dnl      [partitiondb=yes]
dnl      ;;
dnl    * )
dnl      AC_MSG_RESULT([no])
dnl      [partitiondb=no]
dnl      ;;
dnl  esac
      AC_DEFINE([HAVE_PARTITION_DB], [1], [Builds Partition DB])
      AC_MSG_RESULT([yes])
      [partitiondb=yes]
      ;;
    * )
      AC_MSG_RESULT([no])
      [partitiondb=no]
      ;;
  esac

])
dnl ---------------------------------------------------------------------------
+47 −0
Original line number Diff line number Diff line
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_STORAGE_ENGINE
dnl
dnl What it does:
dnl   creates --with-xxx configure option
dnl   adds HAVE_XXX to config.h
dnl   appends &xxx_hton, to the list of hanldertons
dnl   appends a dir to the list of source directories
dnl   appends ha_xxx.cc to the list of handler files
dnl
dnl  all names above are configurable with reasonable defaults.
dnl
dnl ---------------------------------------------------------------------------

AC_DEFUN([MYSQL_STORAGE_ENGINE],
[_MYSQL_STORAGE_ENGINE(
[$1],                                dnl name
m4_default([$2], [$1 storage engine]),    dnl verbose name
m4_default([$3], [$1-storage-engine]),    dnl with-name
m4_default([$4], no),                     dnl default
m4_default([$5], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE]),
m4_default([$6], $1[_hton]),              dnl hton
m4_default([$7], []),                     dnl path to the code
m4_default([$8], [ha_$1.o]),             dnl path to the handler in
m4_default([$9], []),                    dnl path to extra libraries
[$10],                                     dnl code-if-set
)])

AC_DEFUN([_MYSQL_STORAGE_ENGINE],
[
AC_ARG_WITH([$3], AS_HELP_STRING([--with-$3], [enable $2 (default is $4)]),
[], [ [with_]m4_bpatsubst([$3], -, _)=['$4']])
AC_CACHE_CHECK([whether to use $2], [mysql_cv_use_]m4_bpatsubst([$3], -, _),
[mysql_cv_use_]m4_bpatsubst([$3], -, _)=[$with_]m4_bpatsubst([$3], -, _))
AH_TEMPLATE([$5], [Build $2])
if test "[$mysql_cv_use_]m4_bpatsubst([$3], -, _)" != no; then
AC_DEFINE([$5])
mysql_se_decls="${mysql_se_decls},$6"
mysql_se_htons="${mysql_se_htons},&$6"
mysql_se_dirs="$mysql_se_dirs $7"
mysql_se_objs="$mysql_se_objs $8"
mysql_se_libs="$mysql_se_libs $9"
$10
fi
])

dnl ---------------------------------------------------------------------------
Loading