icu.m4 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # BEGIN COPYRIGHT BLOCK
  2. # Copyright (C) 2006 Red Hat, Inc.
  3. # All rights reserved.
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU General Public License
  7. # as published by the Free Software Foundation; either version 2
  8. # of the License, or (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. #
  19. # END COPYRIGHT BLOCK
  20. AC_CHECKING(for LIBICU)
  21. # check for --with-icu
  22. AC_MSG_CHECKING(for --with-icu)
  23. AC_ARG_WITH(icu, [ --with-icu=PATH ICU directory],
  24. [
  25. if test -d "$withval"/lib
  26. then
  27. AC_MSG_RESULT([using $withval])
  28. ICUDIR=$withval
  29. icu_lib="-L$ICUDIR/lib"
  30. else
  31. echo
  32. AC_MSG_ERROR([$withval not found])
  33. fi
  34. icu_inc="-I$withval/include"
  35. icu_bin="$withval/bin"
  36. ],
  37. AC_MSG_RESULT(no))
  38. # check for --with-icu-inc
  39. AC_MSG_CHECKING(for --with-icu-inc)
  40. AC_ARG_WITH(icu-inc, [ --with-icu-inc=PATH ICU include directory],
  41. [
  42. if test -d "$withval"
  43. then
  44. AC_MSG_RESULT([using $withval])
  45. icu_inc="-I$withval"
  46. else
  47. echo
  48. AC_MSG_ERROR([$withval not found])
  49. fi
  50. ],
  51. AC_MSG_RESULT(no))
  52. # check for --with-icu-lib
  53. AC_MSG_CHECKING(for --with-icu-lib)
  54. AC_ARG_WITH(icu-lib, [ --with-icu-lib=PATH ICU library directory],
  55. [
  56. if test -d "$withval"
  57. then
  58. AC_MSG_RESULT([using $withval])
  59. icu_lib="-L$withval"
  60. else
  61. echo
  62. AC_MSG_ERROR([$withval not found])
  63. fi
  64. ],
  65. AC_MSG_RESULT(no))
  66. # check for --with-icu-bin
  67. AC_MSG_CHECKING(for --with-icu-bin)
  68. AC_ARG_WITH(icu-bin, [ --with-icu-bin=PATH ICU binary directory],
  69. [
  70. if test -d "$withval"
  71. then
  72. AC_MSG_RESULT([using $withval])
  73. icu_bin="$withval"
  74. else
  75. echo
  76. AC_MSG_ERROR([$withval not found])
  77. fi
  78. ],
  79. AC_MSG_RESULT(no))
  80. # if ICU is not found yet, try pkg-config
  81. # last resort
  82. if test -z "$icu_lib"; then
  83. AC_MSG_CHECKING(for icu with icu-config)
  84. AC_PATH_PROG(ICU_CONFIG, icu-config)
  85. if test -n "$ICU_CONFIG"; then
  86. icu_lib=`$ICU_CONFIG --ldflags-searchpath`
  87. icu_inc=`$ICU_CONFIG --cppflags-searchpath`
  88. icu_bin=`$ICU_CONFIG --bindir`
  89. AC_MSG_RESULT([using system ICU])
  90. else
  91. AC_MSG_ERROR([ICU not found, specify with --with-icu.])
  92. fi
  93. fi