| 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 |
AC_DEFUN([AX_LIB_MYSQL], |
|---|
| 63 |
[ |
|---|
| 64 |
AC_ARG_WITH([mysql], |
|---|
| 65 |
AC_HELP_STRING([--with-mysql=@<:@ARG@:>@], |
|---|
| 66 |
[use MySQL client library @<:@default=yes@:>@, optionally specify path to mysql_config] |
|---|
| 67 |
), |
|---|
| 68 |
[ |
|---|
| 69 |
if test "$withval" = "no"; then |
|---|
| 70 |
want_mysql="no" |
|---|
| 71 |
elif test "$withval" = "yes"; then |
|---|
| 72 |
want_mysql="yes" |
|---|
| 73 |
else |
|---|
| 74 |
want_mysql="yes" |
|---|
| 75 |
MYSQL_CONFIG="$withval" |
|---|
| 76 |
fi |
|---|
| 77 |
], |
|---|
| 78 |
[want_mysql="yes"] |
|---|
| 79 |
) |
|---|
| 80 |
|
|---|
| 81 |
MYSQL_CFLAGS="" |
|---|
| 82 |
MYSQL_LDFLAGS="" |
|---|
| 83 |
MYSQL_VERSION="" |
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
if test "$want_mysql" = "yes"; then |
|---|
| 90 |
|
|---|
| 91 |
if test -z "$MYSQL_CONFIG" -o test; then |
|---|
| 92 |
AC_PATH_PROG([MYSQL_CONFIG], [mysql_config], [no]) |
|---|
| 93 |
fi |
|---|
| 94 |
|
|---|
| 95 |
AC_MSG_CHECKING([for MySQL libraries]) |
|---|
| 96 |
if test "$MYSQL_CONFIG" != "no"; then |
|---|
| 97 |
|
|---|
| 98 |
MYSQL_CFLAGS="`$MYSQL_CONFIG --cflags`" |
|---|
| 99 |
MYSQL_LDFLAGS="`$MYSQL_CONFIG --libs`" |
|---|
| 100 |
|
|---|
| 101 |
MYSQL_VERSION=`$MYSQL_CONFIG --version` |
|---|
| 102 |
|
|---|
| 103 |
AC_DEFINE([HAVE_MYSQL], [1], |
|---|
| 104 |
[Define to 1 if MySQL libraries are available]) |
|---|
| 105 |
|
|---|
| 106 |
found_mysql="yes" |
|---|
| 107 |
AC_MSG_RESULT([yes]) |
|---|
| 108 |
else |
|---|
| 109 |
found_mysql="no" |
|---|
| 110 |
AC_MSG_RESULT([no]) |
|---|
| 111 |
fi |
|---|
| 112 |
fi |
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 |
mysql_version_req=ifelse([$1], [], [], [$1]) |
|---|
| 120 |
|
|---|
| 121 |
if test "$found_mysql" = "yes" -a -n "$mysql_version_req"; then |
|---|
| 122 |
|
|---|
| 123 |
AC_MSG_CHECKING([if MySQL version is >= $mysql_version_req]) |
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
mysql_version_req_major=`expr $mysql_version_req : '\([[0-9]]*\)'` |
|---|
| 128 |
mysql_version_req_minor=`expr $mysql_version_req : '[[0-9]]*\.\([[0-9]]*\)'` |
|---|
| 129 |
mysql_version_req_micro=`expr $mysql_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` |
|---|
| 130 |
if test "x$mysql_version_req_micro" = "x"; then |
|---|
| 131 |
mysql_version_req_micro="0" |
|---|
| 132 |
fi |
|---|
| 133 |
|
|---|
| 134 |
mysql_version_req_number=`expr $mysql_version_req_major \* 1000000 \ |
|---|
| 135 |
\+ $mysql_version_req_minor \* 1000 \ |
|---|
| 136 |
\+ $mysql_version_req_micro` |
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 |
mysql_version_major=`expr $MYSQL_VERSION : '\([[0-9]]*\)'` |
|---|
| 141 |
mysql_version_minor=`expr $MYSQL_VERSION : '[[0-9]]*\.\([[0-9]]*\)'` |
|---|
| 142 |
mysql_version_micro=`expr $MYSQL_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` |
|---|
| 143 |
if test "x$mysql_version_micro" = "x"; then |
|---|
| 144 |
mysql_version_micro="0" |
|---|
| 145 |
fi |
|---|
| 146 |
|
|---|
| 147 |
mysql_version_number=`expr $mysql_version_major \* 1000000 \ |
|---|
| 148 |
\+ $mysql_version_minor \* 1000 \ |
|---|
| 149 |
\+ $mysql_version_micro` |
|---|
| 150 |
|
|---|
| 151 |
mysql_version_check=`expr $mysql_version_number \>\= $mysql_version_req_number` |
|---|
| 152 |
if test "$mysql_version_check" = "1"; then |
|---|
| 153 |
AC_MSG_RESULT([yes]) |
|---|
| 154 |
else |
|---|
| 155 |
AC_MSG_RESULT([no]) |
|---|
| 156 |
fi |
|---|
| 157 |
fi |
|---|
| 158 |
|
|---|
| 159 |
AC_SUBST([MYSQL_VERSION]) |
|---|
| 160 |
AC_SUBST([MYSQL_CFLAGS]) |
|---|
| 161 |
AC_SUBST([MYSQL_LDFLAGS]) |
|---|
| 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 |
AC_DEFUN(CHECK_SSL, |
|---|
| 205 |
[AC_ARG_WITH(ssl, |
|---|
| 206 |
|
|---|
| 207 |
[ |
|---|
| 208 |
AC_HELP_STRING([--with-ssl=@<:@DIR@:>@], [look for OpenSSL in DIR (Use when it's not found with the default search path)]) |
|---|
| 209 |
], |
|---|
| 210 |
|
|---|
| 211 |
[ AS_IF([test "x$with_ssl" != xno], |
|---|
| 212 |
[ AC_MSG_CHECKING([for OpenSSL]) |
|---|
| 213 |
for dir in $with_ssl /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do |
|---|
| 214 |
ssldir="$dir" |
|---|
| 215 |
if test -f "$dir/include/openssl/ssl.h"; then |
|---|
| 216 |
found_ssl="yes"; |
|---|
| 217 |
CFLAGS="$CFLAGS -I$ssldir/include/"; |
|---|
| 218 |
break; |
|---|
| 219 |
fi |
|---|
| 220 |
if test -f "$dir/include/ssl.h"; then |
|---|
| 221 |
found_ssl="yes"; |
|---|
| 222 |
CFLAGS="$CFLAGS -I$ssldir/include/"; |
|---|
| 223 |
break; |
|---|
| 224 |
fi |
|---|
| 225 |
done |
|---|
| 226 |
if test x_$found_ssl != x_yes; then |
|---|
| 227 |
AC_MSG_RESULT(no) |
|---|
| 228 |
else |
|---|
| 229 |
AC_MSG_RESULT(yes) |
|---|
| 230 |
LIBS="$LIBS -lssl -lcrypto"; |
|---|
| 231 |
LDFLAGS="$LDFLAGS -L$ssldir/lib"; |
|---|
| 232 |
HAVE_SSL="yes"; |
|---|
| 233 |
AC_SUBST(HAVE_SSL) |
|---|
| 234 |
fi |
|---|
| 235 |
], |
|---|
| 236 |
AC_MSG_NOTICE([ssl support disabled]) |
|---|
| 237 |
)], |
|---|
| 238 |
[ |
|---|
| 239 |
AC_MSG_CHECKING([for OpenSSL]) |
|---|
| 240 |
for dir in /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do |
|---|
| 241 |
ssldir="$dir" |
|---|
| 242 |
if test -f "$dir/include/openssl/ssl.h"; then |
|---|
| 243 |
found_ssl="yes"; |
|---|
| 244 |
CFLAGS="$CFLAGS -I$ssldir/include/"; |
|---|
| 245 |
break; |
|---|
| 246 |
fi |
|---|
| 247 |
if test -f "$dir/include/ssl.h"; then |
|---|
| 248 |
found_ssl="yes"; |
|---|
| 249 |
CFLAGS="$CFLAGS -I$ssldir/include/"; |
|---|
| 250 |
break; |
|---|
| 251 |
fi |
|---|
| 252 |
done |
|---|
| 253 |
if test x_$found_ssl != x_yes; then |
|---|
| 254 |
AC_MSG_RESULT(no) |
|---|
| 255 |
else |
|---|
| 256 |
AC_MSG_RESULT(yes) |
|---|
| 257 |
LIBS="$LIBS -lssl -lcrypto"; |
|---|
| 258 |
LDFLAGS="$LDFLAGS -L$ssldir/lib"; |
|---|
| 259 |
HAVE_SSL="yes"; |
|---|
| 260 |
AC_SUBST(HAVE_SSL) |
|---|
| 261 |
fi |
|---|
| 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 |
AC_DEFUN([TYPE_SOCKLEN_T], |
|---|
| 316 |
[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, |
|---|
| 317 |
[ |
|---|
| 318 |
AC_TRY_COMPILE( |
|---|
| 319 |
[ |
|---|
| 320 |
|
|---|
| 321 |
[socklen_t len = 42; return 0;], |
|---|
| 322 |
ac_cv_type_socklen_t=yes, |
|---|
| 323 |
ac_cv_type_socklen_t=no) |
|---|
| 324 |
]) |
|---|
| 325 |
if test $ac_cv_type_socklen_t != yes; then |
|---|
| 326 |
AC_DEFINE(socklen_t, int, [Substitute for socklen_t]) |
|---|
| 327 |
fi |
|---|
| 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 |
AC_DEFUN([LIB_SOCKET_NSL], |
|---|
| 363 |
[ |
|---|
| 364 |
AC_SEARCH_LIBS([gethostbyname], [nsl]) |
|---|
| 365 |
AC_SEARCH_LIBS([socket], [socket], [], [ |
|---|
| 366 |
AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"], |
|---|
| 367 |
[], [-lnsl])]) |
|---|
| 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 |
|
|---|
| 394 |
|
|---|
| 395 |
|
|---|
| 396 |
|
|---|
| 397 |
AC_DEFUN([AC_FUNC_SNPRINTF], |
|---|
| 398 |
[AC_CHECK_FUNCS(snprintf vsnprintf) |
|---|
| 399 |
AC_MSG_CHECKING(for working snprintf) |
|---|
| 400 |
AC_CACHE_VAL(ac_cv_have_working_snprintf, |
|---|
| 401 |
[AC_TRY_RUN( |
|---|
| 402 |
[ |
|---|
| 403 |
|
|---|
| 404 |
int main(void) |
|---|
| 405 |
{ |
|---|
| 406 |
char bufs[5] = { 'x', 'x', 'x', '\0', '\0' }; |
|---|
| 407 |
char bufd[5] = { 'x', 'x', 'x', '\0', '\0' }; |
|---|
| 408 |
int i; |
|---|
| 409 |
i = snprintf (bufs, 2, "%s", "111"); |
|---|
| 410 |
if (strcmp (bufs, "1")) exit (1); |
|---|
| 411 |
if (i != 3) exit (1); |
|---|
| 412 |
i = snprintf (bufd, 2, "%d", 111); |
|---|
| 413 |
if (strcmp (bufd, "1")) exit (1); |
|---|
| 414 |
if (i != 3) exit (1); |
|---|
| 415 |
exit(0); |
|---|
| 416 |
}], ac_cv_have_working_snprintf=yes, ac_cv_have_working_snprintf=no, ac_cv_have_working_snprintf=cross)]) |
|---|
| 417 |
AC_MSG_RESULT([$ac_cv_have_working_snprintf]) |
|---|
| 418 |
AC_MSG_CHECKING(for working vsnprintf) |
|---|
| 419 |
AC_CACHE_VAL(ac_cv_have_working_vsnprintf, |
|---|
| 420 |
[AC_TRY_RUN( |
|---|
| 421 |
[ |
|---|
| 422 |
|
|---|
| 423 |
|
|---|
| 424 |
int my_vsnprintf (char *buf, const char *tmpl, ...) |
|---|
| 425 |
{ |
|---|
| 426 |
int i; |
|---|
| 427 |
va_list args; |
|---|
| 428 |
va_start (args, tmpl); |
|---|
| 429 |
i = vsnprintf (buf, 2, tmpl, args); |
|---|
| 430 |
va_end (args); |
|---|
| 431 |
return i; |
|---|
| 432 |
} |
|---|
| 433 |
|
|---|
| 434 |
int main(void) |
|---|
| 435 |
{ |
|---|
| 436 |
char bufs[5] = { 'x', 'x', 'x', '\0', '\0' }; |
|---|
| 437 |
char bufd[5] = { 'x', 'x', 'x', '\0', '\0' }; |
|---|
| 438 |
int i; |
|---|
| 439 |
i = my_vsnprintf (bufs, "%s", "111"); |
|---|
| 440 |
if (strcmp (bufs, "1")) exit (1); |
|---|
| 441 |
if (i != 3) exit (1); |
|---|
| 442 |
i = my_vsnprintf (bufd, "%d", 111); |
|---|
| 443 |
if (strcmp (bufd, "1")) exit (1); |
|---|
| 444 |
if (i != 3) exit (1); |
|---|
| 445 |
exit(0); |
|---|
| 446 |
}], ac_cv_have_working_vsnprintf=yes, ac_cv_have_working_vsnprintf=no, ac_cv_have_working_vsnprintf=cross)]) |
|---|
| 447 |
AC_MSG_RESULT([$ac_cv_have_working_vsnprintf]) |
|---|
| 448 |
if test x$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf != "xyesyes"; then |
|---|
| 449 |
AC_LIBOBJ(snprintf) |
|---|
| 450 |
AC_MSG_WARN([Replacing missing/broken (v)snprintf() with version from http://www.ijs.si/software/snprintf/.]) |
|---|
| 451 |
AC_DEFINE(PREFER_PORTABLE_SNPRINTF, 1, "enable replacement (v)snprintf if system (v)snprintf is broken") |
|---|
| 452 |
fi]) |
|---|
| 453 |
|
|---|
| 454 |
|
|---|
| 455 |
|
|---|
| 456 |
|
|---|
| 457 |
|
|---|
| 458 |
|
|---|
| 459 |
|
|---|
| 460 |
|
|---|
| 461 |
|
|---|
| 462 |
|
|---|
| 463 |
|
|---|
| 464 |
|
|---|
| 465 |
|
|---|
| 466 |
|
|---|
| 467 |
|
|---|
| 468 |
|
|---|
| 469 |
|
|---|
| 470 |
|
|---|
| 471 |
|
|---|
| 472 |
|
|---|
| 473 |
|
|---|
| 474 |
|
|---|
| 475 |
|
|---|
| 476 |
|
|---|
| 477 |
|
|---|
| 478 |
|
|---|
| 479 |
|
|---|
| 480 |
|
|---|
| 481 |
|
|---|
| 482 |
|
|---|
| 483 |
|
|---|
| 484 |
|
|---|
| 485 |
|
|---|
| 486 |
|
|---|
| 487 |
|
|---|
| 488 |
|
|---|
| 489 |
|
|---|
| 490 |
|
|---|
| 491 |
|
|---|
| 492 |
|
|---|
| 493 |
|
|---|
| 494 |
|
|---|
| 495 |
|
|---|
| 496 |
|
|---|
| 497 |
|
|---|
| 498 |
|
|---|
| 499 |
|
|---|
| 500 |
AC_DEFUN([AX_LIB_POSTGRESQL], |
|---|
| 501 |
[ |
|---|
| 502 |
AC_ARG_WITH([postgresql], |
|---|
| 503 |
AC_HELP_STRING([--with-postgresql=@<:@ARG@:>@], |
|---|
| 504 |
[use PostgreSQL library @<:@default=yes@:>@, optionally specify path to pg_config] |
|---|
| 505 |
), |
|---|
| 506 |
[ |
|---|
| 507 |
if test "$withval" = "no"; then |
|---|
| 508 |
want_postgresql="no" |
|---|
| 509 |
elif test "$withval" = "yes"; then |
|---|
| 510 |
want_postgresql="yes" |
|---|
| 511 |
else |
|---|
| 512 |
want_postgresql="yes" |
|---|
| 513 |
PG_CONFIG="$withval" |
|---|
| 514 |
fi |
|---|
| 515 |
], |
|---|
| 516 |
[want_postgresql="yes"] |
|---|
| 517 |
) |
|---|
| 518 |
|
|---|
| 519 |
POSTGRESQL_CFLAGS="" |
|---|
| 520 |
POSTGRESQL_LDFLAGS="" |
|---|
| 521 |
POSTGRESQL_POSTGRESQL="" |
|---|
| 522 |
|
|---|
| 523 |
|
|---|
| 524 |
|
|---|
| 525 |
|
|---|
| 526 |
|
|---|
| 527 |
if test "$want_postgresql" = "yes"; then |
|---|
| 528 |
|
|---|
| 529 |
if test -z "$PG_CONFIG" -o test; then |
|---|
| 530 |
AC_PATH_PROG([PG_CONFIG], [pg_config], [no]) |
|---|
| 531 |
fi |
|---|
| 532 |
|
|---|
| 533 |
AC_MSG_CHECKING([for PostgreSQL libraries]) |
|---|
| 534 |
if test "$PG_CONFIG" != "no"; then |
|---|
| 535 |
|
|---|
| 536 |
POSTGRESQL_CFLAGS="-I`$PG_CONFIG --includedir`" |
|---|
| 537 |
POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir` -lpq" |
|---|
| 538 |
|
|---|
| 539 |
POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's |
|---|
| 540 |
|
|---|
| 541 |
AC_DEFINE([HAVE_POSTGRESQL], [1], |
|---|
| 542 |
[Define to 1 if PostgreSQL libraries are available]) |
|---|
| 543 |
|
|---|
| 544 |
found_postgresql="yes" |
|---|
| 545 |
AC_MSG_RESULT([yes]) |
|---|
| 546 |
else |
|---|
| 547 |
found_postgresql="no" |
|---|
| 548 |
AC_MSG_RESULT([no]) |
|---|
| 549 |
fi |
|---|
| 550 |
fi |
|---|
| 551 |
|
|---|
| 552 |
|
|---|
| 553 |
|
|---|
| 554 |
|
|---|
| 555 |
|
|---|
| 556 |
|
|---|
| 557 |
postgresql_version_req=ifelse([$1], [], [], [$1]) |
|---|
| 558 |
|
|---|
| 559 |
if test "$found_postgresql" = "yes" -a -n "$postgresql_version_req"; then |
|---|
| 560 |
|
|---|
| 561 |
AC_MSG_CHECKING([if PostgreSQL version is >= $postgresql_version_req]) |
|---|
| 562 |
|
|---|
| 563 |
|
|---|
| 564 |
|
|---|
| 565 |
postgresql_version_req_major=`expr $postgresql_version_req : '\([[0-9]]*\)'` |
|---|
| 566 |
postgresql_version_req_minor=`expr $postgresql_version_req : '[[0-9]]*\.\([[0-9]]*\)'` |
|---|
| 567 |
postgresql_version_req_micro=`expr $postgresql_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` |
|---|
| 568 |
if test "x$postgresql_version_req_micro" = "x"; then |
|---|
| 569 |
postgresql_version_req_micro="0" |
|---|
| 570 |
fi |
|---|
| 571 |
|
|---|
| 572 |
postgresql_version_req_number=`expr $postgresql_version_req_major \* 1000000 \ |
|---|
| 573 |
\+ $postgresql_version_req_minor \* 1000 \ |
|---|
| 574 |
\+ $postgresql_version_req_micro` |
|---|
| 575 |
|
|---|
| 576 |
|
|---|
| 577 |
|
|---|
| 578 |
postgresql_version_major=`expr $POSTGRESQL_VERSION : '\([[0-9]]*\)'` |
|---|
| 579 |
postgresql_version_minor=`expr $POSTGRESQL_VERSION : '[[0-9]]*\.\([[0-9]]*\)'` |
|---|
| 580 |
postgresql_version_micro=`expr $POSTGRESQL_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` |
|---|
| 581 |
if test "x$postgresql_version_micro" = "x"; then |
|---|
| 582 |
postgresql_version_micro="0" |
|---|
| 583 |
fi |
|---|
| 584 |
|
|---|
| 585 |
postgresql_version_number=`expr $postgresql_version_major \* 1000000 \ |
|---|
| 586 |
\+ $postgresql_version_minor \* 1000 \ |
|---|
| 587 |
\+ $postgresql_version_micro` |
|---|
| 588 |
|
|---|
| 589 |
postgresql_version_check=`expr $postgresql_version_number \>\= $postgresql_version_req_number` |
|---|
| 590 |
if test "$postgresql_version_check" = "1"; then |
|---|
| 591 |
AC_MSG_RESULT([yes]) |
|---|
| 592 |
else |
|---|
| 593 |
AC_MSG_RESULT([no]) |
|---|
| 594 |
fi |
|---|
| 595 |
fi |
|---|
| 596 |
|
|---|
| 597 |
AC_SUBST([POSTGRESQL_VERSION]) |
|---|
| 598 |
AC_SUBST([POSTGRESQL_CFLAGS]) |
|---|
| 599 |
AC_SUBST([POSTGRESQL_LDFLAGS]) |
|---|
| 600 |
]) |
|---|
| 601 |
|
|---|
| 602 |
|
|---|
| 603 |
|
|---|
| 604 |
|
|---|
| 605 |
|
|---|
| 606 |
|
|---|
| 607 |
|
|---|
| 608 |
|
|---|
| 609 |
|
|---|
| 610 |
|
|---|
| 611 |
|
|---|
| 612 |
|
|---|
| 613 |
|
|---|
| 614 |
|
|---|
| 615 |
|
|---|
| 616 |
|
|---|
| 617 |
|
|---|
| 618 |
|
|---|
| 619 |
|
|---|
| 620 |
|
|---|
| 621 |
|
|---|
| 622 |
|
|---|
| 623 |
|
|---|
| 624 |
|
|---|
| 625 |
|
|---|
| 626 |
|
|---|
| 627 |
|
|---|
| 628 |
|
|---|
| 629 |
|
|---|
| 630 |
|
|---|
| 631 |
|
|---|
| 632 |
|
|---|
| 633 |
|
|---|
| 634 |
|
|---|
| 635 |
|
|---|
| 636 |
|
|---|
| 637 |
|
|---|
| 638 |
|
|---|
| 639 |
|
|---|
| 640 |
AC_DEFUN([AX_LIB_SQLITE3], |
|---|
| 641 |
[ |
|---|
| 642 |
AC_ARG_WITH([sqlite3], |
|---|
| 643 |
AC_HELP_STRING( |
|---|
| 644 |
[--with-sqlite3=@<:@ARG@:>@], |
|---|
| 645 |
[use SQLite 3 library @<:@default=yes@:>@, optionally specify the prefix for sqlite3 library] |
|---|
| 646 |
), |
|---|
| 647 |
[ |
|---|
| 648 |
if test "$withval" = "no"; then |
|---|
| 649 |
WANT_SQLITE3="no" |
|---|
| 650 |
elif test "$withval" = "yes"; then |
|---|
| 651 |
WANT_SQLITE3="yes" |
|---|
| 652 |
ac_sqlite3_path="" |
|---|
| 653 |
else |
|---|
| 654 |
WANT_SQLITE3="yes" |
|---|
| 655 |
ac_sqlite3_path="$withval" |
|---|
| 656 |
fi |
|---|
| 657 |
], |
|---|
| 658 |
[WANT_SQLITE3="yes"] |
|---|
| 659 |
) |
|---|
| 660 |
|
|---|
| 661 |
SQLITE3_CFLAGS="" |
|---|
| 662 |
SQLITE3_LDFLAGS="" |
|---|
| 663 |
SQLITE3_VERSION="" |
|---|
| 664 |
|
|---|
| 665 |
if test "x$WANT_SQLITE3" = "xyes"; then |
|---|
| 666 |
|
|---|
| 667 |
ac_sqlite3_header="sqlite3.h" |
|---|
| 668 |
|
|---|
| 669 |
sqlite3_version_req=ifelse([$1], [], [3.0.0], [$1]) |
|---|
| 670 |
sqlite3_version_req_shorten=`expr $sqlite3_version_req : '\([[0-9]]*\.[[0-9]]*\)'` |
|---|
| 671 |
sqlite3_version_req_major=`expr $sqlite3_version_req : '\([[0-9]]*\)'` |
|---|
| 672 |
sqlite3_version_req_minor=`expr $sqlite3_version_req : '[[0-9]]*\.\([[0-9]]*\)'` |
|---|
| 673 |
sqlite3_version_req_micro=`expr $sqlite3_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` |
|---|
| 674 |
if test "x$sqlite3_version_req_micro" = "x" ; then |
|---|
| 675 |
sqlite3_version_req_micro="0" |
|---|
| 676 |
fi |
|---|
| 677 |
|
|---|
| 678 |
sqlite3_version_req_number=`expr $sqlite3_version_req_major \* 1000000 \ |
|---|
| 679 |
\+ $sqlite3_version_req_minor \* 1000 \ |
|---|
| 680 |
\+ $sqlite3_version_req_micro` |
|---|
| 681 |
|
|---|
| 682 |
AC_MSG_CHECKING([for SQLite3 library >= $sqlite3_version_req]) |
|---|
| 683 |
|
|---|
| 684 |
if test "$ac_sqlite3_path" != ""; then |
|---|
| 685 |
ac_sqlite3_ldflags="-L$ac_sqlite3_path/lib" |
|---|
| 686 |
ac_sqlite3_cppflags="-I$ac_sqlite3_path/include" |
|---|
| 687 |
else |
|---|
| 688 |
for ac_sqlite3_path_tmp in /usr /usr/local /opt ; do |
|---|
| 689 |
if test -f "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header" \ |
|---|
| 690 |
&& test -r "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header"; then |
|---|
| 691 |
ac_sqlite3_path=$ac_sqlite3_path_tmp |
|---|
| 692 |
ac_sqlite3_cppflags="-I$ac_sqlite3_path_tmp/include" |
|---|
| 693 |
ac_sqlite3_ldflags="-L$ac_sqlite3_path_tmp/lib" |
|---|
| 694 |
break; |
|---|
| 695 |
fi |
|---|
| 696 |
done |
|---|
| 697 |
fi |
|---|
| 698 |
|
|---|
| 699 |
ac_sqlite3_ldflags="$ac_sqlite3_ldflags -lsqlite3" |
|---|
| 700 |
|
|---|
| 701 |
saved_CPPFLAGS="$CPPFLAGS" |
|---|
| 702 |
CPPFLAGS="$CPPFLAGS $ac_sqlite3_cppflags" |
|---|
| 703 |
AC_COMPILE_IFELSE( |
|---|
| 704 |
[ |
|---|
| 705 |
AC_LANG_PROGRAM([[@%:@include <sqlite3.h>]], |
|---|
| 706 |
[[ |
|---|
| 707 |
|
|---|
| 708 |
/* Everything is okay */ |
|---|
| 709 |
|
|---|
| 710 |
|
|---|
| 711 |
|
|---|
| 712 |
]] |
|---|
| 713 |
) |
|---|
| 714 |
], |
|---|
| 715 |
[ |
|---|
| 716 |
AC_MSG_RESULT([yes]) |
|---|
| 717 |
success="yes" |
|---|
| 718 |
], |
|---|
| 719 |
[ |
|---|
| 720 |
AC_MSG_RESULT([not found]) |
|---|
| 721 |
succees="no" |
|---|
| 722 |
] |
|---|
| 723 |
) |
|---|
| 724 |
|
|---|
| 725 |
CPPFLAGS="$saved_CPPFLAGS" |
|---|
| 726 |
|
|---|
| 727 |
if test "$success" = "yes"; then |
|---|
| 728 |
|
|---|
| 729 |
SQLITE3_CFLAGS="$ac_sqlite3_cppflags" |
|---|
| 730 |
SQLITE3_LDFLAGS="$ac_sqlite3_ldflags" |
|---|
| 731 |
|
|---|
| 732 |
ac_sqlite3_header_path="$ac_sqlite3_path/include/$ac_sqlite3_header" |
|---|
| 733 |
|
|---|
| 734 |
|
|---|
| 735 |
if test "x$ac_sqlite3_header_path" != "x"; then |
|---|
| 736 |
ac_sqlite3_version=`cat $ac_sqlite3_header_path \ |
|---|
| 737 |
| grep ' |
|---|
| 738 |
| sed -e 's/"//'` |
|---|
| 739 |
if test $ac_sqlite3_version != ""; then |
|---|
| 740 |
SQLITE3_VERSION=$ac_sqlite3_version |
|---|
| 741 |
else |
|---|
| 742 |
AC_MSG_WARN([Can not find SQLITE_VERSION macro in sqlite3.h header to retrieve SQLite version!]) |
|---|
| 743 |
fi |
|---|
| 744 |
fi |
|---|
| 745 |
|
|---|
| 746 |
AC_SUBST(SQLITE3_CFLAGS) |
|---|
| 747 |
AC_SUBST(SQLITE3_LDFLAGS) |
|---|
| 748 |
AC_SUBST(SQLITE3_VERSION) |
|---|
| 749 |
AC_DEFINE(HAVE_SQLITE3) |
|---|
| 750 |
fi |
|---|
| 751 |
fi |
|---|
| 752 |
]) |
|---|
| 753 |
|
|---|
| 754 |
|
|---|
| 755 |
|
|---|
| 756 |
|
|---|
| 757 |
|
|---|
| 758 |
|
|---|
| 759 |
|
|---|
| 760 |
|
|---|
| 761 |
|
|---|
| 762 |
|
|---|
| 763 |
|
|---|
| 764 |
|
|---|
| 765 |
|
|---|
| 766 |
|
|---|
| 767 |
|
|---|
| 768 |
|
|---|
| 769 |
|
|---|
| 770 |
|
|---|
| 771 |
|
|---|
| 772 |
|
|---|
| 773 |
|
|---|
| 774 |
|
|---|
| 775 |
|
|---|
| 776 |
|
|---|
| 777 |
|
|---|
| 778 |
|
|---|
| 779 |
|
|---|
| 780 |
|
|---|
| 781 |
|
|---|
| 782 |
|
|---|
| 783 |
|
|---|
| 784 |
|
|---|
| 785 |
|
|---|
| 786 |
|
|---|
| 787 |
|
|---|
| 788 |
|
|---|
| 789 |
|
|---|
| 790 |
|
|---|
| 791 |
|
|---|
| 792 |
|
|---|
| 793 |
|
|---|
| 794 |
|
|---|
| 795 |
|
|---|
| 796 |
|
|---|
| 797 |
|
|---|
| 798 |
|
|---|
| 799 |
|
|---|
| 800 |
|
|---|
| 801 |
|
|---|
| 802 |
|
|---|
| 803 |
|
|---|
| 804 |
AC_DEFUN([AX_C___ATTRIBUTE__], |
|---|
| 805 |
[AC_MSG_CHECKING(for __attribute__) |
|---|
| 806 |
AC_CACHE_VAL(ac_cv___attribute__, [ |
|---|
| 807 |
AC_TRY_COMPILE( |
|---|
| 808 |
[ |
|---|
| 809 |
static void foo(void) __attribute__ ((unused)); |
|---|
| 810 |
static void |
|---|
| 811 |
foo(void) { |
|---|
| 812 |
exit(1); |
|---|
| 813 |
}],, |
|---|
| 814 |
ac_cv___attribute__=yes, |
|---|
| 815 |
ac_cv___attribute__=no |
|---|
| 816 |
)]) |
|---|
| 817 |
if test "$ac_cv___attribute__" = "yes"; then |
|---|
| 818 |
AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__]) |
|---|
| 819 |
fi |
|---|
| 820 |
AC_MSG_RESULT($ac_cv___attribute__) |
|---|
| 821 |
]) |
|---|
| 822 |
|
|---|
| 823 |
|
|---|
| 824 |
|
|---|
| 825 |
|
|---|
| 826 |
|
|---|
| 827 |
|
|---|
| 828 |
|
|---|
| 829 |
|
|---|
| 830 |
|
|---|
| 831 |
|
|---|
| 832 |
|
|---|
| 833 |
|
|---|
| 834 |
|
|---|
| 835 |
|
|---|
| 836 |
|
|---|
| 837 |
|
|---|
| 838 |
|
|---|
| 839 |
|
|---|
| 840 |
|
|---|
| 841 |
|
|---|
| 842 |
|
|---|
| 843 |
|
|---|
| 844 |
|
|---|
| 845 |
|
|---|
| 846 |
|
|---|
| 847 |
|
|---|
| 848 |
|
|---|
| 849 |
|
|---|
| 850 |
|
|---|
| 851 |
|
|---|
| 852 |
|
|---|
| 853 |
|
|---|
| 854 |
|
|---|
| 855 |
|
|---|
| 856 |
|
|---|
| 857 |
|
|---|
| 858 |
|
|---|
| 859 |
|
|---|
| 860 |
|
|---|
| 861 |
|
|---|
| 862 |
|
|---|
| 863 |
|
|---|
| 864 |
|
|---|
| 865 |
|
|---|
| 866 |
|
|---|
| 867 |
|
|---|