Changed launcher to not have S3D_SERVER #defined to allow visible dialog messages
[scorched3d.git] / configure-sql.m4
blob9c316b31311679a385bf34b349bdf6277ab4aa90
1 dnl Checks for mysql
2 MYSQL_LIBS=
3 AC_ARG_WITH([mysql],
4             AC_HELP_STRING([--with-mysql],
5                            [enable mysql support (default no)]),
6             [use_mysql=${withval}],,)
7 AH_TEMPLATE(HAVE_MYSQL,[Define if you have libmysql])
9 if test x"$use_mysql" = x"yes"; then
10         AC_MSG_CHECKING(for MySql support)
11         have_mysql=no
12         AC_TRY_COMPILE([
13                 #include <mysql/mysql.h>
14                 ],[
15                 ],[
16                 have_mysql=yes
17         ])
18         AC_MSG_RESULT($have_mysql)
20         if test x$have_mysql != xyes; then
21                 AC_MSG_ERROR([*** Can't find the MySql library Try: http://www.mysql.com])
22         else
23                 MYSQL_CFLAGS=`mysql_config --cflags`
24                 MYSQL_CFLAGS="$MYSQL_CFLAGS -DHAVE_MYSQL=1"
25                 MYSQL_LIBS=`mysql_config --libs`
26         fi
28 AC_SUBST(MYSQL_LIBS)
29 AC_SUBST(MYSQL_CFLAGS)
31 dnl Checks for pgsql
32 PGSQL_LIBS=
33 AC_ARG_WITH([pgsql],
34             AC_HELP_STRING([--with-pgsql],
35                            [enable pgsql support (default no)]),
36             [use_pgsql=${withval}],,)
37 AH_TEMPLATE(HAVE_PGSQL,[Define if you have libpq])
39 if test x"$use_pgsql" = x"yes"; then
40         AC_MSG_CHECKING(for PGSql support)
41         have_pgsql=no
42         AC_TRY_COMPILE([
43                 #include <pgsql/libpq-fe.h>
44                 ],[
45                 ],[
46                 have_pgsql=yes
47         ])
48         AC_MSG_RESULT($have_pgsql)
50         if test x$have_pgsql != xyes; then
51                 AC_MSG_ERROR([*** Can't find the PGSql library Try: http://www.postgresql.org])
52         else
53                 AC_DEFINE(HAVE_PGSQL)
54                 PGSQL_LIBS="-lpq"
55         fi
57 AC_SUBST(PGSQL_LIBS)