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