-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in_old
393 lines (340 loc) · 13.6 KB
/
configure.in_old
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
dnl Process this file with autoconf to produce a configure script.
AC_INIT
dnl Checks for programs.
AC_PROG_CC
AM_INIT_AUTOMAKE(pgpool-II, 3.3.0-alpha1, [subdir-objects])
# AC_PROG_RANLIB
AC_PROG_LIBTOOL
AM_PROG_LEX
AC_PROG_YACC
dnl suggested by libtoolize --force
AC_CONFIG_MACRO_DIR([m4])
dnl Check compiler option
dnl check -Wall option
OLD_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wall"
AC_MSG_CHECKING(for -Wall option)
AC_CACHE_VAL(ac_cv_wall,
AC_TRY_COMPILE([], [char a;], ac_cv_wall=yes, ac_cv_wall=no))
echo $ac_cv_wall
if test $ac_cv_wall = no; then
CFLAGS=$OLD_CFLAGS
fi
dnl check -Wmissing-prototypes
OLD_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wmissing-prototypes"
AC_MSG_CHECKING(for -Wmissing-prototypes option)
AC_CACHE_VAL(ac_cv_wmissing_prototypes,
AC_TRY_COMPILE([], [char a;], ac_cv_wmissing_prototypes=yes,
ac_cv_wmissing_prototypes=no))
echo $ac_cv_wmissing_prototypes
if test $ac_cv_wmissing_prototypes = no; then
CFLAGS=$OLD_CFLAGS
fi
dnl check -Wmissing-prototypes
OLD_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wmissing-declarations"
AC_MSG_CHECKING(for -Wmissing-declarations option)
AC_CACHE_VAL(ac_cv_wmissing_declarations,
AC_TRY_COMPILE([], [char a;], ac_cv_wmissing_declarations=yes,
ac_cv_wmissing_declarations=no))
echo $ac_cv_wmissing_declarations
if test $ac_cv_wmissing_declarations = no; then
CFLAGS=$OLD_CFLAGS
fi
dnl Checks for libraries.
AC_CHECK_LIB(m, main)
AC_CHECK_LIB(nsl, main)
AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(ipc, main)
AC_CHECK_LIB(IPC, main)
AC_CHECK_LIB(lc, main)
AC_CHECK_LIB(compat, main)
AC_CHECK_LIB(BSD, main)
AC_CHECK_LIB(gen, main)
AC_CHECK_LIB(PW, main)
AC_CHECK_LIB(resolv, main)
AC_CHECK_LIB(crypt, main)
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h unistd.h getopt.h netinet/tcp.h netinet/in.h netdb.h sys/param.h sys/types.h sys/socket.h sys/un.h sys/time.h sys/sem.h sys/shm.h sys/select.h crypt.h sys/pstat.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_HEADER_TIME
dnl ===== Copied from PostgreSQL's configure start =====
dnl
dnl Check to see if we have a working 64-bit integer type.
dnl This breaks down into two steps:
dnl (1) figure out if the compiler has a 64-bit int type with working
dnl arithmetic, and if so
dnl (2) see whether snprintf() can format the type correctly. (Currently,
dnl snprintf is the only library routine we really need for int8 support.)
dnl It's entirely possible to have a compiler that handles a 64-bit type
dnl when the C library doesn't; this is fairly likely when using gcc on
dnl an older platform, for example.
dnl If there is no native snprintf() or it does not handle the 64-bit type,
dnl we force our own version of snprintf() to be used instead.
dnl Note this test must be run after our initial check for snprintf/vsnprintf.
m4_include([c-compiler.m4])
m4_include([c-library.m4])
m4_include([general.m4])
dnl This mazic variable is set to "yes" in PostgreSQL's configure.in
dnl if PORTNAME is "win32".
dnl pgpool-II does not suppport Windows at the moment, so we set to "no".
pgac_need_repl_snprintf=no
PGAC_TYPE_64BIT_INT([long int])
if test x"$HAVE_LONG_INT_64" = x"no" ; then
PGAC_TYPE_64BIT_INT([long long int])
fi
dnl If we need to use "long long int", figure out whether nnnLL notation works.
if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then
AC_TRY_COMPILE([
#define INT64CONST(x) x##LL
long long int foo = INT64CONST(0x1234567890123456);
],
[],
[AC_DEFINE(HAVE_LL_CONSTANTS, 1, [Define to 1 if constants of type 'long long int' should have the suffix LL.])],
[])
fi
# If we found "long int" is 64 bits, assume snprintf handles it. If
# we found we need to use "long long int", better check. We cope with
# snprintfs that use %lld, %qd, or %I64d as the format. If none of these
# work, fall back to our own snprintf emulation (which we know uses %lld).
if test "$HAVE_LONG_LONG_INT_64" = yes ; then
if test $pgac_need_repl_snprintf = no; then
PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT
if test "$LONG_LONG_INT_FORMAT" = ""; then
# Force usage of our own snprintf, since system snprintf is broken
pgac_need_repl_snprintf=yes
LONG_LONG_INT_FORMAT='%lld'
fi
else
# Here if we previously decided we needed to use our own snprintf
LONG_LONG_INT_FORMAT='%lld'
fi
LONG_LONG_UINT_FORMAT=`echo "$LONG_LONG_INT_FORMAT" | sed 's/d$/u/'`
INT64_FORMAT="\"$LONG_LONG_INT_FORMAT\""
UINT64_FORMAT="\"$LONG_LONG_UINT_FORMAT\""
else
# Here if we are not using 'long long int' at all
INT64_FORMAT='"%ld"'
UINT64_FORMAT='"%lu"'
fi
AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT,
[Define to the appropriate snprintf format for 64-bit ints, if any.])
AC_DEFINE_UNQUOTED(UINT64_FORMAT, $UINT64_FORMAT,
[Define to the appropriate snprintf format for unsigned 64-bit ints, if any.])
# Now we have checked all the reasons to replace snprintf
if test $pgac_need_repl_snprintf = yes; then
AC_DEFINE(USE_REPL_SNPRINTF, 1, [Use replacement snprintf() functions.])
AC_LIBOBJ(snprintf)
fi
# Need a #define for the size of Datum (unsigned long)
AC_CHECK_SIZEOF([unsigned long])
# And check size of void *, size_t (enables tweaks for > 32bit address space)
AC_CHECK_SIZEOF([void *])
AC_CHECK_SIZEOF([size_t])
# Decide whether float4 is passed by value: user-selectable, enabled by default
AC_MSG_CHECKING([whether to build with float4 passed by value])
PGAC_ARG_BOOL(enable, float4-byval, yes, [disable float4 passed by value],
[AC_DEFINE([USE_FLOAT4_BYVAL], 1,
[Define to 1 if you want float4 values to be passed by value. (--enable-float4-byval)])
float4passbyval=true],
[float4passbyval=false])
AC_MSG_RESULT([$enable_float4_byval])
AC_DEFINE_UNQUOTED([FLOAT4PASSBYVAL], [$float4passbyval], [float4 values are passed by value if 'true', by reference if 'false'])
# Decide whether float8 is passed by value.
# Note: this setting also controls int8 and related types such as timestamp.
# If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
# If not, trying to select it is an error.
AC_MSG_CHECKING([whether to build with float8 passed by value])
if test $ac_cv_sizeof_unsigned_long -ge 8 ; then
PGAC_ARG_BOOL(enable, float8-byval, yes, [disable float8 passed by value])
else
PGAC_ARG_BOOL(enable, float8-byval, no, [disable float8 passed by value])
if test "$enable_float8_byval" = yes ; then
AC_MSG_ERROR([--enable-float8-byval is not supported on 32-bit platforms.])
fi
fi
if test "$enable_float8_byval" = yes ; then
AC_DEFINE([USE_FLOAT8_BYVAL], 1,
[Define to 1 if you want float8, int8, etc values to be passed by value. (--enable-float8-byval)])
float8passbyval=true
else
float8passbyval=false
fi
AC_MSG_RESULT([$enable_float8_byval])
AC_DEFINE_UNQUOTED([FLOAT8PASSBYVAL], [$float8passbyval], [float8, int8, and related values are passed by value if 'true', by reference if 'false'])
dnl Rest of part cannot be executed by autocnf-2.59.
dnl AC_CHECK_ALIGNOF is supported autoconf-2.60 or higher.
dnl ===== Copied from PostgreSQL's configure start =====
dnl Checks for sockaddr_storage structure, members and necessary types
m4_include([ac_func_accept_argtypes.m4])
AC_CHECK_TYPES([struct sockaddr_storage], [], [],
[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
])
AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family,
struct sockaddr_storage.__ss_family,
struct sockaddr_storage.ss_len,
struct sockaddr_storage.__ss_len,
struct sockaddr.sa_len], [], [],
[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
])
AC_CHECK_TYPES([union semun],[],[],[#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>])
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_FUNC_WAIT3
AC_FUNC_ACCEPT_ARGTYPES
AC_CHECK_FUNCS(setsid select socket sigprocmask strdup strerror strftime strtok asprintf vasprintf gai_strerror hstrerror pstat setproctitle vsyslog)
dnl Checks for pg_config command.
AC_CHECK_PROGS(PGCONFIG, pg_config)
if test -z $PGCONFIG
then
PGSQL_INCLUDE_DIR=/usr/local/pgsql/include
PGSQL_LIB_DIR=/usr/local/pgsql/lib
else
PGSQL_INCLUDE_DIR=`pg_config --includedir`
PGSQL_LIB_DIR=`pg_config --libdir`
fi
AC_ARG_WITH(pgsql,
[ --with-pgsql=DIR site header files for PostgreSQL in DIR],
[
case "$withval" in
"" | y | ye | yes | n | no)
AC_MSG_ERROR([*** You must supply an argument to the --with-pgsql option.])
;;
esac
PGSQL_INCLUDE_DIR="$withval"/include
PGSQL_LIB_DIR="$withval"/lib
])
AC_ARG_WITH(pgsql-includedir,
[ --with-pgsql-includedir=DIR site header files for PostgreSQL in DIR],
[
case "$withval" in
"" | y | ye | yes | n | no)
AC_MSG_ERROR([*** You must supply an argument to the --with-pgsql-includedir option.])
;;
esac
PGSQL_INCLUDE_DIR="$withval"
])
AC_ARG_WITH(pgsql-libdir,
[ --with-pgsql-libdir=DIR site library files for PostgreSQL in DIR],
[
case "$withval" in
"" | y | ye | yes | n | no)
AC_MSG_ERROR([*** You must supply an argument to the --with-pgsql-libdir option.])
;;
esac
PGSQL_LIB_DIR="$withval"
])
AC_ARG_WITH(openssl,
[ --with-openssl build with OpenSSL support],
[],
[openssl=no])
if test "$with_openssl" = yes || test "$with_openssl" = auto; then
AC_CHECK_HEADERS(openssl/ssl.h,
[AC_DEFINE([USE_SSL], 1,
[Define to 1 to build with SSL support. (--with-openssl)])],
[
if test "$with_openssl" = yes; then
AC_MSG_ERROR([header file <openssl/ssl.h> is required for SSL])
else
AC_MSG_WARN([header file <openssl/ssl.h> is required for SSL])
fi
])
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
AC_CHECK_LIB(ssl, SSL_library_init, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
fi
AC_ARG_WITH(pam,
[ --with-pam build with PAM support],
[AC_DEFINE([USE_PAM], 1, [Define to 1 to build with PAM support. (--with-pam)])])
if test "$with_pam" = yes ; then
AC_CHECK_LIB(pam, pam_start, [], [AC_MSG_ERROR([library 'pam' is required for PAM])])
AC_CHECK_HEADERS(security/pam_appl.h, [],
[AC_CHECK_HEADERS(pam/pam_appl.h, [],
[AC_MSG_ERROR([header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM.])])])
fi
AC_ARG_WITH(memcached,
[ --with-memcached=DIR site header files for libmemcached in DIR],
[
case "$withval" in
"" | y | ye | yes | n | no)
AC_MSG_ERROR([*** You must supply an argument to the --with-memcached option.])
;;
*)
MEMCACHED_INCLUDE_DIR="$withval"/include
MEMCACHED_LIB_DIR="$withval"/lib
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I$MEMCACHED_INCLUDE_DIR"
AC_CHECK_HEADERS(
[libmemcached/memcached.h],
[AC_DEFINE([USE_MEMCACHED], 1, [Define to 1 to build with memcached support])],
[AC_MSG_ERROR([header file <libmemcached/memcached.h> is required for memcached support])])
CFLAGS=$OLD_CFLAGS
AC_CHECK_LIB(memcached, memcached_create, [], [AC_MSG_ERROR(libmemcached is not installed)])
MEMCACHED_INCLUDE_OPT="-I $MEMCACHED_INCLUDE_DIR"
MEMCACHED_LINK_OPT="-L$MEMCACHED_LIB_DIR"
MEMCACHED_RPATH_OPT="-rpath $MEMCACHED_LIB_DIR"
;;
esac
])
AC_SUBST(MEMCACHED_INCLUDE_OPT)
AC_SUBST(MEMCACHED_LINK_OPT)
AC_SUBST(MEMCACHED_RPATH_OPT)
OLD_LDFLAGS="$LDFLAGS"
LDFLAGS="-L$PGSQL_LIB_DIR"
OLD_LIBS="$LIBS"
AC_CHECK_LIB(pq, PQexecPrepared, [], [AC_MSG_ERROR(libpq is not installed or libpq is old)])
AC_CHECK_FUNCS(PQprepare)
LDFLAGS="$OLD_LDFLAGS"
LIBS="$OLD_LIBS"
AC_SUBST(PGSQL_INCLUDE_DIR)
AC_SUBST(PGSQL_LIB_DIR)
AC_SUBST(MEMCACHED_DIR)
# --enable(disable)-rpath option
AC_ARG_ENABLE(rpath,
[ --disable-rpath do not embed shared library search path in executables],
[case "${enableval}" in
yes) rpath=yes ;;
no) rpath=no ;;
esac],
[rpath=yes]
)
AM_CONDITIONAL([enable_rpath], test x$rpath = xyes)
# Decide whether to use row lock against the sequence table for insert_lock.
# This lock method is compatible with pgpool-II 3.0 series(until 3.0.4).
AC_MSG_CHECKING([whether to use row lock against the sequence table for insert_lock])
PGAC_ARG_BOOL(enable, sequence-lock, no, [insert_lock compatible with pgpool-II 3.0 series (until 3.0.4)])
if test "$enable_sequence_lock" = yes && test "$enable_table_lock" = yes ; then
AC_MSG_ERROR([--enable-table-lock cannot be enabled at the same time.])
fi
if test "$enable_sequence_lock" = yes ; then
AC_DEFINE([USE_SEQUENCE_LOCK], 1,
[Define to 1 if you want to use row lock against the sequence table for insert_lock. (--enable-sequence-lock)])
fi
AC_MSG_RESULT([$enable_sequence_lock])
# Decide whether to use table lock against the target table for insert_lock.
# This lock method is compatible with pgpool-II 2.2 and 2.3 series.
AC_MSG_CHECKING([whether to use table lock against the target table for insert_lock])
PGAC_ARG_BOOL(enable, table-lock, no, [insert_lock compatible with pgpool-II 2.2 and 2.3 series])
if test "$enable_table_lock" = yes && test "$enable_sequence_lock" = yes ; then
AC_MSG_ERROR([--enable-sequence-lock cannot be enabled at the same time.])
fi
if test "$enable_table_lock" = yes ; then
AC_DEFINE([USE_TABLE_LOCK], 1,
[Define to 1 if you want to use table lock against the target table for insert_lock. (--enable-table-lock)])
fi
AC_MSG_RESULT([$enable_table_lock])
AM_CONFIG_HEADER(src/include/config.h)
AC_OUTPUT([Makefile src/Makefile src/parser/Makefile src/tools/pcp/Makefile src/watchdog/Makefile])