~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.in

Made system non-foreign.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl -*- ksh -*-
2
2
dnl Process this file with autoconf to produce a configure script.
3
3
 
4
 
AC_PREREQ(2.52)dnl              Minimum Autoconf version required.
 
4
AC_PREREQ(2.61)dnl              Minimum Autoconf version required.
5
5
 
6
 
AC_INIT(sql/mysqld.cc)
 
6
AC_INIT
 
7
AC_CONFIG_SRCDIR([sql/mysqld.cc])
7
8
AC_CONFIG_AUX_DIR(config)
8
 
AM_CONFIG_HEADER([include/config.h:config.h.in])
9
 
AC_CANONICAL_SYSTEM
 
9
AC_CONFIG_HEADERS([include/config.h:config.h.in])
 
10
AC_CANONICAL_TARGET
10
11
AM_INIT_AUTOMAKE(mysql, 7.0.0, no-define)
11
12
 
12
13
PROTOCOL_VERSION=10
33
34
MYSQL_VERSION_ID=`echo $MYSQL_NUMERIC_VERSION | \
34
35
    awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
35
36
 
36
 
# Add previous major version for debian package upgrade path
37
 
MYSQL_PREVIOUS_BASE_VERSION=5.1
38
 
 
39
37
# The port should be constant for a LONG time
40
38
MYSQL_TCP_PORT_DEFAULT=3306
41
39
 
78
76
# Canonicalize the configuration name.
79
77
 
80
78
# Check whether --with-system-type or --without-system-type was given.
81
 
AC_ARG_WITH(system-type,
82
 
    [  --with-system-type      Set the system type, like "sun-solaris10"],
 
79
AC_ARG_WITH([system-type],
 
80
    [AS_HELP_STRING([--with-system-type],
 
81
       [Set the system type, like "sun-solaris10"])],
83
82
    [SYSTEM_TYPE="$withval"],
84
83
    [SYSTEM_TYPE="$host_vendor-$host_os"])
85
 
AC_ARG_WITH(machine-type,
86
 
    [  --with-machine-type     Set the machine type, like "powerpc"],
 
84
AC_ARG_WITH([machine-type],
 
85
    [AS_HELP_STRING([--with-machine-type],
 
86
       [Set the machine type, like "powerpc"])],
87
87
    [MACHINE_TYPE="$withval"],
88
88
    [MACHINE_TYPE="$host_cpu"])
89
89
AC_SUBST(SYSTEM_TYPE)
179
179
AC_SUBST(CC_VERSION)
180
180
MYSQL_CHECK_CXX_VERSION
181
181
 
182
 
if test "$ac_cv_prog_gcc" = "yes"
 
182
if test "$ac_cv_c_compiler_gnu" = "yes"
183
183
then
184
184
  AS="$CC -c"
185
185
  AC_SUBST(AS)
270
270
  # We should use -Wno-invalid-offsetof flag to disable some warnings from gcc
271
271
  # regarding offset() usage in C++ which are done in a safe manner in the
272
272
  # server
273
 
  CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
 
273
  CXXFLAGS="$CXXFLAGS -Wall -fno-implicit-templates -fno-exceptions -fno-rtti"
 
274
  CFLAGS="$CFLAGS -Wall"
274
275
  AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
275
276
    [1], [Defined by configure. Use explicit template instantiation.])
276
277
fi
667
668
 
668
669
# Build optimized or debug version ?
669
670
# First check for gcc and g++
670
 
if test "$ac_cv_prog_gcc" = "yes"
 
671
if test "$ac_cv_c_compiler_gnu" = "yes"
671
672
then
672
673
  DEBUG_CFLAGS="-g"
673
674
  DEBUG_OPTIMIZE_CC="-O"
727
728
 
728
729
# If we should allow error injection tests
729
730
AC_ARG_WITH(error-inject,
730
 
    AC_HELP_STRING([--with-error-inject],[Enable error injection in MySQL Server]),
 
731
    AS_HELP_STRING([--with-error-inject],[Enable error injection in MySQL Server]),
731
732
    [ with_error_inject=$withval ],
732
733
    [ with_error_inject=no ])
733
734
 
741
742
fi
742
743
 
743
744
AC_ARG_WITH([fast-mutexes],
744
 
            AC_HELP_STRING([--with-fast-mutexes], 
745
 
            [Compile with fast mutexes (default is disabled)]),
 
745
            AS_HELP_STRING([--with-fast-mutexes],[Compile with fast mutexes (default is disabled)]),
746
746
            [with_fast_mutexes=$withval], [with_fast_mutexes=no])
747
747
 
748
748
if test "$with_fast_mutexes" != "no"
769
769
AC_SUBST(COMPILATION_COMMENT)
770
770
 
771
771
AC_MSG_CHECKING("need of special linking flags")
772
 
if test "$TARGET_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes"
 
772
if test "$TARGET_LINUX" = "true" -a "$ac_cv_c_compiler_gnu" = "yes" -a "$all_is_static" != "yes"
773
773
then
774
774
  LDFLAGS="$LDFLAGS -rdynamic"
775
775
  AC_MSG_RESULT("-rdynamic")
792
792
AC_C_CONST
793
793
AC_C_INLINE
794
794
AC_TYPE_OFF_T
795
 
AC_STRUCT_ST_RDEV
796
795
AC_HEADER_TIME
797
796
AC_STRUCT_TM
798
797
MYSQL_NEEDS_MYSYS_NEW
845
844
AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
846
845
# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
847
846
# follow any standard), we'll use well-defined preprocessor macros:
848
 
AC_TRY_CPP([
 
847
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
849
848
#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
850
849
#error USE_PRAGMA_IMPLEMENTATION
851
850
#endif
852
 
],AC_MSG_RESULT(no) ,AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION")
 
851
]])],[AC_MSG_RESULT(no) ],[AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION"])
853
852
 
854
853
# This always gives a warning. Ignore it unless you are cross compiling
855
854
AC_C_BIGENDIAN
914
913
# Already-done: strcasecmp
915
914
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
916
915
 
917
 
AC_STAT_MACROS_BROKEN
 
916
AC_HEADER_STAT
918
917
MYSQL_SIGNAL_CHECK
919
918
MYSQL_CHECK_GETPW_FUNCS
920
919
MYSQL_HAVE_TIOCGWINSZ
994
993
  strtol strtoll strtoul strtoull tell tempnam vidattr \
995
994
  posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
996
995
 
997
 
# Check that isinf() is available in math.h and can be used in both C and C++ 
 
996
# Check that isinf() is available in math.h and can be used in both C and C++
998
997
# code
999
 
AC_MSG_CHECKING(for isinf in <math.h>)
1000
 
AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r],
1001
 
  AC_MSG_RESULT(yes)
1002
 
  AC_MSG_CHECKING(whether isinf() can be used in C++ code)
1003
 
  AC_LANG_SAVE
1004
 
  AC_LANG_CPLUSPLUS
1005
 
  AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r],
 
998
AC_MSG_CHECKING(for isinf in math.h)
 
999
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
 
1000
    float f = 0.0; 
 
1001
    int r = isinf(f); 
 
1002
    return r;
 
1003
  ]])],[
1006
1004
    AC_MSG_RESULT(yes)
1007
 
    AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]),
1008
 
    AC_MSG_RESULT(no))
1009
 
  AC_LANG_RESTORE,
1010
 
  AC_MSG_RESULT(no))
1011
 
 
 
1005
    AC_MSG_CHECKING(whether isinf() can be used in C++ code)
 
1006
    AC_LANG_PUSH([C++])
 
1007
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
 
1008
      float f = 0.0;
 
1009
      int r = isinf(f);
 
1010
      return r;
 
1011
    ]])],[
 
1012
      AC_MSG_RESULT(yes)
 
1013
      AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function])
 
1014
    ],[
 
1015
      AC_MSG_RESULT(no)
 
1016
    ])
 
1017
    AC_LANG_POP([])
 
1018
  ],[
 
1019
  AC_MSG_RESULT(no)])
 
1020
 
 
1021
 
1012
1022
CFLAGS="$ORG_CFLAGS"
1013
1023
 
1014
1024
# Sanity check: We chould not have any fseeko symbol unless
1022
1032
 
1023
1033
# Check definition of pthread_getspecific
1024
1034
AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args,
1025
 
AC_TRY_COMPILE(
1026
 
[#if !defined(_REENTRANT)
 
1035
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if !defined(_REENTRANT)
1027
1036
#define _REENTRANT
1028
1037
#endif
1029
1038
#define _POSIX_PTHREAD_SEMANTICS 
1030
 
#include <pthread.h> ],
1031
 
[ void *pthread_getspecific(pthread_key_t key);
1032
 
pthread_getspecific((pthread_key_t) NULL); ],
1033
 
mysql_cv_getspecific_args=POSIX, mysql_cv_getspecific_args=other))
 
1039
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
 
1040
pthread_getspecific((pthread_key_t) NULL); ]])],[mysql_cv_getspecific_args=POSIX],[mysql_cv_getspecific_args=other]))
1034
1041
  if test "$mysql_cv_getspecific_args" = "other"
1035
1042
  then
1036
1043
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
1039
1046
 
1040
1047
  # Check definition of pthread_mutex_init
1041
1048
  AC_CACHE_CHECK("args to pthread_mutex_init", mysql_cv_mutex_init_args,
1042
 
  AC_TRY_COMPILE(
1043
 
[#define _REENTRANT
 
1049
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1044
1050
#define _POSIX_PTHREAD_SEMANTICS 
1045
 
#include <pthread.h> ],
1046
 
 
1051
#include <pthread.h> ]], [[ 
1047
1052
  pthread_mutexattr_t attr;
1048
1053
  pthread_mutex_t mp;
1049
 
  pthread_mutex_init(&mp,&attr); ],
1050
 
mysql_cv_mutex_init_args=POSIX, mysql_cv_mutex_init_args=other))
 
1054
  pthread_mutex_init(&mp,&attr); ]])],[mysql_cv_mutex_init_args=POSIX],[mysql_cv_mutex_init_args=other]))
1051
1055
  if test "$mysql_cv_mutex_init_args" = "other"
1052
1056
  then
1053
1057
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
1058
1062
#---START: Used in for client configure
1059
1063
# Check definition of readdir_r
1060
1064
AC_CACHE_CHECK("args to readdir_r", mysql_cv_readdir_r,
1061
 
AC_TRY_LINK(
1062
 
[#define _REENTRANT
 
1065
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1063
1066
#define _POSIX_PTHREAD_SEMANTICS 
1064
1067
#include <pthread.h>
1065
 
#include <dirent.h>],
1066
 
[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1067
 
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ],
1068
 
mysql_cv_readdir_r=POSIX, mysql_cv_readdir_r=other))
 
1068
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
 
1069
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],[mysql_cv_readdir_r=POSIX],[mysql_cv_readdir_r=other]))
1069
1070
if test "$mysql_cv_readdir_r" = "POSIX"
1070
1071
then
1071
1072
  AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
1073
1074
 
1074
1075
# Check definition of posix sigwait()
1075
1076
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
1076
 
AC_TRY_LINK(
1077
 
[#define _REENTRANT
 
1077
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1078
1078
#define _POSIX_PTHREAD_SEMANTICS 
1079
1079
#include <pthread.h>
1080
 
#include <signal.h>],
1081
 
[#ifndef _AIX
 
1080
#include <signal.h>]], [[#ifndef _AIX
1082
1081
sigset_t set;
1083
1082
int sig;
1084
1083
sigwait(&set,&sig);
1085
 
#endif],
1086
 
mysql_cv_sigwait=POSIX, mysql_cv_sigwait=other))
 
1084
#endif]])],[mysql_cv_sigwait=POSIX],[mysql_cv_sigwait=other]))
1087
1085
if test "$mysql_cv_sigwait" = "POSIX"
1088
1086
then
1089
1087
  AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
1094
1092
unset mysql_cv_sigwait
1095
1093
# Check definition of posix sigwait()
1096
1094
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
1097
 
AC_TRY_LINK(
1098
 
[#define _REENTRANT
 
1095
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1099
1096
#define _POSIX_PTHREAD_SEMANTICS 
1100
1097
#include <pthread.h>
1101
 
#include <signal.h>],
1102
 
[sigset_t set;
 
1098
#include <signal.h>]], [[sigset_t set;
1103
1099
int sig;
1104
 
sigwait(&set);],
1105
 
mysql_cv_sigwait=NONPOSIX, mysql_cv_sigwait=other))
 
1100
sigwait(&set);]])],[mysql_cv_sigwait=NONPOSIX],[mysql_cv_sigwait=other]))
1106
1101
if test "$mysql_cv_sigwait" = "NONPOSIX"
1107
1102
then
1108
1103
  AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
1112
1107
 
1113
1108
# Check if pthread_attr_setscope() exists
1114
1109
AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope,
1115
 
AC_TRY_LINK(
1116
 
[#define _REENTRANT
 
1110
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1117
1111
#define _POSIX_PTHREAD_SEMANTICS 
1118
 
#include <pthread.h>],
1119
 
[pthread_attr_t thr_attr;
1120
 
pthread_attr_setscope(&thr_attr,0);],
1121
 
mysql_cv_pthread_attr_setscope=yes, mysql_cv_pthread_attr_setscope=no))
 
1112
#include <pthread.h>]], [[pthread_attr_t thr_attr;
 
1113
pthread_attr_setscope(&thr_attr,0);]])],[mysql_cv_pthread_attr_setscope=yes],[mysql_cv_pthread_attr_setscope=no]))
1122
1114
if test "$mysql_cv_pthread_attr_setscope" = "yes"
1123
1115
then
1124
1116
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1126
1118
 
1127
1119
# Check for bad includes
1128
1120
AC_MSG_CHECKING("can netinet files be included")
1129
 
AC_TRY_COMPILE(
1130
 
[#include <sys/types.h>
 
1121
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1131
1122
#include <sys/socket.h>
1132
1123
#include <netinet/in_systm.h>
1133
1124
#include <netinet/in.h>
1134
1125
#include <netinet/ip.h>
1135
 
#include <netinet/tcp.h>],
1136
 
[ printf("1\n"); ],
1137
 
netinet_inc=yes, netinet_inc=no)
 
1126
#include <netinet/tcp.h>]], [[ printf("1\n"); ]])],[netinet_inc=yes],[netinet_inc=no])
1138
1127
if test "$netinet_inc" = "no"
1139
1128
then
1140
1129
  AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
1141
1130
fi
1142
1131
AC_MSG_RESULT("$netinet_inc")
1143
1132
 
1144
 
AC_LANG_SAVE
1145
 
AC_LANG_CPLUSPLUS
 
1133
AC_LANG_PUSH([C++])
1146
1134
AC_CHECK_HEADERS(cxxabi.h)
1147
1135
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
1148
 
[AC_TRY_LINK([#include <cxxabi.h>], [
 
1136
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
1149
1137
  char *foo= 0; int bar= 0;
1150
1138
  foo= abi::__cxa_demangle(foo, foo, 0, &bar);
1151
 
], [mysql_cv_cxa_demangle=yes], [mysql_cv_cxa_demangle=no])])
1152
 
AC_LANG_RESTORE
 
1139
]])],[mysql_cv_cxa_demangle=yes],[mysql_cv_cxa_demangle=no])])
 
1140
AC_LANG_POP([])
1153
1141
 
1154
1142
if test "x$mysql_cv_cxa_demangle" = xyes; then
1155
1143
  AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
1172
1160
 
1173
1161
MYSQL_CONFIGURE_PLUGINS([none])
1174
1162
 
1175
 
# Only build client code?
1176
 
AC_ARG_WITH(server,
1177
 
    [  --without-server        Only build the client.],
1178
 
    [with_server=$withval],
1179
 
    [with_server=yes]
1180
 
)
1181
 
 
1182
 
#MYSQL_CHECK_CPU
1183
 
 
1184
 
# If we have threads generate some library functions and test programs
1185
 
sql_server_dirs=
1186
 
sql_server=
1187
 
server_scripts=
1188
 
 
1189
 
dnl This probably should be cleaned up more - for now the threaded
1190
 
dnl client is just using plain-old libs.
1191
 
sql_client_dirs="strings regex mysys libmysql"
1192
 
 
1193
 
sql_client_dirs="$sql_client_dirs client"
1194
 
 
1195
 
CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS"
1196
 
 
1197
1163
AC_SUBST(CLIENT_LIBS)
1198
1164
AC_SUBST(CLIENT_THREAD_LIBS)
1199
 
AC_SUBST(NON_THREADED_LIBS)
1200
1165
AC_SUBST(STATIC_NSS_FLAGS)
1201
 
AC_SUBST(sql_client_dirs)
1202
 
 
1203
 
if test "$with_server" = "yes"
1204
 
then
1205
 
  AC_DEFINE([THREAD], [1],
1206
 
            [Define if you want to have threaded code. This may be undef on client code])
1207
 
  # Avoid _PROGRAMS names
1208
 
  THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_thr_init.o mf_keycache.o"
1209
 
  AC_SUBST(THREAD_LOBJECTS)
1210
 
  server_scripts="mysqld_safe mysql_install_db"
1211
 
  sql_server_dirs="strings mysys dbug extra regex"
1212
 
 
1213
 
  sql_server="sql"
1214
 
fi
 
1166
 
 
1167
AC_DEFINE([THREAD], [1],
 
1168
          [Define if you want to have threaded code. This may be undef on client code])
1215
1169
 
1216
1170
# IMPORTANT - do not modify LIBS past this line - this hack is the only way
1217
1171
# I know to add the static NSS magic if we have static NSS libraries with
1220
1174
LDFLAGS="$LDFLAGS $OTHER_LIBC_LIB"
1221
1175
LIBS="$LIBS $STATIC_NSS_FLAGS"
1222
1176
 
1223
 
AC_SUBST(sql_server_dirs)
1224
 
AC_SUBST(sql_server)
1225
 
AC_SUBST(server_scripts)
1226
 
 
1227
1177
AC_SUBST(mysql_plugin_dirs)
1228
1178
AC_SUBST(mysql_plugin_libs)
1229
1179
AC_SUBST(mysql_plugin_defs)
1230
1180
 
1231
 
 
1232
 
# Now that sql_client_dirs and sql_server_dirs are stable, determine the union.
1233
 
# Start with the (longer) server list, add each client item not yet present.
1234
 
sql_union_dirs=" $sql_server_dirs "
1235
 
for DIR in $sql_client_dirs
1236
 
do
1237
 
  if echo " $sql_union_dirs " | grep " $DIR " >/dev/null
1238
 
  then
1239
 
    :  # already present, skip
1240
 
  else
1241
 
    sql_union_dirs="$sql_union_dirs $DIR "
1242
 
  fi
1243
 
done
1244
 
AC_SUBST(sql_union_dirs)
1245
 
 
1246
1181
# Some usefull subst
1247
1182
AC_SUBST(CC)
1248
1183
AC_SUBST(GXX)
1269
1204
 dbug/Makefile scripts/Makefile include/Makefile dnl
1270
1205
 support-files/Makefile dnl
1271
1206
 mysql-test/Makefile dnl
 
1207
 man/Makefile dnl
1272
1208
 include/mysql_version.h plugin/Makefile)
1273
1209
 
1274
1210
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)