summaryrefslogtreecommitdiff
path: root/libmysql/configure.in
blob: 22179a3397158a88943cb7afe2d6ab06c0da3fa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
dnl Process this file with autoconf to produce a configure script.
AC_INIT(libmysql.c)
dnl The version number should be autogenerated from the toplevel configure.in
AM_INIT_AUTOMAKE(libmysql, 3.23.11-alpha)
AM_CONFIG_HEADER(my_config.h)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_RANLIB

# We use libtool
AM_PROG_LIBTOOL

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(sgtty.h sys/ioctl.h)
# Maybe some can be removed but I got sick of adding them on at a time
# /David
AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
 memory.h pwd.h select.h \
 stdlib.h stddef.h \
 strings.h string.h synch.h sys/mman.h sys/socket.h \
 sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
 unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h)


dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_CHECK_SIZEOF(char, 1)
if test "$ac_cv_sizeof_char" -eq 0
then
  AC_MSG_ERROR([No size for char type.
A likely cause for this could be that there isn't any static libraries
installed. You can verify this by checking if you have libm.a in /lib,
/usr/lib or some other standard place.  If this is the problem,
install the static libraries and try again.  If this isn't the
problem, examine config.log for possible errors.  If you want to
report this include ALL system information and include at least the
last 20 rows from config.log!])
fi
AC_CHECK_SIZEOF(int, 4)
if test "$ac_cv_sizeof_int" -eq 0
then
  AC_MSG_ERROR("No size for int type.")
fi
AC_CHECK_SIZEOF(long, 4)
if test "$ac_cv_sizeof_long" -eq 0
then
  AC_MSG_ERROR("No size for long type.")
fi
AC_CHECK_SIZEOF(long long, 8)
if test "$ac_cv_sizeof_long_long" -eq 0
then
  AC_MSG_ERROR("MySQL needs a long long type.")
fi
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_TYPE_UID_T

# Do the system files define ulong
MYSQL_CHECK_ULONG
# Do the system files define uchar
MYSQL_CHECK_UCHAR
# Do the system files define uint
MYSQL_CHECK_UINT

#---START: Used in for client configure
# Check base type of last arg to accept
MYSQL_TYPE_ACCEPT
#---END:

dnl Checks for library functions.
AC_TYPE_SIGNAL
# Standard MySQL list
AC_CHECK_FUNCS(alarm bmove \
 chsize ftruncate rint finite fpsetmask fpresetsticky\
 cuserid fcntl fconvert  \
 getrusage getpwuid getcwd getrlimit getwd index locking longjmp \
 perror pread realpath rename \
 socket strnlen madvise \
 strtoul strtoull snprintf tempnam thr_setconcurrency \
 gethostbyaddr_r gethostbyname_r getpwnam \
 bfill bzero bcmp strstr strpbrk strerror\
 tell atod memcpy memmove \
 setupterm strcasecmp sighold \
 vidattr setupterm lrand48 localtime_r \
 sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \
 pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \
 pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \
 pthread_condattr_create rwlock_init \
 crypt dlopen dlerror fchmod getpass getpassphrase)

# This is special for libmysql
AC_CHECK_FUNCS(strtok_r)

#---START: Used in for client configure

# Check definition of gethostbyname_r (glibc2.0.100 is different from Solaris)
ac_save_CXXFLAGS="$CXXFLAGS"
AC_CACHE_CHECK([style of gethostname_r routines], mysql_cv_gethostname_style,
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
if test "$ac_cv_prog_gxx" = "yes"
then
  CXXFLAGS="$CXXFLAGS -Werror"
fi
AC_TRY_COMPILE(
[#ifndef SCO
#define _REENTRANT
#endif
#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>],
[int skr;

 int res = gethostbyname_r((const char *) 0,
  (struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, &skr);],
mysql_cv_gethostname_style=glibc2, mysql_cv_gethostname_style=other))
AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
if test "$mysql_cv_gethostname_style" = "glibc2"
then
  AC_DEFINE(HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R)
fi

if test "$with_mit_threads" = "no"
then
  # Check definition of pthread_getspecific
  AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args,
  AC_TRY_COMPILE(
[#ifndef SCO
#define _REENTRANT
#endif
#define _POSIX_PTHREAD_SEMANTICS 
#include <pthread.h> ],
[ void *pthread_getspecific(pthread_key_t key);
pthread_getspecific((pthread_key_t) NULL); ],
mysql_cv_getspecific_args=POSIX, mysql_cv_getspecific_args=other))
  if test "$mysql_cv_getspecific_args" = "other"
  then
    AC_DEFINE(HAVE_NONPOSIX_PTHREAD_GETSPECIFIC)
  fi

  # Check definition of pthread_mutex_init
  AC_CACHE_CHECK("args to pthread_mutex_init", mysql_cv_mutex_init_args,
  AC_TRY_COMPILE(
[#ifndef SCO
#define _REENTRANT
#endif
#define _POSIX_PTHREAD_SEMANTICS 
#include <pthread.h> ],
[ 
  pthread_mutexattr_t attr;
  pthread_mutex_t mp;
  pthread_mutex_init(&mp,&attr); ],
mysql_cv_mutex_init_args=POSIX, mysql_cv_mutex_init_args=other))
  if test "$mysql_cv_mutex_init_args" = "other"
  then
    AC_DEFINE(HAVE_NONPOSIX_PTHREAD_MUTEX_INIT)
  fi
fi
#---END:

#---START: Used in for client configure
# Check definition of readdir_r
AC_CACHE_CHECK("args to readdir_r", mysql_cv_readdir_r,
AC_TRY_LINK(
[#ifndef SCO
#define _REENTRANT
#endif
#define _POSIX_PTHREAD_SEMANTICS 
#include <pthread.h>
#include <dirent.h>],
[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ],
mysql_cv_readdir_r=POSIX, mysql_cv_readdir_r=other))
if test "$mysql_cv_readdir_r" = "POSIX"
then
  AC_DEFINE(HAVE_READDIR_R)
fi

# Check definition av posix sigwait()
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
AC_TRY_LINK(
[#ifndef SCO
#define _REENTRANT
#endif
#define _POSIX_PTHREAD_SEMANTICS 
#include <pthread.h>
#include <signal.h>],
[#ifndef _AIX
sigset_t set;
int sig;
sigwait(&set,&sig);
#endif],
mysql_cv_sigwait=POSIX, mysql_cv_sigwait=other))
if test "$mysql_cv_sigwait" = "POSIX"
then
  AC_DEFINE(HAVE_SIGWAIT)
fi

if test "$mysql_cv_sigwait" != "POSIX"
then
unset mysql_cv_sigwait
# Check definition av posix sigwait()
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
AC_TRY_LINK(
[#ifndef SCO
#define _REENTRANT
#endif
#define _POSIX_PTHREAD_SEMANTICS 
#include <pthread.h>
#include <signal.h>],
[sigset_t set;
int sig;
sigwait(&set);],
mysql_cv_sigwait=NONPOSIX, mysql_cv_sigwait=other))
if test "$mysql_cv_sigwait" = "NONPOSIX"
then
  AC_DEFINE(HAVE_NONPOSIX_SIGWAIT)
fi
fi
#---END:

AC_OUTPUT(Makefile)