1# Process this file with autoconf to produce a configure script.
2AC_INIT(scim-tables, 0.5.10, suzhe@tsinghua.org.cn) #do not forget to edit skim/configure.in.in to change the version
3AC_CONFIG_SRCDIR([src/scim_table_imengine.h])
4
5SCIM_VERSION=1.4.9
6
7AC_SUBST(SCIM_VERSION)
8
9GETTEXT_PACKAGE=scim-tables
10AC_SUBST(GETTEXT_PACKAGE)
11AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext domain])
12
13# Init automake stuff
14AM_INIT_AUTOMAKE
15AM_CONFIG_HEADER([config.h])
16
17# Init gettext
18ALL_LINGUAS="zh_CN zh_TW ja ko de fr it pa nl"
19AM_GNU_GETTEXT
20
21AC_LIBTOOL_WIN32_DLL
22AC_LIBTOOL_DLOPEN
23AC_PROG_LIBTOOL
24AC_LIB_LTDL
25AC_SUBST(LIBTOOL_DEPS)
26
27AC_PROG_CXX
28AC_PROG_CC
29AC_LANG(C++)
30
31AC_C_CONST
32AC_C_INLINE
33AC_TYPE_SIZE_T
34
35# Check SCIM
36PKG_CHECK_MODULES(SCIM,[scim >= $SCIM_VERSION])
37
38# Check if we should build setup module
39PKG_CHECK_MODULES(SCIM_GTKUTILS,[scim-gtkutils >= $SCIM_VERSION],
40		  		[SCIM_HAS_GTKUTILS=yes],
41				[SCIM_HAS_GTKUTILS=no])
42
43if test "$SCIM_HAS_GTKUTILS" = "yes"; then
44  SCIM_BUILD_SETUP=1
45else
46  SCIM_BUILD_SETUP=0
47fi
48
49AM_CONDITIONAL(SCIM_BUILD_SETUP, [test "$SCIM_HAS_GTKUTILS" = "yes"])
50AC_SUBST(SCIM_BUILD_SETUP)
51
52# Checks for header files.
53AC_HEADER_STDC
54AC_CHECK_HEADERS([langinfo.h libintl.h string.h hash_map ext/hash_map])
55
56# libtool option to control which symbols are exported
57# right now, symbols starting with _ are not exported
58LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
59AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
60
61# Extra args.
62AC_ARG_ENABLE(debug,
63	      [  --enable-debug          Turn on debugging], ,
64	      enable_debug=no)
65
66AC_ARG_ENABLE(skim-support,
67              [  --enable-skim-support  Enable skim Setup UI], ,
68              enable_skim_support=yes)
69
70AM_CONDITIONAL(SCIM_BUILD_SKIM_SETUP, [test "$enable_skim_support" = "yes"])
71
72if test "$enable_debug" = "yes"; then
73  AC_DEFINE(ENABLE_DEBUG,1,[Define this to enable the debug facility in libscim])
74  CFLAGS="$CFLAGS -g"
75  CXXFLAGS="$CXXFLAGS -g"
76fi
77
78SCIM_ICONDIR=`$PKG_CONFIG --variable=icondir scim`
79SCIM_MODULEDIR=`$PKG_CONFIG --variable=moduledir scim`
80SCIM_DATADIR=`$PKG_CONFIG --variable=scimdatadir scim`
81
82if test "x$SCIM_ICONDIR" = "x"; then
83  SCIM_ICONDIR=${datadir}/scim/icons
84fi
85
86if test "x$SCIM_MODULEDIR" = "x"; then
87  SCIM_MODULEDIR=${libdir}/scim-1.0
88fi
89
90if test "x$SCIM_DATADIR" = "x"; then
91  SCIM_DATADIR=${datadir}/scim
92fi
93
94AC_SUBST(SCIM_ICONDIR)
95AC_SUBST(SCIM_MODULEDIR)
96AC_SUBST(SCIM_DATADIR)
97
98SCIM_TABLEDIR=$SCIM_DATADIR/tables
99
100AC_SUBST(SCIM_TABLEDIR)
101
102AC_CONFIG_FILES([Makefile  intl/Makefile po/Makefile.in m4/Makefile
103		 docs/Makefile
104		 icons/Makefile
105		 src/Makefile
106		 scim-tables.spec
107		 tables/Makefile
108		 tables/additional/IPA-Kirshenbaum.txt
109		 tables/additional/IPA-X-SAMPA.txt
110		 tables/additional/LaTeX.txt
111		 tables/additional/Makefile
112		 tables/am/Amharic.txt
113		 tables/am/Makefile
114		 tables/ar/Arabic.txt
115		 tables/ar/Makefile
116		 tables/bn/Bengali-inscript.txt
117		 tables/bn/Bengali-probhat.txt
118		 tables/bn/Makefile
119		 tables/gr/Makefile
120		 tables/gr/greekpoly.txt
121		 tables/gu/Gujarati-inscript.txt
122		 tables/gu/Gujarati-phonetic.txt
123		 tables/gu/Makefile
124		 tables/he/Makefile
125		 tables/he/classicalhebrew.txt
126		 tables/hi/Hindi-inscript.txt
127		 tables/hi/Hindi-phonetic.txt
128		 tables/hi/Hindi-remington.txt
129		 tables/hi/Makefile
130		 tables/ja/HIRAGANA.txt
131		 tables/ja/KATAKANA.txt
132		 tables/ja/Makefile
133		 tables/ja/Nippon.txt
134		 tables/kn/Kannada-inscript.txt
135		 tables/kn/Kannada-kgp.txt
136		 tables/kn/Makefile
137		 tables/ko/Hangul.txt
138		 tables/ko/HangulRomaja.txt
139		 tables/ko/Hanja.txt
140		 tables/ko/Makefile
141		 tables/ml/Makefile
142		 tables/ml/Malayalam-inscript.txt
143		 tables/ml/Malayalam-phonetic.txt
144		 tables/mr/Makefile
145		 tables/mr/Marathi-remington.txt
146		 tables/ne/Makefile
147		 tables/ne/Nepali_Rom.txt
148		 tables/ne/Nepali_Trad.txt
149		 tables/pa/Makefile
150		 tables/pa/Punjabi-inscript.txt
151		 tables/pa/Punjabi-jhelum.txt
152		 tables/pa/Punjabi-phonetic.txt
153		 tables/pa/Punjabi-remington.txt
154		 tables/ru/Makefile
155		 tables/ru/RussianTraditional.txt
156		 tables/ru/Translit.txt
157		 tables/ru/Yawerty.txt
158		 tables/ta/Makefile
159		 tables/ta/Tamil-inscript.txt
160		 tables/ta/Tamil-phonetic.txt
161		 tables/ta/Tamil-remington.txt
162		 tables/ta/Tamil-tamil99.txt
163		 tables/te/Makefile
164		 tables/te/Telugu-inscript.txt
165		 tables/th/Makefile
166		 tables/th/Thai.txt
167		 tables/ug/Makefile
168		 tables/ug/Uyghur-Romanized.txt
169		 tables/ug/Uyghur-Standard.txt
170		 tables/uk/Makefile
171		 tables/uk/Ukrainian-Translit.txt
172		 tables/vi/Makefile
173		 tables/vi/Viqr.txt
174		 tables/zh/Array30.txt
175		 tables/zh/CNS11643.txt
176		 tables/zh/CangJie.txt
177		 tables/zh/CangJie3.txt
178		 tables/zh/CangJie5.txt
179		 tables/zh/CantonHK.txt
180		 tables/zh/Cantonese.txt
181		 tables/zh/Dayi3.txt
182		 tables/zh/EZ-Big.txt
183		 tables/zh/Erbi-QS.txt
184		 tables/zh/Erbi.txt
185		 tables/zh/Jyutping.txt
186		 tables/zh/Makefile
187		 tables/zh/Quick.txt
188		 tables/zh/Simplex.txt
189		 tables/zh/SmartCangJie6.txt
190		 tables/zh/Stroke5.txt
191		 tables/zh/Wu.txt
192		 tables/zh/Wubi.txt
193		 tables/zh/ZhuYin-Big.txt
194		 tables/zh/ZhuYin.txt
195		 tables/zh/Ziranma.txt
196])
197
198if test "$enable_skim_support" = "yes"; then
199  REQUIRED_SKIM_VERSION=1.2.1
200  dnl skim probably has been installed under prefix=$KDEDIR, so add it to search path of pkgconfig
201  kde_libsuffix=`kde-config --libsuffix`
202  test -z "$KDEDIR" && KDEDIR=`kde-config --prefix`
203  AC_SUBST(KDEDIR)
204  export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$KDEDIR/lib${kde_libsuffix}/pkgconfig
205  PKG_CHECK_MODULES(SKIM, [skim >= $REQUIRED_SKIM_VERSION],
206                          [HAS_SKIM=yes],
207                          [HAS_SKIM=no])
208else
209  HAS_SKIM=no
210fi
211
212if test "x$HAS_SKIM" = "xyes"; then
213  PKG_CHECK_MODULES(SCIM_KDEUTILS,[scim_kdeutils >= $REQUIRED_SKIM_VERSION],
214                                [HAS_KDEUTILS=yes],
215                                [HAS_KDEUTILS=no])
216  if test "x$HAS_KDEUTILS" = "xyes"; then
217      AC_CONFIG_SUBDIRS(skim)
218      SCIM_TABLES_ENABLE_SKIM_SUPPORT=1
219      enable_skim_support=yes
220  else
221      SCIM_TABLES_ENABLE_SKIM_SUPPORT=0
222      enable_skim_support=no
223  fi
224else
225  SCIM_TABLES_ENABLE_SKIM_SUPPORT=0
226  enable_skim_support=no
227fi
228
229AM_CONDITIONAL(SCIM_TABLES_ENABLE_SKIM_SUPPORT, [test "$SCIM_TABLES_ENABLE_SKIM_SUPPORT" = "1"])
230AC_SUBST(SCIM_TABLES_ENABLE_SKIM_SUPPORT)
231AC_OUTPUT
232
233AC_MSG_RESULT([
234Build options:
235  Version                  $VERSION
236  Install prefix           $prefix
237  Build shared libs        $enable_shared
238  Build static libs        $enable_static
239  Enable debug             $enable_debug
240
241Module options:
242  Enable skim support      $enable_skim_support
243])
244