-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.in
193 lines (173 loc) · 4.97 KB
/
configure.in
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
dnl For Queue for MySQL - a mysql pluggable storage engine
AC_INIT(src/ha_queue.cc)
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(src/queue_config.h)
AC_PREFIX_PROGRAM(mysqld_safe)
# **** edit below two lines to update version ****
AM_INIT_AUTOMAKE("q4m", 0.9.7)
AC_DEFINE([Q4M_VERSION_HEX],[0x0009],[hexadecimal version no])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_PROG_LIBTOOL
LIBTOOL="$LIBTOOL --preserve-dup-deps"
AC_SUBST(LIBTOOL)
sinclude(config/ac_mysql.m4)
MYSQL_SRC_TEST
AC_SUBST(MYSQL_INC)
# check if prefix points to mysql 5.1
if test ! -e "${prefix}/include/mysql/plugin.h" -a ! -e "${prefix}/include/mysql.h"
then
echo "failed to lacate mysql 5.1 installation" >&2
echo "Please specify mysql 5.1 directory with --prefix option." >&2
exit 1
fi
# change libdir to prefix/lib/mysql unless otherwise specified
MYSQL_LIBDIR="${prefix}/lib"
if test "$libdir" = '${exec_prefix}/lib'
then
if test -d "${prefix}/lib/mysql/plugin"
then
MYSQL_LIBDIR="${libdir}/mysql"
libdir="${libdir}/mysql/plugin"
elif test -d "${prefix}/lib/plugin"
then
libdir="${libdir}/plugin"
fi
fi
AC_SUBST(MYSQL_LIBDIR)
# We only support GCC and Sun's forte at the moment
if test "$GCC" = "yes"
then
CFLAGS="$CFLAGS -Wall"
CXXFLAGS="$CXXFLAGS -Wall"
else
CFLAGS="-Xa -xstrconst -mt -D_FORTEC_ -fast -m64"
CXXFLAGS="$CXXFLAGS -noex -mt -D_FORTEC_ -fast -m64"
DTRACEFLAGS="-64"
fi
OSNAME=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
PROCNAME=`uname -p | tr "[[:upper:]]" "[[:lower:]]"`
if test "$PROCNAME" = "i686"
then
PROCNAME="i386"
fi
if test "$OSNAME" = "linux" -a "$PROCNAME" = "x86_64"
then
CFLAGS="$CFLAGS -fpic"
CXXFLAGS="$CXXFLAGS -fpic"
fi
if test "$OSNAME" = "linux"
then
LDFLAGS="-Wl,--hash-style=both"
fi
AC_ARG_WITH(debug,
[ --with-debug enable debugging, should match the configuration
used to compile mysql ],
[
if test "$withval" = "yes"
then
CFLAGS="$CFLAGS -g -DSAFE_MUTEX"
CXXFLAGS="$CXXFLAGS -g -DSAFE_MUTEX"
fi
],
[ with_debug=no ])
AC_ARG_WITH(sync,
[ --with-sync=yes commit to disk at checkpoints (default)
--with-sync=no do not commit explicitly to disk
--with-sync=fsync use fsync instead of fdatasync
--with-sync=fcntl use fcntl(F_FULLFSYNC) instead of fdatasync ],
[ with_sync=$withval ],
[ with_sync=yes ])
if test "$with_sync" = "yes"
then
if test "$OSNAME" = "darwin" ; then
with_sync="fcntl"
elif test "$OSNAME" = "freebsd" ; then
with_sync="fsync"
else
with_sync="fdatasync"
fi
fi
case "$with_sync" in
fcntl)
AC_DEFINE([FDATASYNC_USE_FCNTL],1,[use fcntl for fdatasysnc])
;;
fsync)
AC_DEFINE([FDATASYNC_USE_FSYNC],1,[use fsync instead of fdatasync])
;;
no)
AC_DEFINE([FDATASYNC_SKIP],1,[do not sync at checkpoints])
;;
esac
dnl no support for disabling the feature
AC_DEFINE([Q4M_USE_MT_PWRITE],1,[do not serialize pwrite])
AC_ARG_ENABLE(mmap,
[ --enable-mmap use mmap for reading data (default:yes)])
if test "$enable_mmap" != "no"
then
AC_DEFINE([Q4M_USE_MMAP],1,[use mmap for reading data])
fi
AC_ARG_WITH(delete,
[ --with-delete=pwrite use pwrite for row deletions (default)
--with-delete=msync use msync
--with-delete=mt-pwrite
use pwrite from multiple threads (experimental) ],
[ with_delete_method=$withval ],
[ with_delete_method=pwrite ])
if test "$with_delete_method" = "pwrite"
then
AC_DEFINE([Q4M_DELETE_METHOD],[Q4M_DELETE_SERIAL_PWRITE],
[use pwrite for row deletions])
elif test "$with_delete_method" = "mt-pwrite"
then
AC_DEFINE([Q4M_DELETE_METHOD],[Q4M_DELETE_MT_PWRITE],
[use multi-threaded pwrite for row deletions])
elif test "$with_delete_method" = "msync"
then
if test "$enable_mmap" = "no"
then
echo "cannot use --with-delete=msync without --enable-mmap" >&2
exit 1
fi
AC_DEFINE([Q4M_DELETE_METHOD],[Q4M_DELETE_MSYNC],
[use msync for row deletions])
else
echo "unknown delete method: $with_delete_method" >&2
exit 1
fi
if test "$OSNAME" = "darwin" ; then
AC_DEFINE([Q4M_USE_RELATIVE_TIMEDWAIT],1,[use pthread_cond_timedwait_relative_np])
fi
if test -z "$DOC_ROOT"
then
DOC_ROOT='http://q4m.github.com/'
fi
AC_SUBST(DOC_ROOT)
AC_CHECK_SIZEOF(int*)
if test "$SIZEOF_INT_P" = "8"
then
if test "$PROCNAME" = "x86_64"
then
BINARY_ARCH="$OSNAME-x86_64"
else
BINARY_ARCH="$OSNAME-$PROCNAME-64bit"
fi
else
BINARY_ARCH="$OSNAME-$PROCNAME"
fi
AC_SUBST(BINARY_ARCH)
if test -z "$BINARY_DIST_DIR"
then
BINARY_DIST_DIR="$PACKAGE-$VERSION-$BINARY_ARCH"
fi
AC_SUBST(BINARY_DIST_DIR)
AC_C_CONST
AC_TYPE_SIZE_T
AC_CHECK_FUNCS([lseek64])
AC_CHECK_FUNC(powl, [], [AC_DEFINE([powl],[pow],[use pow instead of powl])])
AC_CHECK_HEADERS(limits.h syslimits.h)
AC_SEARCH_LIBS([pthread_mutex_timedlock], [pthread], [AC_DEFINE([HAVE_PTHREAD_MUTEX_TIMEDLOCK],1,[use pthread_mutex_timedlock])])
AC_OUTPUT(Makefile src/Makefile t/Makefile)