icu.m4 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # BEGIN COPYRIGHT BLOCK
  2. # Copyright (C) 2006 Red Hat, Inc.
  3. # All rights reserved.
  4. #
  5. # License: GPL (version 3 or any later version).
  6. # See LICENSE for details.
  7. # END COPYRIGHT BLOCK
  8. AC_CHECKING(for LIBICU)
  9. # check for --with-icu
  10. AC_MSG_CHECKING(for --with-icu)
  11. AC_ARG_WITH(icu, AS_HELP_STRING([--with-icu@<:@=PATH@:>@],[ICU directory]),
  12. [
  13. if test "$withval" = "yes"
  14. then
  15. AC_MSG_RESULT(yes)
  16. elif test "$withval" = "no"
  17. then
  18. AC_MSG_RESULT(no)
  19. AC_MSG_ERROR([ICU is required.])
  20. elif test -d "$withval"/lib
  21. then
  22. AC_MSG_RESULT([using $withval])
  23. ICUDIR=$withval
  24. icu_lib="-L$ICUDIR/lib"
  25. icu_inc="-I$withval/include"
  26. icu_bin="$withval/bin"
  27. else
  28. echo
  29. AC_MSG_ERROR([$withval not found])
  30. fi
  31. ],
  32. AC_MSG_RESULT(yes))
  33. # check for --with-icu-inc
  34. AC_MSG_CHECKING(for --with-icu-inc)
  35. AC_ARG_WITH(icu-inc, AS_HELP_STRING([--with-icu-inc=PATH],[ICU include directory]),
  36. [
  37. if test -d "$withval"
  38. then
  39. AC_MSG_RESULT([using $withval])
  40. icu_inc="-I$withval"
  41. else
  42. echo
  43. AC_MSG_ERROR([$withval not found])
  44. fi
  45. ],
  46. AC_MSG_RESULT(no))
  47. # check for --with-icu-lib
  48. AC_MSG_CHECKING(for --with-icu-lib)
  49. AC_ARG_WITH(icu-lib, AS_HELP_STRING([--with-icu-lib=PATH],[ICU library directory]),
  50. [
  51. if test -d "$withval"
  52. then
  53. AC_MSG_RESULT([using $withval])
  54. icu_lib="-L$withval"
  55. else
  56. echo
  57. AC_MSG_ERROR([$withval not found])
  58. fi
  59. ],
  60. AC_MSG_RESULT(no))
  61. # check for --with-icu-bin
  62. AC_MSG_CHECKING(for --with-icu-bin)
  63. AC_ARG_WITH(icu-bin, AS_HELP_STRING([--with-icu-bin=PATH],[ICU binary directory]),
  64. [
  65. if test -d "$withval"
  66. then
  67. AC_MSG_RESULT([using $withval])
  68. icu_bin="$withval"
  69. else
  70. echo
  71. AC_MSG_ERROR([$withval not found])
  72. fi
  73. ],
  74. AC_MSG_RESULT(no))
  75. # if ICU is not found yet, try pkg-config
  76. # last resort
  77. if test -z "$icu_lib"; then
  78. AC_PATH_PROG(ICU_CONFIG, icu-config)
  79. AC_MSG_CHECKING(for icu with icu-config)
  80. if test -n "$ICU_CONFIG"; then
  81. icu_lib=`$ICU_CONFIG --ldflags-searchpath`
  82. icu_inc=`$ICU_CONFIG --cppflags-searchpath`
  83. icu_bin=`$ICU_CONFIG --bindir`
  84. AC_MSG_RESULT([using system ICU])
  85. else
  86. AC_MSG_ERROR([ICU not found, specify with --with-icu.])
  87. fi
  88. fi