You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2825 lines
88 KiB

26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
19 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
24 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
21 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
Prevent bugs by making DBUG_* expressions syntactically equivalent to a single statement. --- Bug#24795: SHOW PROFILE Profiling is only partially functional on some architectures. Where there is no getrusage() system call, presently Null values are returned where it would be required. Notably, Windows needs some love applied to make it as useful. Syntax this adds: SHOW PROFILES SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n] where "n" is an integer and "types" is zero or many (comma-separated) of "CPU" "MEMORY" (not presently supported) "BLOCK IO" "CONTEXT SWITCHES" "PAGE FAULTS" "IPC" "SWAPS" "SOURCE" "ALL" It also adds a session variable (boolean) "profiling", set to "no" by default, and (integer) profiling_history_size, set to 15 by default. This patch abstracts setting THDs' "proc_info" behind a macro that can be used as a hook into the profiling code when profiling support is compiled in. All future code in this line should use that mechanism for setting thd->proc_info. --- Tests are now set to omit the statistics. --- Adds an Information_schema table, "profiling" for access to "show profile" data. --- Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795 into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community --- Fix merge problems. --- Fixed one bug in the query_source being NULL. Updated test results. --- Include more thorough profiling tests. Improve support for prepared statements. Use session-specific query IDs, starting at zero. --- Selecting from I_S.profiling is no longer quashed in profiling, as requested by Giuseppe. Limit the size of captured query text. No longer log queries that are zero length.
19 years ago
Prevent bugs by making DBUG_* expressions syntactically equivalent to a single statement. --- Bug#24795: SHOW PROFILE Profiling is only partially functional on some architectures. Where there is no getrusage() system call, presently Null values are returned where it would be required. Notably, Windows needs some love applied to make it as useful. Syntax this adds: SHOW PROFILES SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n] where "n" is an integer and "types" is zero or many (comma-separated) of "CPU" "MEMORY" (not presently supported) "BLOCK IO" "CONTEXT SWITCHES" "PAGE FAULTS" "IPC" "SWAPS" "SOURCE" "ALL" It also adds a session variable (boolean) "profiling", set to "no" by default, and (integer) profiling_history_size, set to 15 by default. This patch abstracts setting THDs' "proc_info" behind a macro that can be used as a hook into the profiling code when profiling support is compiled in. All future code in this line should use that mechanism for setting thd->proc_info. --- Tests are now set to omit the statistics. --- Adds an Information_schema table, "profiling" for access to "show profile" data. --- Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795 into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community --- Fix merge problems. --- Fixed one bug in the query_source being NULL. Updated test results. --- Include more thorough profiling tests. Improve support for prepared statements. Use session-specific query IDs, starting at zero. --- Selecting from I_S.profiling is no longer quashed in profiling, as requested by Giuseppe. Limit the size of captured query text. No longer log queries that are zero length.
19 years ago
18 years ago
Prevent bugs by making DBUG_* expressions syntactically equivalent to a single statement. --- Bug#24795: SHOW PROFILE Profiling is only partially functional on some architectures. Where there is no getrusage() system call, presently Null values are returned where it would be required. Notably, Windows needs some love applied to make it as useful. Syntax this adds: SHOW PROFILES SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n] where "n" is an integer and "types" is zero or many (comma-separated) of "CPU" "MEMORY" (not presently supported) "BLOCK IO" "CONTEXT SWITCHES" "PAGE FAULTS" "IPC" "SWAPS" "SOURCE" "ALL" It also adds a session variable (boolean) "profiling", set to "no" by default, and (integer) profiling_history_size, set to 15 by default. This patch abstracts setting THDs' "proc_info" behind a macro that can be used as a hook into the profiling code when profiling support is compiled in. All future code in this line should use that mechanism for setting thd->proc_info. --- Tests are now set to omit the statistics. --- Adds an Information_schema table, "profiling" for access to "show profile" data. --- Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795 into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community --- Fix merge problems. --- Fixed one bug in the query_source being NULL. Updated test results. --- Include more thorough profiling tests. Improve support for prepared statements. Use session-specific query IDs, starting at zero. --- Selecting from I_S.profiling is no longer quashed in profiling, as requested by Giuseppe. Limit the size of captured query text. No longer log queries that are zero length.
19 years ago
18 years ago
Prevent bugs by making DBUG_* expressions syntactically equivalent to a single statement. --- Bug#24795: SHOW PROFILE Profiling is only partially functional on some architectures. Where there is no getrusage() system call, presently Null values are returned where it would be required. Notably, Windows needs some love applied to make it as useful. Syntax this adds: SHOW PROFILES SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n] where "n" is an integer and "types" is zero or many (comma-separated) of "CPU" "MEMORY" (not presently supported) "BLOCK IO" "CONTEXT SWITCHES" "PAGE FAULTS" "IPC" "SWAPS" "SOURCE" "ALL" It also adds a session variable (boolean) "profiling", set to "no" by default, and (integer) profiling_history_size, set to 15 by default. This patch abstracts setting THDs' "proc_info" behind a macro that can be used as a hook into the profiling code when profiling support is compiled in. All future code in this line should use that mechanism for setting thd->proc_info. --- Tests are now set to omit the statistics. --- Adds an Information_schema table, "profiling" for access to "show profile" data. --- Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795 into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community --- Fix merge problems. --- Fixed one bug in the query_source being NULL. Updated test results. --- Include more thorough profiling tests. Improve support for prepared statements. Use session-specific query IDs, starting at zero. --- Selecting from I_S.profiling is no longer quashed in profiling, as requested by Giuseppe. Limit the size of captured query text. No longer log queries that are zero length.
19 years ago
Prevent bugs by making DBUG_* expressions syntactically equivalent to a single statement. --- Bug#24795: SHOW PROFILE Profiling is only partially functional on some architectures. Where there is no getrusage() system call, presently Null values are returned where it would be required. Notably, Windows needs some love applied to make it as useful. Syntax this adds: SHOW PROFILES SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n] where "n" is an integer and "types" is zero or many (comma-separated) of "CPU" "MEMORY" (not presently supported) "BLOCK IO" "CONTEXT SWITCHES" "PAGE FAULTS" "IPC" "SWAPS" "SOURCE" "ALL" It also adds a session variable (boolean) "profiling", set to "no" by default, and (integer) profiling_history_size, set to 15 by default. This patch abstracts setting THDs' "proc_info" behind a macro that can be used as a hook into the profiling code when profiling support is compiled in. All future code in this line should use that mechanism for setting thd->proc_info. --- Tests are now set to omit the statistics. --- Adds an Information_schema table, "profiling" for access to "show profile" data. --- Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community-3--bug24795 into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community --- Fix merge problems. --- Fixed one bug in the query_source being NULL. Updated test results. --- Include more thorough profiling tests. Improve support for prepared statements. Use session-specific query IDs, starting at zero. --- Selecting from I_S.profiling is no longer quashed in profiling, as requested by Giuseppe. Limit the size of captured query text. No longer log queries that are zero length.
19 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
24 years ago
23 years ago
26 years ago
21 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
Fixed compiler warnings Fixed compile-pentium64 scripts Fixed wrong estimate of update_with_key_prefix in sql-bench Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1 Fixed unsafe define of uint4korr() Fixed that --extern works with mysql-test-run.pl Small trivial cleanups This also fixes a bug in counting number of rows that are updated when we have many simultanous queries Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc Split handle_one_connection() into reusable sub functions. Split create_new_thread() into reusable sub functions. Added thread_scheduler; Preliminary interface code for future thread_handling code. Use 'my_thread_id' for internal thread id's Make thr_alarm_kill() to depend on thread_id instead of thread Make thr_abort_locks_for_thread() depend on thread_id instead of thread In store_globals(), set my_thread_var->id to be thd->thread_id. Use my_thread_var->id as basis for my_thread_name() The above changes makes the connection we have between THD and threads more soft. Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions Fixed compiler warnings Fixed core dumps when running with --debug Removed setting of signal masks (was never used) Made event code call pthread_exit() (portability fix) Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called. Made handling of thread_id and thd->variables.pseudo_thread_id uniform. Removed one common 'not freed memory' warning from mysqltest Fixed a couple of usage of not initialized warnings (unlikely cases) Suppress compiler warnings from bdb and (for the moment) warnings from ndb
19 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
21 years ago
26 years ago
21 years ago
26 years ago
21 years ago
26 years ago
21 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
23 years ago
23 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
Fixed compiler warnings Fixed compile-pentium64 scripts Fixed wrong estimate of update_with_key_prefix in sql-bench Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1 Fixed unsafe define of uint4korr() Fixed that --extern works with mysql-test-run.pl Small trivial cleanups This also fixes a bug in counting number of rows that are updated when we have many simultanous queries Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc Split handle_one_connection() into reusable sub functions. Split create_new_thread() into reusable sub functions. Added thread_scheduler; Preliminary interface code for future thread_handling code. Use 'my_thread_id' for internal thread id's Make thr_alarm_kill() to depend on thread_id instead of thread Make thr_abort_locks_for_thread() depend on thread_id instead of thread In store_globals(), set my_thread_var->id to be thd->thread_id. Use my_thread_var->id as basis for my_thread_name() The above changes makes the connection we have between THD and threads more soft. Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions Fixed compiler warnings Fixed core dumps when running with --debug Removed setting of signal masks (was never used) Made event code call pthread_exit() (portability fix) Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called. Made handling of thread_id and thd->variables.pseudo_thread_id uniform. Removed one common 'not freed memory' warning from mysqltest Fixed a couple of usage of not initialized warnings (unlikely cases) Suppress compiler warnings from bdb and (for the moment) warnings from ndb
19 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
20 years ago
26 years ago
23 years ago
23 years ago
23 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
23 years ago
26 years ago
26 years ago
26 years ago
26 years ago
  1. dnl -*- ksh -*-
  2. dnl Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.52)dnl Minimum Autoconf version required.
  4. AC_INIT(sql/mysqld.cc)
  5. AC_CANONICAL_SYSTEM
  6. # The Docs Makefile.am parses this line!
  7. # remember to also update version.c in ndb
  8. #
  9. # When changing major version number please also check switch statement
  10. # in mysqlbinlog::check_master_version().
  11. AM_INIT_AUTOMAKE(mysql, 5.1.31)
  12. AM_CONFIG_HEADER([include/config.h:config.h.in])
  13. PROTOCOL_VERSION=10
  14. DOT_FRM_VERSION=6
  15. # See the libtool docs for information on how to do shared lib versions.
  16. SHARED_LIB_MAJOR_VERSION=16
  17. SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
  18. NDB_SHARED_LIB_MAJOR_VERSION=3
  19. NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
  20. # Set all version vars based on $VERSION. How do we do this more elegant ?
  21. # Remember that regexps needs to quote [ and ] since this is run through m4
  22. # We take some made up examples
  23. #
  24. # VERSION 5.1.40sp1-alpha 5.0.34a
  25. # MYSQL_NO_DASH_VERSION 5.1.40sp1 5.0.34a
  26. # MYSQL_NUMERIC_VERSION 5.1.40 5.0.34
  27. # MYSQL_BASE_VERSION 5.1 5.0
  28. # MYSQL_VERSION_ID 50140 50034
  29. #
  30. MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
  31. MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
  32. MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
  33. MYSQL_VERSION_ID=`echo $MYSQL_NUMERIC_VERSION | \
  34. awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
  35. # Add previous major version for debian package upgrade path
  36. MYSQL_PREVIOUS_BASE_VERSION=5.0
  37. # The port should be constant for a LONG time
  38. MYSQL_TCP_PORT_DEFAULT=3306
  39. MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock"
  40. dnl Include m4
  41. sinclude(config/ac-macros/alloca.m4)
  42. sinclude(config/ac-macros/check_cpu.m4)
  43. sinclude(config/ac-macros/character_sets.m4)
  44. sinclude(config/ac-macros/compiler_flag.m4)
  45. sinclude(config/ac-macros/plugins.m4)
  46. sinclude(config/ac-macros/ha_ndbcluster.m4)
  47. sinclude(config/ac-macros/large_file.m4)
  48. sinclude(config/ac-macros/misc.m4)
  49. sinclude(config/ac-macros/readline.m4)
  50. sinclude(config/ac-macros/ssl.m4)
  51. sinclude(config/ac-macros/zlib.m4)
  52. # Remember to add a directory sql/share/LANGUAGE
  53. AVAILABLE_LANGUAGES="\
  54. czech danish dutch english estonian french german greek hungarian \
  55. italian japanese korean norwegian norwegian-ny polish portuguese \
  56. romanian russian serbian slovak spanish swedish ukrainian"
  57. #####
  58. #####
  59. AC_SUBST(MYSQL_NO_DASH_VERSION)
  60. AC_SUBST(MYSQL_BASE_VERSION)
  61. AC_SUBST(MYSQL_VERSION_ID)
  62. AC_SUBST(MYSQL_PREVIOUS_BASE_VERSION)
  63. AC_SUBST(PROTOCOL_VERSION)
  64. AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
  65. [mysql client protocol version])
  66. AC_SUBST(DOT_FRM_VERSION)
  67. AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
  68. [Version of .frm files])
  69. AC_SUBST(SHARED_LIB_MAJOR_VERSION)
  70. AC_SUBST(SHARED_LIB_VERSION)
  71. AC_SUBST(AVAILABLE_LANGUAGES)
  72. # Canonicalize the configuration name.
  73. # Check whether --with-system-type or --without-system-type was given.
  74. AC_ARG_WITH(system-type,
  75. [ --with-system-type Set the system type, like "sun-solaris10"],
  76. [SYSTEM_TYPE="$withval"],
  77. [SYSTEM_TYPE="$host_vendor-$host_os"])
  78. AC_ARG_WITH(machine-type,
  79. [ --with-machine-type Set the machine type, like "powerpc"],
  80. [MACHINE_TYPE="$withval"],
  81. [MACHINE_TYPE="$host_cpu"])
  82. AC_SUBST(SYSTEM_TYPE)
  83. AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
  84. [Name of system, eg sun-solaris])
  85. AC_SUBST(MACHINE_TYPE)
  86. AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
  87. [Machine type name, eg sparc])
  88. # Detect intel x86 like processor
  89. BASE_MACHINE_TYPE=$MACHINE_TYPE
  90. case $MACHINE_TYPE in
  91. i?86) BASE_MACHINE_TYPE=i386 ;;
  92. esac
  93. # Save some variables and the command line options for mysqlbug
  94. SAVE_CC="$CC"
  95. SAVE_CXX="$CXX"
  96. SAVE_ASFLAGS="$ASFLAGS"
  97. SAVE_CFLAGS="$CFLAGS"
  98. SAVE_CXXFLAGS="$CXXFLAGS"
  99. SAVE_LDFLAGS="$LDFLAGS"
  100. SAVE_CXXLDFLAGS="$CXXLDFLAGS"
  101. CONF_COMMAND="$0 $ac_configure_args"
  102. AC_SUBST(CONF_COMMAND)
  103. AC_SUBST(SAVE_CC)
  104. AC_SUBST(SAVE_CXX)
  105. AC_SUBST(SAVE_ASFLAGS)
  106. AC_SUBST(SAVE_CFLAGS)
  107. AC_SUBST(SAVE_CXXFLAGS)
  108. AC_SUBST(SAVE_LDFLAGS)
  109. AC_SUBST(SAVE_CXXLDFLAGS)
  110. AC_SUBST(CXXLDFLAGS)
  111. #AC_ARG_PROGRAM # Automaticly invoked by AM_INIT_AUTOMAKE
  112. AM_SANITY_CHECK
  113. # This is needed is SUBDIRS is set
  114. AC_PROG_MAKE_SET
  115. ##############################################################################
  116. # The below section needs to be done before AC_PROG_CC
  117. ##############################################################################
  118. # Hack for OS X/Darwin and Metrowerks CodeWarrior
  119. AC_ARG_WITH(darwin-mwcc,
  120. [ --with-darwin-mwcc Use Metrowerks CodeWarrior wrappers on OS X/Darwin],[
  121. if [ "with_darwin_mwcc" = yes ] ; then
  122. builddir=`pwd`
  123. ccwrapper="$builddir/support-files/MacOSX/mwcc-wrapper"
  124. arwrapper="$builddir/support-files/MacOSX/mwar-wrapper"
  125. CC="$ccwrapper"
  126. CXX="$ccwrapper"
  127. LD="$ccwrapper"
  128. AR="$arwrapper"
  129. RANLIB=:
  130. export CC CXX LD AR RANLIB
  131. AC_SUBST(AR)
  132. AC_SUBST(RANLIB)
  133. fi
  134. ])
  135. AM_CONDITIONAL(DARWIN_MWCC, test x$with_darwin_mwcc = xyes)
  136. if test "x${CFLAGS-}" = x ; then
  137. cflags_is_set=no
  138. else
  139. cflags_is_set=yes
  140. fi
  141. if test "x${CPPFLAGS-}" = x ; then
  142. cppflags_is_set=no
  143. else
  144. cppflags_is_set=yes
  145. fi
  146. if test "x${LDFLAGS-}" = x ; then
  147. ldflags_is_set=no
  148. else
  149. ldflags_is_set=yes
  150. fi
  151. ################ End of section to be done before AC_PROG_CC #################
  152. # The following hack should ensure that configure doesn't add optimizing
  153. # or debugging flags to CFLAGS or CXXFLAGS
  154. # C_EXTRA_FLAGS are flags that are automaticly added to both
  155. # CFLAGS and CXXFLAGS
  156. CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
  157. CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
  158. dnl Checks for programs.
  159. AC_PROG_AWK
  160. AC_PROG_CC
  161. AC_PROG_CXX
  162. AC_PROG_CPP
  163. # Print version of CC and CXX compiler (if they support --version)
  164. case $SYSTEM_TYPE in
  165. *netware*)
  166. CC_VERSION=`$CC -version | grep -i version`
  167. ;;
  168. *)
  169. CC_VERSION=`$CC --version | sed 1q`
  170. ;;
  171. esac
  172. if test $? -eq "0"
  173. then
  174. AC_MSG_CHECKING("C Compiler version")
  175. AC_MSG_RESULT("$CC $CC_VERSION")
  176. else
  177. CC_VERSION=""
  178. fi
  179. AC_SUBST(CC_VERSION)
  180. MYSQL_CHECK_CXX_VERSION
  181. # Fix for sgi gcc / sgiCC which tries to emulate gcc
  182. if test "$CC" = "sgicc"
  183. then
  184. ac_cv_prog_gcc="no"
  185. fi
  186. if test "$CXX" = "sgi++"
  187. then
  188. GXX="no"
  189. fi
  190. if test "$ac_cv_prog_gcc" = "yes"
  191. then
  192. AS="$CC -c"
  193. AC_SUBST(AS)
  194. else
  195. AC_PATH_PROG(AS, as, as)
  196. fi
  197. # Still need ranlib for readline; local static use only so no libtool.
  198. AC_PROG_RANLIB
  199. # We use libtool
  200. #AC_LIBTOOL_WIN32_DLL
  201. AC_PROG_LIBTOOL
  202. # Ensure that we have --preserve-dup-deps defines, otherwise we get link
  203. # problems of 'mysql' with CXX=g++
  204. LIBTOOL="$LIBTOOL --preserve-dup-deps"
  205. AC_SUBST(LIBTOOL)dnl
  206. AC_SUBST(NM)dnl
  207. # NM= "$NM -X64"
  208. #archive_expsym_cmds= `echo "$archive_expsym_cmds" | sed -e '/"$(CC)"//'`
  209. #archive_expsym_cmds= "$CC -q64 $archive_expsym_cmds"
  210. # CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
  211. #AC_LIBTOOL_DLOPEN AC_LIBTOOL_WIN32_DLL AC_DISABLE_FAST_INSTALL AC_DISABLE_SHARED AC_DISABLE_STATIC
  212. # AC_PROG_INSTALL
  213. AC_PROG_INSTALL
  214. test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
  215. # Not critical since the generated file is distributed
  216. AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
  217. AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf)
  218. AC_CHECK_PROG(DVIS, tex, manual.dvi)
  219. #check the return type of sprintf
  220. AC_MSG_CHECKING("return type of sprintf")
  221. AC_TRY_RUN([
  222. int main()
  223. {
  224. char* s = "hello";
  225. char buf[6];
  226. if((int)sprintf(buf, s) == strlen(s))
  227. return 0;
  228. return -1;
  229. }
  230. ],
  231. [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
  232. AC_MSG_RESULT("int")],
  233. [AC_TRY_RUN([
  234. int main()
  235. {
  236. char* s = "hello";
  237. char buf[6];
  238. if((char*)sprintf(buf,s) == buf + strlen(s))
  239. return 0;
  240. return -1;
  241. } ],
  242. [AC_DEFINE(SPRINTF_RETURNS_PTR, [1], [Broken sprintf])
  243. AC_MSG_RESULT("ptr")],
  244. [AC_DEFINE(SPRINTF_RETURNS_GARBAGE, [1], [Broken sprintf])
  245. AC_MSG_RESULT("garbage")]
  246. )],
  247. # Cross compile, assume POSIX
  248. [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
  249. AC_MSG_RESULT("int (we assume)")]
  250. )
  251. AC_PATH_PROG(uname_prog, uname, no)
  252. # We should go through this and put all the explictly system dependent
  253. # stuff in one place
  254. AC_MSG_CHECKING(operating system)
  255. AC_CACHE_VAL(mysql_cv_sys_os,
  256. [
  257. if test "$uname_prog" != "no"; then
  258. mysql_cv_sys_os="`uname`"
  259. else
  260. mysql_cv_sys_os="Not Solaris"
  261. fi
  262. ])
  263. AC_MSG_RESULT($mysql_cv_sys_os)
  264. # This should be rewritten to use $target_os
  265. case "$target_os" in
  266. sco3.2v5*)
  267. CFLAGS="$CFLAGS -DSCO"
  268. CXXFLAGS="$CXXFLAGS -DSCO"
  269. LD='$(CC) $(CFLAGS)'
  270. case "$CFLAGS" in
  271. *-belf*)
  272. AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[
  273. case "$LDFLAGS" in
  274. *-belf*) ;;
  275. *) AC_MSG_WARN([Adding -belf option to ldflags.])
  276. LDFLAGS="$LDFLAGS -belf"
  277. ;;
  278. esac
  279. ])
  280. ;;
  281. *)
  282. AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[
  283. case "$LDFLAGS" in
  284. *-belf*) ;;
  285. *)
  286. AC_MSG_WARN([Adding -belf option to ldflags.])
  287. LDFLAGS="$LDFLAGS -belf"
  288. ;;
  289. esac
  290. ])
  291. ;;
  292. esac
  293. ;;
  294. sysv5UnixWare* | sysv5OpenUNIX8*)
  295. if test "$GCC" != "yes"; then
  296. # Use the built-in alloca()
  297. CFLAGS="$CFLAGS -Kalloca"
  298. fi
  299. CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA"
  300. ;;
  301. sysv5SCO_SV6.0.0*)
  302. if test "$GCC" != "yes"; then
  303. # Use the built-in alloca()
  304. CFLAGS="$CFLAGS -Kalloca"
  305. CXXFLAGS="$CFLAGS -Kalloca"
  306. # Use no_implicit for templates
  307. CXXFLAGS="$CXXFLAGS -Tno_implicit"
  308. AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
  309. [1], [Defined by configure. Use explicit template instantiation.])
  310. fi
  311. ;;
  312. esac
  313. AC_SUBST(CC)
  314. AC_SUBST(CFLAGS)
  315. AC_SUBST(CXX)
  316. AC_SUBST(CXXFLAGS)
  317. AC_SUBST(ASFLAGS)
  318. AC_SUBST(LD)
  319. AC_SUBST(INSTALL_SCRIPT)
  320. export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
  321. if test "$GCC" = "yes"
  322. then
  323. # mysqld requires -fno-implicit-templates.
  324. # Disable exceptions as they seams to create problems with gcc and threads.
  325. # mysqld doesn't use run-time-type-checking, so we disable it.
  326. # We should use -Wno-invalid-offsetof flag to disable some warnings from gcc
  327. # regarding offset() usage in C++ which are done in a safe manner in the
  328. # server
  329. CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
  330. AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
  331. [1], [Defined by configure. Use explicit template instantiation.])
  332. fi
  333. MYSQL_PROG_AR
  334. # libmysqlclient versioning when linked with GNU ld.
  335. if $LD --version 2>/dev/null|grep -q GNU; then
  336. LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libmysql/libmysql.ver"
  337. AC_CONFIG_FILES(libmysql/libmysql.ver)
  338. fi
  339. AC_SUBST(LD_VERSION_SCRIPT)
  340. # Avoid bug in fcntl on some versions of linux
  341. AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os])
  342. # Any variation of Linux
  343. if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
  344. then
  345. MYSQLD_DEFAULT_SWITCHES="--skip-external-locking"
  346. TARGET_LINUX="true"
  347. AC_MSG_RESULT([yes])
  348. AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
  349. else
  350. MYSQLD_DEFAULT_SWITCHES=""
  351. TARGET_LINUX="false"
  352. AC_MSG_RESULT([no])
  353. fi
  354. AC_SUBST(MYSQLD_DEFAULT_SWITCHES)
  355. AC_SUBST(TARGET_LINUX)
  356. dnl Find paths to some shell programs
  357. AC_PATH_PROG(LN, ln, ln)
  358. # This must be able to take a -f flag like normal unix ln.
  359. AC_PATH_PROG(LN_CP_F, ln, ln)
  360. case $SYSTEM_TYPE in
  361. *netware*) ;;
  362. *)
  363. # If ln -f does not exists use -s (AFS systems)
  364. if test -n "$LN_CP_F"; then
  365. LN_CP_F="$LN_CP_F -s"
  366. fi
  367. ;;
  368. esac
  369. AC_PATH_PROG(MV, mv, mv)
  370. AC_PATH_PROG(RM, rm, rm)
  371. AC_PATH_PROG(CP, cp, cp)
  372. AC_PATH_PROG(SED, sed, sed)
  373. AC_PATH_PROG(CMP, cmp, cmp)
  374. AC_PATH_PROG(CHMOD, chmod, chmod)
  375. AC_PATH_PROG(HOSTNAME, hostname, hostname)
  376. AC_PATH_PROG(DIFF, diff, diff)
  377. # Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
  378. # fall back to 'tar' otherwise and hope that it's a GNU tar as well
  379. AC_CHECK_PROGS(TAR, gnutar gtar tar)
  380. dnl We use a path for perl so the script startup works
  381. dnl We make sure to use perl, not perl5, in hopes that the RPMs will
  382. dnl not depend on the perl5 binary being installed (probably a bug in RPM)
  383. AC_PATH_PROG(PERL, perl, no)
  384. if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
  385. then
  386. PERL5=$PERL
  387. else
  388. AC_PATH_PROG(PERL5, perl5, no)
  389. if test "$PERL5" != no
  390. then
  391. PERL=$PERL5
  392. ac_cv_path_PERL=$ac_cv_path_PERL5
  393. fi
  394. fi
  395. AC_SUBST(HOSTNAME)
  396. AC_SUBST(PERL)
  397. AC_SUBST(PERL5)
  398. # Enable the abi_check rule only if gcc is available
  399. if expr "$CC" : ".*gcc.*"
  400. then
  401. ABI_CHECK="abi_check"
  402. else
  403. ABI_CHECK=""
  404. fi
  405. AC_SUBST(ABI_CHECK)
  406. # Look for PS usage. We use double dollar-signs in FIND_PROC because this
  407. # value is written to a makefile, which interprets away one level of
  408. # dollar-signs. So, interpretation stages are m4 and then shell in autoconf,
  409. # then Make, then shell. The autoconf substitution uses single quotes, so
  410. # no unprotected single quotes should appear in the expression.
  411. AC_PATH_PROG(PS, ps, ps)
  412. AC_MSG_CHECKING("how to check if pid exists")
  413. PS=$ac_cv_path_PS
  414. # Linux style
  415. if $PS wwwp $$ 2> /dev/null | grep -- "$0" > /dev/null
  416. then
  417. FIND_PROC="$PS wwwp \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
  418. # Solaris
  419. elif $PS -fp $$ 2> /dev/null | grep -- $0 > /dev/null
  420. then
  421. FIND_PROC="$PS -p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
  422. # BSD style
  423. elif $PS -uaxww 2> /dev/null | grep -- $0 > /dev/null
  424. then
  425. FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
  426. # SysV style
  427. elif $PS -ef 2> /dev/null | grep -- $0 > /dev/null
  428. then
  429. FIND_PROC="$PS -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
  430. # Do anybody use this?
  431. elif $PS $$ 2> /dev/null | grep -- $0 > /dev/null
  432. then
  433. FIND_PROC="$PS \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
  434. else
  435. case $SYSTEM_TYPE in
  436. *freebsd*|*dragonfly*)
  437. FIND_PROC="$PS p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
  438. ;;
  439. *darwin*)
  440. FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
  441. ;;
  442. *cygwin*)
  443. FIND_PROC="$PS -e | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
  444. ;;
  445. *netware*)
  446. FIND_PROC=
  447. ;;
  448. *)
  449. AC_MSG_ERROR([Could not find the right ps and/or grep switches. Which OS is this? See the Installation chapter in the Reference Manual.])
  450. esac
  451. fi
  452. AC_SUBST(FIND_PROC)
  453. AC_MSG_RESULT("$FIND_PROC")
  454. # Check if a pid is valid
  455. AC_PATH_PROG(KILL, kill, kill)
  456. AC_MSG_CHECKING("for kill switches")
  457. if $ac_cv_path_KILL -0 $$
  458. then
  459. CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
  460. elif kill -s 0 $$
  461. then
  462. CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
  463. else
  464. AC_MSG_WARN([kill -0 to check for pid seems to fail])
  465. CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
  466. fi
  467. AC_SUBST(CHECK_PID)
  468. AC_MSG_RESULT("$CHECK_PID")
  469. # We need an ANSI C compiler
  470. AM_PROG_CC_STDC
  471. # We need an assembler, too
  472. AM_PROG_AS
  473. CCASFLAGS="$CCASFLAGS $ASFLAGS"
  474. # Check if we need noexec stack for assembler
  475. AC_CHECK_NOEXECSTACK
  476. if test "$am_cv_prog_cc_stdc" = "no"
  477. then
  478. AC_MSG_ERROR([MySQL requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
  479. fi
  480. NOINST_LDFLAGS="-static"
  481. static_nss=""
  482. STATIC_NSS_FLAGS=""
  483. OTHER_LIBC_LIB=""
  484. AC_ARG_WITH(other-libc,
  485. [ --with-other-libc=DIR Link against libc and other standard libraries
  486. installed in the specified non-standard location
  487. overriding default. Originally added to be able to
  488. link against glibc 2.2 without making the user
  489. upgrade the standard libc installation.],
  490. [
  491. other_libc_include="$withval/include"
  492. other_libc_lib="$withval/lib"
  493. with_other_libc="yes"
  494. enable_shared="no"
  495. all_is_static="yes"
  496. CFLAGS="$CFLAGS -I$other_libc_include"
  497. # There seems to be a feature in gcc that treats system and libc headers
  498. # silently when they violatate ANSI C++ standard, but it is strict otherwise
  499. # since gcc cannot now recognize that our headers are libc, we work around
  500. # by telling it to be permissive. Note that this option only works with
  501. # new versions of gcc (2.95.x and above)
  502. CXXFLAGS="$CXXFLAGS -fpermissive -I$other_libc_include"
  503. if test -f "$other_libc_lib/libnss_files.a"
  504. then
  505. # libc has been compiled with --enable-static-nss
  506. # we need special flags, but we will have to add those later
  507. STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
  508. STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS"
  509. OTHER_LIBC_LIB="-static -L$other_libc_lib"
  510. static_nss=1
  511. else
  512. # this is a dirty hack. We if we detect static nss glibc in the special
  513. # location, we do not re-direct the linker to get libraries from there
  514. # during check. The reason is that if we did, we would have to find a
  515. # way to append the special static nss flags to LIBS every time we do
  516. # any check - this is definitely feasible, but not worthwhile the risk
  517. # of breaking other things. So for our purposes it would be sufficient
  518. # to assume that whoever is using static NSS knows what he is doing and
  519. # has sensible libraries in the regular location
  520. LDFLAGS="$LDFLAGS -static -L$other_libc_lib "
  521. fi
  522. # When linking against custom libc installed separately, we want to force
  523. # all binary builds to be static, including the build done by configure
  524. # itself to test for system features.
  525. with_mysqld_ldflags="-all-static"
  526. with_client_ldflags="-all-static"
  527. NOINST_LDFLAGS="-all-static"
  528. ],
  529. [
  530. other_libc_include=
  531. other_libc_lib=
  532. with_other_libc="no"
  533. ]
  534. )
  535. AC_SUBST(NOINST_LDFLAGS)
  536. #
  537. # Check if we are using Linux and a glibc compiled with static nss
  538. # (this is true on the MySQL build machines to avoid NSS problems)
  539. #
  540. if test "$TARGET_LINUX" = "true" -a "$static_nss" = ""
  541. then
  542. tmp=`nm /usr/lib*/libc.a | grep _nss_files_getaliasent_r`
  543. if test -n "$tmp"
  544. then
  545. STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
  546. STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS"
  547. static_nss=1
  548. fi
  549. fi
  550. AC_MSG_CHECKING(whether features provided by the user community should be included.)
  551. AC_ARG_ENABLE(community-features,
  552. AC_HELP_STRING(
  553. [--disable-community-features],
  554. [Disable additional features provided by the user community.]),
  555. [ ENABLE_COMMUNITY_FEATURES=$enableval ],
  556. [ ENABLE_COMMUNITY_FEATURES=yes ]
  557. )
  558. if test "$ENABLE_COMMUNITY_FEATURES" = "yes"
  559. then
  560. AC_DEFINE([COMMUNITY_SERVER], [1],
  561. [Whether features provided by the user community should be included])
  562. AC_MSG_RESULT([yes])
  563. else
  564. AC_MSG_RESULT([no])
  565. fi
  566. AC_ARG_WITH(server-suffix,
  567. [ --with-server-suffix Append value to the version string.],
  568. [ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
  569. [ MYSQL_SERVER_SUFFIX= ]
  570. )
  571. AC_SUBST(MYSQL_SERVER_SUFFIX)
  572. # Set flags if we want to force to use pthreads
  573. AC_ARG_WITH(pthread,
  574. [ --with-pthread Force use of pthread library.],
  575. [ with_pthread=$withval ],
  576. [ with_pthread=no ]
  577. )
  578. # Force use of thread libs LIBS
  579. AC_ARG_WITH(named-thread-libs,
  580. [ --with-named-thread-libs=ARG
  581. Use specified thread libraries instead of
  582. those automatically found by configure.],
  583. [ with_named_thread=$withval ],
  584. [ with_named_thread=no ]
  585. )
  586. # Force use of a curses libs
  587. AC_ARG_WITH(named-curses-libs,
  588. [ --with-named-curses-libs=ARG
  589. Use specified curses libraries instead of
  590. those automatically found by configure.],
  591. [ with_named_curses=$withval ],
  592. [ with_named_curses=no ]
  593. )
  594. # Make thread safe client
  595. AC_ARG_ENABLE(thread-safe-client,
  596. [ --disable-thread-safe-client
  597. Compile the client without threads.],
  598. [ THREAD_SAFE_CLIENT=$enableval ],
  599. [ THREAD_SAFE_CLIENT=yes ]
  600. )
  601. # compile with strings functions in assembler
  602. AC_ARG_ENABLE(assembler,
  603. [ --enable-assembler Use assembler versions of some string
  604. functions if available.],
  605. [ ENABLE_ASSEMBLER=$enableval ],
  606. [ ENABLE_ASSEMBLER=no ]
  607. )
  608. AC_MSG_CHECKING(if we should use assembler functions)
  609. # For now we only support assembler on i386 and sparc systems
  610. AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
  611. AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
  612. AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
  613. AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
  614. if test "$ASSEMBLER_TRUE" = ""
  615. then
  616. AC_MSG_RESULT([yes])
  617. else
  618. AC_MSG_RESULT([no])
  619. fi
  620. # Add query profiler
  621. AC_MSG_CHECKING(if SHOW PROFILE should be enabled.)
  622. AC_ARG_ENABLE(profiling,
  623. AS_HELP_STRING([--enable-profiling], [Build a version with query profiling code (req. community-features)]),
  624. [ ENABLED_PROFILING=$enableval ],
  625. [ ENABLED_PROFILING=$ENABLE_COMMUNITY_FEATURES ])
  626. if test "$ENABLED_PROFILING" = "yes"
  627. then
  628. if test "$ENABLE_COMMUNITY_FEATURES" = "yes";
  629. then
  630. AC_DEFINE([ENABLED_PROFILING], [1],
  631. [If SHOW PROFILE should be enabled])
  632. AC_MSG_RESULT([yes])
  633. else
  634. ENABLED_PROFILING="no"
  635. AC_MSG_RESULT([no, overridden by community-features disabled])
  636. fi
  637. else
  638. AC_MSG_RESULT([no])
  639. fi
  640. # Use this to set the place used for unix socket used to local communication.
  641. AC_ARG_WITH(unix-socket-path,
  642. [ --with-unix-socket-path=SOCKET
  643. Where to put the unix-domain socket. SOCKET must be
  644. an absolute file name.],
  645. [ MYSQL_UNIX_ADDR=$withval ],
  646. [ MYSQL_UNIX_ADDR=$MYSQL_UNIX_ADDR_DEFAULT ]
  647. )
  648. AC_SUBST(MYSQL_UNIX_ADDR)
  649. AC_ARG_WITH(tcp-port,
  650. [ --with-tcp-port=port-number
  651. Which port to use for MySQL services (default 3306)],
  652. [ MYSQL_TCP_PORT=$withval ],
  653. [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT
  654. # if we actually defaulted (as opposed to the pathological case of
  655. # --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
  656. # happen if whole batch of servers was built from a script), set
  657. # the default to zero to indicate that; we don't lose information
  658. # that way, because 0 obviously indicates that we can get the
  659. # default value from MYSQL_TCP_PORT. this seems really evil, but
  660. # testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
  661. # a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
  662. # intend it to mean "use the default, in fact, look up a good default
  663. # from /etc/services if you can", but really, really meant 3306 when
  664. # they passed in 3306. When they pass in a specific value, let them
  665. # have it; don't second guess user and think we know better, this will
  666. # just make people cross. this makes the the logic work like this
  667. # (which is complicated enough):
  668. #
  669. # - if a port was set during build, use that as a default.
  670. #
  671. # - otherwise, try to look up a port in /etc/services; if that fails,
  672. # use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306)
  673. #
  674. # - allow the MYSQL_TCP_PORT environment variable to override that.
  675. #
  676. # - allow command-line parameters to override all of the above.
  677. #
  678. # the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
  679. # so don't mess with that.
  680. MYSQL_TCP_PORT_DEFAULT=0 ]
  681. )
  682. AC_SUBST(MYSQL_TCP_PORT)
  683. # We might want to document the assigned port in the manual.
  684. AC_SUBST(MYSQL_TCP_PORT_DEFAULT)
  685. # Use this to set the place used for unix socket used to local communication.
  686. AC_ARG_WITH(mysqld-user,
  687. [ --with-mysqld-user=username
  688. What user the mysqld daemon shall be run as.],
  689. [ MYSQLD_USER=$withval ],
  690. [ MYSQLD_USER=mysql ]
  691. )
  692. AC_SUBST(MYSQLD_USER)
  693. # If we should allow LOAD DATA LOCAL
  694. AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
  695. AC_ARG_ENABLE(local-infile,
  696. [ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)],
  697. [ ENABLED_LOCAL_INFILE=$enableval ],
  698. [ ENABLED_LOCAL_INFILE=no ]
  699. )
  700. if test "$ENABLED_LOCAL_INFILE" = "yes"
  701. then
  702. AC_MSG_RESULT([yes])
  703. AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
  704. [If LOAD DATA LOCAL INFILE should be enabled by default])
  705. else
  706. AC_MSG_RESULT([no])
  707. fi
  708. # If we should allow init-file, skip-grant-table and bootstrap options
  709. AC_MSG_CHECKING(If we should should enable init-file, skip-grant-table options and bootstrap)
  710. AC_ARG_ENABLE(grant-options,
  711. [ --disable-grant-options Disables the use of --init-file, --skip-grant-tables and --bootstrap options],
  712. [ mysql_grant_options_enabled=$enableval ],
  713. [ mysql_grant_options_enabled=yes ]
  714. )
  715. if test "$mysql_grant_options_enabled" = "yes"
  716. then
  717. AC_MSG_RESULT([yes])
  718. else
  719. AC_DEFINE([DISABLE_GRANT_OPTIONS], [1],
  720. [Disables the use of --init-file, --skip-grant-tables and --bootstrap options])
  721. AC_MSG_RESULT([no])
  722. fi
  723. MYSQL_SYS_LARGEFILE
  724. # Types that must be checked AFTER large file support is checked
  725. AC_TYPE_SIZE_T
  726. #--------------------------------------------------------------------
  727. # Check for system header files
  728. #--------------------------------------------------------------------
  729. AC_HEADER_DIRENT
  730. AC_HEADER_STDC
  731. AC_HEADER_SYS_WAIT
  732. AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
  733. memory.h pwd.h select.h \
  734. stdlib.h stddef.h \
  735. strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
  736. sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
  737. unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
  738. sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h \
  739. sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h \
  740. execinfo.h)
  741. AC_CHECK_HEADERS([xfs/xfs.h])
  742. #--------------------------------------------------------------------
  743. # Check for system libraries. Adds the library to $LIBS
  744. # and defines HAVE_LIBM etc
  745. #--------------------------------------------------------------------
  746. AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
  747. AC_CHECK_LIB(nsl_r, gethostbyname_r, [],
  748. AC_CHECK_LIB(nsl, gethostbyname_r))
  749. AC_CHECK_FUNC(gethostbyname_r)
  750. AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
  751. AC_CHECK_FUNC(yp_get_default_domain, ,
  752. AC_CHECK_LIB(nsl, yp_get_default_domain))
  753. AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
  754. # This may get things to compile even if bind-8 is installed
  755. AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
  756. # Check if crypt() exists in libc or libcrypt, sets LIBS if needed
  757. AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
  758. # See if we need a library for address lookup.
  759. AC_SEARCH_LIBS(inet_aton, [socket nsl resolv])
  760. # For the sched_yield() function on Solaris
  761. AC_CHECK_FUNC(sched_yield, , AC_CHECK_LIB(posix4, sched_yield))
  762. MYSQL_CHECK_ZLIB_WITH_COMPRESS
  763. # For large pages support
  764. if test "$TARGET_LINUX" = "true"
  765. then
  766. # For SHM_HUGETLB on Linux
  767. AC_CHECK_DECLS(SHM_HUGETLB,
  768. AC_DEFINE([HAVE_LARGE_PAGES], [1],
  769. [Define if you have large pages support])
  770. AC_DEFINE([HUGETLB_USE_PROC_MEMINFO], [1],
  771. [Define if /proc/meminfo shows the huge page size (Linux only)])
  772. , ,
  773. [
  774. #include <sys/shm.h>
  775. ]
  776. )
  777. fi
  778. #--------------------------------------------------------------------
  779. # Check for TCP wrapper support
  780. #--------------------------------------------------------------------
  781. AC_ARG_WITH(libwrap,
  782. [ --with-libwrap[=DIR] Compile in libwrap (tcp_wrappers) support],[
  783. case "$with_libwrap" in
  784. no) : ;;
  785. yes|*)
  786. _cppflags=${CPPFLAGS}
  787. _ldflags=${LDFLAGS}
  788. if test "$with_libwrap" != "yes"; then
  789. CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include"
  790. LDFLAGS="${LDFLAGS} -L$with_libwrap/lib"
  791. fi
  792. _libs=${LIBS}
  793. AC_CHECK_HEADER(tcpd.h,
  794. LIBS="-lwrap $LIBS"
  795. AC_MSG_CHECKING(for TCP wrappers library -lwrap)
  796. AC_TRY_LINK([#include <tcpd.h>
  797. int allow_severity = 0;
  798. int deny_severity = 0;
  799. struct request_info *req;
  800. ],[hosts_access (req)],
  801. AC_MSG_RESULT(yes)
  802. AC_DEFINE([LIBWRAP], [1], [Define if you have -lwrap])
  803. AC_DEFINE([HAVE_LIBWRAP], [1], [Define if have -lwrap])
  804. if test "$with_libwrap" != "yes"; then
  805. WRAPLIBS="-L${with_libwrap}/lib"
  806. fi
  807. WRAPLIBS="${WRAPLIBS} -lwrap",
  808. AC_MSG_RESULT(no)
  809. CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
  810. CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
  811. LDFLAGS=${_ldflags} LIBS=${_libs}
  812. ;;
  813. esac
  814. ])
  815. AC_SUBST(WRAPLIBS)
  816. if test "$TARGET_LINUX" = "true"; then
  817. AC_ARG_WITH(pstack,
  818. [ --with-pstack Use the pstack backtrace library],
  819. [ USE_PSTACK=$withval ],
  820. [ USE_PSTACK=no ])
  821. pstack_libs=
  822. pstack_dir=
  823. if test "$USE_PSTACK" = yes -a "$TARGET_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386"
  824. then
  825. have_libiberty= have_libbfd=
  826. my_save_LIBS="$LIBS"
  827. dnl I have no idea if this is a good test - can not find docs for libiberty
  828. AC_CHECK_LIB([iberty], [fdmatch],
  829. [have_libiberty=yes
  830. AC_CHECK_LIB([bfd], [bfd_openr], [have_libbfd=yes], , [-liberty])])
  831. LIBS="$my_save_LIBS"
  832. if test x"$have_libiberty" = xyes -a x"$have_libbfd" = xyes
  833. then
  834. pstack_dir="pstack"
  835. pstack_libs="../pstack/libpstack.a -lbfd -liberty"
  836. # We must link staticly when using pstack
  837. with_mysqld_ldflags="-all-static"
  838. AC_SUBST([pstack_dir])
  839. AC_SUBST([pstack_libs])
  840. AC_DEFINE([USE_PSTACK], [1], [the pstack backtrace library])
  841. dnl This check isn't needed, but might be nice to give some feedback....
  842. dnl AC_CHECK_HEADER(libiberty.h,
  843. dnl have_libiberty_h=yes,
  844. dnl have_libiberty_h=no)
  845. else
  846. USE_PSTACK="no"
  847. fi
  848. else
  849. USE_PSTACK="no"
  850. fi
  851. fi
  852. AC_MSG_CHECKING([if we should use pstack])
  853. AC_MSG_RESULT([$USE_PSTACK])
  854. # Check for gtty if termio.h doesn't exists
  855. if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
  856. then
  857. AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty))
  858. fi
  859. # We make a special variable for non-threaded version of LIBS to avoid
  860. # including thread libs into non-threaded version of MySQL client library.
  861. # Later in this script LIBS will be augmented with a threads library.
  862. NON_THREADED_LIBS="$LIBS"
  863. AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
  864. uchar, uint, ulong],[],[], [
  865. #include <sys/types.h>
  866. ])
  867. AC_CHECK_TYPES([in_addr_t], [], [], [
  868. #include <sys/types.h>
  869. #include <sys/socket.h>
  870. #include <netinet/in.h>
  871. #include <arpa/inet.h>
  872. ])
  873. AC_CHECK_TYPES([fp_except], [], [], [
  874. #include <sys/types.h>
  875. #include <ieeefp.h>
  876. ])
  877. #
  878. # Some system specific hacks
  879. #
  880. MAX_C_OPTIMIZE="-O3"
  881. MAX_CXX_OPTIMIZE="-O3"
  882. case $SYSTEM_TYPE in
  883. *solaris2.7*)
  884. # Solaris 2.7 has a broken /usr/include/widec.h
  885. # Make a fixed copy in ./include
  886. AC_MSG_WARN([Fixing broken include files for $SYSTEM_TYPE])
  887. echo " - Creating local copy of widec.h"
  888. if test ! -d include
  889. then
  890. mkdir ./include
  891. fi
  892. builddir=`pwd`
  893. sed -e "s|^#if[ ]*!defined(lint) && !defined(__lint)|#if !defined\(lint\) \&\& !defined\(__lint\) \&\& !defined\(getwc\)|" < /usr/include/widec.h > include/widec.h
  894. CFLAGS="$CFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
  895. CXXFLAGS="$CXXFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
  896. ;;
  897. *solaris2.8*)
  898. # Solaris 2.8 has a broken /usr/include/widec.h
  899. # Make a fixed copy in ./include
  900. AC_MSG_WARN([Fixing broken include files for $SYSTEM_TYPE])
  901. echo " - Creating local copy of widec.h"
  902. if test ! -d include
  903. then
  904. mkdir ./include
  905. fi
  906. builddir=`pwd`
  907. sed -e "s|^#if[ ]*!defined(__lint)|#if !defined\(__lint\) \&\& !defined\(getwc\)|" < /usr/include/widec.h > include/widec.h
  908. CFLAGS="$CFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
  909. CXXFLAGS="$CXXFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
  910. ;;
  911. *solaris2.5.1*)
  912. AC_MSG_WARN([Enabling getpass() workaround for Solaris 2.5.1])
  913. CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS -DHAVE_RWLOCK_T";
  914. CXXFLAGS="$CXXFLAGS -DHAVE_RWLOCK_T -DSOLARIS"
  915. ;;
  916. *solaris*)
  917. CFLAGS="$CFLAGS -DHAVE_RWLOCK_T"
  918. CXXFLAGS="$CXXFLAGS -DHAVE_RWLOCK_T"
  919. ;;
  920. *SunOS*)
  921. AC_MSG_WARN([Enabling getpass() workaround for SunOS])
  922. CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS";
  923. ;;
  924. *hpux10.20*)
  925. AC_MSG_WARN([Enabling workarounds for hpux 10.20])
  926. CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX10 -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX"
  927. CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX10 -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX"
  928. if test "$with_named_thread" = "no"
  929. then
  930. AC_MSG_WARN([Using --with-named-thread=-lpthread])
  931. with_named_thread="-lcma"
  932. fi
  933. ;;
  934. *hpux11.*)
  935. AC_MSG_WARN([Enabling workarounds for hpux 11])
  936. CFLAGS="$CFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
  937. CXXFLAGS="$CXXFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
  938. if test "$with_named_thread" = "no"
  939. then
  940. AC_MSG_WARN([Using --with-named-thread=-lpthread])
  941. with_named_thread="-lpthread"
  942. fi
  943. # Fixes for HPUX 11.0 compiler
  944. if test "$ac_cv_prog_gcc" = "no"
  945. then
  946. CFLAGS="$CFLAGS -DHAVE_BROKEN_INLINE"
  947. # set working flags first in line, letting override it (i. e. for debug):
  948. CXXFLAGS="+O2 $CXXFLAGS"
  949. MAX_C_OPTIMIZE=""
  950. MAX_CXX_OPTIMIZE=""
  951. ndb_cxxflags_fix="$ndb_cxxflags_fix -Aa"
  952. fi
  953. ;;
  954. *rhapsody*)
  955. if test "$ac_cv_prog_gcc" = "yes"
  956. then
  957. CPPFLAGS="$CPPFLAGS -traditional-cpp "
  958. CFLAGS="-DHAVE_CTHREADS_WRAPPER -DDO_NOT_REMOVE_THREAD_WRAPPERS"
  959. CXXFLAGS="-DHAVE_CTHREADS_WRAPPER"
  960. if test $with_named_curses = "no"
  961. then
  962. with_named_curses=""
  963. fi
  964. fi
  965. ;;
  966. *darwin5*)
  967. if test "$ac_cv_prog_gcc" = "yes"
  968. then
  969. FLAGS="-traditional-cpp -DHAVE_DARWIN5_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
  970. CFLAGS="$CFLAGS $FLAGS"
  971. CXXFLAGS="$CXXFLAGS $FLAGS"
  972. MAX_C_OPTIMIZE="-O"
  973. with_named_curses=""
  974. fi
  975. ;;
  976. *darwin6*)
  977. if test "$ac_cv_prog_gcc" = "yes"
  978. then
  979. FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH -DDONT_DECLARE_CXA_PURE_VIRTUAL "
  980. CFLAGS="$CFLAGS $FLAGS"
  981. CXXFLAGS="$CXXFLAGS $FLAGS"
  982. MAX_C_OPTIMIZE="-O"
  983. fi
  984. ;;
  985. *darwin*)
  986. if test "$ac_cv_prog_gcc" = "yes"
  987. then
  988. FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL"
  989. CFLAGS="$CFLAGS $FLAGS"
  990. CXXFLAGS="$CXXFLAGS $FLAGS"
  991. MAX_C_OPTIMIZE="-O"
  992. fi
  993. ;;
  994. *freebsd*|*dragonfly*)
  995. AC_MSG_WARN([Adding fix for interrupted reads])
  996. OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'`
  997. if test "$OSVERSION" -gt "480100" && \
  998. test "$OSVERSION" -lt "500000" || \
  999. test "$OSVERSION" -gt "500109"
  1000. then
  1001. CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000"
  1002. else
  1003. CFLAGS="$CFLAGS -DHAVE_BROKEN_REALPATH"
  1004. CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000 -DHAVE_BROKEN_REALPATH"
  1005. fi
  1006. ;;
  1007. *netbsd*)
  1008. AC_MSG_WARN([Adding flag -Dunix])
  1009. CFLAGS="$CFLAGS -Dunix"
  1010. CXXFLAGS="$CXXFLAGS -Dunix"
  1011. OVERRIDE_MT_LD_ADD="\$(top_srcdir)/mit-pthreads/obj/libpthread.a"
  1012. ;;
  1013. *bsdi*)
  1014. AC_MSG_WARN([Adding fix for BSDI])
  1015. CFLAGS="$CFLAGS -D__BSD__ -DHAVE_BROKEN_REALPATH"
  1016. AC_DEFINE_UNQUOTED([SOCKOPT_OPTLEN_TYPE], [size_t],
  1017. [Last argument to get/setsockopt])
  1018. ;;
  1019. *sgi-irix6*)
  1020. if test "$with_named_thread" = "no"
  1021. then
  1022. AC_MSG_WARN([Using --with-named-thread=-lpthread])
  1023. with_named_thread="-lpthread"
  1024. fi
  1025. CXXFLAGS="$CXXFLAGS -D_BOOL"
  1026. ;;
  1027. *aix4.3*)
  1028. AC_MSG_WARN([Adding defines for AIX])
  1029. CFLAGS="$CFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS -DSIGNALS_DONT_BREAK_READ"
  1030. CXXFLAGS="$CXXFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS -DSIGNALS_DONT_BREAK_READ"
  1031. ;;
  1032. dnl Is this the right match for DEC OSF on alpha?
  1033. *dec-osf*)
  1034. if test "$ac_cv_prog_gcc" = "yes" && test "$host_cpu" = "alpha"
  1035. then
  1036. AC_MSG_WARN([Adding defines for DEC OSF on alpha])
  1037. CFLAGS="$CFLAGS -mieee"
  1038. CXXFLAGS="$CXXFLAGS -mieee"
  1039. fi
  1040. AC_MSG_WARN([Adding defines for OSF1])
  1041. # gethostbyname_r is deprecated and doesn't work ok on OSF1
  1042. CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC"
  1043. CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC"
  1044. # fix to handle include of <stdint.h> correctly on OSF1 with cxx compiler
  1045. CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk"
  1046. ;;
  1047. *netware*)
  1048. # No need for curses library so set it to null
  1049. with_named_curses=""
  1050. # No thread library - in LibC
  1051. with_named_thread=""
  1052. #
  1053. # Edit Makefile.in files.
  1054. #
  1055. echo -n "configuring Makefile.in files for NetWare... "
  1056. for file in sql/Makefile.in extra/Makefile.in client/Makefile.in
  1057. do
  1058. # echo "#### $file ####"
  1059. filedir="`dirname $file`"
  1060. filebase="`basename $file`"
  1061. filesed=$filedir/$filebase.sed
  1062. #
  1063. # Backup and always use original file
  1064. #
  1065. if test -f $file.bk
  1066. then
  1067. cp -fp $file.bk $file
  1068. else
  1069. cp -fp $file $file.bk
  1070. fi
  1071. case $file in
  1072. sql/Makefile.in)
  1073. # Use gen_lex_hash.linux instead of gen_lex_hash
  1074. # Add library dependencies to mysqld_DEPENDENCIES
  1075. lib_DEPENDENCIES="\$(pstack_libs) \$(openssl_libs) \$(yassl_libs)"
  1076. cat > $filesed << EOF
  1077. s,\(\./gen_lex_hash\)\$(EXEEXT),\1.linux,
  1078. s%\(mysqld_DEPENDENCIES = \)%\1$lib_DEPENDENCIES %
  1079. EOF
  1080. ;;
  1081. extra/Makefile.in)
  1082. cat > $filesed << EOF
  1083. s,\(extra/comp_err\)\$(EXEEXT),\1.linux,
  1084. EOF
  1085. ;;
  1086. libmysql/Makefile.in)
  1087. cat > $filesed << EOF
  1088. s,libyassl.la,.libs/libyassl.a,
  1089. s,libtaocrypt.la,.libs/libtaocrypt.a,
  1090. EOF
  1091. ;;
  1092. libmysql_r/Makefile.in)
  1093. cat > $filesed << EOF
  1094. s,libyassl.la,.libs/libyassl.a,
  1095. s,libtaocrypt.la,.libs/libtaocrypt.a,
  1096. EOF
  1097. ;;
  1098. client/Makefile.in)
  1099. #
  1100. cat > $filesed << EOF
  1101. s,libmysqlclient.la,.libs/libmysqlclient.a,
  1102. EOF
  1103. ;;
  1104. esac
  1105. if `sed -f $filesed $file > $file.nw`;\
  1106. then
  1107. mv -f $file.nw $file
  1108. rm -f $filesed
  1109. else
  1110. exit 1
  1111. fi
  1112. # wait for file system changes to complete
  1113. sleep 1
  1114. done
  1115. echo "done"
  1116. #
  1117. # Make sure the following files are writable.
  1118. #
  1119. # When the files are retrieved from some source code control systems they are read-only.
  1120. #
  1121. echo -n "making sure specific build files are writable... "
  1122. for file in \
  1123. Docs/manual.chm \
  1124. Docs/mysql.info \
  1125. Docs/INSTALL-BINARY \
  1126. INSTALL-SOURCE \
  1127. COPYING
  1128. do
  1129. if test -e $file; then
  1130. chmod +w $file
  1131. fi
  1132. done
  1133. echo "done"
  1134. ;;
  1135. esac
  1136. #---START: Used in for client configure
  1137. # Check if we threads are in libc or if we should use
  1138. # -lpthread, -lpthreads or mit-pthreads
  1139. # We have to check libc last because else it fails on Solaris 2.6
  1140. with_posix_threads="no"
  1141. # Search thread lib on Linux
  1142. if test "$with_named_thread" = "no"
  1143. then
  1144. AC_MSG_CHECKING("Linux threads")
  1145. if test "$TARGET_LINUX" = "true"
  1146. then
  1147. AC_MSG_RESULT("starting")
  1148. # use getconf to check glibc contents
  1149. AC_MSG_CHECKING("getconf GNU_LIBPTHREAD_VERSION")
  1150. case `getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` in
  1151. NPTL* )
  1152. AC_MSG_RESULT("NPTL")
  1153. AC_DEFINE([HAVE_NPTL], [1], [NPTL threads implementation])
  1154. with_named_thread="-lpthread"
  1155. ;;
  1156. LINUXTHREADS* )
  1157. AC_MSG_RESULT("Linuxthreads")
  1158. AC_DEFINE([HAVE_LINUXTHREADS], [1],
  1159. [Whether we are using Xavier Leroy's LinuxThreads])
  1160. with_named_thread="-lpthread"
  1161. ;;
  1162. * )
  1163. AC_MSG_RESULT("unknown")
  1164. ;;
  1165. esac
  1166. if test "$with_named_thread" = "no"
  1167. then
  1168. # old method, check headers
  1169. # Look for LinuxThreads.
  1170. AC_MSG_CHECKING("LinuxThreads in header file comment")
  1171. res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
  1172. if test "$res" -gt 0
  1173. then
  1174. AC_MSG_RESULT("Found")
  1175. AC_DEFINE([HAVE_LINUXTHREADS], [1],
  1176. [Whether we are using Xavier Leroy's LinuxThreads])
  1177. # Linux 2.0 sanity check
  1178. AC_TRY_COMPILE([#include <sched.h>], [int a = sched_get_priority_min(1);], ,
  1179. AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual]))
  1180. # RedHat 5.0 does not work with dynamic linking of this. -static also
  1181. # gives a speed increase in linux so it does not hurt on other systems.
  1182. with_named_thread="-lpthread"
  1183. else
  1184. AC_MSG_RESULT("Not found")
  1185. # If this is a linux machine we should barf
  1186. AC_MSG_ERROR([This is a Linux system without a working getconf,
  1187. and Linuxthreads was not found. Please install it (or a new glibc) and try again.
  1188. See the Installation chapter in the Reference Manual for more information.])
  1189. fi
  1190. else
  1191. AC_MSG_RESULT("no need to check headers")
  1192. fi
  1193. AC_MSG_CHECKING("for pthread_create in -lpthread")
  1194. ac_save_LIBS="$LIBS"
  1195. LIBS="$LIBS -lpthread"
  1196. AC_TRY_LINK( [#include <pthread.h>],
  1197. [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
  1198. AC_MSG_RESULT("yes"),
  1199. [ AC_MSG_RESULT("no")
  1200. AC_MSG_ERROR([
  1201. This is a Linux system claiming to support threads, either Linuxthreads or NPTL, but linking a test program failed.
  1202. Please install one of these (or a new glibc) and try again.
  1203. See the Installation chapter in the Reference Manual for more information.]) ]
  1204. )
  1205. LIBS="$ac_save_LIBS"
  1206. else
  1207. AC_MSG_RESULT("no")
  1208. fi # "$TARGET_LINUX"
  1209. fi # "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
  1210. # Hack for DEC-UNIX (OSF1 -> Tru64)
  1211. if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
  1212. then
  1213. AC_MSG_CHECKING("DEC threads post OSF/1 3.2")
  1214. if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
  1215. then
  1216. with_named_thread="-lpthread -lmach -lexc"
  1217. CFLAGS="$CFLAGS -D_REENTRANT"
  1218. CXXFLAGS="$CXXFLAGS -D_REENTRANT"
  1219. AC_DEFINE(HAVE_DEC_THREADS, [1], [Whether we are using DEC threads])
  1220. AC_MSG_RESULT("yes")
  1221. else
  1222. AC_MSG_RESULT("no")
  1223. fi # DEC threads
  1224. fi # "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
  1225. dnl This is needed because -lsocket has to come after the thread
  1226. dnl library on SCO.
  1227. AC_DEFUN([MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK], [
  1228. LIBS=`echo " $LIBS " | sed -e 's/ -lsocket / /g'`
  1229. ])
  1230. # Hack for SCO UNIX
  1231. if test "$with_named_thread" = "no"
  1232. then
  1233. AC_MSG_CHECKING("SCO threads")
  1234. if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null
  1235. then
  1236. if test -f /usr/lib/libgthreads.a -o -f /usr/lib/libgthreads.so
  1237. then
  1238. MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
  1239. with_named_thread="-lgthreads -lsocket -lgthreads"
  1240. # sched.h conflicts with fsu-threads
  1241. touch ./include/sched.h
  1242. touch ./include/semaphore.h
  1243. # We must have gcc
  1244. if expr "$CC" : ".*gcc.*"
  1245. then
  1246. AC_MSG_RESULT("yes")
  1247. else
  1248. AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.])
  1249. fi
  1250. AC_MSG_RESULT("yes")
  1251. elif test -f /usr/local/lib/libpthread.a -o -f /usr/local/lib/libpthread.so
  1252. then
  1253. MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
  1254. with_named_thread="-lpthread -lsocket"
  1255. # sched.h conflicts with fsu-threads
  1256. # touch ./include/sched.h
  1257. AC_MSG_CHECKING("for gcc")
  1258. # We must have gcc
  1259. if expr "$CC" : ".*gcc.*"
  1260. then
  1261. AC_MSG_RESULT("yes")
  1262. else
  1263. AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.])
  1264. fi
  1265. AC_MSG_RESULT("yes")
  1266. # Hack for SCO UnixWare 7.1.x
  1267. #
  1268. elif test "$with_named_thread" = "no"
  1269. then
  1270. AC_MSG_RESULT("no")
  1271. AC_MSG_CHECKING("SCO UnixWare 7.1.x native threads")
  1272. if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null
  1273. then
  1274. if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
  1275. then
  1276. MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
  1277. if expr "$CC" : ".*gcc.*"
  1278. then
  1279. with_named_thread="-pthread -lsocket -lnsl"
  1280. else
  1281. with_named_thread="-Kthread -lsocket -lnsl"
  1282. fi
  1283. if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
  1284. then
  1285. AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1])
  1286. fi
  1287. AC_MSG_RESULT("yes")
  1288. # We must have cc
  1289. AC_MSG_CHECKING("for gcc")
  1290. if expr "$CC" : ".*gcc.*"
  1291. then
  1292. CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
  1293. CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
  1294. else
  1295. CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
  1296. CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
  1297. fi
  1298. else
  1299. AC_MSG_ERROR([configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual.])
  1300. fi
  1301. else
  1302. AC_MSG_RESULT("no")
  1303. fi
  1304. else
  1305. AC_MSG_ERROR([On SCO UNIX MySQL requires that the FSUThreads package is installed. See the Installation chapter in the Reference Manual.])
  1306. fi
  1307. else
  1308. AC_MSG_RESULT("no")
  1309. fi
  1310. fi
  1311. #
  1312. # Check for SCO threading libraries
  1313. #
  1314. if test "$with_named_thread" = "no"
  1315. then
  1316. AC_MSG_CHECKING([SCO OpenServer 6, UnixWare 7 or OpenUNIX 8 native threads])
  1317. if expr "$SYSTEM_TYPE" : ".*UnixWare.*" > /dev/null || \
  1318. expr "$SYSTEM_TYPE" : ".*SCO_SV6.*" > /dev/null || \
  1319. expr "$SYSTEM_TYPE" : ".*OpenUNIX.*" > /dev/null
  1320. then
  1321. if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
  1322. then
  1323. MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
  1324. if expr "$CC" : ".*gcc.*" > /dev/null
  1325. then
  1326. with_named_thread="-pthread -lsocket -lnsl"
  1327. CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
  1328. CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
  1329. else
  1330. with_named_thread="-Kthread -lsocket -lnsl"
  1331. CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
  1332. CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
  1333. fi
  1334. if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
  1335. then
  1336. AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1], [Have UnixWare 7 (or similar) almost-POSIX threading library])
  1337. fi
  1338. AC_MSG_RESULT(yes)
  1339. else
  1340. AC_MSG_ERROR([configure: error: Can't find thread library on SCO/Caldera system. See the Installation chapter in the Reference Manual.])
  1341. fi
  1342. else
  1343. AC_MSG_RESULT(no)
  1344. fi
  1345. fi
  1346. # Hack for Siemens UNIX
  1347. if test "$with_named_thread" = "no"
  1348. then
  1349. AC_MSG_CHECKING("Siemens threads")
  1350. if test -f /usr/lib/libxnet.so -a "$SYSTEM_TYPE" = "sni-sysv4"
  1351. then
  1352. LIBS="-lxnet $LIBS"
  1353. NON_THREADED_LIBS="-lxnet $NON_THREADED_LIBS"
  1354. with_named_thread="-Kthread $LDFLAGS -lxnet"
  1355. LD_FLAGS=""
  1356. CFLAGS="-Kthread $CFLAGS"
  1357. CXXFLAGS="-Kthread $CXXFLAGS"
  1358. AC_MSG_RESULT("yes")
  1359. else
  1360. AC_MSG_RESULT("no")
  1361. fi
  1362. fi
  1363. # Use library named -lpthread
  1364. if test "$with_named_thread" = "no" -a "$with_pthread" = "yes"
  1365. then
  1366. with_named_thread="-lpthread"
  1367. fi
  1368. #---END:
  1369. # Hack for Solaris >= 2.5
  1370. # We want both the new and the old interface
  1371. if test "$with_named_thread" = "no"
  1372. then
  1373. AC_MSG_CHECKING("Solaris threads")
  1374. if test -f /usr/lib/libpthread.so -a -f /usr/lib/libthread.so
  1375. then
  1376. with_named_thread="-lpthread -lthread"
  1377. AC_MSG_RESULT("yes")
  1378. else
  1379. AC_MSG_RESULT("no")
  1380. fi
  1381. fi
  1382. # Should we use named pthread library ?
  1383. AC_MSG_CHECKING("named thread libs:")
  1384. if test "$with_named_thread" != "no"
  1385. then
  1386. LIBS="$with_named_thread $LIBS $with_named_thread"
  1387. CLIENT_THREAD_LIBS="$with_named_thread"
  1388. with_posix_threads="yes"
  1389. AC_MSG_RESULT("$with_named_thread")
  1390. else
  1391. AC_MSG_RESULT("no")
  1392. # pthread_create is in standard libraries (As in BSDI 3.0)
  1393. AC_MSG_CHECKING("for pthread_create in -libc");
  1394. AC_TRY_LINK(
  1395. [#include <pthread.h>],
  1396. [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
  1397. with_posix_threads=yes, with_posix_threads=no)
  1398. AC_MSG_RESULT("$with_posix_threads")
  1399. if test "$with_posix_threads" = "no"
  1400. then
  1401. AC_MSG_CHECKING("for pthread_create in -lpthread")
  1402. ac_save_LIBS="$LIBS"
  1403. LIBS="$LIBS -lpthread"
  1404. CLIENT_THREAD_LIBS="-lpthread"
  1405. AC_TRY_LINK(
  1406. [#include <pthread.h>],
  1407. [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
  1408. with_posix_threads=yes, with_posix_threads=no)
  1409. AC_MSG_RESULT("$with_posix_threads")
  1410. if test "$with_posix_threads" = "no"
  1411. then
  1412. LIBS=" $ac_save_LIBS -lpthreads"
  1413. CLIENT_THREAD_LIBS="-lpthreads"
  1414. AC_MSG_CHECKING("for pthread_create in -lpthreads")
  1415. AC_TRY_LINK(
  1416. [#include <pthread.h>],
  1417. [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
  1418. with_posix_threads=yes, with_posix_threads=no)
  1419. AC_MSG_RESULT("$with_posix_threads")
  1420. if test "$with_posix_threads" = "no"
  1421. then
  1422. # This is for FreeBSD
  1423. LIBS="$ac_save_LIBS -pthread"
  1424. CLIENT_THREAD_LIBS="-pthread"
  1425. AC_MSG_CHECKING("for pthread_create in -pthread")
  1426. AC_TRY_LINK(
  1427. [#include <pthread.h>],
  1428. [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
  1429. with_posix_threads=yes, with_posix_threads=no)
  1430. AC_MSG_RESULT("$with_posix_threads")
  1431. fi
  1432. fi
  1433. fi
  1434. fi
  1435. #---START: Used in for client configure
  1436. # Must be checked after, because strtok_r may be in -lpthread
  1437. # On AIX strtok_r is in libc_r
  1438. my_save_LIBS="$LIBS"
  1439. AC_CHECK_LIB(pthread,strtok_r)
  1440. LIBS="$my_save_LIBS"
  1441. if test "$ac_cv_lib_pthread_strtok_r" = "no"
  1442. then
  1443. AC_CHECK_LIB(c_r,strtok_r)
  1444. case "$with_osf32_threads---$target_os" in
  1445. # Don't keep -lc_r in LIBS; -pthread handles it magically
  1446. yes---* | *---freebsd* | *---hpux*) LIBS="$my_save_LIBS" ;;
  1447. esac
  1448. AC_CHECK_FUNCS(strtok_r pthread_init)
  1449. else
  1450. AC_CHECK_FUNCS(strtok_r)
  1451. fi
  1452. #---END:
  1453. # dlopen, dlerror
  1454. case "$with_mysqld_ldflags " in
  1455. *"-all-static "*)
  1456. # No need to check for dlopen when mysqld is linked with
  1457. # -all-static as it won't be able to load any functions.
  1458. # NOTE! It would be better if it was possible to test if dlopen
  1459. # can be used, but a good way to test it couldn't be found
  1460. ;;
  1461. *)
  1462. # Check for dlopen, needed for user definable functions
  1463. # This must be checked after threads on AIX
  1464. # We only need this for mysqld, not for the clients.
  1465. my_save_LIBS="$LIBS"
  1466. LIBS=""
  1467. AC_CHECK_LIB(dl,dlopen)
  1468. LIBDL=$LIBS
  1469. LIBS="$my_save_LIBS"
  1470. AC_SUBST(LIBDL)
  1471. my_save_LIBS="$LIBS"
  1472. LIBS="$LIBS $LIBDL"
  1473. AC_CHECK_FUNCS(dlopen dlerror)
  1474. LIBS="$my_save_LIBS"
  1475. ;;
  1476. esac
  1477. # System characteristics
  1478. case $SYSTEM_TYPE in
  1479. *netware*) ;;
  1480. *)
  1481. AC_SYS_RESTARTABLE_SYSCALLS
  1482. ;;
  1483. esac
  1484. # Build optimized or debug version ?
  1485. # First check for gcc and g++
  1486. if test "$ac_cv_prog_gcc" = "yes"
  1487. then
  1488. DEBUG_CFLAGS="-g"
  1489. DEBUG_OPTIMIZE_CC="-O"
  1490. OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE"
  1491. else
  1492. DEBUG_CFLAGS="-g"
  1493. DEBUG_OPTIMIZE_CC=""
  1494. OPTIMIZE_CFLAGS="-O"
  1495. fi
  1496. if test "$ac_cv_prog_cxx_g" = "yes"
  1497. then
  1498. DEBUG_CXXFLAGS="-g"
  1499. DEBUG_OPTIMIZE_CXX="-O"
  1500. OPTIMIZE_CXXFLAGS="$MAX_CXX_OPTIMIZE"
  1501. else
  1502. DEBUG_CXXFLAGS="-g"
  1503. DEBUG_OPTIMIZE_CXX=""
  1504. OPTIMIZE_CXXFLAGS="-O"
  1505. fi
  1506. case $SYSTEM_TYPE in
  1507. *netware*)
  1508. DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4"
  1509. DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4"
  1510. DEBUG_OPTIMIZE_CC="-DDEBUG"
  1511. DEBUG_OPTIMIZE_CXX="-DDEBUG"
  1512. OPTIMIZE_CFLAGS="-O3 -DNDEBUG"
  1513. OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
  1514. ;;
  1515. esac
  1516. # If the user specified CFLAGS, we won't add any optimizations
  1517. if test -n "$SAVE_CFLAGS"
  1518. then
  1519. OPTIMIZE_CFLAGS=""
  1520. DEBUG_OPTIMIZE_CC=""
  1521. fi
  1522. # Ditto for CXXFLAGS
  1523. if test -n "$SAVE_CXXFLAGS"
  1524. then
  1525. OPTIMIZE_CXXFLAGS=""
  1526. DEBUG_OPTIMIZE_CXX=""
  1527. fi
  1528. AC_ARG_WITH(debug,
  1529. [ --with-debug Add debug code
  1530. --with-debug=full Add debug code (adds memory checker, very slow)],
  1531. [with_debug=$withval],
  1532. [with_debug=no])
  1533. if test "$with_debug" = "yes"
  1534. then
  1535. # Medium debug.
  1536. AC_DEFINE([DBUG_ON], [1], [Use libdbug])
  1537. CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DSAFE_MUTEX $CFLAGS"
  1538. CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS"
  1539. elif test "$with_debug" = "full"
  1540. then
  1541. # Full debug. Very slow in some cases
  1542. AC_DEFINE([DBUG_ON], [1], [Use libdbug])
  1543. CFLAGS="$DEBUG_CFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS"
  1544. CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS"
  1545. else
  1546. # Optimized version. No debug
  1547. AC_DEFINE([DBUG_OFF], [1], [Don't use libdbug])
  1548. CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
  1549. CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
  1550. fi
  1551. # If we should allow error injection tests
  1552. AC_ARG_WITH(error-inject,
  1553. AC_HELP_STRING([--with-error-inject],[Enable error injection in MySQL Server]),
  1554. [ with_error_inject=$withval ],
  1555. [ with_error_inject=no ])
  1556. if test $with_debug != "no"
  1557. then
  1558. if test "$with_error_inject" = "yes"
  1559. then
  1560. AC_DEFINE([ERROR_INJECT_SUPPORT], [1],
  1561. [Enable error injection in MySQL Server])
  1562. fi
  1563. fi
  1564. AC_ARG_WITH([fast-mutexes],
  1565. AC_HELP_STRING([--with-fast-mutexes],
  1566. [Compile with fast mutexes (default is disabled)]),
  1567. [with_fast_mutexes=$withval], [with_fast_mutexes=no])
  1568. if test "$with_fast_mutexes" != "no"
  1569. then
  1570. if test "$with_debug" != "no"
  1571. then
  1572. AC_MSG_WARN(['--with-fast-mutexes' ignored when '--with-debug' is given])
  1573. else
  1574. AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1],
  1575. [Define to 1 if you want to use fast mutexes])
  1576. fi
  1577. fi
  1578. AC_ARG_WITH([atomic-ops],
  1579. AC_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
  1580. [Implement atomic operations using pthread rwlocks or atomic CPU
  1581. instructions for multi-processor (default) or uniprocessor
  1582. configuration]), , [with_atomic_ops=smp])
  1583. case "$with_atomic_ops" in
  1584. "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
  1585. [Assume single-CPU mode, no concurrency]) ;;
  1586. "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
  1587. [Use pthread rwlocks for atomic ops]) ;;
  1588. "smp") ;;
  1589. *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
  1590. esac
  1591. AC_CACHE_CHECK([whether the compiler provides atomic builtins],
  1592. [mysql_cv_gcc_atomic_builtins], [AC_TRY_RUN([
  1593. int main()
  1594. {
  1595. int foo= -10; int bar= 10;
  1596. if (!__sync_fetch_and_add(&foo, bar) || foo)
  1597. return -1;
  1598. bar= __sync_lock_test_and_set(&foo, bar);
  1599. if (bar || foo != 10)
  1600. return -1;
  1601. bar= __sync_val_compare_and_swap(&bar, foo, 15);
  1602. if (bar)
  1603. return -1;
  1604. return 0;
  1605. }
  1606. ], [mysql_cv_gcc_atomic_builtins=yes],
  1607. [mysql_cv_gcc_atomic_builtins=no],
  1608. [mysql_cv_gcc_atomic_builtins=no])])
  1609. if test "x$mysql_cv_gcc_atomic_builtins" = xyes; then
  1610. AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
  1611. [Define to 1 if compiler provides atomic builtins.])
  1612. fi
  1613. # Force static compilation to avoid linking problems/get more speed
  1614. AC_ARG_WITH(mysqld-ldflags,
  1615. [ --with-mysqld-ldflags Extra linking arguments for mysqld],
  1616. [MYSQLD_EXTRA_LDFLAGS=$withval],
  1617. [MYSQLD_EXTRA_LDFLAGS=])
  1618. AC_SUBST(MYSQLD_EXTRA_LDFLAGS)
  1619. AC_ARG_WITH(client-ldflags,
  1620. [ --with-client-ldflags Extra linking arguments for clients],
  1621. [CLIENT_EXTRA_LDFLAGS=$withval],
  1622. [CLIENT_EXTRA_LDFLAGS=])
  1623. AC_SUBST(CLIENT_EXTRA_LDFLAGS)
  1624. AC_ARG_WITH(mysqld-libs,
  1625. [ --with-mysqld-libs Extra libraries to link with for mysqld],
  1626. [MYSQLD_EXTRA_LIBS=$withval],
  1627. [MYSQLD_EXTRA_LIBS=])
  1628. AC_SUBST(MYSQLD_EXTRA_LIBS)
  1629. AC_ARG_WITH(lib-ccflags,
  1630. [ --with-lib-ccflags Extra CC options for libraries],
  1631. [LIB_EXTRA_CCFLAGS=$withval],
  1632. [LIB_EXTRA_CCFLAGS=])
  1633. AC_SUBST(LIB_EXTRA_CCFLAGS)
  1634. # Avoid stupid bug on some OS
  1635. AC_ARG_WITH(low-memory,
  1636. [ --with-low-memory Try to use less memory to compile to avoid
  1637. memory limitations.],
  1638. [with_lowmem=$withval],
  1639. [with_lowmem=no])
  1640. if test "$with_lowmem" = "yes"
  1641. then
  1642. if test "$ac_cv_prog_gcc" = "yes"
  1643. then
  1644. LM_CFLAGS="-fno-inline"
  1645. else
  1646. LM_CFLAGS="-O0"
  1647. fi
  1648. else
  1649. LM_CFLAGS=""
  1650. fi
  1651. AC_SUBST(LM_CFLAGS)
  1652. AC_ARG_WITH(comment,
  1653. [ --with-comment Comment about compilation environment.],
  1654. [with_comment=$withval],
  1655. [with_comment=no])
  1656. if test "$with_comment" != "no"
  1657. then
  1658. COMPILATION_COMMENT=$with_comment
  1659. else
  1660. COMPILATION_COMMENT="Source distribution"
  1661. fi
  1662. AC_SUBST(COMPILATION_COMMENT)
  1663. AC_MSG_CHECKING("need of special linking flags")
  1664. if test "$TARGET_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes"
  1665. then
  1666. LDFLAGS="$LDFLAGS -rdynamic"
  1667. AC_MSG_RESULT("-rdynamic")
  1668. else
  1669. case "$SYSTEM_TYPE$with_mysqld_ldflags " in
  1670. *freebsd*"-all-static "*|*dragonfly*"-all-static "*)
  1671. AC_MSG_RESULT("none")
  1672. ;;
  1673. *freebsd*|*dragonfly*)
  1674. MYSQLD_EXTRA_LDFLAGS="$MYSQLD_EXTRA_LDFLAGS -export-dynamic"
  1675. AC_MSG_RESULT("-export-dynamic")
  1676. ;;
  1677. *)
  1678. AC_MSG_RESULT("none")
  1679. ;;
  1680. esac
  1681. fi
  1682. dnl Checks for typedefs, structures, and compiler characteristics.
  1683. AC_C_CONST
  1684. AC_C_INLINE
  1685. AC_TYPE_OFF_T
  1686. AC_STRUCT_ST_RDEV
  1687. AC_HEADER_TIME
  1688. AC_STRUCT_TM
  1689. MYSQL_NEEDS_MYSYS_NEW
  1690. # AC_CHECK_SIZEOF return 0 when it does not find the size of a
  1691. # type. We want a error instead.
  1692. AC_CHECK_SIZEOF(char, 1)
  1693. if test "$ac_cv_sizeof_char" -eq 0
  1694. then
  1695. AC_MSG_ERROR([No size for char type.
  1696. A likely cause for this could be that there isn't any
  1697. static libraries installed. You can verify this by checking if you have libm.a
  1698. in /lib, /usr/lib or some other standard place. If this is the problem,
  1699. install the static libraries and try again. If this isn't the problem,
  1700. examine config.log for possible errors. If you want to report this, use
  1701. 'scripts/mysqlbug' and include at least the last 20 rows from config.log!])
  1702. fi
  1703. AC_CHECK_SIZEOF(char*, 4)
  1704. AC_CHECK_SIZEOF(short, 2)
  1705. AC_CHECK_SIZEOF(int, 4)
  1706. if test "$ac_cv_sizeof_int" -eq 0
  1707. then
  1708. AC_MSG_ERROR("No size for int type.")
  1709. fi
  1710. AC_CHECK_SIZEOF(long, 4)
  1711. if test "$ac_cv_sizeof_long" -eq 0
  1712. then
  1713. AC_MSG_ERROR("No size for long type.")
  1714. fi
  1715. AC_CHECK_SIZEOF(long long, 8)
  1716. if test "$ac_cv_sizeof_long_long" -eq 0
  1717. then
  1718. AC_MSG_ERROR("MySQL needs a long long type.")
  1719. fi
  1720. # off_t is not a builtin type
  1721. AC_CHECK_SIZEOF(off_t, 4)
  1722. if test "$ac_cv_sizeof_off_t" -eq 0
  1723. then
  1724. AC_MSG_ERROR("MySQL needs a off_t type.")
  1725. fi
  1726. dnl
  1727. dnl check if time_t is unsigned
  1728. dnl
  1729. MYSQL_CHECK_TIME_T
  1730. # do we need #pragma interface/#pragma implementation ?
  1731. # yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
  1732. AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
  1733. # instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
  1734. # follow any standard), we'll use well-defined preprocessor macros:
  1735. AC_TRY_CPP([
  1736. #if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
  1737. #error USE_PRAGMA_IMPLEMENTATION
  1738. #endif
  1739. ],AC_MSG_RESULT(no) ,AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION")
  1740. # This always gives a warning. Ignore it unless you are cross compiling
  1741. AC_C_BIGENDIAN
  1742. #---START: Used in for client configure
  1743. # Check base type of last arg to accept
  1744. MYSQL_TYPE_ACCEPT
  1745. #---END:
  1746. # Figure out what type of struct rlimit to use with setrlimit
  1747. MYSQL_TYPE_STRUCT_RLIMIT
  1748. # Find where the stack goes
  1749. MYSQL_STACK_DIRECTION
  1750. # We want to skip alloca on irix unconditionally. It may work on some version..
  1751. MYSQL_FUNC_ALLOCA
  1752. # Do struct timespec have members tv_sec or ts_sec
  1753. MYSQL_TIMESPEC_TS
  1754. # Do we have the tzname variable
  1755. MYSQL_TZNAME
  1756. # Do the c++ compiler have a bool type
  1757. MYSQL_CXX_BOOL
  1758. # Check some common bugs with gcc 2.8.# on sparc
  1759. case $SYSTEM_TYPE in
  1760. *netware*) ;;
  1761. *)
  1762. MYSQL_CHECK_LONGLONG_TO_FLOAT
  1763. if test "$ac_cv_conv_longlong_to_float" != "yes"
  1764. then
  1765. AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
  1766. If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
  1767. again])
  1768. fi
  1769. ;;
  1770. esac
  1771. AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
  1772. AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
  1773. AC_CHECK_TYPES([u_int32_t])
  1774. MYSQL_PTHREAD_YIELD
  1775. ######################################################################
  1776. # For readline/libedit (We simply move the mimimum amount of stuff from
  1777. # the readline/libedit configure.in here)
  1778. dnl Checks for header files.
  1779. AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
  1780. dnl Checks for library functions.
  1781. AC_FUNC_ALLOCA
  1782. AC_PROG_GCC_TRADITIONAL
  1783. AC_TYPE_SIGNAL
  1784. AC_CHECK_FUNCS(re_comp regcomp strdup)
  1785. dnl Sun compilers have their own vis.h that is about something
  1786. dnl totally different. So, not to change the libedit source, we
  1787. dnl do some additional checks before we define HAVE_VIS_H.
  1788. AC_CHECK_HEADER(vis.h,
  1789. [AC_CHECK_FUNC(strvis,
  1790. [AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])])
  1791. AC_CHECK_FUNCS(strlcat strlcpy)
  1792. AC_CHECK_FUNCS(issetugid)
  1793. AC_CHECK_FUNCS(fgetln)
  1794. AC_CHECK_FUNCS(getline flockfile)
  1795. # from old readline settting:
  1796. MAKE_SHELL=/bin/sh
  1797. AC_SUBST(MAKE_SHELL)
  1798. # Already-done: stdlib.h string.h unistd.h termios.h
  1799. AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \
  1800. sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
  1801. sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
  1802. paths.h semaphore.h)
  1803. # Already-done: strcasecmp
  1804. AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
  1805. AC_STAT_MACROS_BROKEN
  1806. MYSQL_SIGNAL_CHECK
  1807. MYSQL_CHECK_GETPW_FUNCS
  1808. MYSQL_HAVE_TIOCGWINSZ
  1809. MYSQL_HAVE_FIONREAD
  1810. MYSQL_HAVE_TIOCSTAT
  1811. MYSQL_STRUCT_DIRENT_D_INO
  1812. MYSQL_STRUCT_DIRENT_D_NAMLEN
  1813. MYSQL_TYPE_SIGHANDLER
  1814. MYSQL_CHECK_MULTIBYTE
  1815. if test "$with_named_curses" = "no"
  1816. then
  1817. MYSQL_CHECK_LIB_TERMCAP
  1818. else
  1819. TERMCAP_LIB="$with_named_curses"
  1820. fi
  1821. AC_SUBST(TERMCAP_LIB)
  1822. # Check if the termcap function 'tgoto' is already declared in
  1823. # system header files or if it need to be declared locally
  1824. AC_CHECK_DECLS(tgoto,,,[
  1825. #ifdef HAVE_CURSES_H
  1826. # include <curses.h>
  1827. #elif HAVE_NCURSES_H
  1828. # include <ncurses.h>
  1829. #endif
  1830. #ifdef HAVE_TERM_H
  1831. # include <term.h>
  1832. #endif
  1833. ])
  1834. LIBEDIT_LOBJECTS=""
  1835. AC_CHECK_FUNC(strunvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS unvis.o"])
  1836. AC_CHECK_FUNC(strvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS vis.o"])
  1837. AC_CHECK_FUNC(strlcpy, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS strlcpy.o"])
  1838. AC_CHECK_FUNC(strlcat, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS strlcat.o"])
  1839. AC_CHECK_FUNC(fgetln, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS fgetln.o"])
  1840. AC_SUBST(LIBEDIT_LOBJECTS)
  1841. enable_readline="yes"
  1842. # End of readline/libedit stuff
  1843. #########################################################################
  1844. dnl Checks for library functions.
  1845. #
  1846. # The following code disables intrinsic function support while we test for
  1847. # library functions. This is to avoid configure problems with Intel ecc
  1848. # compiler
  1849. ORG_CFLAGS="$CFLAGS"
  1850. if test "$GCC" != "yes"; then
  1851. AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
  1852. fi
  1853. #AC_FUNC_MMAP
  1854. AC_TYPE_SIGNAL
  1855. MYSQL_TYPE_QSORT
  1856. AC_FUNC_UTIME_NULL
  1857. AC_FUNC_VPRINTF
  1858. AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
  1859. chsize cuserid fchmod fcntl \
  1860. fconvert fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
  1861. getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
  1862. getpwuid getrlimit getrusage getwd index initgroups isnan \
  1863. localtime_r gethrtime gmtime_r \
  1864. locking longjmp lrand48 madvise mallinfo memcpy memmove \
  1865. mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
  1866. pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
  1867. pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
  1868. pthread_key_delete pthread_rwlock_rdlock pthread_setprio pthread_setschedprio \
  1869. pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
  1870. realpath rename rint rwlock_init setupterm \
  1871. shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
  1872. sighold sigset sigthreadmask port_create sleep \
  1873. snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
  1874. strtol strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \
  1875. posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
  1876. #
  1877. #
  1878. #
  1879. case "$target" in
  1880. *-*-aix4* | *-*-sco*)
  1881. # (grr) aix 4.3 has a stub for clock_gettime, (returning ENOSYS)
  1882. # and using AC_TRY_RUN is hard when cross-compiling
  1883. # We also disable for SCO for the time being, the headers for the
  1884. # thread library we use conflicts with other headers.
  1885. ;;
  1886. *) AC_CHECK_FUNCS(clock_gettime)
  1887. ;;
  1888. esac
  1889. # Check that isinf() is available in math.h and can be used in both C and C++
  1890. # code
  1891. AC_MSG_CHECKING(for isinf in <math.h>)
  1892. AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r],
  1893. AC_MSG_RESULT(yes)
  1894. AC_MSG_CHECKING(whether isinf() can be used in C++ code)
  1895. AC_LANG_SAVE
  1896. AC_LANG_CPLUSPLUS
  1897. AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r],
  1898. AC_MSG_RESULT(yes)
  1899. AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]),
  1900. AC_MSG_RESULT(no))
  1901. AC_LANG_RESTORE,
  1902. AC_MSG_RESULT(no))
  1903. CFLAGS="$ORG_CFLAGS"
  1904. # Sanity check: We chould not have any fseeko symbol unless
  1905. # large_file_support=yes
  1906. AC_CHECK_FUNC(fseeko,
  1907. [if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
  1908. then
  1909. AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
  1910. fi]
  1911. )
  1912. # Check definition of gethostbyaddr_r (glibc2 defines this with 8 arguments)
  1913. ac_save_CXXFLAGS="$CXXFLAGS"
  1914. AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style,
  1915. AC_LANG_SAVE
  1916. AC_LANG_CPLUSPLUS
  1917. # Test whether madvise() is declared in C++ code -- it is not on some
  1918. # systems, such as Solaris
  1919. AC_CHECK_DECLS(madvise, [], [], [#if HAVE_SYS_MMAN_H
  1920. #include <sys/types.h>
  1921. #include <sys/mman.h>
  1922. #endif])
  1923. # Do not treat warnings as errors if we are linking against other libc
  1924. # this is to work around gcc not being permissive on non-system includes
  1925. # with respect to ANSI C++
  1926. # We also remove the -fbranch-probabilities option as this will give warnings
  1927. # about not profiled code, which confuses configure
  1928. # We also must remove -W and -Wcheck which on icc produces warnings that
  1929. # we don't want to catch with -Werror
  1930. if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
  1931. then
  1932. CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
  1933. fi
  1934. AC_TRY_COMPILE(
  1935. [#undef inline
  1936. #if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
  1937. #define _REENTRANT
  1938. #endif
  1939. #include <pthread.h>
  1940. #include <sys/types.h>
  1941. #include <sys/socket.h>
  1942. #include <netinet/in.h>
  1943. #include <arpa/inet.h>
  1944. #include <netdb.h>],
  1945. [int skr;
  1946. struct hostent *foo = gethostbyaddr_r((const char *) 0,
  1947. 0, 0, (struct hostent *) 0, (char *) NULL, 0, &skr); return (foo == 0);],
  1948. mysql_cv_gethost_style=solaris, mysql_cv_gethost_style=other))
  1949. AC_LANG_RESTORE
  1950. CXXFLAGS="$ac_save_CXXFLAGS"
  1951. if test "$mysql_cv_gethost_style" = "solaris"
  1952. then
  1953. AC_DEFINE([HAVE_SOLARIS_STYLE_GETHOST], [1],
  1954. [Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines this with 8 arguments])
  1955. fi
  1956. #---START: Used in for client configure
  1957. # Check definition of gethostbyname_r (glibc2.0.100 is different from Solaris)
  1958. ac_save_CXXFLAGS="$CXXFLAGS"
  1959. AC_CACHE_CHECK([style of gethostbyname_r routines], mysql_cv_gethostbyname_style,
  1960. AC_LANG_SAVE
  1961. AC_LANG_CPLUSPLUS
  1962. if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
  1963. then
  1964. CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
  1965. fi
  1966. AC_TRY_COMPILE(
  1967. [#undef inline
  1968. #if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
  1969. #define _REENTRANT
  1970. #endif
  1971. #include <pthread.h>
  1972. #include <sys/types.h>
  1973. #include <sys/socket.h>
  1974. #include <netinet/in.h>
  1975. #include <arpa/inet.h>
  1976. #include <netdb.h>],
  1977. [int skr;
  1978. skr = gethostbyname_r((const char *) 0,
  1979. (struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, &skr);],
  1980. mysql_cv_gethostbyname_style=glibc2, mysql_cv_gethostbyname_style=other))
  1981. AC_LANG_RESTORE
  1982. CXXFLAGS="$ac_save_CXXFLAGS"
  1983. if test "$mysql_cv_gethostbyname_style" = "glibc2"
  1984. then
  1985. AC_DEFINE([HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE], [1],
  1986. [Solaris define gethostbyname_r with 5 arguments. glibc2 defines this with 6 arguments])
  1987. fi
  1988. # Check 3rd argument of getthostbyname_r
  1989. ac_save_CXXFLAGS="$CXXFLAGS"
  1990. AC_CACHE_CHECK([3 argument to gethostbyname_r routines], mysql_cv_gethostbyname_arg,
  1991. AC_LANG_SAVE
  1992. AC_LANG_CPLUSPLUS
  1993. if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
  1994. then
  1995. CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
  1996. fi
  1997. AC_TRY_COMPILE(
  1998. [#undef inline
  1999. #if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
  2000. #define _REENTRANT
  2001. #endif
  2002. #include <pthread.h>
  2003. #include <sys/types.h>
  2004. #include <sys/socket.h>
  2005. #include <netinet/in.h>
  2006. #include <arpa/inet.h>
  2007. #include <netdb.h>],
  2008. [int skr;
  2009. skr = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0);],
  2010. mysql_cv_gethostbyname_arg=hostent_data, mysql_cv_gethostbyname_arg=char))
  2011. AC_LANG_RESTORE
  2012. CXXFLAGS="$ac_save_CXXFLAGS"
  2013. if test "$mysql_cv_gethostbyname_arg" = "hostent_data"
  2014. then
  2015. AC_DEFINE([HAVE_GETHOSTBYNAME_R_RETURN_INT], [1],
  2016. [In OSF 4.0f the 3'd argument to gethostbyname_r is hostent_data *])
  2017. fi
  2018. # Check definition of pthread_getspecific
  2019. AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args,
  2020. AC_TRY_COMPILE(
  2021. [#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
  2022. #define _REENTRANT
  2023. #endif
  2024. #define _POSIX_PTHREAD_SEMANTICS
  2025. #include <pthread.h> ],
  2026. [ void *pthread_getspecific(pthread_key_t key);
  2027. pthread_getspecific((pthread_key_t) NULL); ],
  2028. mysql_cv_getspecific_args=POSIX, mysql_cv_getspecific_args=other))
  2029. if test "$mysql_cv_getspecific_args" = "other"
  2030. then
  2031. AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
  2032. [For some non posix threads])
  2033. fi
  2034. # Check definition of pthread_mutex_init
  2035. AC_CACHE_CHECK("args to pthread_mutex_init", mysql_cv_mutex_init_args,
  2036. AC_TRY_COMPILE(
  2037. [#if !defined(SCO) && !defined(__osf__)
  2038. #define _REENTRANT
  2039. #endif
  2040. #define _POSIX_PTHREAD_SEMANTICS
  2041. #include <pthread.h> ],
  2042. [
  2043. pthread_mutexattr_t attr;
  2044. pthread_mutex_t mp;
  2045. pthread_mutex_init(&mp,&attr); ],
  2046. mysql_cv_mutex_init_args=POSIX, mysql_cv_mutex_init_args=other))
  2047. if test "$mysql_cv_mutex_init_args" = "other"
  2048. then
  2049. AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
  2050. [For some non posix threads])
  2051. fi
  2052. #---END:
  2053. #---START: Used in for client configure
  2054. # Check definition of readdir_r
  2055. AC_CACHE_CHECK("args to readdir_r", mysql_cv_readdir_r,
  2056. AC_TRY_LINK(
  2057. [#if !defined(SCO) && !defined(__osf__)
  2058. #define _REENTRANT
  2059. #endif
  2060. #define _POSIX_PTHREAD_SEMANTICS
  2061. #include <pthread.h>
  2062. #include <dirent.h>],
  2063. [ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
  2064. readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ],
  2065. mysql_cv_readdir_r=POSIX, mysql_cv_readdir_r=other))
  2066. if test "$mysql_cv_readdir_r" = "POSIX"
  2067. then
  2068. AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
  2069. fi
  2070. # Check definition of posix sigwait()
  2071. AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
  2072. AC_TRY_LINK(
  2073. [#if !defined(SCO) && !defined(__osf__)
  2074. #define _REENTRANT
  2075. #endif
  2076. #define _POSIX_PTHREAD_SEMANTICS
  2077. #include <pthread.h>
  2078. #include <signal.h>],
  2079. [#ifndef _AIX
  2080. sigset_t set;
  2081. int sig;
  2082. sigwait(&set,&sig);
  2083. #endif],
  2084. mysql_cv_sigwait=POSIX, mysql_cv_sigwait=other))
  2085. if test "$mysql_cv_sigwait" = "POSIX"
  2086. then
  2087. AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
  2088. fi
  2089. if test "$mysql_cv_sigwait" != "POSIX"
  2090. then
  2091. unset mysql_cv_sigwait
  2092. # Check definition of posix sigwait()
  2093. AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
  2094. AC_TRY_LINK(
  2095. [#if !defined(SCO) && !defined(__osf__)
  2096. #define _REENTRANT
  2097. #endif
  2098. #define _POSIX_PTHREAD_SEMANTICS
  2099. #include <pthread.h>
  2100. #include <signal.h>],
  2101. [sigset_t set;
  2102. int sig;
  2103. sigwait(&set);],
  2104. mysql_cv_sigwait=NONPOSIX, mysql_cv_sigwait=other))
  2105. if test "$mysql_cv_sigwait" = "NONPOSIX"
  2106. then
  2107. AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
  2108. fi
  2109. fi
  2110. #---END:
  2111. # Check if pthread_attr_setscope() exists
  2112. AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope,
  2113. AC_TRY_LINK(
  2114. [#if !defined(SCO) && !defined(__osf__)
  2115. #define _REENTRANT
  2116. #endif
  2117. #define _POSIX_PTHREAD_SEMANTICS
  2118. #include <pthread.h>],
  2119. [pthread_attr_t thr_attr;
  2120. pthread_attr_setscope(&thr_attr,0);],
  2121. mysql_cv_pthread_attr_setscope=yes, mysql_cv_pthread_attr_setscope=no))
  2122. if test "$mysql_cv_pthread_attr_setscope" = "yes"
  2123. then
  2124. AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
  2125. fi
  2126. # Check for bad includes
  2127. AC_MSG_CHECKING("can netinet files be included")
  2128. AC_TRY_COMPILE(
  2129. [#include <sys/types.h>
  2130. #include <sys/socket.h>
  2131. #include <netinet/in_systm.h>
  2132. #include <netinet/in.h>
  2133. #include <netinet/ip.h>
  2134. #include <netinet/tcp.h>],
  2135. [ printf("1\n"); ],
  2136. netinet_inc=yes, netinet_inc=no)
  2137. if test "$netinet_inc" = "no"
  2138. then
  2139. AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
  2140. fi
  2141. AC_MSG_RESULT("$netinet_inc")
  2142. AC_CACHE_CHECK([support for weak symbols], mysql_cv_weak_symbol,
  2143. [AC_TRY_LINK([],[
  2144. extern void __attribute__((weak)) foo(void);
  2145. ], [mysql_cv_weak_symbol=yes], [mysql_cv_weak_symbol=no])])
  2146. if test "x$mysql_cv_weak_symbol" = xyes; then
  2147. AC_DEFINE(HAVE_WEAK_SYMBOL, 1,
  2148. [Define to 1 if compiler supports weak symbol attribute.])
  2149. fi
  2150. AC_CACHE_CHECK([whether __bss_start is defined], mysql_cv_bss_start,
  2151. [AC_TRY_LINK([],[
  2152. extern char *__bss_start;
  2153. return __bss_start ? 1 : 0;
  2154. ], [mysql_cv_bss_start=yes], [mysql_cv_bss_start=no])])
  2155. if test "x$mysql_cv_bss_start" = xyes; then
  2156. AC_DEFINE(HAVE_BSS_START, 1,
  2157. [Define to 1 if compiler defines __bss_start.])
  2158. fi
  2159. AC_LANG_SAVE
  2160. AC_LANG_CPLUSPLUS
  2161. AC_CHECK_HEADERS(cxxabi.h)
  2162. AC_CACHE_CHECK([for abi::__cxa_demangle], mysql_cv_cxa_demangle,
  2163. [AC_TRY_LINK([#include <cxxabi.h>], [
  2164. char *foo= 0; int bar= 0;
  2165. foo= abi::__cxa_demangle(foo, foo, 0, &bar);
  2166. ], [mysql_cv_cxa_demangle=yes], [mysql_cv_cxa_demangle=no])])
  2167. AC_LANG_RESTORE
  2168. if test "x$mysql_cv_cxa_demangle" = xyes; then
  2169. AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
  2170. [Define to 1 if you have the `abi::__cxa_demangle' function.])
  2171. fi
  2172. #--------------------------------------------------------------------
  2173. # Check for requested features
  2174. #--------------------------------------------------------------------
  2175. MYSQL_CHECK_BIG_TABLES
  2176. MYSQL_CHECK_MAX_INDEXES
  2177. MYSQL_CHECK_VIO
  2178. MYSQL_CHECK_SSL
  2179. #--------------------------------------------------------------------
  2180. # Declare our plugin modules
  2181. # Has to be done late, as the plugin may need to check for existence of
  2182. # functions tested above
  2183. #--------------------------------------------------------------------
  2184. MYSQL_STORAGE_ENGINE(partition, partition, [Partition Support],
  2185. [MySQL Partitioning Support], [max,max-no-ndb])
  2186. dnl -- ndbcluster requires partition to be enabled
  2187. MYSQL_CONFIGURE_PLUGINS([none])
  2188. # Only build client code?
  2189. AC_ARG_WITH(server,
  2190. [ --without-server Only build the client.],
  2191. [with_server=$withval],
  2192. [with_server=yes]
  2193. )
  2194. AC_ARG_WITH(embedded-server,
  2195. [ --with-embedded-server Build the embedded server (libmysqld).],
  2196. [with_embedded_server=$withval],
  2197. [with_embedded_server=no]
  2198. )
  2199. AC_ARG_WITH(query_cache,
  2200. [ --without-query-cache Do not build query cache.],
  2201. [with_query_cache=$withval],
  2202. [with_query_cache=yes]
  2203. )
  2204. if test "$with_query_cache" = "yes"
  2205. then
  2206. AC_DEFINE([HAVE_QUERY_CACHE], [1], [If we want to have query cache])
  2207. fi
  2208. AC_ARG_WITH(geometry,
  2209. [ --without-geometry Do not build geometry-related parts.],
  2210. [with_geometry=$withval],
  2211. [with_geometry=yes]
  2212. )
  2213. if test "$with_geometry" = "yes"
  2214. then
  2215. AC_DEFINE([HAVE_SPATIAL], [1], [Spatial extentions])
  2216. AC_DEFINE([HAVE_RTREE_KEYS], [1], [RTree keys])
  2217. fi
  2218. AC_ARG_WITH(embedded_privilege_control,
  2219. [ --with-embedded-privilege-control
  2220. Build parts to check user's privileges.
  2221. Only affects embedded library.],
  2222. [with_embedded_privilege_control=$withval],
  2223. [with_embedded_privilege_control=no]
  2224. )
  2225. if test "$with_embedded_privilege_control" = "yes"
  2226. then
  2227. AC_DEFINE([HAVE_EMBEDDED_PRIVILEGE_CONTROL], [1],
  2228. [Access checks in embedded library])
  2229. fi
  2230. tools_dirs=""
  2231. AC_ARG_WITH([mysqlmanager],
  2232. AC_HELP_STRING([--with-mysqlmanager], [Build the mysqlmanager binary: yes/no (default: build if server is built.)]),,)
  2233. if test "$with_mysqlmanager" = "yes" -o \
  2234. '(' "$with_mysqlmanager:$with_server" = ":yes" -a \
  2235. -d "$srcdir/server-tools" ')' ; then
  2236. tools_dirs="server-tools"
  2237. fi
  2238. AC_SUBST(tools_dirs)
  2239. #MYSQL_CHECK_CPU
  2240. libmysqld_dirs=
  2241. if test "$with_embedded_server" = "yes"
  2242. then
  2243. libmysqld_dirs=libmysqld
  2244. # We can't build embedded library without building the server, because
  2245. # we depend on libmysys, libmystrings, libmyisam, etc.
  2246. with_server=yes
  2247. fi
  2248. # XXX: We need to add @libmysqld_extra_libs@ (or whatever) so that
  2249. # mysql_config --libmysqld-libs will print out something like
  2250. # -L/path/to/lib/mysql -lmysqld -lmyisam -lmysys -lmystrings -ldbug ...
  2251. AC_SUBST([libmysqld_dirs])
  2252. # Shall we build the docs?
  2253. AC_ARG_WITH(docs,
  2254. [ --without-docs Skip building of the documentation.],
  2255. [with_docs=$withval],
  2256. [with_docs=yes]
  2257. )
  2258. if test "$with_docs" = "yes"
  2259. then
  2260. docs_dirs="Docs"
  2261. if test -f "$srcdir/Docs/manual.chm" ; then
  2262. extra_docs="manual.chm"
  2263. fi
  2264. else
  2265. docs_dirs=""
  2266. extra_docs=""
  2267. fi
  2268. AC_SUBST(docs_dirs)
  2269. AC_SUBST(extra_docs)
  2270. # Shall we build the man pages?
  2271. AC_ARG_WITH(man,
  2272. [ --without-man Skip building of the man pages.],
  2273. [with_man=$withval],
  2274. [with_man=yes]
  2275. )
  2276. # Don't build readline, i have it already
  2277. AC_ARG_WITH(readline,
  2278. [ --without-readline Use system readline instead of bundled copy.],
  2279. [ with_readline=$withval ],
  2280. [ with_readline=undefined ]
  2281. )
  2282. AC_ARG_WITH(libedit,
  2283. [ --without-libedit Use system libedit instead of bundled copy.],
  2284. [ with_libedit=$withval ],
  2285. [ with_libedit=undefined ]
  2286. )
  2287. if test "$with_readline/$with_libedit" = "undefined/undefined" -a ! -e "$srcdir/cmd-line-utils"
  2288. then
  2289. with_readline=no
  2290. with_libedit=no
  2291. fi
  2292. #
  2293. # We support next variants of compilation:
  2294. # --with-readline
  2295. # | yes | no | undefined
  2296. # --with-libedit | | |
  2297. # ---------------+----------------+------+----------------------------------
  2298. # yes | ERROR! | use libedit from mysql sources
  2299. # ---------------+----------------+------+----------------------------------
  2300. # no | use readline | use system readline or external libedit
  2301. # | from mysql | according to results of m4 tests
  2302. # ---------------+ sources (if it + +----------------------------------
  2303. # undefined | is presented) | | use libedit from mysql sources
  2304. compile_readline="no"
  2305. compile_libedit="no"
  2306. if [test "$with_libedit" = "yes"] && [test "$with_readline" = "yes"]
  2307. then
  2308. AC_MSG_ERROR([You can not use --with-readline and --with-libedit at the same time, please choose one of it])
  2309. fi
  2310. readline_topdir=""
  2311. readline_basedir=""
  2312. readline_dir=""
  2313. readline_h_ln_cmd=""
  2314. readline_link=""
  2315. want_to_use_readline="no"
  2316. case $SYSTEM_TYPE in
  2317. *netware*)
  2318. # For NetWare, do not need readline
  2319. echo "Skipping readline"
  2320. ;;
  2321. *)
  2322. if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"]
  2323. then
  2324. readline_topdir="cmd-line-utils"
  2325. readline_basedir="libedit"
  2326. readline_dir="$readline_topdir/$readline_basedir"
  2327. readline_link="\$(top_builddir)/cmd-line-utils/libedit/libedit.a"
  2328. readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/libedit/readline readline"
  2329. compile_libedit=yes
  2330. AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, 1)
  2331. AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE, 1)
  2332. elif test "$with_readline" = "yes"
  2333. then
  2334. readline_topdir="cmd-line-utils"
  2335. readline_basedir="readline"
  2336. readline_dir="$readline_topdir/$readline_basedir"
  2337. readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
  2338. readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/readline readline"
  2339. compile_readline=yes
  2340. want_to_use_readline="yes"
  2341. AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1)
  2342. else
  2343. # Use system readline library
  2344. AC_LANG_SAVE
  2345. AC_LANG_CPLUSPLUS
  2346. MYSQL_CHECK_LIBEDIT_INTERFACE
  2347. MYSQL_CHECK_NEW_RL_INTERFACE
  2348. MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY
  2349. AC_LANG_RESTORE
  2350. if [test "$mysql_cv_new_rl_interface" = "yes"] && [test -d "$srcdir/cmd-line-utils/readline"]
  2351. then
  2352. # Use the new readline interface, but only if the package includes a bundled libreadline
  2353. # this way we avoid linking commercial source with GPL readline
  2354. readline_link="-lreadline"
  2355. want_to_use_readline="yes"
  2356. elif [test "$mysql_cv_libedit_interface" = "yes"]
  2357. then
  2358. # Use libedit
  2359. readline_link="-ledit"
  2360. else
  2361. AC_MSG_ERROR([Could not find system readline or libedit libraries
  2362. Use --with-readline or --with-libedit to use the bundled
  2363. versions of libedit or readline])
  2364. fi
  2365. fi
  2366. # if there is no readline, but we want to build with readline, we fail
  2367. if [test "$want_to_use_readline" = "yes"] && [test ! -d "./cmd-line-utils/readline"]
  2368. then
  2369. AC_MSG_ERROR([This commercially licensed MySQL source package can't
  2370. be built with libreadline. Please use --with-libedit to use
  2371. the bundled version of libedit instead.])
  2372. fi
  2373. ;;
  2374. esac
  2375. AC_SUBST(readline_dir)
  2376. AC_SUBST(readline_topdir)
  2377. AC_SUBST(readline_basedir)
  2378. AC_SUBST(readline_link)
  2379. AC_SUBST(readline_h_ln_cmd)
  2380. # Include man pages, if desired, adapted to the configured parts.
  2381. if test X"$with_man" = Xyes
  2382. then
  2383. # First, create the list of all man pages present.
  2384. MANLISTFIL=manlist.$$
  2385. TMPLISTFIL=`echo $MANLISTFIL | sed -e 's/manlist/tmplist/'`
  2386. if test -f $MANLISTFIL -o -f $TMPLISTFIL
  2387. then
  2388. echo "Temp file '$MANLISTFIL' or '$TMPLISTFIL' already exists in '`pwd`' - aborting"
  2389. exit 1
  2390. fi
  2391. touch $MANLISTFIL $TMPLISTFIL
  2392. ls $srcdir/man/*.[[18]] > $MANLISTFIL
  2393. # Then, remove all those pages from the list which are specific to parts
  2394. # (table handlers, features, ...) which are not configured in this run.
  2395. AC_MSG_CHECKING("for man pages to remove")
  2396. MAN_DROP="dropping"
  2397. if test X"$with_plugin_ndbcluster" != Xyes
  2398. then
  2399. MAN_DROP="$MAN_DROP ndbcluster"
  2400. grep -v '/ndb' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
  2401. fi
  2402. if test X"$with_embedded_server" != Xyes
  2403. then
  2404. MAN_DROP="$MAN_DROP embedded"
  2405. grep -v 'embedded' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
  2406. fi
  2407. if test X"$with_plugin_innobase" != Xyes
  2408. then
  2409. MAN_DROP="$MAN_DROP innodb"
  2410. grep -v 'inno' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
  2411. fi
  2412. AC_MSG_RESULT([$MAN_DROP])
  2413. # Finally, split the man pages into sections 1 and 8.
  2414. # Get rid of line breaks.
  2415. man1_files=`sed -n -e '/\.1$/s/^.*man\///p' <$MANLISTFIL`
  2416. man8_files=`sed -n -e '/\.8$/s/^.*man\///p' <$MANLISTFIL`
  2417. man_dirs="man"
  2418. man1_files=`echo $man1_files`
  2419. man8_files=`echo $man8_files`
  2420. rm -f $MANLISTFIL $TMPLISTFIL
  2421. else
  2422. man_dirs=""
  2423. man1_files=""
  2424. man8_files=""
  2425. fi
  2426. AC_SUBST(man_dirs)
  2427. AC_SUBST(man1_files)
  2428. AC_SUBST(man8_files)
  2429. # If we have threads generate some library functions and test programs
  2430. sql_server_dirs=
  2431. sql_server=
  2432. server_scripts=
  2433. dnl This probably should be cleaned up more - for now the threaded
  2434. dnl client is just using plain-old libs.
  2435. sql_client_dirs="strings regex mysys libmysql"
  2436. AM_CONDITIONAL(THREAD_SAFE_CLIENT, test "$THREAD_SAFE_CLIENT" != "no")
  2437. if test "$THREAD_SAFE_CLIENT" != "no"
  2438. then
  2439. sql_client_dirs="$sql_client_dirs libmysql_r"
  2440. AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should the client be thread safe])
  2441. fi
  2442. sql_client_dirs="$sql_client_dirs client"
  2443. CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS"
  2444. AC_SUBST(CLIENT_LIBS)
  2445. AC_SUBST(CLIENT_THREAD_LIBS)
  2446. AC_SUBST(NON_THREADED_LIBS)
  2447. AC_SUBST(STATIC_NSS_FLAGS)
  2448. AC_SUBST(sql_client_dirs)
  2449. # If configuring for NetWare, build the netware directory
  2450. netware_dir=
  2451. if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null
  2452. then
  2453. netware_dir="netware"
  2454. fi
  2455. AC_SUBST(netware_dir)
  2456. AM_CONDITIONAL(HAVE_NETWARE, test "$netware_dir" = "netware")
  2457. if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no"
  2458. then
  2459. AC_DEFINE([THREAD], [1],
  2460. [Define if you want to have threaded code. This may be undef on client code])
  2461. # Avoid _PROGRAMS names
  2462. THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o mf_keycache.o"
  2463. AC_SUBST(THREAD_LOBJECTS)
  2464. server_scripts="mysqld_safe mysql_install_db"
  2465. sql_server_dirs="strings mysys dbug extra regex"
  2466. sql_server="vio sql"
  2467. fi
  2468. # "innochecksum" is not in the "innobase/" subdirectory, but should be switched
  2469. AM_CONDITIONAL([BUILD_INNODB_TOOLS], [test X"$with_plugin_innobase" = Xyes])
  2470. # IMPORTANT - do not modify LIBS past this line - this hack is the only way
  2471. # I know to add the static NSS magic if we have static NSS libraries with
  2472. # glibc - Sasha
  2473. LDFLAGS="$LDFLAGS $OTHER_LIBC_LIB"
  2474. LIBS="$LIBS $STATIC_NSS_FLAGS"
  2475. AC_SUBST(sql_server_dirs)
  2476. AC_SUBST(sql_server)
  2477. AC_SUBST(server_scripts)
  2478. AC_SUBST(mysql_plugin_dirs)
  2479. AC_SUBST(mysql_plugin_libs)
  2480. AC_SUBST(mysql_plugin_defs)
  2481. # Now that sql_client_dirs and sql_server_dirs are stable, determine the union.
  2482. # Start with the (longer) server list, add each client item not yet present.
  2483. sql_union_dirs=" $sql_server_dirs "
  2484. for DIR in $sql_client_dirs
  2485. do
  2486. if echo " $sql_union_dirs " | grep " $DIR " >/dev/null
  2487. then
  2488. : # already present, skip
  2489. else
  2490. sql_union_dirs="$sql_union_dirs $DIR "
  2491. fi
  2492. done
  2493. AC_SUBST(sql_union_dirs)
  2494. # Some usefull subst
  2495. AC_SUBST(CC)
  2496. AC_SUBST(GXX)
  2497. # Set configuration options for make_binary_distribution
  2498. case $SYSTEM_TYPE in
  2499. *netware*)
  2500. MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
  2501. ;;
  2502. *)
  2503. : # no change for other platforms yet
  2504. ;;
  2505. esac
  2506. AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
  2507. # Output results
  2508. if test -d "$srcdir/pstack" ; then
  2509. AC_CONFIG_FILES(pstack/Makefile pstack/aout/Makefile)
  2510. fi
  2511. if test -d "$srcdir/cmd-line-utils/readline" ; then
  2512. AC_CONFIG_FILES(cmd-line-utils/readline/Makefile)
  2513. fi
  2514. AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
  2515. unittest/Makefile unittest/mytap/Makefile unittest/mytap/t/Makefile dnl
  2516. unittest/mysys/Makefile unittest/examples/Makefile dnl
  2517. strings/Makefile regex/Makefile storage/Makefile dnl
  2518. man/Makefile BUILD/Makefile vio/Makefile dnl
  2519. libmysql/Makefile libmysql_r/Makefile client/Makefile dnl
  2520. sql/Makefile sql/share/Makefile dnl
  2521. sql/sql_builtin.cc sql-common/Makefile dnl
  2522. dbug/Makefile scripts/Makefile include/Makefile dnl
  2523. tests/Makefile Docs/Makefile support-files/Makefile dnl
  2524. support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile dnl
  2525. server-tools/Makefile server-tools/instance-manager/Makefile dnl
  2526. cmd-line-utils/Makefile cmd-line-utils/libedit/Makefile dnl
  2527. libmysqld/Makefile libmysqld/examples/Makefile dnl
  2528. mysql-test/Makefile dnl
  2529. mysql-test/ndb/Makefile netware/Makefile sql-bench/Makefile dnl
  2530. include/mysql_version.h plugin/Makefile win/Makefile)
  2531. AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
  2532. # Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
  2533. AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'")
  2534. AC_OUTPUT
  2535. echo
  2536. echo "MySQL has a Web site at http://www.mysql.com/ which carries details on the"
  2537. echo "latest release, upcoming features, and other information to make your"
  2538. echo "work or play with MySQL more productive. There you can also find"
  2539. echo "information about mailing lists for MySQL discussion."
  2540. echo
  2541. echo "Remember to check the platform specific part of the reference manual for"
  2542. echo "hints about installing MySQL on your platform. Also have a look at the"
  2543. echo "files in the Docs directory."
  2544. echo
  2545. # The following text is checked in ./Do-compile to verify that configure
  2546. # ended sucessfully - don't remove it.
  2547. echo "Thank you for choosing MySQL!"
  2548. echo