File: ax_lib_mysql.m4

package info (click to toggle)
quickfix 1.15.1%2Bdfsg-4
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye
  • size: 42,080 kB
  • sloc: cpp: 631,686; python: 129,549; ruby: 106,716; xml: 43,737; ansic: 7,668; java: 1,826; cs: 816; makefile: 544; sh: 462; sql: 313
file content (36 lines) | stat: -rw-r--r-- 927 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
AC_DEFUN([_MYSQL_CONFIG],[
  AC_ARG_WITH([mysql-config],
  AS_HELP_STRING([--with-mysql-config=PATH], [Path to mysql_config program]),
                 [mysql_config="$withval"], [mysql_config=mysql_config])
])

AC_DEFUN([_MYSQL_CHECK],[
    AC_REQUIRE([_MYSQL_CONFIG])
    AC_SUBST(MYSQL_CFLAGS)
    AC_SUBST(MYSQL_LIBS)
])


AC_DEFUN([AX_LIB_MYSQL], [
    has_mysql=false
    AC_ARG_WITH(mysql,
        [  --with-mysql           will use mysql_config to find mysql], 
        [if test $withval == "no"
         then
           has_mysql=false
         else
           has_mysql=true
         fi],
        has_mysql=false
    )

    if test $has_mysql = true
    then
        AC_REQUIRE([_MYSQL_CHECK])
        AC_DEFINE(HAVE_MYSQL, 1, Define if you have sql library (-lmysqlclient))
        MYSQL_CFLAGS=`$mysql_config --cflags`
        MYSQL_LIBS=`$mysql_config --libs`
    fi
    AM_CONDITIONAL(HAVE_MYSQL, $has_mysql)
])