-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaclocal.m4
153 lines (128 loc) · 4.63 KB
/
aclocal.m4
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
AC_DEFUN(AC_LIB_MYSQL, [
AC_ARG_WITH(mysql-lib,
[ --with-mysql-lib=DIR Look for MySQL client library in DIR],
mysql_lib=$withval, mysql_lib="")
AC_MSG_CHECKING([for libmysqlclient])
AC_MSG_RESULT()
mysql_ok=no
SAVE_LIBS=$LIBS
mysql_lib="$mysql_lib /usr/lib /usr/lib/mysql \
/usr/local/lib /usr/local/lib/mysql \
/usr/local/mysql/lib"
for dir in $mysql_lib; do
if test "x$mysql_found" != "xyes"
then
AC_CHECK_FILE("$dir/libmysqlclient.a",
mysql_found=yes, mysql_found=no)
if test "x$mysql_found" = "xyes"
then
LIBS="-L$dir $SAVE_LIBS $LIBZ_LIB"
MYSQL_LIB="$dir/libmysqlclient.a $LIBZ_LIB"
AC_SUBST(MYSQL_LIB)
AC_CHECK_LIB(mysqlclient, mysql_real_connect,
mysql_ok=yes, mysql_ok=no)
fi
fi
done
if test "x$mysql_ok" != "xyes"
then
AC_MSG_ERROR([Could not find libmysqlclient in '$mysql_lib'])
fi
])
AC_DEFUN(AC_HEADER_MYSQL, [
AC_ARG_WITH(mysql-include,
[ --with-mysql-include=DIR
Look for MySQL include files in DIR],
mysql_include=$withval, mysql_include="")
AC_MSG_CHECKING([for mysql.h])
AC_MSG_RESULT()
mysql_found=no
mysql_include="$mysql_include /usr/include /usr/include/mysql \
/usr/local/include /usr/local/include/mysql \
/usr/local/mysql/include"
for dir in $mysql_include; do
if test "x$mysql_found" != "xyes"
then
AC_CHECK_HEADER($dir/mysql.h,
mysql_found=yes, mysql_found=no)
if test "x$mysql_found" = "xyes"
then
AC_MSG_CHECKING("if MySQL Version $dir is >= 4.0.0")
CPPFLAGS="$CPPFLAGS -I$dir"
AC_TRY_CPP([
#include <mysql_version.h>
#if MYSQL_VERSION_ID < 40000
#error
#endif
], mysql_version_ok=yes, mysql_version_ok=no)
if test "x$mysql_version_ok" != "xno"
then
MYSQL_INCLUDE="$dir"
AC_SUBST(MYSQL_INCLUDE)
fi
AC_MSG_RESULT($mysql_version_ok)
fi
fi
done
if test "x$mysql_found" != "xyes"
then
AC_MSG_ERROR([Could not find mysql.h in '$mysql_include'])
fi
if test "x$mysql_version_ok" != "xyes"
then
echo "Please upgrade your MySQL installation to version 4.0.0 or higher"
echo "If you do have the correct version of MySQL installed somewhere"
echo "other than $dir, please specify it as --with-mysql-include= argument"
exit 1
fi
])
AC_DEFUN(AC_LIB_Z, [
AC_CHECK_LIB(z, compress)
])
AC_DEFUN(AC_CHECK_QT, [
AC_ARG_WITH(qt, [ --with-qt=/path/to/qtdir ],
[
qt_arg=$withval
])
if test -d "$qt_arg" ; then
QTDIR=$qt_arg
fi
if test ! -d "$QTDIR" ; then
for d in /usr/qt3 /usr/lib/qt3 /usr/local/qt3 /usr/local/lib/qt3 \
/opt/qt3 /usr/qt /usr/lib/qt /usr/local/qt /usr/local/lib/qt /opt/qt ; do
if test -d $d ; then
QTDIR=$d
break
fi
done
fi
if test ! -d "$QTDIR" ; then
echo "Qt is not installed. Please install QT 3.0.5 or later"
exit 1
fi
AC_MSG_CHECKING("if Qt Version in $QTDIR is >= 3.0.5")
CPPFLAGS="$CPPFLAGS -I$QTDIR/include"
AC_TRY_CPP([
#include <qglobal.h>
#if QT_VERSION < 0x030005
#error
#endif
], ac_qt_version_ok=yes, ac_qt_version_ok=no)
AC_MSG_RESULT($ac_qt_version_ok)
if test "x$ac_qt_version_ok" = "xno" ; then
echo "Please upgrade your Qt library to version 3.0.5 or higher"
echo "If you do have the correct version of QT installed somewhere"
echo "other than $QTDIR, please specify it as --with-qt= argument"
exit 1
fi
])