Renamed --enable-mysql to --with-mysql. Added
--with-postgres option. Use AC_FUNC_MALLOC and AC_FUNC_REALLOC instead of old jm_* versions.
Showing
1 changed file
with
45 additions
and
13 deletions
... | @@ -285,8 +285,8 @@ AC_CHECK_MEMBERS([struct tm.tm_zone, struct tm.tm_gmtoff, struct tm.tm_isdst], | ... | @@ -285,8 +285,8 @@ AC_CHECK_MEMBERS([struct tm.tm_zone, struct tm.tm_gmtoff, struct tm.tm_isdst], |
285 | 285 | ||
286 | dnl Check for working functions | 286 | dnl Check for working functions |
287 | 287 | ||
288 | jm_FUNC_MALLOC | 288 | AC_FUNC_MALLOC |
289 | jm_FUNC_REALLOC | 289 | AC_FUNC_REALLOC |
290 | AC_FUNC_ALLOCA | 290 | AC_FUNC_ALLOCA |
291 | 291 | ||
292 | jm_INCLUDED_REGEX(lib/regex.c) | 292 | jm_INCLUDED_REGEX(lib/regex.c) |
... | @@ -392,17 +392,49 @@ AC_CHECK_FUNCS(_obstack_begin, | ... | @@ -392,17 +392,49 @@ AC_CHECK_FUNCS(_obstack_begin, |
392 | [AC_LIBOBJ(obstack)]) | 392 | [AC_LIBOBJ(obstack)]) |
393 | 393 | ||
394 | 394 | ||
395 | dnl check if mysql support was added | 395 | dnl check if SQL support is required |
396 | AC_SUBST(MYSQLLIBS) | 396 | AC_SUBST(SQLLIBS) |
397 | AC_ARG_ENABLE([mysql], | 397 | AC_ARG_WITH([mysql], |
398 | AC_HELP_STRING([--enable-mysql], | 398 | AC_HELP_STRING([--with-mysql], |
399 | [enable mysql support (default no)]), | 399 | [enable mysql support (default no)]), |
400 | [use_mysql="yes"],,) | 400 | [use_mysql="yes"],,) |
401 | if test x"$use_mysql" = x"yes"; then | 401 | |
402 | AC_CHECK_HEADER(mysql/mysql.h, | 402 | AC_ARG_WITH([postgres], |
403 | [MYSQLLIBS="-lmysqlclient -lm -L/usr/lib/mysql -L/usr/local/lib/mysql" | 403 | AC_HELP_STRING([--with-postgres], |
404 | AUTHLIBS="$AUTHLIBS $MYSQLLIBS" | 404 | [enable postgres support (default no)]), |
405 | AC_DEFINE(HAVE_MYSQL,1,[Define this if you have mysql libraries])]) | 405 | [use_postgres="yes"],,) |
406 | |||
407 | AH_TEMPLATE(USE_SQL,[Enables SQL support]) | ||
408 | AH_TEMPLATE(HAVE_MYSQL,[Define if you have libmysql]) | ||
409 | AH_TEMPLATE(HAVE_PGSQL,[Define if you have libpq]) | ||
410 | |||
411 | if test x"$use_mysql" = x"yes" -a x"$use_postgres" = x"yes"; then | ||
412 | AC_MSG_ERROR(Use either --with-mysql or --with-postgres, not both) | ||
413 | else | ||
414 | if test x"$use_mysql" = x"yes"; then | ||
415 | AC_CHECK_HEADER(mysql/mysql.h, | ||
416 | [MU_CHECK_LIB(mysqlclient, mysql_real_connect, "-lm", | ||
417 | [ USE_SQL=1 | ||
418 | AC_DEFINE(USE_SQL) | ||
419 | AC_DEFINE(HAVE_MYSQL) | ||
420 | SQLLIBS="$mu_cv_lib_mysqlclient" | ||
421 | ], | ||
422 | [ AC_MSG_ERROR(-lmysqlclient not found) ], | ||
423 | [/usr/local/lib/mysql /usr/lib/mysql])]) | ||
424 | fi | ||
425 | if test x"$use_postgres" = x"yes"; then | ||
426 | MU_CHECK_LIB(pq, PQconnectStart, [], | ||
427 | [ USE_SQL=1 | ||
428 | AC_DEFINE(HAVE_PGSQL) | ||
429 | SQLLIBS=$mu_cv_lib_pq], | ||
430 | [ AC_MSG_ERROR(-lpq not found) ], | ||
431 | [/usr/local/pgsql/lib /usr/pgsql/lib]) | ||
432 | fi | ||
433 | fi | ||
434 | |||
435 | if test x"$USE_SQL" = x1; then | ||
436 | AUTHLIBS="$AUTHLIBS $SQLLIBS" | ||
437 | AC_DEFINE(USE_SQL,1,[Define this to enable SQL support]) | ||
406 | fi | 438 | fi |
407 | 439 | ||
408 | dnl Virtual domain support | 440 | dnl Virtual domain support | ... | ... |
-
Please register or sign in to post a comment