pike.git / src / modules / Mysql / configure.in

version» Context lines:

pike.git/src/modules/Mysql/configure.in:1:   # - # $Id: configure.in,v 1.60 2008/06/28 21:43:57 marcus Exp $ + # $Id: configure.in,v 1.61 2008/07/18 18:20:15 mast Exp $   #   # Configure script for the mysql-module   #   # Henrik Grubbström   #      #   # NOTE:   # Prior to 3.20.0 After 3.20.0   # -------------------------------------------------------------------
pike.git/src/modules/Mysql/configure.in:20:   AC_INIT(mysql.c)   AC_CONFIG_HEADER(config.h)      AC_MODULE_INIT()      PIKE_FEATURE_WITHOUT(Mysql)      OLD_LIBS=$LIBS   OLD_LDFLAGS=$LDFLAGS   OLD_CPPFLAGS=$CPPFLAGS - MYSQL_LIBS="" +       AC_ARG_WITH(mysql, [ --without-mysql no support for the Mysql database],[],[with_mysql=yes])      if test x$with_mysql = xno; then    :   else    PIKE_FEATURE_NODEP(Mysql)       AC_MSG_CHECKING(for Mysql directory prefix)    AC_CACHE_VAL(pike_cv_mysql_lib_dir_prefix, [
pike.git/src/modules/Mysql/configure.in:118:    if test x$ac_cv_header_mysql_h$ac_cv_header_mysql_mysql_h = xnono; then    # Required headerfile missing.    PIKE_FEATURE_NODEP(Mysql)    pike_cv_mysql="no"    fi       # Defines within headerfile   define([AC_CHECK_MYSQL_OPTIONS],   [   AC_MSG_CHECKING(for $1) + AC_CACHE_VAL(ac_cv_pike_mysql_opt_$1, [   AC_TRY_COMPILE([   #if HAVE_WINSOCK2_H   #include <winsock2.h>   #elif HAVE_WINSOCK_H   #include <winsock.h>   #endif   #ifdef HAVE_MYSQL_H   #include <mysql.h>   #else   #ifdef HAVE_MYSQL_MYSQL_H   #include <mysql/mysql.h>   #endif   #endif   ], [   int tmp;   tmp = $1; - ], [ + ], ac_cv_pike_mysql_opt_$1=yes, +  ac_cv_pike_mysql_opt_$1=no) + ]) + if test "x$ac_cv_pike_mysql_opt_$1" = xyes; then    AC_MSG_RESULT(yes)    AC_DEFINE(HAVE_$1) - ], [ + else    AC_MSG_RESULT(no) - ])]) + fi + ])          AC_CHECK_MYSQL_OPTIONS(MYSQL_READ_DEFAULT_FILE)    AC_CHECK_MYSQL_OPTIONS(MYSQL_OPT_CONNECT_TIMEOUT)    AC_CHECK_MYSQL_OPTIONS(MYSQL_OPT_COMPRESS)    AC_CHECK_MYSQL_OPTIONS(MYSQL_OPT_NAMED_PIPE)    AC_CHECK_MYSQL_OPTIONS(MYSQL_INIT_COMMAND)    AC_CHECK_MYSQL_OPTIONS(MYSQL_READ_DEFAULT_GROUP)    AC_CHECK_MYSQL_OPTIONS(MYSQL_SET_CHARSET_DIR)    AC_CHECK_MYSQL_OPTIONS(MYSQL_SET_CHARSET_NAME)    AC_CHECK_MYSQL_OPTIONS(MYSQL_OPT_LOCAL_INFILE)    AC_CHECK_MYSQL_OPTIONS(SHUTDOWN_DEFAULT)    AC_CHECK_MYSQL_OPTIONS(FIELD_TYPE_GEOMETRY)    AC_CHECK_MYSQL_OPTIONS(CLIENT_INTERACTIVE)          # Mysql libs    -  pike_cv_mysql="unknown" + dnl if test x"$pike_cv_sys_os" = xWindows_NT ; then + dnl LIBS="-lshell32 -lkernel32 -lws2_32 -ladvapi32 -luser32 ${LIBS}" + dnl fi    -  if test x"$pike_cv_sys_os" = xWindows_NT ; then -  LIBS="-lshell32 -lkernel32 -lws2_32 -ladvapi32 -luser32 ${LIBS}" -  fi +  old_LIBS="$LIBS"    -  AC_CHECK_LIB(mysqlclient, bchange, [ -  LIBS="-lmysqlclient $LIBS" -  MYSQL_LIBS="-lmysqlclient" -  pike_cv_mysql="post3.20" -  ], [ -  AC_CHECK_LIB(mystrings, bchange, [ -  LIBS="-lmystrings $LIBS" -  MYSQL_LIBS="-lmystrings ${MYSQL_LIBS}" -  pike_cv_mysql="post3.20" -  ], [ -  AC_CHECK_LIB(strings, bchange, [ -  LIBS="-lstrings $LIBS" -  MYSQL_LIBS="-lstrings ${MYSQL_LIBS}" -  pike_cv_mysql="pre3.20" -  ], []) -  ]) - ]) -  -  AC_MSG_CHECKING(Mysql version) -  -  AC_MSG_RESULT($pike_cv_mysql) -  +     # System libs which might be needed    -  if echo $LIBS|grep -- -lsocket >&5 2>&5; then -  : -  else -  AC_CHECK_LIB(socket, socket, [ -  LIBS="-lsocket $LIBS" -  MYSQL_LIBS="-lsocket ${MYSQL_LIBS}" -  ], []) -  fi -  if echo $LIBS|grep -- -lnsl >&5 2>&5; then -  : -  else -  AC_CHECK_LIB(nsl, gethostbyname, [ -  LIBS="-lnsl $LIBS" -  MYSQL_LIBS="-lnsl ${MYSQL_LIBS}" -  ], []) -  fi -  if echo $LIBS|grep -- -lm >&5 2>&5; then -  : -  else -  AC_CHECK_LIB(m, floor, [ -  LIBS="-lm $LIBS" -  MYSQL_LIBS="-lm ${MYSQL_LIBS}" -  ], []) -  fi +  AC_SEARCH_LIBS(socket, socket) +  AC_SEARCH_LIBS(gethostbyname, nsl) +  AC_SEARCH_LIBS(floor, m)       # Header check necessary for PIKE_FUNCS_NEED_DECLS.    AC_CHECK_HEADERS(pthread.h)       # Pthreads is still needed in 3.20.0.    AC_CHECK_FUNC(pthread_self, [], [    AC_CHECK_LIB(pthread, pthread_self, [    LIBS="-lpthread $LIBS"    echo Warning added -lpthread to \$LIBS\!    ], [    AC_CHECK_LIB(pthreads, pthread_self, [    LIBS="-lpthreads $LIBS"    echo Warning added -lpthreads to \$LIBS\!    ], [])    ])    ])    -  AC_CHECK_LIB(dbug, _db_doprnt_, [ -  LIBS="-ldbug $LIBS" -  MYSQL_LIBS="-ldbug ${MYSQL_LIBS}" -  ], []) +  AC_SEARCH_LIBS(_db_doprnt_, dbug) +  AC_SEARCH_LIBS(my_init, mysys)    -  AC_CHECK_LIB(mysys, my_init, [ -  LIBS="-lmysys $LIBS" -  MYSQL_LIBS="-lmysys ${MYSQL_LIBS}" -  ], []) -  +     # mysql 3.23.x libmysqlclient requires zlib... -  AC_CHECK_LIB(z, compress, [ -  LIBS="-lz $LIBS" -  MYSQL_LIBS="-lz ${MYSQL_LIBS}" -  ], []) +  AC_SEARCH_LIBS(compress, z)       # Try a couple of mysqlclient libs    # in order of age, newest first.      define([AC_CHECK_SQLLIB],   [   AC_MSG_CHECKING(for mysql_real_connect in $1)   AC_CACHE_VAL(ac_cv_pike_lib_$1_mysql_real_connect,   [    ac_save_LIBS="$LIBS"
pike.git/src/modules/Mysql/configure.in:322:    PIKE_FEATURE(Mysql,[yes (lib$1)])    AC_MSG_RESULT(yes)    $2    else    AC_MSG_RESULT(no)    $3    fi   fi   ])    +  # libmysql.lib is the name for the libmysql.dll wrapper in the +  # windows releases. There's also a mysqlclient.lib which contain the +  # static version. We prefer the dynamic one so check libmysql first. +  AC_CHECK_SQLLIB(libmysql, [ +  LIBS="-llibmysql $LIBS" +  ], [    AC_CHECK_SQLLIB(mysqlclient, [    LIBS="-lmysqlclient $LIBS" -  MYSQL_LIBS="-lmysqlclient ${MYSQL_LIBS}" +     ], [    AC_CHECK_SQLLIB(mysqllib, [    LIBS="-lmysqllib $LIBS" -  MYSQL_LIBS="-lmysqllib ${MYSQL_LIBS}" +     ], [    AC_CHECK_SQLLIB(mysql, [    LIBS="-lmysql $LIBS" -  MYSQL_LIBS="-lmysql ${MYSQL_LIBS}" +     ], [    PIKE_FEATURE_NODEP(Mysql)    pike_cv_mysql="no"    ])    ])    ]) -  +  ])       if test x$pike_cv_mysql = xno; then :; else    # Check version match    AC_CHECK_FUNC(mysql_get_client_version,[    AC_TRY_RUN([#ifdef HAVE_WINSOCK2_H   #include <winsock2.h>   #else   #ifdef HAVE_WINSOCK_H   #include <winsock.h>   #endif
pike.git/src/modules/Mysql/configure.in:383:    ],[])    ],[])    fi       if test x$pike_cv_mysql = xno; then    # Restore variables, so we don't link with unnessesary libs       LIBS=$OLD_LIBS    CPPFLAGS=$OLD_CPPFLAGS    LDFLAGS=$OLD_LDFLAGS -  MYSQL_LIBS="" +     else    AC_DEFINE(HAVE_MYSQL)       # Note: mysql_port and mysql_unix_port aren't functions, but that shouldn't matter    define([PIKE_CHECK_MYSQL_FUNC], [    changequote(<<, >>)dnl    define(<<AC_CV_NAME>>, translit(pike_cv_mysql_$1, [ *], [_p]))dnl    changequote([, ])dnl    AC_MSG_CHECKING(for $1)    AC_CACHE_VAL(AC_CV_NAME, [
pike.git/src/modules/Mysql/configure.in:415:   #include <mysql/mysql.h>   #else   #error Need mysql.h headerfile!   #endif   #endif    ], [    void (*foo__)() = (void (*)())&$1;    ], [AC_CV_NAME="yes"], [AC_CV_NAME="no"])    ])    if test "$AC_CV_NAME" = "yes"; then -  AC_DEFINE(translit(HAVE_$1,[a-z],[A-Z])) +  AC_DEFINE(translit(HAVE_$1,[a-z],[A-Z]), [], [Defined if $1 exists.])    fi    AC_MSG_RESULT($AC_CV_NAME)    ])       PIKE_CHECK_MYSQL_FUNC(mysql_real_query)    PIKE_CHECK_MYSQL_FUNC(mysql_fetch_lengths)    PIKE_CHECK_MYSQL_FUNC(mysql_options)    PIKE_CHECK_MYSQL_FUNC(mysql_set_character_set) -  +  PIKE_CHECK_MYSQL_FUNC(mysql_ssl_set)    -  AC_CHECK_LIB(mysqlclient, mysql_ssl_set, [ -  AC_DEFINE(HAVE_MYSQL_SSL) -  ]) -  +     # This function should exist even in ancient versions, but it    # appear to exist only in header files sometimes.    PIKE_CHECK_MYSQL_FUNC(mysql_character_set_name)       # Note: The following two are variables:    PIKE_CHECK_MYSQL_FUNC(mysql_port)    PIKE_CHECK_MYSQL_FUNC(mysql_unix_port)       if test "$pike_cv_mysql_mysql_fetch_lengths" = "yes"; then    #
pike.git/src/modules/Mysql/configure.in:484:    if test "X$pike_cv_mysql_fetch_lengths_ret_type" = "X"; then    AC_MSG_RESULT(Unknown -- Defaulting to unsigned long)    AC_DEFINE(FETCH_LENGTHS_TYPE, unsigned long)    else    AC_MSG_RESULT($pike_cv_mysql_fetch_lengths_ret_type)    AC_DEFINE_UNQUOTED(FETCH_LENGTHS_TYPE,    $pike_cv_mysql_fetch_lengths_ret_type)    fi    else :; fi    -  if test x"$pike_cv_sys_os" = xWindows_NT ; then -  MYSQL_LIBS="-lshell32 -lkernel32 -lws2_32 -ladvapi32 -luser32 ${MYSQL_LIBS}" -  fi -  +     # Header checks necessary for PIKE_FUNCS_NEED_DECLS.    AC_CHECK_HEADERS(stdio.h io.h)       AC_CHECK_FUNCS(ldiv open sopen close read fileno puts fgets \    _findfirst _findnext _findclose)       AC_MSG_CHECKING(for the charsetnr member in MYSQL_FIELD)    AC_CACHE_VAL(pike_cv_have_mysql_field_charsetnr, [    AC_TRY_LINK([   #ifdef HAVE_WINSOCK2_H
pike.git/src/modules/Mysql/configure.in:525:    [pike_cv_have_mysql_field_charsetnr="no"])    ])    if test "$pike_cv_have_mysql_field_charsetnr" = yes; then    AC_DEFINE(HAVE_MYSQL_FIELD_CHARSETNR)    fi    AC_MSG_RESULT($pike_cv_have_mysql_field_charsetnr)       fi   fi    - AC_SUBST(MYSQL_LIBS) -  +    AC_OUTPUT(Makefile,echo FOO >stamp-h )