File: acinclude.m4

package info (click to toggle)
chpp 0.3.4-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 3,228 kB
  • ctags: 5,154
  • sloc: ansic: 30,186; cpp: 575; sh: 500; makefile: 314; yacc: 265; asm: 261; lex: 64
file content (109 lines) | stat: -rw-r--r-- 3,174 bytes parent folder | download | duplicates (3)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
AC_DEFUN(AM_PATH_MYSQL,
[
AC_ARG_WITH(mysql-prefix,[  --with-mysql-prefix=PFX  Prefix where mysql client is installed (optional)],
            mysql_config_prefix="$withval", mysql_config_prefix="")
AC_MSG_CHECKING(for libmysql)

no_mysql=""
if test x$mysql_config_prefix != x ; then
  ac_save_CFLAGS="$CFLAGS"
  ac_save_LIBS="$LIBS"
  CFLAGS="$CFLAGS -I$mysql_config_prefix/include"
  LIBS="$LIBS -L$mysql_config_prefix/lib/mysql -lmysqlclient -lm"
  AC_TRY_LINK([#include <mysql/mysql.h>
],[mysql_connect(0, 0, 0, 0);], no_mysql="no", no_mysql="yes")
  CFLAGS="$ac_save_CFLAGS"
  LIBS="$ac_save_LIBS"
fi
if test x$no_mysql = x ; then
  ac_save_CFLAGS="$CFLAGS"
  ac_save_LIBS="$LIBS"
  CFLAGS="$CFLAGS -I/usr/local/include"
  LIBS="$LIBS -L/usr/local/lib/mysql -lmysqlclient -lm"
  AC_TRY_LINK([#include <mysql/mysql.h>
],[mysql_connect(0, 0, 0, 0);], no_mysql="no"
  mysql_config_prefix="/usr/local")
  CFLAGS="$ac_save_CFLAGS"
  LIBS="$ac_save_LIBS"
fi
if test x$no_mysql = x ; then
  ac_save_CFLAGS="$CFLAGS"
  ac_save_LIBS="$LIBS"
  CFLAGS="$CFLAGS -I/usr/include"
  LIBS="$LIBS -L/usr/lib/mysql -lmysqlclient -lm"
  AC_TRY_LINK([#include <mysql/mysql.h>
],[mysql_connect(0, 0, 0, 0);], no_mysql="no"
  mysql_config_prefix="/usr", no_mysql="yes")
  CFLAGS="$ac_save_CFLAGS"
  LIBS="$ac_save_LIBS"
fi
if test x$no_mysql = xno ; then
  AC_MSG_RESULT(yes)
  MYSQL_CFLAGS="-I$mysql_config_prefix/include"
  MYSQL_LIBS="-L$mysql_config_prefix/lib/mysql -lmysqlclient -lm"
  AC_DEFINE(HAVE_LIBMYSQLCLIENT)
else
  AC_MSG_RESULT(no)
  MYSQL_CFLAGS=""
  MYSQL_LIBS=""
fi
AC_SUBST(MYSQL_CFLAGS)
AC_SUBST(MYSQL_LIBS)
])


AC_DEFUN(AM_PATH_MSQL,
[
AC_ARG_WITH(msql-prefix,[  --with-msql-prefix=PFX  Prefix where msql client is installed (optional)],
            msql_config_prefix="$withval", msql_config_prefix="")
AC_MSG_CHECKING(for libmsql)

no_msql=""
if test x$msql_config_prefix != x ; then
  ac_save_CFLAGS="$CFLAGS"
  ac_save_LIBS="$LIBS"
  CFLAGS="$CFLAGS -I$msql_config_prefix/include"
  LIBS="$LIBS -L$msql_config_prefix/lib -lmsql"
  AC_TRY_LINK([#include <time.h>
#include <msql.h>
],[msqlConnect(0);], no_msql="no", no_msql="yes")
  CFLAGS="$ac_save_CFLAGS"
  LIBS="$ac_save_LIBS"
fi
if test x$no_msql = x ; then
  ac_save_CFLAGS="$CFLAGS"
  ac_save_LIBS="$LIBS"
  CFLAGS="$CFLAGS -I/usr/local/Hughes/include"
  LIBS="$LIBS -L/usr/local/Hughes/lib -lmsql"
  AC_TRY_LINK([#include <time.h>
#include <msql.h>
],[msqlConnect(0);], no_msql="no"
  msql_config_prefix="/usr/local/Hughes")
  CFLAGS="$ac_save_CFLAGS"
  LIBS="$ac_save_LIBS"
fi
if test x$no_msql = x ; then
  ac_save_CFLAGS="$CFLAGS"
  ac_save_LIBS="$LIBS"
  CFLAGS="$CFLAGS -I/usr/Hughes/include"
  LIBS="$LIBS -L/usr/Hughes/lib -lmsql"
  AC_TRY_LINK([#include <time.h>
#include <msql.h>
],[msqlConnect(0);], no_msql="no"
  msql_config_prefix="/usr/Hughes", no_msql="yes")
  CFLAGS="$ac_save_CFLAGS"
  LIBS="$ac_save_LIBS"
fi
if test x$no_msql = xno ; then
  AC_MSG_RESULT(yes)
  MSQL_CFLAGS="-I$msql_config_prefix/include"
  MSQL_LIBS="-L$msql_config_prefix/lib -lmsql -lm"
  AC_DEFINE(HAVE_LIBMSQL)
else
  AC_MSG_RESULT(no)
  MSQL_CFLAGS=""
  MSQL_LIBS=""
fi
AC_SUBST(MSQL_CFLAGS)
AC_SUBST(MSQL_LIBS)
])