Add automated test on delayed return value handling in ExternalInterface.call().
[gnash.git] / macros / mysql.m4
blobe20d22b26bafc55ee342352634d6ac5edd1f720d
1 dnl  
2 dnl  Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 
3 dnl  2011 Free Software Foundation, Inc.
4 dnl  
5 dnl  This program is free software; you can redistribute it and/or modify
6 dnl  it under the terms of the GNU General Public License as published by
7 dnl  the Free Software Foundation; either version 3 of the License, or
8 dnl  (at your option) any later version.
9 dnl  
10 dnl  This program is distributed in the hope that it will be useful,
11 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 dnl  GNU General Public License for more details.
14 dnl  You should have received a copy of the GNU General Public License
15 dnl  along with this program; if not, write to the Free Software
16 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19 AC_DEFUN([GNASH_PATH_MYSQL],
21   dnl Lool for the header
22   AC_ARG_WITH(mysql-incl, AC_HELP_STRING([--with-mysql-incl], [directory where mysql headers are]), with_mysql_incl=${withval})
23   AC_CACHE_VAL(ac_cv_path_mysql_incl,[
24     if test x"${with_mysql_incl}" != x ; then
25       if test -f ${with_mysql_incl}/mysql.h ; then
26         ac_cv_path_mysql_incl="-I`(cd ${with_mysql_incl}; pwd)`"
27       else
28         AC_MSG_ERROR([${with_mysql_incl} directory doesn't contain any headers])
29       fi
30     fi
31   ])
33   if test x"${ac_cv_path_mysql_incl}" = x; then
34     AC_CHECK_PROG(mconfig, mysql_config, mysql_config)
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   fi #}
102   if test x"${ac_cv_path_mysql_lib}" != x; then
103     AC_MSG_RESULT(${ac_cv_path_mysql_lib})
104     MYSQL_LIBS="${ac_cv_path_mysql_lib}"
105   else
106     AC_MSG_RESULT(no)
107     MYSQL_LIBS=""
108   fi
110   if test x"${ac_cv_path_mysql_incl}" != x -a x"${ac_cv_path_mysql_lib}" != x; then
111     AC_DEFINE(HAVE_MYSQL, [], [Defined if you have MySQL installed])
112   fi
113   AC_SUBST(MYSQL_CFLAGS)  
114   AC_SUBST(MYSQL_LIBS)
117 # Local Variables:
118 # c-basic-offset: 2
119 # tab-width: 2
120 # indent-tabs-mode: nil
121 # End: