configure: add two mysql-related command line options
authorAndre <maan@p133.(none)>
Mon, 1 May 2006 21:52:54 +0000 (23:52 +0200)
committerAndre <maan@p133.(none)>
Mon, 1 May 2006 21:52:54 +0000 (23:52 +0200)
Makefile.in
NEWS
README.mysql
configure.ac

index 06cc15bb2c5d539ab0482bac59beec80e60247ba..776f3cec90ba76eb428a51bec1ff8b656e9be650 100644 (file)
@@ -148,6 +148,9 @@ slider.o: slider.c
 krell.o: krell.c
        $(CC) -Wall -O -g -fPIC @GTK_CFLAGS@ -c -o $@ krell.c
 
 krell.o: krell.c
        $(CC) -Wall -O -g -fPIC @GTK_CFLAGS@ -c -o $@ krell.c
 
+mysql_selector.o: mysql_selector.c
+       $(CC)  -Wall -O -g @mysql_cppflags@ -c -o $@ $<
+
 %.cmdline.o: %.cmdline.c
        $(CC) -c $(CPPFLAGS) $<
 %.o: %.c
 %.cmdline.o: %.cmdline.c
        $(CC) -c $(CPPFLAGS) $<
 %.o: %.c
diff --git a/NEWS b/NEWS
index b902afb16024b94eb32de061693d575550590d99..6bbb7ba59ad886bbf6b77af42e8ccde62bcfb111 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -32,7 +32,10 @@ features:
        work, but it gets no more testing.
 
        o the tarball no longer contains the screenshot images which
        work, but it gets no more testing.
 
        o the tarball no longer contains the screenshot images which
-       reduces its size from 570 KB to about 410KB.
+       reduces its size quite a bit.
+
+       o configure: new command line options: --enable-mysql-headers
+       and --enable-mysql-libs
 
 
 
 
 
 
index f6f56842317ff67de534a344f09476cee6e08f3b..cb657e066da2eca435c149b144a2c50a1ccf0712 100644 (file)
@@ -63,7 +63,12 @@ more info) or that para_server was built without mysql support. Type
        para_client si
 
 to find out. If mysql is not mentioned as a supported selector,
        para_client si
 
 to find out. If mysql is not mentioned as a supported selector,
-you'll have to recompile.
+you'll have to recompile. If configure does not detect your mysql
+installation, use the --enable-mysql-headers and --enable-mysql-libs
+options to specify the mysql path explicitly . Example:
+
+       ./configure --enable-mysql-headers=/Library/MySQL/include \
+               --enable-mysql-libs=/Library/MySQL/lib/mysql
 
 
 Create a new database
 
 
 Create a new database
index f0754926397ec97afe04ee3afc45ec14d745cfeb..b404da7fd5f0f817001a26e7fb47c7e9029b1c23 100644 (file)
@@ -162,6 +162,18 @@ AC_CHECK_HEADER(SDL/SDL.h, [],
 
 ########################################################################### mysql
 have_mysql="yes"
 
 ########################################################################### 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_headers"; then
+       mysql_libs="-L$enable_mysql_libs"
+       LDFLAGS="$LDFLAGS $mysql_libs"
+fi
 AC_CHECK_HEADER(mysql/mysql.h, [], [
        have_mysql="no"
 ])
 AC_CHECK_HEADER(mysql/mysql.h, [], [
        have_mysql="no"
 ])
@@ -169,8 +181,9 @@ AC_CHECK_LIB([mysqlclient], [mysql_init], [], [
        have_mysql="no"
 ])
 if test "$have_mysql" = "yes"; then
        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"
        server_errlist_objs="$server_errlist_objs mysql_selector"
+       AC_SUBST(mysql_cppflags)
        AC_DEFINE(HAVE_MYSQL, 1, [define to 1 to turn on mysql support])
 else
        AC_MSG_WARN([cannot build mysql-based audio file selector])
        AC_DEFINE(HAVE_MYSQL, 1, [define to 1 to turn on mysql support])
 else
        AC_MSG_WARN([cannot build mysql-based audio file selector])
@@ -350,7 +363,7 @@ AC_SUBST(gui_objs, add_dot_o($gui_objs))
 
 AC_OUTPUT
 AC_MSG_NOTICE([creating Makefile.deps])
 
 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:
 ~~~~~~~~~~~~~~~~~~~~~~~~
 AC_MSG_NOTICE([
 paraslash configuration:
 ~~~~~~~~~~~~~~~~~~~~~~~~