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.

81 lines
2.4KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_icu.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_ICU(version, action-if, action-if-not)
  8. #
  9. # DESCRIPTION
  10. #
  11. # Defines ICU_LIBS, ICU_CFLAGS, ICU_CXXFLAGS. See icu-config(1) man page.
  12. #
  13. # LICENSE
  14. #
  15. # Copyright (c) 2008 Akos Maroy <darkeye@tyrell.hu>
  16. #
  17. # Copying and distribution of this file, with or without modification, are
  18. # permitted in any medium without royalty provided the copyright notice
  19. # and this notice are preserved. This file is offered as-is, without any
  20. # warranty.
  21. #serial 7
  22. AU_ALIAS([AC_CHECK_ICU], [AX_CHECK_ICU])
  23. AC_DEFUN([AX_CHECK_ICU], [
  24. succeeded=no
  25. if test -z "$ICU_CONFIG"; then
  26. AC_PATH_PROG(ICU_CONFIG, icu-config, no)
  27. fi
  28. if test "$ICU_CONFIG" = "no" ; then
  29. echo "*** The icu-config script could not be found. Make sure it is"
  30. echo "*** in your path, and that taglib is properly installed."
  31. echo "*** Or see http://ibm.com/software/globalization/icu/"
  32. else
  33. ICU_VERSION=`$ICU_CONFIG --version`
  34. AC_MSG_CHECKING(for ICU >= $1)
  35. VERSION_CHECK=`expr $ICU_VERSION \>\= $1`
  36. if test "$VERSION_CHECK" = "1" ; then
  37. AC_MSG_RESULT(yes)
  38. succeeded=yes
  39. AC_MSG_CHECKING(ICU_CPPFLAGS)
  40. ICU_CPPFLAGS=`$ICU_CONFIG --cppflags`
  41. AC_MSG_RESULT($ICU_CPPFLAGS)
  42. AC_MSG_CHECKING(ICU_CFLAGS)
  43. ICU_CFLAGS=`$ICU_CONFIG --cflags`
  44. AC_MSG_RESULT($ICU_CFLAGS)
  45. AC_MSG_CHECKING(ICU_CXXFLAGS)
  46. ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags`
  47. AC_MSG_RESULT($ICU_CXXFLAGS)
  48. AC_MSG_CHECKING(ICU_LIBS)
  49. ICU_LIBS=`$ICU_CONFIG --ldflags`
  50. AC_MSG_RESULT($ICU_LIBS)
  51. else
  52. ICU_CPPFLAGS=""
  53. ICU_CFLAGS=""
  54. ICU_CXXFLAGS=""
  55. ICU_LIBS=""
  56. ## If we have a custom action on failure, don't print errors, but
  57. ## do set a variable so people can do so.
  58. ifelse([$3], ,echo "can't find ICU >= $1",)
  59. fi
  60. AC_SUBST(ICU_CPPFLAGS)
  61. AC_SUBST(ICU_CFLAGS)
  62. AC_SUBST(ICU_CXXFLAGS)
  63. AC_SUBST(ICU_LIBS)
  64. fi
  65. if test $succeeded = yes; then
  66. ifelse([$2], , :, [$2])
  67. else
  68. ifelse([$3], , AC_MSG_ERROR([Library requirements (ICU) not met.]), [$3])
  69. fi
  70. ])