Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_mysqlr.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_MYSQLR
  8. #
  9. # DESCRIPTION
  10. #
  11. # First check if mysqlconfig exists. It fails if mysqlconfig is not in
  12. # path. Then it checks for the libraries and replaces -lmysqlclient
  13. # statement with -lmysqlclient_r statement, to enable threaded client
  14. # library.
  15. #
  16. # The following are exported environment variables:
  17. #
  18. # MYSQL_LIBS
  19. # MYSQL_CFLAGS
  20. #
  21. # LICENSE
  22. #
  23. # Copyright (c) 2008 Can Bican <bican@yahoo.com>
  24. #
  25. # Copying and distribution of this file, with or without modification, are
  26. # permitted in any medium without royalty provided the copyright notice
  27. # and this notice are preserved. This file is offered as-is, without any
  28. # warranty.
  29. #serial 6
  30. AU_ALIAS([AC_CHECK_MYSQLR], [AX_CHECK_MYSQLR])
  31. AC_DEFUN([AX_CHECK_MYSQLR],[
  32. AC_PATH_PROG(mysqlconfig,mysql_config)
  33. if test [ -z "$mysqlconfig" ]
  34. then
  35. AC_MSG_ERROR([mysql_config executable not found])
  36. else
  37. AC_MSG_CHECKING(mysql libraries)
  38. MYSQL_LIBS=`${mysqlconfig} --libs | sed -e \
  39. 's/-lmysqlclient /-lmysqlclient_r /' -e 's/-lmysqlclient$/-lmysqlclient_r/'`
  40. AC_MSG_RESULT($MYSQL_LIBS)
  41. AC_MSG_CHECKING(mysql includes)
  42. MYSQL_CFLAGS=`${mysqlconfig} --cflags`
  43. AC_MSG_RESULT($MYSQL_CFLAGS)
  44. fi
  45. ])