monotone

monotone Mtn Source Tree

Root/m4/iconv_translit.m4

1dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2dnl unless already present in VAR.
3dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
4dnl contains two or three consecutive elements that belong together.
5AC_DEFUN([AC_LIB_APPENDTOVAR],
6[
7 for element in [$2]; do
8 haveit=
9 for x in $[$1]; do
10 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
11 if test "X$x" = "X$element"; then
12 haveit=yes
13 break
14 fi
15 done
16 if test -z "$haveit"; then
17 [$1]="${[$1]}${[$1]:+ }$element"
18 fi
19 done
20])
21
22dnl variables prefix and exec_prefix bound to the values they will have
23dnl at the end of the configure script.
24AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
25[
26 acl_save_prefix="$prefix"
27 prefix="$acl_final_prefix"
28 acl_save_exec_prefix="$exec_prefix"
29 exec_prefix="$acl_final_exec_prefix"
30 $1
31 exec_prefix="$acl_save_exec_prefix"
32 prefix="$acl_save_prefix"
33])
34
35AC_DEFUN([AC_FUNC_ICONV_TRANSLIT],
36[AC_CACHE_CHECK([if iconv supports //TRANSLIT],
37 ac_cv_iconv_translit, [
38 am_save_CPPFLAGS="$CPPFLAGS"
39 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
40 am_save_LIBS="$LIBS"
41 LIBS="$LIBS $LIBICONV"
42 AC_TRY_RUN([
43#include <iconv.h>
44
45int main()
46{
47 iconv_t i = iconv_open("ASCII//TRANSLIT", "UTF-8");
48 return i == (iconv_t)(-1);
49}
50],
51 ac_cv_iconv_translit=yes,
52 ac_cv_iconv_translit=no,
53 ac_cv_iconv_translit=no)
54 LIBS="$am_save_LIBS"
55 CPPFLAGS="$am_save_CPPFLAGS"
56 ])
57if test "$ac_cv_iconv_translit" = "yes"; then
58 AC_DEFINE(ICONV_TRANSLIT, 1, [Define if iconv supports //TRANSLIT.])
59fi])

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status