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.

68 lines
2.4KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_mysql_db.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_MYSQL_DB
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check if the specified MySQL database exists, if yes set your
  12. # environment variable to that database name else unset your environment
  13. # variable
  14. #
  15. # Example:
  16. #
  17. # AX_CHECK_MYSQL_DB(DBNAME, [fishmarket])
  18. # if test x$DBNAME = xfishmarket; then
  19. # bla..bla..bla..
  20. # else
  21. # bla..bla..bla..
  22. # fi
  23. #
  24. # LICENSE
  25. #
  26. # Copyright (c) 2008 Gleen Salmon <gleensalmon@yahoo.com>
  27. #
  28. # This program is free software; you can redistribute it and/or modify it
  29. # under the terms of the GNU General Public License as published by the
  30. # Free Software Foundation; either version 2 of the License, or (at your
  31. # option) any later version.
  32. #
  33. # This program is distributed in the hope that it will be useful, but
  34. # WITHOUT ANY WARRANTY; without even the implied warranty of
  35. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  36. # Public License for more details.
  37. #
  38. # You should have received a copy of the GNU General Public License along
  39. # with this program. If not, see <https://www.gnu.org/licenses/>.
  40. #
  41. # As a special exception, the respective Autoconf Macro's copyright owner
  42. # gives unlimited permission to copy, distribute and modify the configure
  43. # scripts that are the output of Autoconf when processing the Macro. You
  44. # need not follow the terms of the GNU General Public License when using
  45. # or distributing such scripts, even though portions of the text of the
  46. # Macro appear in them. The GNU General Public License (GPL) does govern
  47. # all other use of the material that constitutes the Autoconf Macro.
  48. #
  49. # This special exception to the GPL applies to versions of the Autoconf
  50. # Macro released by the Autoconf Archive. When you make and distribute a
  51. # modified version of the Autoconf Macro, you may extend this special
  52. # exception to the GPL to apply to your modified version as well.
  53. #serial 7
  54. AU_ALIAS([AC_CHECK_MYSQL_DB], [AX_CHECK_MYSQL_DB])
  55. AC_DEFUN([AX_CHECK_MYSQL_DB],[
  56. AC_REQUIRE([AX_PROG_MYSQLSHOW])dnl
  57. AC_MSG_CHECKING([for MySQL db $2])
  58. if $MYSQLSHOW -u root -prootpass $2 > /dev/null 2>&1; then
  59. $1=$2
  60. AC_MSG_RESULT([yes])
  61. else
  62. unset $1
  63. AC_MSG_RESULT([no])
  64. fi;dnl
  65. ])