+dnl Check for Thai word-segmentation library.
+dnl If we have one, define HAVE_THAI_WORDSEG and one of these:
+dnl HAVE_LIBTHAI, HAVE_WORDCUT, or HAVE_WORDCUT_OLD
+dnl In addition, set THAI_WORDSEG_LD_FLAGS to a proper value.
+
+PKG_CHECK_MODULES(LIBTHAI, libthai, HAVE_LIBTHAI=yes, HAVE_LIBTHAI=no)