]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - configure.ac
configure.ac: Fix mysql configuration
[paraslash.git] / configure.ac
index 5e2d2b9aafb98ed7365acb55c0847015e330a1cb..a28d4114486c0cc476e77a165929bdeb57ea581a 100644 (file)
@@ -162,6 +162,18 @@ AC_CHECK_HEADER(SDL/SDL.h, [],
 
 ########################################################################### mysql
 have_mysql="yes"
+AC_ARG_ENABLE(mysql_headers, [AC_HELP_STRING(--enable-mysql-headers=dir,
+       [look for mysql.h also in dir])])
+if test -n "$enable_mysql_headers"; then
+       mysql_cppflags="-I$enable_mysql_headers"
+       CPPFLAGS="$CPPFLAGS $mysql_cppflags"
+fi
+AC_ARG_ENABLE(mysql_libs, [AC_HELP_STRING(--enable-mysql-libs=dir,
+       [look for libmysqlclient also in dir])])
+if test -n "$enable_mysql_libs"; then
+       mysql_libs="-L$enable_mysql_libs"
+       LDFLAGS="$LDFLAGS $mysql_libs"
+fi
 AC_CHECK_HEADER(mysql/mysql.h, [], [
        have_mysql="no"
 ])
@@ -169,8 +181,10 @@ AC_CHECK_LIB([mysqlclient], [mysql_init], [], [
        have_mysql="no"
 ])
 if test "$have_mysql" = "yes"; then
-       server_ldflags="$server_ldflags -lmysqlclient"
+       server_ldflags="$server_ldflags $mysql_libs -lmysqlclient"
        server_errlist_objs="$server_errlist_objs mysql_selector"
+       AC_SUBST(mysql_cppflags)
+       AC_SUBST(mysql_libs)
        AC_DEFINE(HAVE_MYSQL, 1, [define to 1 to turn on mysql support])
 else
        AC_MSG_WARN([cannot build mysql-based audio file selector])
@@ -236,12 +250,19 @@ if test "$have_alsa" = "yes"; then
 fi
 ########################################################################### ortp
 have_ortp="yes"
-AC_CHECK_HEADERS([ortp/ortp.h], [], [
-       have_ortp="no"
-])
-AC_CHECK_LIB([ortp], [ortp_init], [], [
-       have_ortp="no"
-])
+AC_ARG_ENABLE(ortp, AC_HELP_STRING([--disable-ortp], [Disable ortp support]),
+       if test x$enableval = xno; then
+               have_ortp=no
+       fi
+)
+if test "$have_ortp" = "yes"; then
+       AC_CHECK_HEADERS([ortp/ortp.h], [], [
+               have_ortp="no"
+       ])
+       AC_CHECK_LIB([ortp], [ortp_init], [], [
+               have_ortp="no"
+       ])
+fi
 if test "$have_ortp" = "yes"; then
        recv_cmdline_objs="$recv_cmdline_objs ortp_recv.cmdline"
        recv_errlist_objs="$recv_errlist_objs ortp_recv"
@@ -257,7 +278,7 @@ if test "$have_ortp" = "yes"; then
        AC_DEFINE(HAVE_ORTP, 1, [define to 1 to turn on ortp support])
 
 else
-       AC_MSG_WARN([deactivating ortp support])
+       AC_MSG_NOTICE([deactivating ortp support])
 fi
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
@@ -343,7 +364,7 @@ AC_SUBST(gui_objs, add_dot_o($gui_objs))
 
 AC_OUTPUT
 AC_MSG_NOTICE([creating Makefile.deps])
-gcc -MM -MG *.c > Makefile.deps
+gcc -MM -MG $mysql_cppflags *.c > Makefile.deps
 AC_MSG_NOTICE([
 paraslash configuration:
 ~~~~~~~~~~~~~~~~~~~~~~~~