dnl Process this file with autoconf to produce a configure script. AC_INIT(src/gmysql.c) AM_INIT_AUTOMAKE(gmysql, 0.3.4) AM_MAINTAINER_MODE AC_MSG_CHECKING(whether to include debugging information in executables) AC_ARG_ENABLE(debug, [ --enable-debug Include debugging information in executables], : ${CFLAGS=-g -Wall} && AC_MSG_RESULT(yes), : ${CFLAGS=-O2 -Wall} && AC_MSG_RESULT(no)) AC_ARG_WITH(mysql, [ --with-mysql=PFX Prefix where MySQL is installed (usually /usr/local)]) AC_ARG_WITH(mysql-includes, [ --with-mysql-includes=PFX Prefix where MySQL includes are found (usually /usr/local/include/mysql)]) AC_ARG_WITH(mysql-libraries, [ --with-mysql-libraries=PFX Prefix where MySQL libraries are found (usually /usr/local/lib/mysql)]) AC_PROG_CC dnl must call this explicitly, otherwise AC_CHECK_HEADER gets confused by if dnl stmt below and thinks AC_PROG_CPP's been called when it hasn't.. duh. AC_PROG_CPP AM_PATH_GTK(1.2.0, [LIBS="$LIBS $GTK_LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" AC_DEFINE_UNQUOTED(CONFIG_GTK_MAJOR,$gtk_config_major_version) AC_DEFINE_UNQUOTED(CONFIG_GTK_MINOR,$gtk_config_minor_version)], AC_MSG_ERROR(Need GTK+ version 1.2.0 or better!)) dnl Check usr/local first, in case sys admin has installed a later version dnl than was included with the OS (in which case the older will be in /usr) if test "x$with_mysql_includes" != "x"; then AC_CHECK_HEADER($with_mysql_includes/mysql.h, [CFLAGS="$CFLAGS -I$with_mysql_includes"], AC_MSG_ERROR(Need MySQL includes!)) fi if test "x$with_mysql_libraries" != "x"; then AC_CHECK_LIB_LOC($with_mysql_libraries,mysqlclient,mysql_connect,, AC_MSG_ERROR(Need MySQL client library!)) fi if test "x$with_mysql" != "x"; then if test "x$with_mysql_libraries" = "x"; then AC_CHECK_LIB_LOC($with_mysql/lib/mysql,mysqlclient,mysql_connect,, AC_MSG_ERROR(Need MySQL client library!)) fi if test "x$with_mysql_includes" = "x"; then AC_CHECK_HEADER($with_mysql/include/mysql/mysql.h, [CFLAGS="$CFLAGS -I$with_mysql/include/mysql"], AC_MSG_ERROR(Need MySQL includes!)) fi else if test "x$with_mysql_libraries" = "x"; then AC_CHECK_LIB_LOC(/opt/lib/mysql,mysqlclient,mysql_connect,, AC_CHECK_LIB_LOC(/usr/local/lib/mysql,mysqlclient,mysql_connect,, AC_CHECK_LIB_LOC(/usr/lib/mysql,mysqlclient,mysql_connect,, AC_CHECK_LIB_LOC(/usr/local/lib,mysqlclient,mysql_connect,, AC_CHECK_LIB_LOC(/opt/lib,mysqlclient,mysql_connect,, AC_CHECK_LIB_LOC(/usr/lib,mysqlclient,mysql_connect,, AC_MSG_ERROR(Need MySQL client library!))))))) fi if test "x$with_mysql_includes" = "x"; then AC_CHECK_HEADER(/opt/include/mysql/mysql.h, CFLAGS="$CFLAGS -I/opt/include/mysql", AC_CHECK_HEADER(/usr/local/include/mysql/mysql.h, CFLAGS="$CFLAGS -I/usr/local/include/mysql", AC_CHECK_HEADER(/usr/include/mysql/mysql.h, CFLAGS="$CFLAGS -I/usr/include/mysql", AC_MSG_ERROR(Need MySQL includes!)))) fi fi AC_OUTPUT(Makefile src/Makefile)