~ubuntu-branches/ubuntu/natty/freeradius/natty-updates

« back to all changes in this revision

Viewing changes to src/modules/rlm_sql/drivers/rlm_sql_mysql/configure

  • Committer: Bazaar Package Importer
  • Author(s): Paul Hampson
  • Date: 2006-01-15 13:34:13 UTC
  • mto: (3.1.3 dapper) (4.1.3 sid) (1.1.14 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060115133413-zo1dslttvdoalqym
Tags: upstream-1.1.0
ImportĀ upstreamĀ versionĀ 1.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
ac_default_prefix=/usr/local
13
13
# Any additions from configure.in:
14
14
ac_help="$ac_help
15
 
  --with-mysql-include-dir=DIR       Directory where the MySQL includes may be found "
16
 
ac_help="$ac_help
17
 
  --with-mysql-lib-dir=DIR       Directory where the MySQL libraries may be found "
18
 
ac_help="$ac_help
19
 
  --with-mysql-dir=DIR       Base directory where MySQL is installed "
 
15
  --with-mysql-dir=DIR          base directory where MySQL is installed "
 
16
ac_help="$ac_help
 
17
  --with-mysql-lib-dir=DIR      directory where the MySQL libraries may be found "
 
18
ac_help="$ac_help
 
19
  --with-mysql-include-dir=DIR  directory where the MySQL includes may be found "
 
20
ac_help="$ac_help
 
21
  --with-threads                use threads, if available. (default=yes) "
20
22
 
21
23
# Initialize some variables set by options.
22
24
# The variables have the same names as the options, with
527
529
fi
528
530
 
529
531
 
530
 
# From configure.in Revision: 1.9 
531
 
 
532
 
 
533
 
 
534
 
# Extract the first word of "gcc", so it can be a program name with args.
 
532
# From configure.in Revision: 1.9.4.1 
 
533
 
 
534
 
 
535
 
 
536
SMART_LIBS=""
 
537
SMART_CLFAGS=""
 
538
mysql_lib_dir=""
 
539
mysql_include_dir=""
 
540
 
 
541
if test x$with_rlm_sql_mysql != xno; then
 
542
 
 
543
    targetname=rlm_sql_mysql # we change this if a test fails
 
544
 
 
545
            
 
546
        # Check whether --with-mysql-dir or --without-mysql-dir was given.
 
547
if test "${with_mysql_dir+set}" = set; then
 
548
  withval="$with_mysql_dir"
 
549
   mysql_lib_dir="$withval/lib/mysql"
 
550
      mysql_include_dir="$withval/include" 
 
551
    
 
552
fi
 
553
 
 
554
 
 
555
        # Check whether --with-mysql-lib-dir or --without-mysql-lib-dir was given.
 
556
if test "${with_mysql_lib_dir+set}" = set; then
 
557
  withval="$with_mysql_lib_dir"
 
558
   mysql_lib_dir="$withval" 
 
559
    
 
560
fi
 
561
 
 
562
 
 
563
        # Check whether --with-mysql-include-dir or --without-mysql-include-dir was given.
 
564
if test "${with_mysql_include_dir+set}" = set; then
 
565
  withval="$with_mysql_include_dir"
 
566
   mysql_include_dir="$withval" 
 
567
    
 
568
fi
 
569
 
 
570
 
 
571
        mysql_with_threads=yes
 
572
    # Check whether --with-threads or --without-threads was given.
 
573
if test "${with_threads+set}" = set; then
 
574
  withval="$with_threads"
 
575
   case "$withval" in
 
576
        no)
 
577
            mysql_with_threads=no
 
578
            ;;
 
579
        *)
 
580
            ;;
 
581
        esac 
 
582
    
 
583
fi
 
584
 
 
585
 
 
586
            
 
587
    # Extract the first word of "gcc", so it can be a program name with args.
535
588
set dummy gcc; ac_word=$2
536
589
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
537
 
echo "configure:538: checking for $ac_word" >&5
 
590
echo "configure:591: checking for $ac_word" >&5
538
591
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
539
592
  echo $ac_n "(cached) $ac_c" 1>&6
540
593
else
564
617
  # Extract the first word of "cc", so it can be a program name with args.
