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