1
- # #### http://autoconf-archive.cryp.to/ax_lib_mysql.html
1
+ # ===========================================================================
2
+ # http://www.gnu.org/software/autoconf-archive/ax_lib_mysql.html
3
+ # ===========================================================================
2
4
#
3
5
# SYNOPSIS
4
6
#
5
7
# AX_LIB_MYSQL([MINIMUM-VERSION])
6
8
#
7
9
# DESCRIPTION
8
10
#
9
- # This macro provides tests of availability of MySQL client library
10
- # of particular version or newer.
11
+ # This macro provides tests of availability of MySQL client library of
12
+ # particular version or newer.
11
13
#
12
- # AX_LIB_MYSQL macro takes only one argument which is optional. If
13
- # there is no required version passed, then macro does not run
14
- # version test.
14
+ # AX_LIB_MYSQL macro takes only one argument which is optional. If there
15
+ # is no required version passed, then macro does not run version test.
15
16
#
16
17
# The --with-mysql option takes one of three possible values:
17
18
#
18
19
# no - do not check for MySQL client library
19
20
#
20
- # yes - do check for MySQL library in standard locations
21
- # (mysql_config should be in the PATH)
21
+ # yes - do check for MySQL library in standard locations (mysql_config
22
+ # should be in the PATH)
22
23
#
23
24
# path - complete path to mysql_config utility, use this option if
24
25
# mysql_config can't be found in the PATH
33
34
#
34
35
# HAVE_MYSQL
35
36
#
36
- # LAST MODIFICATION
37
+ # LICENSE
37
38
#
38
- # 2006-07-16
39
+ # Copyright (c) 2008 Mateusz Loskot <[email protected] >
39
40
#
40
- # COPYLEFT
41
- #
42
- # Copyright (c) 2006 Mateusz Loskot <[email protected] >
43
- #
44
- # Copying and distribution of this file, with or without
45
- # modification, are permitted in any medium without royalty provided
46
- # the copyright notice and this notice are preserved.
41
+ # Copying and distribution of this file, with or without modification, are
42
+ # permitted in any medium without royalty provided the copyright notice
43
+ # and this notice are preserved. This file is offered as-is, without any
44
+ # warranty.
45
+
46
+ # serial 12
47
47
48
48
AC_DEFUN ( [ AX_LIB_MYSQL ] ,
49
49
[
50
50
AC_ARG_WITH ( [ mysql] ,
51
- AC_HELP_STRING ( [ --with-mysql=@<:@ ARG@:>@ ] ,
51
+ AS_HELP_STRING ( [ --with-mysql=@<:@ ARG@:>@ ] ,
52
52
[ use MySQL client library @<:@ default=yes@:>@ , optionally specify path to mysql_config]
53
53
) ,
54
54
[
@@ -63,37 +63,31 @@ AC_DEFUN([AX_LIB_MYSQL],
63
63
] ,
64
64
[ want_mysql="yes"]
65
65
)
66
+ AC_ARG_VAR ( [ MYSQL_CONFIG] , [ Full path to mysql_config program] )
66
67
67
68
MYSQL_CFLAGS=""
68
69
MYSQL_LDFLAGS=""
69
70
MYSQL_VERSION=""
70
71
71
72
dnl
72
- dnl Check MySQL libraries (libpq)
73
+ dnl Check MySQL libraries
73
74
dnl
74
75
75
76
if test "$want_mysql" = "yes"; then
76
77
77
- if test -z "$MYSQL_CONFIG" -o test ; then
78
- AC_PATH_PROG ( [ MYSQL_CONFIG] , [ mysql_config] , [ no] )
78
+ if test -z "$MYSQL_CONFIG" ; then
79
+ AC_PATH_PROGS ( [ MYSQL_CONFIG] , [ mysql_config mysql_config5 ] , [ no] )
79
80
fi
80
81
81
82
if test "$MYSQL_CONFIG" != "no"; then
82
- AC_MSG_CHECKING ( [ for MySQL libraries] )
83
-
84
83
MYSQL_CFLAGS="`$MYSQL_CONFIG --cflags`"
85
84
MYSQL_LDFLAGS="`$MYSQL_CONFIG --libs`"
86
85
87
86
MYSQL_VERSION=`$MYSQL_CONFIG --version`
88
87
89
- AC_DEFINE ( [ HAVE_MYSQL] , [ 1] ,
90
- [ Define to 1 if MySQL libraries are available] )
91
-
92
88
found_mysql="yes"
93
- AC_MSG_RESULT ( [ yes] )
94
89
else
95
90
found_mysql="no"
96
- AC_MSG_RESULT ( [ no] )
97
91
fi
98
92
fi
99
93
@@ -142,6 +136,11 @@ AC_DEFUN([AX_LIB_MYSQL],
142
136
fi
143
137
fi
144
138
139
+ if test "$found_mysql" = "yes" ; then
140
+ AC_DEFINE ( [ HAVE_MYSQL] , [ 1] ,
141
+ [ Define to 1 if MySQL libraries are available] )
142
+ fi
143
+
145
144
AC_SUBST ( [ MYSQL_VERSION] )
146
145
AC_SUBST ( [ MYSQL_CFLAGS] )
147
146
AC_SUBST ( [ MYSQL_LDFLAGS] )
0 commit comments