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.

2928 lines
92 KiB

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