565
618
set dummy cc; ac_word=$2
566
619
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
567
 
echo "configure:568: checking for $ac_word" >&5
 
620
echo "configure:621: checking for $ac_word" >&5
568
621
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
569
622
  echo $ac_n "(cached) $ac_c" 1>&6
570
623
else
615
668
      # Extract the first word of "cl", so it can be a program name with args.
616
669
set dummy cl; ac_word=$2
617
670
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
618
 
echo "configure:619: checking for $ac_word" >&5
 
671
echo "configure:672: checking for $ac_word" >&5
619
672
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
620
673
  echo $ac_n "(cached) $ac_c" 1>&6
621
674
else
647
700
fi
648
701
 
649
702
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
650
 
echo "configure:651: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
703
echo "configure:704: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
651
704
 
652
705
ac_ext=c
653
706
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
658
711
 
659
712
cat > conftest.$ac_ext << EOF
660
713
 
661
 
#line 662 "configure"
 
714
#line 715 "configure"
662
715
#include "confdefs.h"
663
716
 
664
717
main(){return(0);}
665
718
EOF
666
 
if { (eval echo configure:667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 
719
if { (eval echo configure:720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
667
720
  ac_cv_prog_cc_works=yes
668
721
  # If we can't run a trivial program, we are probably using a cross compiler.
669
722
  if (./conftest; exit) 2>/dev/null; then
689
742
  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
690
743
fi
691
744
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
692
 
echo "configure:693: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 
745
echo "configure:746: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
693
746
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
694
747
cross_compiling=$ac_cv_prog_cc_cross
695
748
 
696
749
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
697
 
echo "configure:698: checking whether we are using GNU C" >&5
 
750
echo "configure:751: checking whether we are using GNU C" >&5
698
751
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
699
752
  echo $ac_n "(cached) $ac_c" 1>&6
700
753
else
703
756
  yes;
704
757
#endif
705
758
EOF
706
 
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
 
759
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
707
760
  ac_cv_prog_gcc=yes
708
761
else
709
762
  ac_cv_prog_gcc=no
722
775
ac_save_CFLAGS="$CFLAGS"
723
776
CFLAGS=
724
777
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
725
 
echo "configure:726: checking whether ${CC-cc} accepts -g" >&5
 
778
echo "configure:779: checking whether ${CC-cc} accepts -g" >&5
726
779
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
727
780
  echo $ac_n "(cached) $ac_c" 1>&6
728
781
else
753
806
  fi
754
807
fi
755
808
 
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
760
 
  CPP=
761
 
fi
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
765
 
else
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.
768
 
  CPP="${CC-cc} -E"
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"
774
 
#include <assert.h>
775
 
Syntax Error
776
 
EOF
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
781
 
  :
782
 
else
783
 
  echo "$ac_err" >&5
784
 
  echo "configure: failed program was:" >&5
785
 
  cat conftest.$ac_ext >&5
786
 
  rm -rf conftest*
787
 
  CPP="${CC-cc} -E -traditional-cpp"
788
 
  cat > conftest.$ac_ext <<EOF
789
 
#line 790 "configure"
790
 
#include "confdefs.h"
791
 
#include <assert.h>
792
 
Syntax Error
793
 
EOF
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
798
 
  :
799
 
else
800
 
  echo "$ac_err" >&5
801
 
  echo "configure: failed program was:" >&5
802
 
  cat conftest.$ac_ext >&5
803
 
  rm -rf conftest*
804
 
  CPP="${CC-cc} -nologo -E"
805
 
  cat > conftest.$ac_ext <<EOF
806
 
#line 807 "configure"
807
 
#include "confdefs.h"
808
 
#include <assert.h>
809
 
Syntax Error
810
 
EOF
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
815
 
  :
816
 
else
817
 
  echo "$ac_err" >&5
818
 
  echo "configure: failed program was:" >&5
819
 
  cat conftest.$ac_ext >&5
820
 
  rm -rf conftest*
821
 
  CPP=/lib/cpp
822
 
fi
823
 
rm -f conftest*
824
 
fi
825
 
rm -f conftest*
826
 
fi
827
 
rm -f conftest*
828
 
  ac_cv_prog_CPP="$CPP"
829
 
fi
830
 
  CPP="$ac_cv_prog_CPP"
831
 
else
832
 
  ac_cv_prog_CPP="$CPP"
833
 
fi
834
 
echo "$ac_t""$CPP" 1>&6
835
 
 
836
 
 
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" 
841
 
 
842
 
fi
843
 
 
844
 
 
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" 
849
 
 
850
 
fi
851
 
 
852
 
 
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"
858
 
 
859
 
 
860
 
fi
861
 
 
862
 
 
863
 
if test x$with_rlm_sql_mysql != xno; then
864
 
 
865
 
        targetname=rlm_sql_mysql   # we might change this later.
866
 
 
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
873
815
else
894
836
  echo "$ac_t""no" 1>&6
895
837
fi
896
838
 
897
 
        if test "x$MYSQL_CONFIG" = "xyes"
898
 
        then
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
903
 
EOF
904
 
 
905
 
        else
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
911
 
else
912
 
  ac_save_LIBS="$LIBS"
913
 
LIBS="-lz  $LIBS"
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.  */
920
 
char compress();
921
 
 
922
 
int main() {
923
 
compress()
924
 
; return 0; }
925
 
EOF
926
 
if { (eval echo configure:927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
927
 
  rm -rf conftest*
928
 
  eval "ac_cv_lib_$ac_lib_var=yes"
929
 
else
930
 
  echo "configure: failed program was:" >&5
931
 
  cat conftest.$ac_ext >&5
932
 
  rm -rf conftest*
933
 
  eval "ac_cv_lib_$ac_lib_var=no"
934
 
fi
935
 
rm -f conftest*
936
 
LIBS="$ac_save_LIBS"
937
 
 
938
 
fi
939
 
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
940
 
  echo "$ac_t""yes" 1>&6
941
 
  LIBS="$LIBS -lz"
942
 
else
943
 
  echo "$ac_t""no" 1>&6
944
 
fi
945
 
 
946
 
 
947
 
                echo $ac_n "checking for mysql/mysql.h""... $ac_c" 1>&6
948
 
echo "configure:949: checking for mysql/mysql.h" >&5
949
 
 
950
 
                cat > conftest.$ac_ext <<EOF
951
 
#line 952 "configure"
952
 
#include "confdefs.h"
953
 
#include <mysql/mysql.h>
954
 
int main() {
955
 
int a = 1;
956
 
; return 0; }
957
 
EOF
958
 
if { (eval echo configure:959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
959
 
  rm -rf conftest*
960
 
  MYSQL_INCLUDE=" "
961
 
else
962
 
  echo "configure: failed program was:" >&5
963
 
  cat conftest.$ac_ext >&5
964
 
  rm -rf conftest*
965
 
  MYSQL_INCLUDE=
966
 
                
967
 
fi
968
 
rm -f conftest*
969
 
 
970
 
                if test "x$MYSQL_INCLUDE" = "x"; then
971
 
                        old_CFLAGS="$CFLAGS"
972
 
 
973
 
 
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>
980
 
int main() {
981
 
int a = 1;
982
 
; return 0; }
983
 
EOF
984
 
if { (eval echo configure:985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
985
 
  rm -rf conftest*
986
 
  MYSQL_INCLUDE="-I$try"
987
 
else
988
 
  echo "configure: failed program was:" >&5
989
 
  cat conftest.$ac_ext >&5
990
 
  rm -rf conftest*
991
 
  MYSQL_INCLUDE=
992
 
                                
993
 
fi
994
 
rm -f conftest*
995
 
                                if test "x$MYSQL_INCLUDE" != "x"; then
996
 
                                        cat >> confdefs.h <<\EOF
997
 
#define HAVE_MYSQL_MYSQL_H 1
998
 
EOF
999
 
 
1000
 
                                        break;
1001
 
                                fi
1002
 
                        done
1003
 
                        CFLAGS="$old_CFLAGS"
1004
 
                fi
1005
 
 
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
1010
 
                else
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
1015
 
EOF
1016
 
 
1017
 
  
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
1020
 
 
1021
 
                        old_LIBS="$LIBS"
1022
 
 
1023
 
 
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();
1030
 
int main() {
1031
 
mysql_init()
1032
 
; return 0; }
1033
 
EOF
1034
 
if { (eval echo configure:1035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1035
 
  rm -rf conftest*
1036
 
  MYSQL_LIBS="-L$try -lmysqlclient $old_LIBS"
1037
 
else
1038
 
  echo "configure: failed program was:" >&5
1039
 
  cat conftest.$ac_ext >&5
1040
 
  rm -rf conftest*
1041
 
  MYSQL_LIBS=
1042
 
                                
1043
 
fi
1044
 
rm -f conftest*
1045
 
                                if test "x$MYSQL_LIBS" != "x"; then
1046
 
                                        break;
1047
 
                                fi
1048
 
                        done
1049
 
                        LIBS="$old_LIBS"
1050
 
 
1051
 
                                                                        if test "x$MYSQL_LIBS" = "x"; then
1052
 
                                echo "$ac_t""no" 1>&6
1053
 
                                MYSQL_INCLUDE=
1054
 
                                echo "configure: warning: mysql libraries not found.  Use --with-mysql-lib-dir=<path>." 1>&2
1055
 
                                targetname=   # disabled module
1056
 
                        else
1057
 
                                echo "$ac_t""yes" 1>&6 
1058
 
                                sql_mysql_ldflags="$sql_mysql_ldflags $MYSQL_LIBS"
1059
 
                        fi
1060
 
                fi
1061
 
                sql_mysql_ldflags="$sql_mysql_ldflags $LIBS"
1062
 
        fi
1063
 
 
1064
 
        if test "x$targetname" = "x"; then
1065
 
                echo "configure: warning: sql submodule 'mysql' disabled" 1>&2
1066
 
        fi
1067
 
 
1068
 
else
1069
 
        targetname=
1070
 
        echo \*\*\* module rlm_sql_mysql is disabled.
1071
 
fi
1072
 
 
 
839
 
 
840
            
 
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
 
847
else
 
848
  ac_save_LIBS="$LIBS"
 
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();
 
857
 
 
858
int main() {
 
859
pthread_create()
 
860
; return 0; }
 
861
EOF
 
862
if { (eval echo configure:863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 
863
  rm -rf conftest*
 
864
  eval "ac_cv_lib_$ac_lib_var=yes"
 
865
else
 
866
  echo "configure: failed program was:" >&5
 
867
  cat conftest.$ac_ext >&5
 
868
  rm -rf conftest*
 
869
  eval "ac_cv_lib_$ac_lib_var=no"
 
870
fi
 
871
rm -f conftest*
 
872
LIBS="$ac_save_LIBS"
 
873
 
 
874
fi
 
875
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 
876
  echo "$ac_t""yes" 1>&6
 
877
   LIBS="-lpthread $LIBS" 
 
878
else
 
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
 
885
else
 
886
  ac_save_LIBS="$LIBS"
 
887
LIBS="-lc_r  $LIBS"
 
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();
 
895
 
 
896
int main() {
 
897
pthread_create()
 
898
; return 0; }
 
899
EOF
 
900
if { (eval echo configure:901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 
901
  rm -rf conftest*
 
902
  eval "ac_cv_lib_$ac_lib_var=yes"
 
903
else
 
904
  echo "configure: failed program was:" >&5
 
905
  cat conftest.$ac_ext >&5
 
906
  rm -rf conftest*
 
907
  eval "ac_cv_lib_$ac_lib_var=no"
 
908
fi
 
909
rm -f conftest*
 
910
LIBS="$ac_save_LIBS"
 
911
 
 
912
fi
 
913
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 
914
  echo "$ac_t""yes" 1>&6
 
915
   LIBS="-lc_r $LIBS" 
 
916
else
 
917
  echo "$ac_t""no" 1>&6
 
918
 mysql_with_threads=no 
 
919
                                  
 
920
fi
 
921
 
 
922
                     
 
923
fi
 
924
 
 
925
    fi
 
926
 
 
927
    if test "x$mysql_with_threads" = "xyes"; then
 
928
                if test "x$MYSQL_CONFIG" = "xyes"; then
 
929
            mysql_libs="$(mysql_config --libs_r)"
 
930
            old_LIBS="$LIBS"
 
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.  */
 
940
char mysql_init();
 
941
 
 
942
int main() {
 
943
mysql_init()
 
944
; return 0; }
 
945
EOF
 
946
if { (eval echo configure:947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 
947
  rm -rf conftest*
 
948
  have_libmysqlclient_r=yes
 
949
else
 
950
  echo "configure: failed program was:" >&5
 
951
  cat conftest.$ac_ext >&5
 
952
fi
 
953
rm -f conftest*
 
954
            LIBS="$old_LIBS"
 
955
            if test "x$have_libmysqlclient_r" = "xyes"; then
 
956
                echo "$ac_t""yes" 1>&6
 
957
                SMART_LIBS="$mysql_libs $SMART_LIBS"
 
958
            else
 
959
                echo "$ac_t""no" 1>&6
 
960
            fi
 
961
        fi
 
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"
 
965
            
 
966
 
 
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
 
971
 
 
972
old_LIBS="$LIBS"
 
973
smart_lib=
 
974
smart_lib_dir=
 
975
 
 
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();
 
983
int main() {
 
984
 mysql_init()
 
985
; return 0; }
 
986
EOF
 
987
if { (eval echo configure:988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 
988
  rm -rf conftest*
 
989
  smart_lib="-L$try -lmysqlclient_r"
 
990
else
 
991
  echo "configure: failed program was:" >&5
 
992
  cat conftest.$ac_ext >&5
 
993
fi
 
994
rm -f conftest*
 
995
    if test "x$smart_lib" != "x"; then
 
996
      break;
 
997
    fi
 
998
  done
 
999
  LIBS="$old_LIBS"
 
1000
fi
 
1001
 
 
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();
 
1008
int main() {
 
1009
 mysql_init()
 
1010
; return 0; }
 
1011
EOF
 
1012
if { (eval echo configure:1013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 
1013
  rm -rf conftest*
 
1014
  smart_lib="-lmysqlclient_r"
 
1015
else
 
1016
  echo "configure: failed program was:" >&5
 
1017
  cat conftest.$ac_ext >&5
 
1018
fi
 
1019
rm -f conftest*
 
1020
  LIBS="$old_LIBS"
 
1021
fi
 
1022
 
 
1023
if test "x$smart_lib" = "x"; then
 
1024
  
 
1025
 
 
1026
if test "x$LOCATE" != "x"; then
 
1027
        DIRS=
 
1028
  file=libmysqlclient_r${libltdl_cv_shlibext}
 
1029
 
 
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
 
1033
      continue;
 
1034
    fi
 
1035
 
 
1036
    dir=`${DIRNAME} $x 2>/dev/null`
 
1037
                exclude=`echo ${dir} | ${GREP} /home`
 
1038
    if test "x$exclude" != "x"; then
 
1039
      continue
 
1040
    fi
 
1041
 
 
1042
                    already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
 
1043
    if test "x$already" = "x"; then
 
1044
      DIRS="$DIRS $dir"
 
1045
    fi
 
1046
  done
 
1047
fi
 
1048
 
 
1049
eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
 
1050
 
 
1051
  
 
1052
 
 
1053
if test "x$LOCATE" != "x"; then
 
1054
        DIRS=
 
1055
  file=libmysqlclient_r.a
 
1056
 
 
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
 
1060
      continue;
 
1061
    fi
 
1062
 
 
1063
    dir=`${DIRNAME} $x 2>/dev/null`
 
1064
                exclude=`echo ${dir} | ${GREP} /home`
 
1065
    if test "x$exclude" != "x"; then
 
1066
      continue
 
1067
    fi
 
1068
 
 
1069
                    already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
 
1070
    if test "x$already" = "x"; then
 
1071
      DIRS="$DIRS $dir"
 
1072
    fi
 
1073
  done
 
1074
fi
 
1075
 
 
1076
eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
 
1077
 
 
1078
 
 
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();
 
1085
int main() {
 
1086
 mysql_init()
 
1087
; return 0; }
 
1088
EOF
 
1089
if { (eval echo configure:1090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 
1090
  rm -rf conftest*
 
1091
  smart_lib="-L$try -lmysqlclient_r"
 
1092
else
 
1093
  echo "configure: failed program was:" >&5
 
1094
  cat conftest.$ac_ext >&5
 
1095
fi
 
1096
rm -f conftest*
 
1097
    if test "x$smart_lib" != "x"; then
 
1098
      break;
 
1099
    fi
 
1100
  done
 
1101
  LIBS="$old_LIBS"
 
1102
fi
 
1103
 
 
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"
 
1109
else
 
1110
  echo "$ac_t""no" 1>&6
 
1111
fi
 
1112
 
 
1113
            if test "x$ac_cv_lib_mysqlclient_r_mysql_init" != "xyes"
 
1114
                then
 
1115
                                echo "configure: warning: mysql libraries not found. Use --with-mysql-lib-dir=<path>." 1>&2
 
1116
                targetname="" # disable module
 
1117
            fi
 
1118
        fi
 
1119
    else
 
1120
                if test "x$MYSQL_CONFIG" = "xyes"; then
 
1121
            mysql_libs="$(mysql_config --libs)"
 
1122
            old_LIBS="$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.  */
 
1132
char mysql_init();
 
1133
 
 
1134
int main() {
 
1135
mysql_init()
 
1136
; return 0; }
 
1137
EOF
 
1138
if { (eval echo configure:1139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 
1139
  rm -rf conftest*
 
1140
  have_libmysqlclient=yes
 
1141
else
 
1142
  echo "configure: failed program was:" >&5
 
1143
  cat conftest.$ac_ext >&5
 
1144
fi
 
1145
rm -f conftest*
 
1146
            LIBS="$old_LIBS"
 
1147
            if test "x$have_libmysqlclient" = "xyes"; then
 
1148
                echo "$ac_t""yes" 1>&6
 
1149
                SMART_LIBS="$mysql_libs $SMART_LIBS"
 
1150
            else
 
1151
                echo "$ac_t""no" 1>&6
 
1152
            fi
 
1153
        fi
 
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"
 
1157
            
 
1158
 
 
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
 
1163
 
 
1164
old_LIBS="$LIBS"
 
1165
smart_lib=
 
1166
smart_lib_dir=
 
1167
 
 
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();
 
1175
int main() {
 
1176
 mysql_init()
 
1177
; return 0; }
 
1178
EOF
 
1179
if { (eval echo configure:1180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 
1180
  rm -rf conftest*
 
1181
  smart_lib="-L$try -lmysqlclient"
 
1182
else
 
1183
  echo "configure: failed program was:" >&5
 
1184
  cat conftest.$ac_ext >&5
 
1185
fi
 
1186
rm -f conftest*
 
1187
    if test "x$smart_lib" != "x"; then
 
1188
      break;
 
1189
    fi
 
1190
  done
 
1191
  LIBS="$old_LIBS"
 
1192
fi
 
1193
 
 
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();
 
1200
int main() {
 
1201
 mysql_init()
 
1202
; return 0; }
 
1203
EOF
 
1204
if { (eval echo configure:1205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 
1205
  rm -rf conftest*
 
1206
  smart_lib="-lmysqlclient"
 
1207
else
 
1208
  echo "configure: failed program was:" >&5
 
1209
  cat conftest.$ac_ext >&5
 
1210
fi
 
1211
rm -f conftest*
 
1212
  LIBS="$old_LIBS"
 
1213
fi
 
1214
 
 
1215
if test "x$smart_lib" = "x"; then
 
1216
  
 
1217
 
 
1218
if test "x$LOCATE" != "x"; then
 
1219
        DIRS=
 
1220
  file=libmysqlclient${libltdl_cv_shlibext}
 
1221
 
 
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
 
1225
      continue;
 
1226
    fi
 
1227
 
 
1228
    dir=`${DIRNAME} $x 2>/dev/null`
 
1229
                exclude=`echo ${dir} | ${GREP} /home`
 
1230
    if test "x$exclude" != "x"; then
 
1231
      continue
 
1232
    fi
 
1233
 
 
1234
                    already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
 
1235
    if test "x$already" = "x"; then
 
1236
      DIRS="$DIRS $dir"
 
1237
    fi
 
1238
  done
 
1239
fi
 
1240
 
 
1241
eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
 
1242
 
 
1243
  
 
1244
 
 
1245
if test "x$LOCATE" != "x"; then
 
1246
        DIRS=
 
1247
  file=libmysqlclient.a
 
1248
 
 
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
 
1252
      continue;
 
1253
    fi
 
1254
 
 
1255
    dir=`${DIRNAME} $x 2>/dev/null`
 
1256
                exclude=`echo ${dir} | ${GREP} /home`
 
1257
    if test "x$exclude" != "x"; then
 
1258
      continue
 
1259
    fi
 
1260
 
 
1261
                    already=`echo \$smart_lib_dir ${DIRS} | ${GREP} ${dir}`
 
1262
    if test "x$already" = "x"; then
 
1263
      DIRS="$DIRS $dir"
 
1264
    fi
 
1265
  done
 
1266
fi
 
1267
 
 
1268
eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
 
1269
 
 
1270
 
 
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();
 
1277
int main() {
 
1278
 mysql_init()
 
1279
; return 0; }
 
1280
EOF
 
1281
if { (eval echo configure:1282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 
1282
  rm -rf conftest*
 
1283
  smart_lib="-L$try -lmysqlclient"
 
1284
else
 
1285
  echo "configure: failed program was:" >&5
 
1286
  cat conftest.$ac_ext >&5
 
1287
fi
 
1288
rm -f conftest*
 
1289
    if test "x$smart_lib" != "x"; then
 
1290
      break;
 
1291
    fi
 
1292
  done
 
1293
  LIBS="$old_LIBS"
 
1294
fi
 
1295
 
 
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"
 
1301
else
 
1302
  echo "$ac_t""no" 1>&6
 
1303
fi
 
1304
 
 
1305
            if test "x$ac_cv_lib_mysqlclient_mysql_init" != "xyes"
 
1306
                then
 
1307
                                echo "configure: warning: mysql libraries not found. Use --with-mysql-lib-dir=<path>." 1>&2
 
1308
                targetname="" # disable module
 
1309
            fi
 
1310
        fi
 
1311
    fi
 
1312
 
 
1313
            
 
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"
 
1323
#include <mysql.h>
 
1324
int main() {
 
1325
int a = 1;
 
1326
; return 0; }
 
1327
EOF
 
1328
if { (eval echo configure:1329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 
1329
  rm -rf conftest*
 
1330
  have_mysql_h=yes
 
1331
else
 
1332
  echo "configure: failed program was:" >&5
 
1333
  cat conftest.$ac_ext >&5
 
1334
fi
 
1335
rm -f conftest*
 
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 
 
1340
EOF
 
1341
 
 
1342
            SMART_CFLAGS="$SMART_CFLAGS $mysql_cflags"
 
1343
        else
 
1344
            echo "$ac_t""no" 1>&6
 
1345
        fi
 
1346
        CFLAGS="$old_CFLAGS"
 
1347
    fi
 
1348
    if test "x$have_mysql_h" != "xyes"; then
 
1349
                smart_try_dir="$mysql_include_dir /usr/local/include \
 
1350
                /usr/local/mysql/include"
 
1351
        
 
1352
 
 
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
 
1356
 
 
1357
old_CFLAGS="$CFLAGS"
 
1358
smart_include=
 
1359
smart_include_dir=
 
1360
 
 
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"
 
1367
 
 
1368
                    #include <mysql/mysql.h>
 
1369
int main() {
 
1370
 int a = 1;
 
1371
; return 0; }
 
1372
EOF
 
1373
if { (eval echo configure:1374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 
1374
  rm -rf conftest*
 
1375
  smart_include="-I$try"
 
1376
else
 
1377
  echo "configure: failed program was:" >&5
 
1378
  cat conftest.$ac_ext >&5
 
1379
  rm -rf conftest*
 
1380
  smart_include=
 
1381
fi
 
1382
rm -f conftest*
 
1383
    if test "x$smart_include" != "x"; then
 
1384
      break;
 
1385
    fi
 
1386
  done
 
1387
  CFLAGS="$old_CFLAGS"
 
1388
fi
 
1389
 
 
1390
if test "x$smart_include" = "x"; then
 
1391
  cat > conftest.$ac_ext <<EOF
 
1392
#line 1393 "configure"
 
1393
#include "confdefs.h"
 
1394
 
 
1395
                  #include <mysql/mysql.h>
 
1396
int main() {
 
1397
 int a = 1;
 
1398
; return 0; }
 
1399
EOF
 
1400
if { (eval echo configure:1401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 
1401
  rm -rf conftest*
 
1402
  smart_include=" "
 
1403
else
 
1404
  echo "configure: failed program was:" >&5
 
1405
  cat conftest.$ac_ext >&5
 
1406
  rm -rf conftest*
 
1407
  smart_include=
 
1408
fi
 
1409
rm -f conftest*
 
1410
fi
 
1411
 
 
1412
if test "x$smart_include" = "x"; then
 
1413
  
 
1414
 
 
1415
if test "x$LOCATE" != "x"; then
 
1416
        DIRS=
 
1417
  file=mysql/mysql.h
 
1418
 
 
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
 
1422
      continue;
 
1423
    fi
 
1424
 
 
1425
    dir=`${DIRNAME} $x 2>/dev/null`
 
1426
                exclude=`echo ${dir} | ${GREP} /home`
 
1427
    if test "x$exclude" != "x"; then
 
1428
      continue
 
1429
    fi
 
1430
 
 
1431
                    already=`echo \$smart_include_dir ${DIRS} | ${GREP} ${dir}`
 
1432
    if test "x$already" = "x"; then
 
1433
      DIRS="$DIRS $dir"
 
1434
    fi
 
1435
  done
 
1436
fi
 
1437
 
 
1438
eval "smart_include_dir=\"\$smart_include_dir $DIRS\""
 
1439
 
 
1440
 
 
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"
 
1446
 
 
1447
                    #include <mysql/mysql.h>
 
1448
int main() {
 
1449
 int a = 1;
 
1450
; return 0; }
 
1451
EOF
 
1452
if { (eval echo configure:1453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 
1453
  rm -rf conftest*
 
1454
  smart_include="-I$try"
 
1455
else
 
1456
  echo "configure: failed program was:" >&5
 
1457
  cat conftest.$ac_ext >&5
 
1458
  rm -rf conftest*
 
1459
  smart_include=
 
1460
fi
 
1461
rm -f conftest*
 
1462
    if test "x$smart_include" != "x"; then
 
1463
      break;
 
1464
    fi
 
1465
  done
 
1466
  CFLAGS="$old_CFLAGS"
 
1467
fi
 
1468
 
 
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"
 
1474
else
 
1475
  echo "$ac_t""no" 1>&6
 
1476
fi
 
1477
 
 
1478
        if test "$ac_cv_header_mysql_mysql_h" = "yes"; then
 
1479
            cat >> confdefs.h <<\EOF
 
1480
#define HAVE_MYSQL_MYSQL_H 
 
1481
EOF
 
1482
 
 
1483
        else
 
1484
                    echo "configure: warning: mysql headers not found. Use --with-mysql-include-dir=<path>." 1>&2
 
1485
            targetname="" # disable module
 
1486
        fi
 
1487
    fi
 
1488
 
 
1489
    if test "x$targetname" = "x"; then
 
1490
        echo "configure: warning: sql submodule 'mysql' disabled" 1>&2
 
1491
    fi
 
1492
else
 
1493
    targetname=
 
1494
    echo \*\*\* module rlm_sql_mysql is disabled.
 
1495
fi
 
1496
 
 
1497
sql_mysql_ldflags="$SMART_LIBS"
 
1498
sql_mysql_cflags="$SMART_CFLAGS"
1073
1499
 
1074
1500
 
1075
1501
 
1206
1632
s%@infodir@%$infodir%g
1207
1633
s%@mandir@%$mandir%g
1208
1634
s%@CC@%$CC%g
1209
 
s%@CPP@%$CPP%g
1210
1635
s%@MYSQL_CONFIG@%$MYSQL_CONFIG%g
1211
1636
s%@sql_mysql_ldflags@%$sql_mysql_ldflags%g
1212
1637
s%@sql_mysql_cflags@%$sql_mysql_cflags%g