22 |
dnl Check functions |
dnl Check functions |
23 |
AC_CHECK_FUNCS(memmove) |
AC_CHECK_FUNCS(memmove) |
24 |
|
|
25 |
AC_ARG_WITH(mysqlpath, |
default_directory="/usr /usr/local" |
26 |
AC_HELP_STRING([--with-mysqlpath], [specify the top level of the mysql installation tree. (default is /usr/local/mysql)]), |
|
27 |
mysqltop=$withval, mysqltop=/usr/local/mysql |
AC_DEFUN(FAIL_MESSAGE,[ |
28 |
) |
echo |
29 |
|
echo |
30 |
AC_MSG_CHECKING([for mysql in directory $mysqltop]) |
echo "**********************************************" |
31 |
|
echo " ERROR: unable to find" $1 |
32 |
if test "X$mysqltop" = "X" |
echo " checked in the following places" |
33 |
then |
for i in `echo $2`; do |
34 |
AC_MSG_RESULT([no]) |
echo " $i" |
35 |
AC_MSG_ERROR([msql directory not specified]) |
done |
36 |
fi |
echo "**********************************************" |
37 |
|
echo |
38 |
|
exit |
39 |
|
]) |
40 |
|
|
41 |
|
AC_ARG_WITH(authmysql, |
42 |
|
AC_HELP_STRING([--with-authmysql=DIR],[Create MySQL authentication module, optionally specify dir of mysql files]), |
43 |
|
[ with_mysql="$withval" ], |
44 |
|
[ with_mysql=no ]) |
45 |
|
|
46 |
|
if test "$with_mysql" != "no"; then |
47 |
|
if test "$with_mysql" = "yes"; then |
48 |
|
mysql_directory="$default_directory"; |
49 |
|
mysql_fail="yes" |
50 |
|
elif test -d $withval; then |
51 |
|
mysql_directory="$withval" |
52 |
|
mysql_fail="no" |
53 |
|
elif test "$with_mysql" = ""; then |
54 |
|
mysql_directory="$default_directory"; |
55 |
|
mysql_fail="no" |
56 |
|
fi |
57 |
|
|
58 |
|
AC_MSG_CHECKING(for mysql) |
59 |
|
|
60 |
|
for i in $mysql_directory; do |
61 |
|
if test -r $i/include/mysql/mysql.h; then |
62 |
|
MYSQL_DIR=$i |
63 |
|
MYSQL_INC_DIR=$i/include/mysql |
64 |
|
elif test -r $i/include/mysql.h; then |
65 |
|
MYSQL_DIR=$i |
66 |
|
MYSQL_INC_DIR=$i/include |
67 |
|
fi |
68 |
|
done |
69 |
|
|
70 |
|
if test -z "$MYSQL_DIR"; then |
71 |
|
if test "$mysql_fail" != "no"; then |
72 |
|
tmp="" |
73 |
|
for i in $mysql_directory; do |
74 |
|
tmp="$tmp $i/include $i/include/mysql" |
75 |
|
done |
76 |
|
FAIL_MESSAGE("mysql headers (mysql.h)", $tmp) |
77 |
|
else |
78 |
|
AC_MSG_RESULT(no) |
79 |
|
fi |
80 |
|
else |
81 |
|
|
82 |
if test -d $mysqltop |
for i in lib lib/mysql; do |
83 |
then |
str="$MYSQL_DIR/$i/libmysqlclient.*" |
84 |
AC_MSG_RESULT([yes]) |
for j in `echo $str`; do |
85 |
CFLAGS="$CFLAGS -I$mysqltop/include" |
if test -r $j; then |
86 |
LIBS="$LIBS $mysqltop/lib/libmysqlclient.a" |
MYSQL_LIB_DIR="$MYSQL_DIR/$i" |
87 |
else |
break 2 |
88 |
AC_MSG_RESULT([no]) |
fi |
89 |
AC_MSG_ERROR([mysql directory not found!]) |
done |
90 |
|
done |
91 |
|
|
92 |
|
if test -z "$MYSQL_LIB_DIR"; then |
93 |
|
if test "$mysql_fail" != "no"; then |
94 |
|
FAIL_MESSAGE("mysqlclient library", |
95 |
|
"$MYSQL_DIR/lib $MYSQL_DIR/lib/mysql") |
96 |
|
else |
97 |
|
AC_MSG_RESULT(no) |
98 |
|
fi |
99 |
|
else |
100 |
|
AC_MSG_RESULT(yes) |
101 |
|
CFLAGS="$CFLAGS -I${MYSQL_INC_DIR}" |
102 |
|
LDFLAGS="${LDFLAGS} -L${MYSQL_LIB_DIR}" |
103 |
|
dnl CPPFLAGS="${CPPFLAGS} -I${MYSQL_INC_DIR} -DENABLE_MYSQL" |
104 |
|
LIBS="-lmysqlclient ${LIBS}" |
105 |
|
fi |
106 |
|
fi |
107 |
fi |
fi |
108 |
|
|
109 |
|
dnl CFLAGS="$CFLAGS -I$mysqltop/include" |
110 |
|
dnl LIBS="$LIBS $mysqltop/lib/libmysqlclient.a" |
111 |
|
|
112 |
|
|
113 |
|
dnl AC_ARG_WITH(mysqlpath, |
114 |
|
dnl AC_HELP_STRING([--with-mysqlpath], [specify the top level of the mysql installation tree. (default is /usr/local/mysql)]), |
115 |
|
dnl mysqltop=$withval, mysqltop=/usr/local/mysql |
116 |
|
dnl ) |
117 |
|
|
118 |
|
dnl AC_MSG_CHECKING([for mysql in directory $mysqltop]) |
119 |
|
|
120 |
|
dnl if test "X$mysqltop" = "X" |
121 |
|
dnl then |
122 |
|
dnl AC_MSG_RESULT([no]) |
123 |
|
dnl AC_MSG_ERROR([msql directory not specified]) |
124 |
|
dnl fi |
125 |
|
|
126 |
|
dnl if test -d $mysqltop |
127 |
|
dnl then |
128 |
|
dnl AC_MSG_RESULT([yes]) |
129 |
|
dnl CFLAGS="$CFLAGS -I$mysqltop/include" |
130 |
|
dnl LIBS="$LIBS $mysqltop/lib/libmysqlclient.a" |
131 |
|
dnl else |
132 |
|
dnl AC_MSG_RESULT([no]) |
133 |
|
dnl AC_MSG_ERROR([mysql directory not found!]) |
134 |
|
dnl fi |
135 |
|
|
136 |
AC_CONFIG_FILES([Makefile]) |
AC_CONFIG_FILES([Makefile]) |
137 |
AC_OUTPUT |
AC_OUTPUT |