process Invoke messages from the standalone player. GetURL and FSCommand now also...
[gnash.git] / macros / mysql.m4
blob9689d116747bbef015f6ba65b3772b4766d95ff4
1 dnl  
2 dnl    Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
3 dnl  
4 dnl  This program is free software; you can redistribute it and/or modify
5 dnl  it under the terms of the GNU General Public License as published by
6 dnl  the Free Software Foundation; either version 3 of the License, or
7 dnl  (at your option) any later version.
8 dnl  
9 dnl  This program is distributed in the hope that it will be useful,
10 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl  GNU General Public License for more details.
13 dnl  You should have received a copy of the GNU General Public License
14 dnl  along with this program; if not, write to the Free Software
15 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 AC_DEFUN([GNASH_PATH_MYSQL],
20   dnl Lool for the header
21   AC_ARG_WITH(mysql-incl, AC_HELP_STRING([--with-mysql-incl], [directory where mysql headers are]), with_mysql_incl=${withval})
22   AC_CACHE_VAL(ac_cv_path_mysql_incl,[
23     if test x"${with_mysql_incl}" != x ; then
24       if test -f ${with_mysql_incl}/mysql.h ; then
25         ac_cv_path_mysql_incl="-I`(cd ${with_mysql_incl}; pwd)`"
26       else
27         AC_MSG_ERROR([${with_mysql_incl} directory doesn't contain any headers])
28       fi
29     fi
30   ])
32   if test x"${ac_cv_path_mysql_incl}" = x; then
33     AC_CHECK_PROG(mconfig, mysql_config, mysql_config)
34     AC_MSG_RESULT(${ac_cv_prog_mconfig})
35   fi
36   if test x"${ac_cv_prog_mconfig}" = "x" ; then
37      AC_CHECK_PROG(mconfig, mysql-config, mysql-config)
38   fi
40   if test x"${ac_cv_prog_mconfig}" != "x" ; then
41      ac_cv_path_mysql_incl=`${mconfig} --include`
42   fi
44   AC_MSG_CHECKING([for MySQL headers])
45   if test x"${ac_cv_path_mysql_incl}" = x ; then
46     AC_MSG_CHECKING([for mysql header])
47     for i in $incllist; do
48       if test -f $i/mysql/mysql.h; then
49         ac_cv_path_mysql_incl="-I$i/mysql"
50         break
51       fi
52     done
53   fi
55   if test x"${ac_cv_path_mysql_incl}" != x ; then
56     MYSQL_CFLAGS="${ac_cv_path_mysql_incl}"
57     AC_MSG_RESULT(yes)
58   else
59     MYSQL_CFLAGS=""
60     AC_MSG_RESULT(no)
61   fi
63   dnl Look for the library
64   AC_ARG_WITH(mysql-lib, AC_HELP_STRING([--with-mysql-lib], [directory where mysql libraries are]), with_mysql_lib=${withval})
65     AC_CACHE_VAL(ac_cv_path_mysql_lib,[
66     if test x"${with_mysql_lib}" != x ; then
67       if test -f ${with_mysql_lib}/libmysqlclient.a -o -f ${with_mysql_lib}/libmysqlclient.${shlibext}; then
68               ac_cv_path_mysql_lib="-L`(cd ${with_mysql_lib}; pwd)`"
69       else
70         AC_MSG_ERROR([${with_mysql_lib} directory doesn't contain mysql libraries.])
71       fi
72     fi
73   ])
75   AC_MSG_CHECKING([for MySQL libraries])
76   if test x"${ac_cv_prog_mconfig}" != "x" ; then
77      ac_cv_path_mysql_lib=`${mconfig} --libs`
78   fi
80   if test x"${ac_cv_path_mysql_lib}" = x; then #{
82     topdir=""
84     AC_CHECK_LIB(mysqlclient, mysql_init, [ac_cv_path_mysql_lib="-lmysqlclient"], [
85       for i in $libslist; do
86               if test -f $i/libmysqlclient.a -o -f $i/libmysqlclient.${shlibext}; then
87           topdir=$i
88                 if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
89                   ac_cv_path_mysql_lib="-L$i -lmysqlclient"
90             break
91           else
92                   ac_cv_path_mysql_lib="-lmysqlclient"
93                   break
94           fi
95         fi
96       done
97     ])
98     AC_MSG_CHECKING([for MySQL client library])
99     AC_MSG_RESULT(${ac_cv_path_mysql_lib})
100   fi #}
103   if test x"${ac_cv_path_mysql_lib}" != x; then
104     MYSQL_LIBS="${ac_cv_path_mysql_lib}"
105   else
106     MYSQL_LIBS=""
107   fi
109   if test x"${ac_cv_path_mysql_incl}" != x -a x"${ac_cv_path_mysql_lib}" != x; then
110     AC_DEFINE(HAVE_MYSQL, [], [Defined if you have MySQL installed])
111   fi
112   AC_SUBST(MYSQL_CFLAGS)  
113   AC_SUBST(MYSQL_LIBS)
116 # Local Variables:
117 # c-basic-offset: 2
118 # tab-width: 2
119 # indent-tabs-mode: nil
120 # End: