Merge branch 'tizen_3.0' into tizen
[platform/core/uifw/isf.git] / configure.ac
1 # Process this file with autoconf to produce a configure script
2 #AC_INIT(scim, 1.4.7, suzhe@tsinghua.org.cn)
3 AC_INIT(isf, 3.0.186, isf@samsung.com)
4 AC_CONFIG_SRCDIR([ism/src/scim.h])
5
6 ###########################################################
7 ##          Some definitions of Version macros.          ##
8 ###########################################################
9
10 # ISF version
11 ISF_MAJOR_VERSION=3
12 ISF_MINOR_VERSION=0
13 ISF_MICRO_VERSION=186
14
15 ISF_VERSION=$ISF_MAJOR_VERSION.$ISF_MINOR_VERSION.$ISF_MICRO_VERSION
16
17 AC_SUBST(ISF_MAJOR_VERSION)
18 AC_SUBST(ISF_MINOR_VERSION)
19 AC_SUBST(ISF_MICRO_VERSION)
20 AC_SUBST(ISF_VERSION)
21
22 # SCIM version
23 SCIM_MAJOR_VERSION=1
24 SCIM_MINOR_VERSION=4
25 SCIM_MICRO_VERSION=7
26
27 SCIM_VERSION=$SCIM_MAJOR_VERSION.$SCIM_MINOR_VERSION.$SCIM_MICRO_VERSION
28
29 AC_SUBST(SCIM_MAJOR_VERSION)
30 AC_SUBST(SCIM_MINOR_VERSION)
31 AC_SUBST(SCIM_MICRO_VERSION)
32 AC_SUBST(SCIM_VERSION)
33
34 # libtool versioning for SCIM
35
36 # increment if the interface has additions, changes, removals.
37 SCIM_CURRENT=10
38
39 # increment any time the source changes; set to 0 if you increment CURRENT
40 SCIM_REVISION=3
41
42 # increment if any interfaces have been added; set to 0
43 # if any interfaces have been removed. removal has
44 # precedence over adding, so set to 0 if both happened.
45 SCIM_AGE=2
46
47 AC_SUBST(SCIM_CURRENT)
48 AC_SUBST(SCIM_REVISION)
49 AC_SUBST(SCIM_AGE)
50
51 # Define a string for the earliest version that this release cannot
52 # coexist with. This is used for directory hierarchies.
53 #
54 SCIM_EPOCH=-1.0
55 AC_SUBST(SCIM_EPOCH)
56
57 # Define a string for the earliest version that this release has
58 # binary compatibility with. This is used for module locations.
59 #
60 SCIM_BINARY_VERSION=1.4.0
61 AC_SUBST(SCIM_BINARY_VERSION)
62
63 AC_DEFINE_UNQUOTED(SCIM_BINARY_VERSION, "$SCIM_BINARY_VERSION", [The binary version of SCIM library.])
64 AC_DEFINE_UNQUOTED(SCIM_VERSION, "$SCIM_VERSION", [The release version of SCIM library.])
65 AC_DEFINE_UNQUOTED(SCIM_MAJOR_VERSION, $SCIM_MAJOR_VERSION, [The Major version of SCIM library.])
66 AC_DEFINE_UNQUOTED(SCIM_MINOR_VERSION, $SCIM_MINOR_VERSION, [The Minor version of SCIM library.])
67 AC_DEFINE_UNQUOTED(SCIM_MICRO_VERSION, $SCIM_MICRO_VERSION, [The Micro version of SCIM library.])
68
69 GETTEXT_PACKAGE=scim
70 AC_SUBST(GETTEXT_PACKAGE)
71 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext domain])
72
73 ###########################################################
74 ##                  Start Configuration.                 ##
75 ###########################################################
76 AC_CANONICAL_HOST
77 AC_USE_SYSTEM_EXTENSIONS
78
79 # Init automake stuff
80 AM_INIT_AUTOMAKE
81 AM_CONFIG_HEADER([config.h])
82
83 # Init platform
84 PLATFORM_INIT
85
86 # Init gettext
87 ALL_LINGUAS="ar as az be_BY bg bn bn_BD ca cs da de el_GR en en_PH en_US es_ES es_MX es_US et eu fa fi fr fr_CA ga gl gu he hi hr hu hy id is it_IT ja_JP ka kk km kn ko_KR ky_KG lo lt lv mg mk ml mn_MN mr ms my_MM my_ZG nb ne nl or pa pl pl_SP pt_BR pt_PT ro ru_RU si sk sl sq sr sv sw ta te tg_TJ th tk_TM tl tr_TR uk ur uz vi xh zh_CN zh_HK zh_TW zh_TW zu"
88 AM_GNU_GETTEXT
89
90 # Init libtool
91 AC_LIBTOOL_DLOPEN
92 AC_PROG_LIBTOOL
93 AC_LIB_LTDL
94 AC_SUBST(LIBTOOL_DEPS)
95
96 # libtool option to control which symbols are exported
97 # right now, symbols starting with _ are not exported
98 # !!! DO NOT USE IT !!!
99 LIBTOOL_EXPORT_OPTIONS=''
100 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
101
102 # Checks for programs.
103 AC_PROG_CXX
104 AC_PROG_CC
105 AC_LANG(C++)
106
107 # Checks if doxygen is avaiable
108
109 DOXYGEN=no
110 if test "x$with_doxygen" != "xno"; then
111   AC_PATH_PROG(DOXYGEN, doxygen, no)
112 fi
113
114 AM_CONDITIONAL(HAVE_DOXYGEN, test x$DOXYGEN != xno)
115 AC_SUBST(DOXYGEN)
116
117 # Checks if graphviz is available
118 AC_CHECK_PROG(HAVE_GRAPHVIZ, dot, YES, NO)
119 AC_PATH_PROG(DOT, dot)
120 DOT=`dirname $DOT`
121 AC_SUBST(DOT)
122
123 AC_PATH_PROG(PERL, perl)
124 AC_SUBST(PERL)
125
126 # Check intltool
127 #IT_PROG_INTLTOOL([0.33], [no-xml])
128
129 # Checks for libraries.
130 AC_HEADER_STDC
131 AC_HEADER_TIME
132 AC_CHECK_HEADERS([langinfo.h libintl.h string.h dirent.h hash_map ext/hash_map])
133 AC_CHECK_HEADERS([stdio.h ctype.h errno.h assert.h])
134
135 # Checks for typedefs, structures, and compiler characteristics.
136 AC_C_CONST
137 AC_C_INLINE
138 AC_TYPE_SIZE_T
139
140 if test x$ac_cv_type_size_t != xyes; then
141   AC_MSG_ERROR([No type size_t, but SCIM needs it!])
142 fi
143
144 AC_CHECK_SIZEOF(char)
145 AC_CHECK_SIZEOF(unsigned short int)
146 AC_CHECK_SIZEOF(unsigned int)
147 AC_CHECK_SIZEOF(unsigned long int)
148 AC_CHECK_SIZEOF(unsigned long long int)
149 AC_CHECK_HEADERS([stdint.h],[has_stdint=yes],[has_stdint=no])
150
151 if test x$ac_cv_sizeof_unsigned_short_int = x2 && test x$ac_cv_sizeof_char = x1 ; then
152   :
153 else
154   AC_MSG_ERROR([
155 *** SCIM requires
156 ***      sizeof (unsigned short int)  == 2
157 ***      sizeof (char)                == 1
158 *** You might want to consider using the GNU C compiler.
159 ])
160 fi
161
162 if test x$ac_cv_sizeof_wchar_t = x0 ; then
163   AC_MSG_ERROR([
164 *** SCIM requires a compiler that supports wchar_t,
165 *** You might want to consider using the GNU C compiler.
166 ])
167 fi
168
169 if test x$has_stdint = xyes; then
170   INCLUDE_STDINT="#include <stdint.h>"
171   UINT16="uint16_t"
172   UINT32="uint32_t"
173   UINT64="uint64_t"
174 else
175   INCLUDE_STDINT="//#include <stdint.h>"
176   UINT16="unsigned short int"
177   if test x$ac_cv_sizeof_unsigned_int = x4; then
178     UINT32="unsigned int"
179   else
180     if test x$ac_cv_sizeof_unsigned_long_int = x4; then
181       UINT32="unsigned long int"
182     else
183       AC_MSG_ERROR([*** No suitable integer type for uint32 found.])
184     fi
185   fi
186   if test x$ac_cv_sizeof_unsigned_long_long_int = x8; then
187     UINT64="unsigned long long int"
188   else
189     AC_MSG_ERROR([*** No suitable integer type for uint64 found.])
190   fi
191 fi
192 AC_SUBST(INCLUDE_STDINT)
193 AC_SUBST(UINT16)
194 AC_SUBST(UINT32)
195 AC_SUBST(UINT64)
196
197 # Checks for library functions.
198 AC_FUNC_MALLOC
199 AC_CHECK_FUNCS([gettimeofday memmove memset nl_langinfo setlocale daemon])
200 AC_CHECK_FUNCS([memcpy strcmp strchr strrchr])
201 AC_CHECK_FUNCS([opendir closedir readdir])
202 AC_CHECK_FUNCS([usleep nanosleep])
203 AC_CHECK_FUNCS([gethostbyname gethostbyname_r socket bind accept connect listen],
204                [socket_ok=yes],
205                [socket_ok=no])
206
207 AM_ICONV
208
209 # Check EINA
210 PKG_CHECK_MODULES(EINA, [eina])
211
212 # Check ECORE
213 PKG_CHECK_MODULES(ECORE, [ecore])
214
215 # Check ECORE_IPC library
216 PKG_CHECK_MODULES(ECORE_IPC, [ecore-ipc])
217
218 # Check ECORE FILE library
219 PKG_CHECK_MODULES(ECORE_FILE, [ecore-file])
220
221 # Check ECORE EVAS library
222 PKG_CHECK_MODULES(ECORE_EVAS, [ecore-evas])
223
224 # Check ECORE IMF
225 PKG_CHECK_MODULES(ECORE_IMF, [ecore-imf],
226                   [ISF_HAS_ECORE_IMF=yes],
227                   [ISF_HAS_ECORE_IMF=no])
228
229 if test "$ISF_HAS_ECORE_IMF" = "yes"; then
230   EFL_LIBDIR=`$PKG_CONFIG --variable=libdir ecore-imf`
231   ECORE_IMF_MODULE_ARCH=`$PKG_CONFIG --variable=module_arch ecore`
232   if test -z "$EFL_LIBDIR)"; then
233     EFL_LIBDIR="$libdir"
234   fi
235   EFL_IM_MODULEDIR=$EFL_LIBDIR/ecore_imf/modules/isf/$ECORE_IMF_MODULE_ARCH
236   WAYLAND_IM_MODULEDIR=$EFL_LIBDIR/ecore_imf/modules/wayland/$ECORE_IMF_MODULE_ARCH
237   AC_SUBST(EFL_LIBDIR)
238   AC_SUBST(EFL_IM_MODULEDIR)
239   AC_SUBST(WAYLAND_IM_MODULEDIR)
240 fi
241
242 # Check EVAS
243 PKG_CHECK_MODULES(EVAS, [evas])
244
245 # Check ECORE X library
246 PKG_CHECK_MODULES(ECOREX, [ecore-x],
247                   [ISF_HAS_ECOREX=yes],
248                   [ISF_HAS_ECOREX=no])
249
250 if test "$ISF_HAS_ECOREX" = "yes"; then
251   AC_DEFINE(HAVE_ECOREX,1,[Have ecore-x functions.])
252 fi
253
254 # Check XKBCOMMON library
255 PKG_CHECK_MODULES(XKBCOMMON, [xkbcommon])
256
257 # Check ECORE WAYLAND library
258 PKG_CHECK_MODULES(ECORE_WL, [ecore-wayland],
259                   [ISF_HAS_ECOREWL=yes],
260                   [ISF_HAS_ECOREWL=no])
261
262 if test "$ISF_HAS_ECOREWL" = "yes"; then
263   AC_DEFINE(HAVE_ECOREWL,1,[Have ecore-wayland functions.])
264 fi
265
266 # Check WAYLAND TEXT INPUT library
267 PKG_CHECK_MODULES(WL_TEXT_INPUT, [text-client])
268
269 # Check WAYLAND INPUT METHOD library
270 PKG_CHECK_MODULES(WL_INPUT_METHOD, [input-method-client])
271
272 # Check EDJE library
273 PKG_CHECK_MODULES(EDJE, [edje])
274
275 # Check ELEMENTARY library
276 PKG_CHECK_MODULES(ELEMENTARY, [elementary],
277                   [ISF_HAS_ELM=yes],
278                   [ISF_HAS_ELM=no])
279
280 # Check EFL extension library
281 PKG_CHECK_MODULES(EFL_EXTENSION, [efl-extension])
282
283 # Check glib library
284 PKG_CHECK_MODULES(GLIB, [glib-2.0])
285
286 # Check tzplatform-config library
287 PKG_CHECK_MODULES(TZPLATFORM_CONFIG, [libtzplatform-config])
288
289 # Check appcore-efl library
290 PKG_CHECK_MODULES(APPCORE_EFL, [appcore-efl])
291
292 # Check dlog library
293 PKG_CHECK_MODULES(DLOG, [dlog >= 0])
294
295 # Check notification library
296 PKG_CHECK_MODULES(NOTIFICATION, [notification],
297                   [ISF_HAS_NOTIFICATION=yes],
298                   [ISF_HAS_NOTIFICATION=no])
299
300 # Check tts library
301 PKG_CHECK_MODULES(TTS, [tts],
302                   [ISF_HAS_TTS=yes],
303                   [ISF_HAS_TTS=no])
304
305 if test "$ISF_HAS_TTS" = "yes"; then
306   AC_DEFINE(HAVE_TTS,1,[Have TTS functions.])
307 fi
308
309 # Check cynara liblaries
310 PKG_CHECK_MODULES(CYNARA, [cynara-client, cynara-creds-socket, cynara-session])
311
312 # Check vconf library
313 PKG_CHECK_MODULES(VCONF, [vconf],
314                   [ISF_HAS_VCONF=yes],
315                   [ISF_HAS_VCONF=no])
316
317 # Check edbus library
318 PKG_CHECK_MODULES(EDBUS, [edbus])
319
320 # Check bluetooth library
321 PKG_CHECK_MODULES(BLUETOOTH, [capi-network-bluetooth],
322                   [ISF_HAS_BLUETOOTH=yes],
323                   [ISF_HAS_BLUETOOTH=no])
324
325 # Check feedback library
326 PKG_CHECK_MODULES(FEEDBACK, [feedback],
327                   [ISF_HAS_FEEDBACK=yes],
328                   [ISF_HAS_FEEDBACK=no])
329
330 # Check package manager
331 PKG_CHECK_MODULES(PACKAGE_MANAGER, [capi-appfw-package-manager])
332
333 # Check AUL
334 PKG_CHECK_MODULES(AUL, [aul])
335
336 # Check App Control
337 PKG_CHECK_MODULES(APP_CONTROL, [capi-appfw-app-control])
338
339 # Check appfw library
340 PKG_CHECK_MODULES(APPFW, [capi-appfw-application])
341
342 # Check libwebsockets
343 PKG_CHECK_MODULES(LIBWEBSOCKETS, [libwebsockets],
344                   [ISF_HAS_LIBWEBSOCKETS=yes],
345                   [ISF_HAS_LIBWEBSOCKETS=no])
346
347 # Check core package manager
348 PKG_CHECK_MODULES(PKGMGR_INFO, [pkgmgr-info],
349                   [ISF_HAS_PKGMGR_INFO=yes],
350                   [ISF_HAS_PKGMGR_INFO=no])
351
352 # Check db-util library
353 PKG_CHECK_MODULES(DB_UTIL, [db-util],
354                   [ISF_HAS_DB_UTIL=yes],
355                   [ISF_HAS_DB_UTIL=no])
356
357 # Ignore checked modules if --disable option is added
358 AC_ARG_ENABLE(include-notification,
359               [  --disable-include-notification         Do not include notification package],
360               enable_notification=no,
361               enable_notification=yes)
362
363 AC_ARG_ENABLE(include-libwebsocket,
364               [  --disable-include-libwebsocket         Do not include libwebsocket package],
365               enable_libwebsocket=no,
366               enable_libwebsocket=yes)
367
368 if test "$ISF_HAS_VCONF" = "yes"; then
369   AC_DEFINE(HAVE_VCONF,1,[Have VConf functions.])
370 fi
371
372 if test "$ISF_HAS_BLUETOOTH" = "yes"; then
373   AC_DEFINE(HAVE_BLUETOOTH,1,[Have Bluetooth functions.])
374 fi
375
376 if test "$ISF_HAS_FEEDBACK" = "yes"; then
377   AC_DEFINE(HAVE_FEEDBACK,1,[Have Feedback functions.])
378 fi
379
380 if test "$ISF_HAS_NOTIFICATION" = "yes" && test "$enable_notification" = "yes"; then
381   AC_DEFINE(HAVE_NOTIFICATION,1,[Have Notification functions.])
382 fi
383
384 if test "$enable_notification" = "no"; then
385   AC_MSG_NOTICE([Notification functions force-disabled.])
386 fi
387
388 if test "$ISF_HAS_PKGMGR_INFO" = "yes"; then
389   AC_DEFINE(HAVE_PKGMGR_INFO,1,[Have Package manager functions.])
390 fi
391
392 # Check GTK2 library
393 PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0 pango >= 1.1.0 gdk-pixbuf-2.0 >= 2.4.0],
394                   [SCIM_HAS_GTK2=yes],
395                   [SCIM_HAS_GTK2=no])
396
397 SCIM_HAS_GTK2_2=no
398 if test "$SCIM_HAS_GTK2" = "yes"; then
399   if $PKG_CONFIG --exists "gtk+-2.0 >= 2.2" ; then
400     SCIM_HAS_GTK2_2=yes
401     GTK_VERSION=2.2.0
402     AC_DEFINE(GDK_MULTIHEAD_SAFE,1,[Force use of GDK's multihead-safe APIs.])
403   fi
404   if $PKG_CONFIG --exists "gtk+-2.0 >= 2.3.5" ; then
405     SCIM_HAS_GTK2_4=yes
406     GTK_VERSION=2.3.5
407     AC_DEFINE(HAVE_GTK_DRAW_INSERTION_CURSOR,1,[Have gtk_draw_insertion_cursor ().])
408   fi
409   GTK_BINARY_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
410   GTK_LIBDIR=`$PKG_CONFIG --variable=libdir gtk+-2.0`
411   if test -z "$GTK_LIBDIR)"; then
412     GTK_LIBDIR="$libdir"
413   fi
414   GTK_IM_MODULEDIR=$GTK_LIBDIR/gtk-2.0/$GTK_BINARY_VERSION/immodules
415   AC_SUBST(GTK_LIBDIR)
416   AC_SUBST(GTK_IM_MODULEDIR)
417   AC_SUBST(GTK_VERSION)
418   AC_SUBST(GTK_BINARY_VERSION)
419 fi
420
421 # Check if we have gthread
422 PKG_CHECK_MODULES(GTHREAD2,[gthread-2.0 >= 2.0.0],
423                   [SCIM_HAS_GTHREAD2=yes],
424                   [SCIM_HAS_GTHREAD2=no])
425
426 # Checks for X11 header files.
427 AC_PATH_XTRA
428
429 # Add -lX11 to X_LIBS
430 if test "$have_x" = "yes"; then
431   X_LIBS="$X_LIBS -lX11"
432 fi
433
434 case $host_cpu in
435   *arm* ) TARGET=ARM;;
436       * ) TARGET=X86;;
437 esac
438 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
439
440 ###########################################################
441 ##             Definiation of compile args.              ##
442 ###########################################################
443 AC_ARG_WITH(gtk-im-module-dir,
444             AS_HELP_STRING([--with-gtk-im-module-dir=dir],
445                            [Select gtk immodule dir]),
446             GTK_IM_MODULEDIR=$with_gtk_im_module_dir)
447
448 AC_ARG_WITH(efl-im-module-dir,
449             AS_HELP_STRING([--with-efl-im-module-dir=dir],
450                            [Select efl immodule dir]),
451             EFL_IM_MODULEDIR=$with_efl_im_module_dir)
452
453 AC_ARG_WITH(wayland-im-module-dir,
454             AS_HELP_STRING([--with-wayland-im-module-dir=dir],
455                            [Select wayland immodule dir]),
456             WAYLAND_IM_MODULEDIR=$with_wayland_im_module_dir)
457
458 AC_ARG_WITH(ro-app-dir,
459             AS_HELP_STRING([--with-ro-app-dir=dir],
460                            [Select Read only application dir]),
461             RO_APP_DIR=$with_ro_app_dir)
462
463 AC_ARG_WITH(ro-packages-dir,
464             AS_HELP_STRING([--with-ro-app-dir=dir],
465                            [Select Read only packages dir]),
466             RO_PACKAGES_DIR=$with_ro_packages_dir)
467
468 AC_ARG_ENABLE(ld-version-script,
469               [  --enable-ld-version-script Use ld version script to limit exported symbols],
470               enable_ld_version_script=yes,
471               enable_ld_version_script=no)
472
473 AC_ARG_ENABLE(debug,
474               [  --enable-debug            Turn on debugging],
475               enable_debug=yes,
476               enable_debug=no)
477
478 AC_ARG_ENABLE(x86,
479               [  --enable-x86              Build for x86 host],
480               enable_x86=yes,
481               enable_x86=no)
482
483 AC_ARG_ENABLE(hash-map,
484               [  --enable-hash-map         Use hast_map instead of std::map internally],
485               enable_hash_map=yes,
486               enable_hash_map=no)
487
488 AC_ARG_ENABLE(config-simple,
489               [  --disable-config-simple   Do not build Simple Config module],
490               enable_config_simple=no,
491               enable_config_simple=yes)
492
493 AC_ARG_ENABLE(config-socket,
494               [  --disable-config-socket   Do not build Socket Config module],
495               enable_config_socket=no,
496               enable_config_socket=yes)
497
498 AC_ARG_ENABLE(frontend-x11,
499               [  --disable-frontend-x11    Do not build X11 FrontEnd module],
500               enable_frontend_x11=no,
501               enable_frontend_x11=yes)
502
503 AC_ARG_ENABLE(frontend-socket,
504               [  --disable-frontend-socket Do not build Socket FrontEnd module],
505               enable_frontend_socket=no,
506               enable_frontend_socket=yes)
507
508 AC_ARG_ENABLE(im-socket,
509               [  --disable-im-socket       Do not build Socket IMEngine module],
510               enable_im_socket=no,
511               enable_im_socket=yes)
512
513 AC_ARG_ENABLE(filter-sctc,
514               [  --disable-filter-sctc     Do not build Simplified/Traditional Chinese conversion Filter module],
515               enable_filter_sctc=no,
516               enable_filter_sctc=yes)
517
518 AC_ARG_ENABLE(gtk2-immodule,
519               [  --disable-gtk2-immodule   Do not build GTK2 IMModule],
520               enable_gtk2_immodule=no,
521               enable_gtk2_immodule=yes)
522
523 AC_ARG_ENABLE(efl-immodule,
524               [  --disable-efl-immodule    Do not build EFL IMModule],
525               enable_efl_immodule=no,
526               enable_efl_immodule=yes)
527
528 AC_ARG_ENABLE(wayland-immodule,
529               [  --disable-wayland-immodule    Do not build Wayland IMModule],
530               enable_wayland_immodule=no,
531               enable_wayland_immodule=yes)
532
533 AC_ARG_ENABLE(panel-efl,
534               [  --disable-panel-efl       Do not build EFL Panel],
535               enable_panel_efl=no,
536               enable_panel_efl=check)
537
538 AC_ARG_ENABLE(tray-icon,
539               [  --disable-tray-icon       Do not build Tray Icon],
540               enable_tray_icon=no,
541               enable_tray_icon=yes)
542
543 AC_ARG_ENABLE(multiwindow-support,
544               [  --disable-multiwindow-support       Do not build Multiwindow Support],
545               enable_multiwindow_support=no,
546               enable_multiwindow_support=yes)
547
548 AC_ARG_ENABLE(lazy-launch,
549               [  --enable-lazy-launch      Launch ISF when focusing in entry],
550               enable_lazy_launch=yes,
551               enable_lazy_launch=no)
552
553 AC_ARG_ENABLE(ime-embed-app,
554               [  --disable-ime-embed-app      Do not load IME in application when socket invalidate],
555               enable_ime_embed_app=no,
556               enable_ime_embed_app=yes)
557
558 if test "$have_x" = "yes"; then
559   SCIM_BUILD_X11_UTILS=1
560   enable_x11_utils=yes
561 else
562   SCIM_BUILD_X11_UTILS=0
563   enable_x11_utils=no
564 fi
565
566 if test "$enable_hash_map" = "yes"; then
567   AC_DEFINE(ENABLE_HASH_MAP,1,[Use hash map instead of map in libscim])
568 fi
569
570 if test "$enable_debug" = "yes"; then
571   AC_DEFINE(ENABLE_DEBUG,1,[Define this to enable the debug facility in libscim])
572   CFLAGS="$CFLAGS -g"
573   CXXFLAGS="$CXXFLAGS -g"
574 fi
575
576 if test "$enable_x86" = "yes"; then
577   AC_DEFINE(ENABLE_X86_HOST,1,[Build for x86 host])
578 fi
579
580 if test "$enable_tests" = "yes"; then
581   SCIM_BUILD_TESTS=1
582 else
583   SCIM_BUILD_TESTS=0
584   enable_tests=no
585 fi
586
587 if test "$enable_config_simple" = "yes"; then
588   SCIM_BUILD_CONFIG_SIMPLE=1
589 else
590   SCIM_BUILD_CONFIG_SIMPLE=0
591   enable_config_simple=no
592 fi
593
594 if test "$enable_config_socket" = "yes" -a "$socket_ok" = "yes"; then
595   SCIM_BUILD_CONFIG_SOCKET=1
596 else
597   SCIM_BUILD_CONFIG_SOCKET=0
598   enable_config_socket=no
599 fi
600
601 if test "$enable_frontend_x11" = "yes" -a "$have_x" = "yes"; then
602   SCIM_BUILD_FRONTEND_X11=1
603 else
604   SCIM_BUILD_FRONTEND_X11=0
605   enable_frontend_x11=no
606 fi
607
608 if test "$enable_frontend_socket" = "yes" -a "$socket_ok" = "yes"; then
609   SCIM_BUILD_FRONTEND_SOCKET=1
610 else
611   SCIM_BUILD_FRONTEND_SOCKET=0
612   enable_frontend_socket=no
613 fi
614
615 if test "$enable_im_rawcode" = "yes"; then
616   SCIM_BUILD_IMENGINE_RAWCODE=1
617 else
618   SCIM_BUILD_IMENGINE_RAWCODE=0
619   enable_im_rawcode=no
620 fi
621
622 if test "$enable_im_socket" = "yes" -a "$socket_ok" = "yes"; then
623   SCIM_BUILD_IMENGINE_SOCKET=1
624 else
625   SCIM_BUILD_IMENGINE_SOCKET=0
626   enable_im_socket=no
627 fi
628
629 if test "$enable_filter_sctc" = "yes"; then
630   SCIM_BUILD_FILTER_SCTC=1
631 else
632   SCIM_BUILD_FILTER_SCTC=0
633   enable_filter_sctc=no
634 fi
635
636 if test "$enable_gtk2_immodule" = "yes" -a "$SCIM_HAS_GTK2" = "yes"; then
637   SCIM_BUILD_GTK2_IMMODULE=1
638 else
639   SCIM_BUILD_GTK2_IMMODULE=0
640   enable_gtk2_immodule=no
641 fi
642
643 if test "$SCIM_HAS_GTK2" = "yes"; then
644   enable_gtk_utils=yes
645   SCIM_BUILD_GTK_UTILS=1
646 else
647   enable_gtk_utils=no
648   SCIM_BUILD_GTK_UTILS=0
649 fi
650
651 if test "$enable_tray_icon" = "yes"; then
652   if test "$SCIM_HAS_GTK2_2" = "yes" -a "$no_x" != "yes"; then
653     enable_tray_icon=yes
654     AC_DEFINE(ENABLE_TRAY_ICON,1,[Enable the TrayIcon code.])
655   fi
656 else
657   enable_tray_icon=no
658 fi
659
660 if test "$enable_multiwindow_support" = "yes"; then
661   enable_multiwindow_support=yes
662   AC_DEFINE(ENABLE_MULTIWINDOW_SUPPORT,1,[Enable the Multi Window code.])
663 else
664   enable_multiwindow_support=no
665 fi
666
667 if test "$enable_efl_immodule" = "yes" -a "$ISF_HAS_ECORE_IMF" = "yes"; then
668   ISF_BUILD_EFL_IMMODULE=1
669 else
670   ISF_BUILD_EFL_IMMODULE=0
671   enable_efl_immodule=no
672 fi
673
674 if test "$enable_wayland_immodule" = "yes" -a "$ISF_HAS_ECORE_IMF" = "yes"; then
675   ISF_BUILD_WAYLAND_IMMODULE=1
676 else
677   ISF_BUILD_WAYLAND_IMMODULE=0
678   enable_wayland_immodule=no
679 fi
680
681 ISF_BUILD_PANEL_EFL=0
682 if test "$enable_panel_efl" != "no"; then
683   enable_panel_efl=no
684   if test "$ISF_HAS_ELM" = "yes"; then
685     ISF_BUILD_PANEL_EFL=1
686     enable_panel_efl=yes
687   fi
688 fi
689
690 ISF_BUILD_REMOTE_INPUT=0
691 if test "$enable_remote_input" != "no"; then
692   enable_remote_input=no
693   if test "$ISF_HAS_LIBWEBSOCKETS" = "yes" && test "$enable_libwebsocket" = "yes"; then
694     ISF_BUILD_REMOTE_INPUT=1
695     enable_remote_input=yes
696   fi
697   if test "$enable_libwebsocket" = "no"; then
698     AC_MSG_NOTICE([LIBWEBSOCKET forced disable.])
699   fi
700 fi
701
702 #if nothing needs libscim-gtkutils, just disable it
703 if test "$enable_panel_gtk" != "yes"; then
704   enable_gtk_utils=no
705   SCIM_BUILD_GTK_UTILS=0
706 fi
707
708 AM_CONDITIONAL(HAVE_X,
709                 [test "$have_x" = "yes"])
710
711 if test "$enable_lazy_launch" = "yes"; then
712   AC_DEFINE(ENABLE_LAZY_LAUNCH,1,[Launch ISF when focusing in entry])
713   ISF_INSTALL_SYSTEMD_SCRIPT=0
714 else
715   ISF_INSTALL_SYSTEMD_SCRIPT=1
716 fi
717
718 if test "$enable_ime_embed_app" = "yes"; then
719   AC_DEFINE(ENABLE_IME_EMBED_APP,1,[Load imengine in application side when socket invalidate])
720 fi
721
722 AM_CONDITIONAL(SCIM_LD_VERSION_SCRIPT,
723                 [test "$enable_ld_version_script" = "yes"])
724
725 AM_CONDITIONAL(SCIM_BUILD_TESTS,
726                 [test "$enable_tests" = "yes"])
727
728 AM_CONDITIONAL(SCIM_BUILD_CONFIG_SIMPLE,
729                 [test "$enable_config_simple" = "yes"])
730
731 AM_CONDITIONAL(SCIM_BUILD_CONFIG_SOCKET,
732                 [test "$enable_config_socket" = "yes"])
733
734 AM_CONDITIONAL(SCIM_BUILD_FRONTEND_X11,
735                 [test "$enable_frontend_x11" = "yes"])
736
737 AM_CONDITIONAL(SCIM_BUILD_FRONTEND_SOCKET,
738                 [test "$enable_frontend_socket" = "yes"])
739
740 AM_CONDITIONAL(SCIM_BUILD_IMENGINE_SOCKET,
741                 [test "$enable_im_socket" = "yes"])
742
743 AM_CONDITIONAL(SCIM_BUILD_IMENGINE_RAWCODE,
744                 [test "$enable_im_rawcode" = "yes"])
745
746 AM_CONDITIONAL(SCIM_BUILD_GTK2_IMMODULE,
747                 [test "$enable_gtk2_immodule" = "yes"])
748
749 AM_CONDITIONAL(SCIM_BUILD_FILTER_SCTC,
750                 [test "$enable_filter_sctc" = "yes"])
751
752 AM_CONDITIONAL(SCIM_BUILD_GTK_UTILS,
753                 [test "$enable_gtk_utils" = "yes"])
754
755 AM_CONDITIONAL(SCIM_BUILD_X11_UTILS,
756                 [test "$enable_x11_utils" = "yes"])
757
758 AM_CONDITIONAL(SCIM_BUILD_TRAY_ICON,
759                 [test "$enable_tray_icon" = "yes"])
760
761 AM_CONDITIONAL(ISF_BUILD_EFL_IMMODULE,
762                 [test "$enable_efl_immodule" = "yes"])
763
764 AM_CONDITIONAL(ISF_BUILD_WAYLAND_IMMODULE,
765                 [test "$enable_wayland_immodule" = "yes"])
766
767 AM_CONDITIONAL(ISF_BUILD_PANEL_EFL,
768                 [test "$enable_panel_efl" = "yes"])
769
770 AM_CONDITIONAL(ISF_BUILD_REMOTE_INPUT,
771                 [test "$enable_remote_input" = "yes"])
772
773 AM_CONDITIONAL(ISF_BUILD_DB_UTIL,
774                 [test "$ISF_HAS_DB_UTIL" = "yes"])
775
776 AM_CONDITIONAL(ISF_INSTALL_SYSTEMD_SCRIPT,
777                 [test "$enable_lazy_launch" = "no"])
778
779 AC_SUBST(SCIM_BUILD_TESTS)
780 AC_SUBST(SCIM_BUILD_CONFIG_SIMPLE)
781 AC_SUBST(SCIM_BUILD_CONFIG_SOCKET)
782 AC_SUBST(SCIM_BUILD_FRONTEND_X11)
783 AC_SUBST(SCIM_BUILD_FRONTEND_SOCKET)
784 AC_SUBST(SCIM_BUILD_IMENGINE_RAWCODE)
785 AC_SUBST(SCIM_BUILD_IMENGINE_TABLE)
786 AC_SUBST(SCIM_BUILD_IMENGINE_SOCKET)
787 AC_SUBST(SCIM_BUILD_FILTER_SCTC)
788 AC_SUBST(SCIM_BUILD_GTK2_IMMODULE)
789 AC_SUBST(SCIM_BUILD_SCIM_SETUP)
790 AC_SUBST(SCIM_BUILD_GTK_UTILS)
791 AC_SUBST(SCIM_BUILD_X11_UTILS)
792 AC_SUBST(ISF_BUILD_EFL_IMMODULE)
793 AC_SUBST(ISF_BUILD_PANEL_EFL)
794 AC_SUBST(ISF_BUILD_REMOTE_INPUT)
795 AC_SUBST(ISF_BUILD_DB_UTIL)
796 AC_SUBST(ISF_INSTALL_SYSTEMD_SCRIPT)
797 AC_SUBST(ISF_BUILD_KBD_MODE_CHANGER)
798
799 ISF_BUILDING_DLL="-DISF_BUILDING_DLL"
800 AC_SUBST(ISF_BUILDING_DLL)
801
802 # Output All necessary Paths.
803 SCIM_BINDIR="$prefix/bin"
804 SCIM_DATADIR="$datadir/scim"
805 SCIM_SYSCONFDIR="$sysconfdir"
806 SCIM_ICONDIR="$datadir/scim/icons"
807 SCIM_MODULE_PATH="$libdir/scim$SCIM_EPOCH"
808 SCIM_LIBEXECDIR="$libdir/scim$SCIM_EPOCH"
809 SCIM_LOCALEDIR="/usr/share/locale"
810 SCIM_TEMPDIR="/tmp"
811
812 AC_SUBST(SCIM_BINDIR)
813 AC_SUBST(SCIM_DATADIR)
814 AC_SUBST(SCIM_SYSCONFDIR)
815 AC_SUBST(SCIM_ICONDIR)
816 AC_SUBST(SCIM_MODULE_PATH)
817 AC_SUBST(SCIM_LIBEXECDIR)
818 AC_SUBST(SCIM_LOCALEDIR)
819 AC_SUBST(SCIM_TEMPDIR)
820
821 AC_SUBST(RO_APP_DIR)
822 AC_SUBST(RO_PACKAGES_DIR)
823
824 ###########################################################
825 ##                      Output files.                    ##
826 ###########################################################
827 AC_SUBST(ac_aux_dir)
828 AC_CONFIG_FILES([Makefile
829                  po/Makefile.in
830                  ism/src/Makefile
831                  ism/src/scim_types.h
832                  ism/utils/Makefile
833                  ism/data/Makefile
834                  ism/data/icons/Makefile
835                  ism/data/pixmaps/Makefile
836                  ism/modules/Makefile
837                  ism/modules/frontend/imdkit/Makefile
838                  ism/modules/frontend/Makefile
839                  ism/modules/imengine/Makefile
840                  ism/modules/filter/Makefile
841                  ism/modules/config/Makefile
842                  ism/modules/panelagent/ecoresocket/Makefile
843                  ism/modules/panelagent/wayland/Makefile
844                  ism/modules/panelagent/socketconfigserver/Makefile
845                  ism/configs/Makefile
846                  ism/extras/Makefile
847                  ism/extras/gtk2_immodule/Makefile
848                  ism/extras/efl_immodule/Makefile
849                  ism/extras/wayland_immodule/Makefile
850                  ism/extras/efl_panel/Makefile
851                  ism/extras/kbd_mode_changer/Makefile
852                  ism/extras/pkgmgr_parser/Makefile
853                  ism/demos/Makefile
854                  intltool-extract
855                  intltool-merge
856                  intltool-update
857                  isf.pc
858                  scim.pc
859                  scim-gtkutils.pc
860                  scim.spec])
861 AC_OUTPUT
862
863 AC_MSG_RESULT([
864 Build options:
865   Version                  $ISF_VERSION
866   Install prefix           $prefix
867   Build shared libs        $enable_shared
868   Build static libs        $enable_static
869   Enable debug             $enable_debug
870   Build for x86 host       $enable_x86
871   Enable ld version script $enable_ld_version_script
872
873 Module options:
874   Simple config module     $enable_config_simple
875   Socket config module     $enable_config_socket
876
877   X11 FrontEnd module      $enable_frontend_x11
878   Socket FrontEnd module   $enable_frontend_socket
879
880   Socket IMEngine module   $enable_im_socket
881
882   SCTC Filter module       $enable_filter_sctc
883
884   GTK2 Utility Library     $enable_gtk_utils
885   X11 Utility Library      $enable_x11_utils
886
887   GTK2 IMModule            $enable_gtk2_immodule
888   GTK2 IMModule dir        $GTK_IM_MODULEDIR
889
890   EFL  IMModule            $enable_efl_immodule
891   EFL  IMModule dir        $EFL_IM_MODULEDIR
892
893   Wayland IMModule         $enable_wayland_immodule
894   Wayland IMModule dir     $WAYLAND_IM_MODULEDIR
895
896   EFL  Panel GUI           $enable_panel_efl
897
898   Enable TrayIcon          $enable_tray_icon
899   Enable MultiWindow       $enable_multiwindow_support
900   Enable LazyLaunch        $enable_lazy_launch
901   Enable IME Embed         $enable_ime_embed_app
902   Enable Remote Input      $enable_remote_input
903 ])
904