summaryrefslogtreecommitdiffstats
path: root/khtml/configure.in.in
blob: c58788de2e4102ff62ba99455a364585421138ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
AM_CONDITIONAL(DOJAVA, test "x$kde_use_qt_emb" != "xyes")

AC_DEFUN([KDE_CHECK_LIBTHAI],
[
AC_MSG_CHECKING([if libthai should be compiled in])
 AC_ARG_WITH(libthai,
    AC_HELP_STRING(
      [--with-libthai=yes],
      [add Thai-language support from libthai library [default=no]]
    ),
   [ ac_libthai=$withval],
   [ ac_libthai=no ]
 )

if test "$ac_libthai" != "no"; then
  AC_CACHE_VAL(kde_link_libthai,
  [
  kde_ldflags_safe="$LDFLAGS"
  kde_libs_safe="$LIBS"

  LDFLAGS="$LDFLAGS $USER_LDFLAGS"
  LIBS="-lthai"

  AC_TRY_LINK([
  #include <thai/thailib.h>
  #include <thai/thbrk.h>
  ],
  [
  thchar_t c = 'C';
  int pos[1];
  size_t n = 12;  
  (void)th_brk(&c, pos, n);
  ],
  kde_link_libthai=yes,
  kde_link_libthai=no
  )

  LDFLAGS=$kde_ldflags_safe
  LIBS=$kde_libs_safe
  ])

  LIBTHAI=""
  if test "$kde_link_libthai" = "no"; then
     AC_MSG_ERROR([Can't tqfind libthai.])
  else
     AC_DEFINE(HAVE_LIBTHAI, 1,
     [Defined if you have libthai and want to have it compiled in])
      LIBTHAI="-lthai"
  fi
  AC_SUBST(LIBTHAI)
fi
AC_MSG_RESULT($ac_libthai)
])

KDE_CHECK_LIBTHAI

KDE_CHECK_HEADERS(valgrind/memcheck.h)