756
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
757
echo "configure:758: checking how to run the C preprocessor" >&5
758
# On Suns, sometimes $CPP names a directory.
759
if test -n "$CPP" && test -d "$CPP"; then
762
if test -z "$CPP"; then
763
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
764
echo $ac_n "(cached) $ac_c" 1>&6
766
# This must be in double quotes, not single quotes, because CPP may get
767
# substituted into the Makefile and "${CC-cc}" will confuse make.
769
# On the NeXT, cc -E runs the code through the compiler's parser,
770
# not just through cpp.
771
cat > conftest.$ac_ext <<EOF
772
#line 773 "configure"
773
#include "confdefs.h"
777
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
778
{ (eval echo configure:779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
779
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
780
if test -z "$ac_err"; then
784
echo "configure: failed program was:" >&5
785
cat conftest.$ac_ext >&5
787
CPP="${CC-cc} -E -traditional-cpp"
788
cat > conftest.$ac_ext <<EOF
789
#line 790 "configure"
790
#include "confdefs.h"
794
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
795
{ (eval echo configure:796: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
796
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
797
if test -z "$ac_err"; then
801
echo "configure: failed program was:" >&5
802
cat conftest.$ac_ext >&5
804
CPP="${CC-cc} -nologo -E"
805
cat > conftest.$ac_ext <<EOF
806
#line 807 "configure"
807
#include "confdefs.h"
811
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
812
{ (eval echo configure:813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
813
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
814
if test -z "$ac_err"; then
818
echo "configure: failed program was:" >&5
819
cat conftest.$ac_ext >&5
828
ac_cv_prog_CPP="$CPP"
830
CPP="$ac_cv_prog_CPP"
832
ac_cv_prog_CPP="$CPP"
834
echo "$ac_t""$CPP" 1>&6
837
# Check whether --with-mysql-include-dir or --without-mysql-include-dir was given.
838
if test "${with_mysql_include_dir+set}" = set; then
839
withval="$with_mysql_include_dir"
840
mysql_include_dir="$withval"
845
# Check whether --with-mysql-lib-dir or --without-mysql-lib-dir was given.
846
if test "${with_mysql_lib_dir+set}" = set; then
847
withval="$with_mysql_lib_dir"
848
mysql_lib_dir="$withval"
853
# Check whether --with-mysql-dir or --without-mysql-dir was given.
854
if test "${with_mysql_dir+set}" = set; then
855
withval="$with_mysql_dir"
856
mysql_lib_dir="$withval/lib/mysql"
857
mysql_include_dir="$withval/include"
863
if test x$with_rlm_sql_mysql != xno; then
865
targetname=rlm_sql_mysql # we might change this later.
867
# Extract the first word of "mysql_config", so it can be a program name with args.
809
# Extract the first word of "mysql_config", so it can be a program name with args.
868
810
set dummy mysql_config; ac_word=$2
869
811
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
870
echo "configure:871: checking for $ac_word" >&5
812
echo "configure:813: checking for $ac_word" >&5
871
813
if eval "test \"`echo '$''{'ac_cv_prog_MYSQL_CONFIG'+set}'`\" = set"; then
872
814
echo $ac_n "(cached) $ac_c" 1>&6
894
836
echo "$ac_t""no" 1>&6
897
if test "x$MYSQL_CONFIG" = "xyes"
899
sql_mysql_ldflags=`mysql_config --libs`
900
sql_mysql_cflags=`mysql_config --cflags`
901
cat >> confdefs.h <<\EOF
902
#define HAVE_MYSQL_H 1
906
echo $ac_n "checking for compress in -lz""... $ac_c" 1>&6
907
echo "configure:908: checking for compress in -lz" >&5
908
ac_lib_var=`echo z'_'compress | sed 'y%./+-%__p_%'`
909
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
910
echo $ac_n "(cached) $ac_c" 1>&6
914
cat > conftest.$ac_ext <<EOF
915
#line 916 "configure"
916
#include "confdefs.h"
917
/* Override any gcc2 internal prototype to avoid an error. */
918
/* We use char because int might match the return type of a gcc2
919
builtin and then its argument prototype would still apply. */
926
if { (eval echo configure:927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
928
eval "ac_cv_lib_$ac_lib_var=yes"
930
echo "configure: failed program was:" >&5
931
cat conftest.$ac_ext >&5
933
eval "ac_cv_lib_$ac_lib_var=no"
939
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
940
echo "$ac_t""yes" 1>&6
943
echo "$ac_t""no" 1>&6
947
echo $ac_n "checking for mysql/mysql.h""... $ac_c" 1>&6
948
echo "configure:949: checking for mysql/mysql.h" >&5
950
cat > conftest.$ac_ext <<EOF
951
#line 952 "configure"
952
#include "confdefs.h"
953
#include <mysql/mysql.h>
958
if { (eval echo configure:959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
962
echo "configure: failed program was:" >&5
963
cat conftest.$ac_ext >&5
970
if test "x$MYSQL_INCLUDE" = "x"; then
974
for try in $mysql_include_dir /usr/local/include /usr/local/mysql/include ; do
975
CFLAGS="$old_CFLAGS -I$try"
976
cat > conftest.$ac_ext <<EOF
977
#line 978 "configure"
978
#include "confdefs.h"
979
#include <mysql/mysql.h>
984
if { (eval echo configure:985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
986
MYSQL_INCLUDE="-I$try"
988
echo "configure: failed program was:" >&5
989
cat conftest.$ac_ext >&5
995
if test "x$MYSQL_INCLUDE" != "x"; then
996
cat >> confdefs.h <<\EOF
997
#define HAVE_MYSQL_MYSQL_H 1
1003
CFLAGS="$old_CFLAGS"
1006
if test "x$MYSQL_INCLUDE" = "x"; then
1007
echo "$ac_t""no" 1>&6
1008
echo "configure: warning: mysql headers not found. Use --with-mysql-include-dir=<path>." 1>&2
1009
targetname= # disabled module
1011
sql_mysql_cflags="${sql_mysql_cflags} ${MYSQL_INCLUDE}"
1012
echo "$ac_t""yes" 1>&6
1013
cat >> confdefs.h <<\EOF
1014
#define HAVE_MYSQL_H 1
1018
echo $ac_n "checking for mysql_init in -lmysqlclient""... $ac_c" 1>&6
1019
echo "configure:1020: checking for mysql_init in -lmysqlclient" >&5
1024
for try in $mysql_lib_dir /usr/lib /usr/lib/mysql /usr/local/lib/mysql /usr/local/mysql/lib/mysql; do
1025
LIBS="$old_LIBS -L$try -lmysqlclient"
1026
cat > conftest.$ac_ext <<EOF
1027
#line 1028 "configure"
1028
#include "confdefs.h"
1029
extern char mysql_init();
1034
if { (eval echo configure:1035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1036
MYSQL_LIBS="-L$try -lmysqlclient $old_LIBS"
1038
echo "configure: failed program was:" >&5
1039
cat conftest.$ac_ext >&5
1045
if test "x$MYSQL_LIBS" != "x"; then
1051
if test "x$MYSQL_LIBS" = "x"; then
1052
echo "$ac_t""no" 1>&6
1054
echo "configure: warning: mysql libraries not found. Use --with-mysql-lib-dir=<path>." 1>&2
1055
targetname= # disabled module
1057
echo "$ac_t""yes" 1>&6
1058
sql_mysql_ldflags="$sql_mysql_ldflags $MYSQL_LIBS"
1061
sql_mysql_ldflags="$sql_mysql_ldflags $LIBS"
1064
if test "x$targetname" = "x"; then
1065
echo "configure: warning: sql submodule 'mysql' disabled" 1>&2
1070
echo \*\*\* module rlm_sql_mysql is disabled.
841
if test "x$mysql_with_threads" = "xyes"; then
842
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
843
echo "configure:844: checking for pthread_create in -lpthread" >&5
844
ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
845
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
846
echo $ac_n "(cached) $ac_c" 1>&6
849
LIBS="-lpthread $LIBS"
850
cat > conftest.$ac_ext <<EOF
851
#line 852 "configure"
852
#include "confdefs.h"
853
/* Override any gcc2 internal prototype to avoid an error. */
854
/* We use char because int might match the return type of a gcc2
855
builtin and then its argument prototype would still apply. */
856
char pthread_create();
862
if { (eval echo configure:863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
864
eval "ac_cv_lib_$ac_lib_var=yes"
866
echo "configure: failed program was:" >&5
867
cat conftest.$ac_ext >&5
869
eval "ac_cv_lib_$ac_lib_var=no"
875
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
876
echo "$ac_t""yes" 1>&6
877
LIBS="-lpthread $LIBS"
879
echo "$ac_t""no" 1>&6
880
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
881
echo "configure:882: checking for pthread_create in -lc_r" >&5
882
ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
883
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
884
echo $ac_n "(cached) $ac_c" 1>&6
888
cat > conftest.$ac_ext <<EOF
889
#line 890 "configure"
890
#include "confdefs.h"
891
/* Override any gcc2 internal prototype to avoid an error. */
892
/* We use char because int might match the return type of a gcc2
893
builtin and then its argument prototype would still apply. */
894
char pthread_create();
900
if { (eval echo configure:901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
902
eval "ac_cv_lib_$ac_lib_var=yes"
904
echo "configure: failed program was:" >&5
905
cat conftest.$ac_ext >&5
907
eval "ac_cv_lib_$ac_lib_var=no"
913
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
914
echo "$ac_t""yes" 1>&6
917
echo "$ac_t""no" 1>&6
918
mysql_with_threads=no
927
if test "x$mysql_with_threads" = "xyes"; then
928
if test "x$MYSQL_CONFIG" = "xyes"; then
929
mysql_libs="$(mysql_config --libs_r)"
931
LIBS="$mysql_libs $LIBS"
932
echo $ac_n "checking for mysql_init in -lmysqlclient_r (using mysql_config)""... $ac_c" 1>&6
933
echo "configure:934: checking for mysql_init in -lmysqlclient_r (using mysql_config)" >&5
934
cat > conftest.$ac_ext <<EOF
935
#line 936 "configure"
936
#include "confdefs.h"
937
/* Override any gcc2 internal prototype to avoid an error. */
938
/* We use char because int might match the return type of a gcc2
939
builtin and then its argument prototype would still apply. */
946
if { (eval echo configure:947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
948
have_libmysqlclient_r=yes
950
echo "configure: failed program was:" >&5
951
cat conftest.$ac_ext >&5
955
if test "x$have_libmysqlclient_r" = "xyes"; then
956
echo "$ac_t""yes" 1>&6
957
SMART_LIBS="$mysql_libs $SMART_LIBS"
959
echo "$ac_t""no" 1>&6
962
if test "x$have_libmysqlclient_r" != "xyes"; then
963
smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql \
964
/usr/local/lib/mysql /usr/local/mysql/lib/mysql"
967
sm_lib_safe=`echo "mysqlclient_r" | sed 'y%./+-%__p_%'`
968
sm_func_safe=`echo "mysql_init" | sed 'y%./+-%__p_%'`
969
echo $ac_n "checking for mysql_init in -lmysqlclient_r""... $ac_c" 1>&6
970
echo "configure:971: checking for mysql_init in -lmysqlclient_r" >&5
976
if test "x$smart_try_dir" != "x"; then
977
for try in $smart_try_dir; do
978
LIBS="-L$try -lmysqlclient_r $old_LIBS"
979
cat > conftest.$ac_ext <<EOF
980
#line 981 "configure"
981
#include "confdefs.h"
982
extern char mysql_init();
987
if { (eval echo configure:988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
989
smart_lib="-L$try -lmysqlclient_r"
991
echo "configure: failed program was:" >&5
992
cat conftest.$ac_ext >&5
995
if test "x$smart_lib" != "x"; then
1002
if test "x$smart_lib" = "x"; then
1003
LIBS="-lmysqlclient_r $old_LIBS"
1004
cat > conftest.$ac_ext <<EOF
1005
#line 1006 "configure"
1006
#include "confdefs.h"
1007
extern char mysql_init();
1012
if { (eval echo configure:1013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1014
smart_lib="-lmysqlclient_r"
1016
echo "configure: failed program was:" >&5
1017
cat conftest.$ac_ext >&5
1023
if test "x$smart_lib" = "x"; then
1026
if test "x$LOCATE" != "x"; then
1028
file=libmysqlclient_r${libltdl_cv_shlibext}
1030
for x in `${LOCATE} $file 2>/dev/null`; do
1031
base=`echo $x | sed "s%/${file}%%"`
1032
if test "x$x" = "x$base"; then
1036
dir=`${DIRNAME} $x 2>/dev/null`
1037
exclude=`echo ${dir} | ${GREP} /home`
1038
if test "x$exclude" != "x"; then
1042
already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1043
if test "x$already" = "x"; then
1049
eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1053
if test "x$LOCATE" != "x"; then
1055
file=libmysqlclient_r.a
1057
for x in `${LOCATE} $file 2>/dev/null`; do
1058
base=`echo $x | sed "s%/${file}%%"`
1059
if test "x$x" = "x$base"; then
1063
dir=`${DIRNAME} $x 2>/dev/null`
1064
exclude=`echo ${dir} | ${GREP} /home`
1065
if test "x$exclude" != "x"; then
1069
already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1070
if test "x$already" = "x"; then
1076
eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1079
for try in $smart_lib_dir /usr/local/lib /opt/lib; do
1080
LIBS="-L$try -lmysqlclient_r $old_LIBS"
1081
cat > conftest.$ac_ext <<EOF
1082
#line 1083 "configure"
1083
#include "confdefs.h"
1084
extern char mysql_init();
1089
if { (eval echo configure:1090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1091
smart_lib="-L$try -lmysqlclient_r"
1093
echo "configure: failed program was:" >&5
1094
cat conftest.$ac_ext >&5
1097
if test "x$smart_lib" != "x"; then
1104
if test "x$smart_lib" != "x"; then
1105
echo "$ac_t""yes" 1>&6
1106
eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
1107
LIBS="$smart_lib $old_LIBS"
1108
SMART_LIBS="$smart_lib $SMART_LIBS"
1110
echo "$ac_t""no" 1>&6
1113
if test "x$ac_cv_lib_mysqlclient_r_mysql_init" != "xyes"
1115
echo "configure: warning: mysql libraries not found. Use --with-mysql-lib-dir=<path>." 1>&2
1116
targetname="" # disable module
1120
if test "x$MYSQL_CONFIG" = "xyes"; then
1121
mysql_libs="$(mysql_config --libs)"
1123
LIBS="$mysql_libs $LIBS"
1124
echo $ac_n "checking for mysql_init in -lmysqlclient (using mysql_config)""... $ac_c" 1>&6
1125
echo "configure:1126: checking for mysql_init in -lmysqlclient (using mysql_config)" >&5
1126
cat > conftest.$ac_ext <<EOF
1127
#line 1128 "configure"
1128
#include "confdefs.h"
1129
/* Override any gcc2 internal prototype to avoid an error. */
1130
/* We use char because int might match the return type of a gcc2
1131
builtin and then its argument prototype would still apply. */
1138
if { (eval echo configure:1139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1140
have_libmysqlclient=yes
1142
echo "configure: failed program was:" >&5
1143
cat conftest.$ac_ext >&5
1147
if test "x$have_libmysqlclient" = "xyes"; then
1148
echo "$ac_t""yes" 1>&6
1149
SMART_LIBS="$mysql_libs $SMART_LIBS"
1151
echo "$ac_t""no" 1>&6
1154
if test "x$have_libmysqlclient" != "xyes"; then
1155
smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql \
1156
/usr/local/lib/mysql /usr/local/mysql/lib/mysql"
1159
sm_lib_safe=`echo "mysqlclient" | sed 'y%./+-%__p_%'`
1160
sm_func_safe=`echo "mysql_init" | sed 'y%./+-%__p_%'`
1161
echo $ac_n "checking for mysql_init in -lmysqlclient""... $ac_c" 1>&6
1162
echo "configure:1163: checking for mysql_init in -lmysqlclient" >&5
1168
if test "x$smart_try_dir" != "x"; then
1169
for try in $smart_try_dir; do
1170
LIBS="-L$try -lmysqlclient $old_LIBS"
1171
cat > conftest.$ac_ext <<EOF
1172
#line 1173 "configure"
1173
#include "confdefs.h"
1174
extern char mysql_init();
1179
if { (eval echo configure:1180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1181
smart_lib="-L$try -lmysqlclient"
1183
echo "configure: failed program was:" >&5
1184
cat conftest.$ac_ext >&5
1187
if test "x$smart_lib" != "x"; then
1194
if test "x$smart_lib" = "x"; then
1195
LIBS="-lmysqlclient $old_LIBS"
1196
cat > conftest.$ac_ext <<EOF
1197
#line 1198 "configure"
1198
#include "confdefs.h"
1199
extern char mysql_init();
1204
if { (eval echo configure:1205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1206
smart_lib="-lmysqlclient"
1208
echo "configure: failed program was:" >&5
1209
cat conftest.$ac_ext >&5
1215
if test "x$smart_lib" = "x"; then
1218
if test "x$LOCATE" != "x"; then
1220
file=libmysqlclient${libltdl_cv_shlibext}
1222
for x in `${LOCATE} $file 2>/dev/null`; do
1223
base=`echo $x | sed "s%/${file}%%"`
1224
if test "x$x" = "x$base"; then
1228
dir=`${DIRNAME} $x 2>/dev/null`
1229
exclude=`echo ${dir} | ${GREP} /home`
1230
if test "x$exclude" != "x"; then
1234
already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1235
if test "x$already" = "x"; then
1241
eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1245
if test "x$LOCATE" != "x"; then
1247
file=libmysqlclient.a
1249
for x in `${LOCATE} $file 2>/dev/null`; do
1250
base=`echo $x | sed "s%/${file}%%"`
1251
if test "x$x" = "x$base"; then
1255
dir=`${DIRNAME} $x 2>/dev/null`
1256
exclude=`echo ${dir} | ${GREP} /home`
1257
if test "x$exclude" != "x"; then
1261
already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
1262
if test "x$already" = "x"; then
1268
eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
1271
for try in $smart_lib_dir /usr/local/lib /opt/lib; do
1272
LIBS="-L$try -lmysqlclient $old_LIBS"
1273
cat > conftest.$ac_ext <<EOF
1274
#line 1275 "configure"
1275
#include "confdefs.h"
1276
extern char mysql_init();
1281
if { (eval echo configure:1282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1283
smart_lib="-L$try -lmysqlclient"
1285
echo "configure: failed program was:" >&5
1286
cat conftest.$ac_ext >&5
1289
if test "x$smart_lib" != "x"; then
1296
if test "x$smart_lib" != "x"; then
1297
echo "$ac_t""yes" 1>&6
1298
eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
1299
LIBS="$smart_lib $old_LIBS"
1300
SMART_LIBS="$smart_lib $SMART_LIBS"
1302
echo "$ac_t""no" 1>&6
1305
if test "x$ac_cv_lib_mysqlclient_mysql_init" != "xyes"
1307
echo "configure: warning: mysql libraries not found. Use --with-mysql-lib-dir=<path>." 1>&2
1308
targetname="" # disable module
1314
if test "x$MYSQL_CONFIG" = "xyes"; then
1315
mysql_cflags="$(mysql_config --cflags)"
1316
old_CFLAGS="$CFLAGS"
1317
CFLAGS="$CFLAGS $mysql_cflags"
1318
echo $ac_n "checking for mysql.h (using mysql_config)""... $ac_c" 1>&6
1319
echo "configure:1320: checking for mysql.h (using mysql_config)" >&5
1320
cat > conftest.$ac_ext <<EOF
1321
#line 1322 "configure"
1322
#include "confdefs.h"
1328
if { (eval echo configure:1329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1332
echo "configure: failed program was:" >&5
1333
cat conftest.$ac_ext >&5
1336
if test "x$have_mysql_h" = "xyes"; then
1337
echo "$ac_t""yes" 1>&6
1338
cat >> confdefs.h <<\EOF
1339
#define HAVE_MYSQL_H
1342
SMART_CFLAGS="$SMART_CFLAGS $mysql_cflags"
1344
echo "$ac_t""no" 1>&6
1346
CFLAGS="$old_CFLAGS"
1348
if test "x$have_mysql_h" != "xyes"; then
1349
smart_try_dir="$mysql_include_dir /usr/local/include \
1350
/usr/local/mysql/include"
1353
ac_safe=`echo "mysql/mysql.h" | sed 'y%./+-%__pm%'`
1354
echo $ac_n "checking for mysql/mysql.h""... $ac_c" 1>&6
1355
echo "configure:1356: checking for mysql/mysql.h" >&5
1357
old_CFLAGS="$CFLAGS"
1361
if test "x$smart_try_dir" != "x"; then
1362
for try in $smart_try_dir; do
1363
CFLAGS="$old_CFLAGS -I$try"
1364
cat > conftest.$ac_ext <<EOF
1365
#line 1366 "configure"
1366
#include "confdefs.h"
1368
#include <mysql/mysql.h>
1373
if { (eval echo configure:1374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1375
smart_include="-I$try"
1377
echo "configure: failed program was:" >&5
1378
cat conftest.$ac_ext >&5
1383
if test "x$smart_include" != "x"; then
1387
CFLAGS="$old_CFLAGS"
1390
if test "x$smart_include" = "x"; then
1391
cat > conftest.$ac_ext <<EOF
1392
#line 1393 "configure"
1393
#include "confdefs.h"
1395
#include <mysql/mysql.h>
1400
if { (eval echo configure:1401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1404
echo "configure: failed program was:" >&5
1405
cat conftest.$ac_ext >&5
1412
if test "x$smart_include" = "x"; then
1415
if test "x$LOCATE" != "x"; then
1419
for x in `${LOCATE} $file 2>/dev/null`; do
1420
base=`echo $x | sed "s%/${file}%%"`
1421
if test "x$x" = "x$base"; then
1425
dir=`${DIRNAME} $x 2>/dev/null`
1426
exclude=`echo ${dir} | ${GREP} /home`
1427
if test "x$exclude" != "x"; then
1431
already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}`
1432
if test "x$already" = "x"; then
1438
eval "smart_include_dir=\"\$smart_include_dir $DIRS\""
1441
for try in $smart_include_dir /usr/local/include /opt/include; do
1442
CFLAGS="$old_CFLAGS -I$try"
1443
cat > conftest.$ac_ext <<EOF
1444
#line 1445 "configure"
1445
#include "confdefs.h"
1447
#include <mysql/mysql.h>
1452
if { (eval echo configure:1453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1454
smart_include="-I$try"
1456
echo "configure: failed program was:" >&5
1457
cat conftest.$ac_ext >&5
1462
if test "x$smart_include" != "x"; then
1466
CFLAGS="$old_CFLAGS"
1469
if test "x$smart_include" != "x"; then
1470
echo "$ac_t""yes" 1>&6
1471
eval "ac_cv_header_$ac_safe=yes"
1472
CFLAGS="$old_CFLAGS $smart_include"
1473
SMART_CFLAGS="$SMART_CFLAGS $smart_include"
1475
echo "$ac_t""no" 1>&6
1478
if test "$ac_cv_header_mysql_mysql_h" = "yes"; then
1479
cat >> confdefs.h <<\EOF
1480
#define HAVE_MYSQL_MYSQL_H
1484
echo "configure: warning: mysql headers not found. Use --with-mysql-include-dir=<path>." 1>&2
1485
targetname="" # disable module
1489
if test "x$targetname" = "x"; then
1490
echo "configure: warning: sql submodule 'mysql' disabled" 1>&2
1494
echo \*\*\* module rlm_sql_mysql is disabled.
1497
sql_mysql_ldflags="$SMART_LIBS"
1498
sql_mysql_cflags="$SMART_CFLAGS"