I don't see the necessarity of chaning the configure.in behaviour. And
it *definitly* has changed. On a system without MySQL configure breaks
claiming that MySQL is not available. Hence we have a broken configure
here.

Bruno, could you please consider asking the developers list for votes
priour to commiting such changes. Thanks in advance.

Stipe

> -dnl Implement the --with-mysql option. This will set HAVE_MYSQL in config.h
> -dnl accordingly and enable the usage of the libmysqlclient routines.
> +dnl Implement the --with-mysql option.
> 
> +AC_CONFIG_SECTION([Configuring MySQL support])
>  AC_ARG_WITH(mysql,
> -[  --with-mysql[=DIR]      where to look for MySQL libs and header files
> -                          DIR points to the installation [/usr/local]],
> -[AC_CONFIG_SECTION([Configuring MySQL support])
> - AC_PATH_PROGS(MYSQL_CONFIG, mysql_config, no)
> - dnl check for MySQL 4.x style mysql_config information
> - if test "$MYSQL_CONFIG" = "no"; then
> -   dnl mysql-3.x style
> -   AC_MSG_CHECKING([for MySQL client support in])
> -   if test "$withval" = "yes"; then
> -     loc="/usr/local"
> -   else
> -     loc="$withval"
> -   fi
> -   AC_MSG_RESULT($loc)
> -   AC_CHECK_FILE("$loc/include/mysql/mysql.h",
> -     [CFLAGS="$CFLAGS -I$loc/include/mysql"; LIBS="$LIBS -L$loc/lib/mysql 
>-lmysqlclient"],
> -     [AC_CHECK_FILE("$loc/include/mysql.h",
> -       [CFLAGS="$CFLAGS -I$loc/include"; LIBS="$LIBS -L$loc/lib -lmysqlclient"],
> -       [AC_MSG_ERROR(Unable to find mysql.h under $loc)]
> -      )]
> -   )
> - else
> -   dnl mysql-4.x style
> -   AC_MSG_CHECKING([mysql version])
> -   mysql_version=`$MYSQL_CONFIG --version`
> -   AC_MSG_RESULT([$mysql_version])
> -   LIBS="$LIBS `$MYSQL_CONFIG --libs`"
> -   CFLAGS="$CFLAGS `$MYSQL_CONFIG --cflags`"
> - fi
> - AC_CHECK_HEADERS(mysql/mysql.h mysql/mysql_com.h mysql/mysql_version.h)
> - AC_CHECK_LIB(mysqlclient, mysql_init)
> - AC_DEFINE(HAVE_MYSQL)
> - MYSQL="yes"
> +[  --with-mysql[=DIR]        where to look for MySQL libs and header files
> +                          DIR points to the installation [/usr/local/mysql]],
> +[ if test -d "$withval"; then
> +    mysqlloc="$withval";
> +  else
> +    AC_MSG_ERROR(Unable to find MySQL libs and/or directories at $withval)
> +  fi
> +])
> +
> +
> +dnl Implement the --enable-mysql option. This will set HAVE_MYSQL in config.h
> +dnl accordingly and enable the usage of the libmysqlclient routines.
> +
> +AC_MSG_CHECKING([whether to compile with MySQL support])
> +AC_ARG_ENABLE(mysql,
> +[  --enable-mysql            enable MySQL storage (default: enabled)], [
> +  if test "$enableval" = no ; then
> +    AC_MSG_RESULT(disabled)
> +  fi
> +],[
> +  dnl test only if --with-mysql has not been used
> +  if test "x$mysqlloc" = "x" ; then
> +    AC_MSG_RESULT(searching)
> +    AC_PATH_PROGS(MYSQL_CONFIG, mysql_config, no)
> +    dnl check for MySQL 4.x style mysql_config information
> +    if test "$MYSQL_CONFIG" = "no"; then
> +      dnl mysql-3.x style
> +      found=""
> +      for loc in /usr /usr/local ; do
> +        if test "x$found" = "x" ; then
> +          AC_MSG_CHECKING([for MySQL client support in])
> +          AC_MSG_RESULT($loc)
> +          AC_CHECK_FILE("$loc/include/mysql/mysql.h",
> +            [CFLAGS="$CFLAGS -I$loc/include/mysql"; LIBS="$LIBS -L$loc/lib/mysql 
>-lmysqlclient"]; found=1,
> +            [AC_CHECK_FILE("$loc/include/mysql.h",
> +              [CFLAGS="$CFLAGS -I$loc/include"; LIBS="$LIBS -L$loc/lib 
>-lmysqlclient"]; found=1
> +             )]
> +          )
> +       fi
> +      done
> +      if test "x$found" != "x1" ; then
> +        AC_MSG_ERROR(Unable to find mysql.h)
> +      fi
> +    else
> +      dnl mysql-4.x style
> +      AC_MSG_CHECKING([mysql version])
> +      mysql_version=`$MYSQL_CONFIG --version`
> +      AC_MSG_RESULT([$mysql_version])
> +      LIBS="$LIBS `$MYSQL_CONFIG --libs`"
> +      CFLAGS="$CFLAGS `$MYSQL_CONFIG --cflags`"
> +    fi
> +  else
> +      AC_MSG_RESULT(searching in $mysqlloc)
> +      AC_CHECK_FILE("$mysqlloc/include/mysql/mysql.h",
> +        [CFLAGS="$CFLAGS -I$mysqlloc/include/mysql"; LIBS="$LIBS 
>-L$mysqlloc/lib/mysql -lmysqlclient"],
> +        [AC_CHECK_FILE("$mysqlloc/include/mysql.h",
> +          [CFLAGS="$CFLAGS -I$mysqlloc/include"; LIBS="$LIBS -L$mysqlloc/lib 
>-lmysqlclient"],
> +          [AC_MSG_ERROR(Unable to find mysql.h under $mysqlloc)]
> +         )]
> +      )
> +  fi
> +  AC_CHECK_HEADERS(mysql/mysql.h mysql/mysql_com.h mysql/mysql_version.h)
> +  AC_CHECK_LIB(mysqlclient, mysql_init)
> +  AC_DEFINE(HAVE_MYSQL)
> +  AC_MSG_CHECKING([whether to compile with MySQL support])
> +  AC_MSG_RESULT(yes)
> +  MYSQL="yes"
>  ])

[EMAIL PROTECTED]
-------------------------------------------------------------------
Wapme Systems AG

M�nsterstr. 248
40470 D�sseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are

Reply via email to