7ec4115f3d3b3c90e7755ed5299405483839dd71
[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, 5.5.42, 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=5
12 ISF_MINOR_VERSION=5
13 ISF_MICRO_VERSION=42
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 FILE library
224 PKG_CHECK_MODULES(ECORE_FILE, [ecore-file])
225
226 # Check ECORE FILE library
227 PKG_CHECK_MODULES(ECORE_INPUT, [ecore-input])
228
229 # Check ECORE EVAS library
230 PKG_CHECK_MODULES(ECORE_EVAS, [ecore-evas])
231
232 # Check ECORE IMF
233 PKG_CHECK_MODULES(ECORE_IMF, [ecore-imf],
234                   [ISF_HAS_ECORE_IMF=yes],
235                   [ISF_HAS_ECORE_IMF=no])
236
237 if test "$ISF_HAS_ECORE_IMF" = "yes"; then
238   EFL_LIBDIR=`$PKG_CONFIG --variable=libdir ecore-imf`
239   ECORE_IMF_MODULE_ARCH=`$PKG_CONFIG --variable=module_arch ecore`
240   if test -z "$EFL_LIBDIR)"; then
241     EFL_LIBDIR="$libdir"
242   fi
243   EFL_IM_MODULEDIR=$EFL_LIBDIR/ecore_imf/modules/isf/$ECORE_IMF_MODULE_ARCH
244   WAYLAND_IM_MODULEDIR=$EFL_LIBDIR/ecore_imf/modules/wayland/$ECORE_IMF_MODULE_ARCH
245   AC_SUBST(EFL_LIBDIR)
246   AC_SUBST(EFL_IM_MODULEDIR)
247   AC_SUBST(WAYLAND_IM_MODULEDIR)
248 fi
249
250 # Check EVAS
251 PKG_CHECK_MODULES(EVAS, [evas])
252
253 # Check ECORE X library
254 PKG_CHECK_MODULES(ECOREX, [ecore-x],
255                   [ISF_HAS_ECOREX=yes],
256                   [ISF_HAS_ECOREX=no])
257
258 if test "$ISF_HAS_ECOREX" = "yes"; then
259   AC_DEFINE(HAVE_ECOREX,1,[Have ecore-x functions.])
260 fi
261
262 # Check XKBCOMMON library
263 PKG_CHECK_MODULES(XKBCOMMON, [xkbcommon])
264
265 # Check ECORE WAYLAND library
266 PKG_CHECK_MODULES(ECORE_WL, [ecore-wl2],
267                   [ISF_HAS_ECOREWL=yes],
268                   [ISF_HAS_ECOREWL=no])
269
270 if test "$ISF_HAS_ECOREWL" = "yes"; then
271   AC_DEFINE(HAVE_ECOREWL,1,[Have ecore-wl2 functions.])
272 fi
273
274 # Check WAYLAND TEXT INPUT library
275 PKG_CHECK_MODULES(WL_TEXT_INPUT, [text-client])
276
277 # Check WAYLAND INPUT METHOD library
278 PKG_CHECK_MODULES(WL_INPUT_METHOD, [input-method-client])
279
280 # Check EDJE library
281 PKG_CHECK_MODULES(EDJE, [edje])
282
283 # Check ELEMENTARY library
284 PKG_CHECK_MODULES(ELEMENTARY, [elementary],
285                   [ISF_HAS_ELM=yes],
286                   [ISF_HAS_ELM=no])
287
288 # Check EFL extension library
289 PKG_CHECK_MODULES(EFL_EXTENSION, [efl-extension])
290
291 # Check glib library
292 PKG_CHECK_MODULES(GLIB, [glib-2.0])
293
294 # Check gio library
295 PKG_CHECK_MODULES(GIO, [gio-2.0])
296
297 # Check tzplatform-config library
298 PKG_CHECK_MODULES(TZPLATFORM_CONFIG, [libtzplatform-config])
299
300 PKG_CHECK_MODULES(APPFW_APPLICATION, [capi-appfw-application])
301
302 # Check dlog library
303 PKG_CHECK_MODULES(DLOG, [dlog >= 0])
304
305 # Check notification library
306 PKG_CHECK_MODULES(NOTIFICATION, [notification],
307                   [ISF_HAS_NOTIFICATION=yes],
308                   [ISF_HAS_NOTIFICATION=no])
309
310 # Check system info library
311 PKG_CHECK_MODULES(SYSTEM_INFO, [capi-system-info])
312
313 # Check tts library
314 PKG_CHECK_MODULES(TTS, [tts],
315                   [ISF_HAS_TTS=yes],
316                   [ISF_HAS_TTS=no])
317
318 if test "$ISF_HAS_TTS" = "yes"; then
319   AC_DEFINE(HAVE_TTS,1,[Have TTS functions.])
320 fi
321
322 # Check cynara liblaries
323 PKG_CHECK_MODULES(CYNARA, [cynara-client, cynara-creds-socket, cynara-session])
324
325 # Check vconf library
326 PKG_CHECK_MODULES(VCONF, [vconf],
327                   [ISF_HAS_VCONF=yes],
328                   [ISF_HAS_VCONF=no])
329
330 # Check edbus library
331 PKG_CHECK_MODULES(EDBUS, [edbus],
332                   [ISF_HAS_EDBUS=yes],
333                   [ISF_HAS_EDBUS=no])
334
335 # Check bluetooth library
336 PKG_CHECK_MODULES(BLUETOOTH, [capi-network-bluetooth],
337                   [ISF_HAS_BLUETOOTH=yes],
338                   [ISF_HAS_BLUETOOTH=no])
339
340 # Check feedback library
341 PKG_CHECK_MODULES(FEEDBACK, [feedback],
342                   [ISF_HAS_FEEDBACK=yes],
343                   [ISF_HAS_FEEDBACK=no])
344
345 # Check package manager
346 PKG_CHECK_MODULES(PACKAGE_MANAGER, [capi-appfw-package-manager])
347
348 # Check AUL
349 PKG_CHECK_MODULES(AUL, [aul])
350
351 # Check App Control
352 PKG_CHECK_MODULES(APP_CONTROL, [capi-appfw-app-control])
353
354 # Check appfw library
355 PKG_CHECK_MODULES(APPFW, [capi-appfw-application])
356
357 # Check libwebsockets
358 PKG_CHECK_MODULES(LIBWEBSOCKETS, [libwebsockets],
359                   [ISF_HAS_LIBWEBSOCKETS=yes],
360                   [ISF_HAS_LIBWEBSOCKETS=no])
361
362 # Check core package manager
363 PKG_CHECK_MODULES(PKGMGR_INFO, [pkgmgr-info],
364                   [ISF_HAS_PKGMGR_INFO=yes],
365                   [ISF_HAS_PKGMGR_INFO=no])
366
367 PKG_CHECK_MODULES(SQLITE3, [sqlite3])
368
369 # Ignore checked modules if --disable option is added
370 AC_ARG_ENABLE(include-notification,
371               [  --disable-include-notification         Do not include notification package],
372               enable_notification=no,
373               enable_notification=yes)
374
375 AC_ARG_ENABLE(include-libwebsocket,
376               [  --disable-include-libwebsocket         Do not include libwebsocket package],
377               enable_libwebsocket=no,
378               enable_libwebsocket=yes)
379
380 # Check systemd library
381 PKG_CHECK_MODULES(SYSTEMD, [libsystemd],
382                   [ISF_HAS_SYSTEMD=yes],
383                   [ISF_HAS_SYSTEMD=no])
384
385 if test "$ISF_HAS_VCONF" = "yes"; then
386   AC_DEFINE(HAVE_VCONF,1,[Have VConf functions.])
387 fi
388
389 if test "$ISF_HAS_BLUETOOTH" = "yes"; then
390   AC_DEFINE(HAVE_BLUETOOTH,1,[Have Bluetooth functions.])
391 fi
392
393 if test "$ISF_HAS_FEEDBACK" = "yes"; then
394   AC_DEFINE(HAVE_FEEDBACK,1,[Have Feedback functions.])
395 fi
396
397 if test "$ISF_HAS_EDBUS" = "yes"; then
398   AC_DEFINE(HAVE_EDBUS,1,[Have edbus functions.])
399 fi
400
401 if test "$ISF_HAS_NOTIFICATION" = "yes" && test "$enable_notification" = "yes"; then
402   AC_DEFINE(HAVE_NOTIFICATION,1,[Have Notification functions.])
403 fi
404
405 if test "$enable_notification" = "no"; then
406   AC_MSG_NOTICE([Notification functions force-disabled.])
407 fi
408
409 if test "$ISF_HAS_PKGMGR_INFO" = "yes"; then
410   AC_DEFINE(HAVE_PKGMGR_INFO,1,[Have Package manager functions.])
411 fi
412
413 # Check GTK2 library
414 PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0 pango >= 1.1.0 gdk-pixbuf-2.0 >= 2.4.0],
415                   [SCIM_HAS_GTK2=yes],
416                   [SCIM_HAS_GTK2=no])
417
418 SCIM_HAS_GTK2_2=no
419 if test "$SCIM_HAS_GTK2" = "yes"; then
420   if $PKG_CONFIG --exists "gtk+-2.0 >= 2.2" ; then
421     SCIM_HAS_GTK2_2=yes
422     GTK_VERSION=2.2.0
423     AC_DEFINE(GDK_MULTIHEAD_SAFE,1,[Force use of GDK's multihead-safe APIs.])
424   fi
425   if $PKG_CONFIG --exists "gtk+-2.0 >= 2.3.5" ; then
426     SCIM_HAS_GTK2_4=yes
427     GTK_VERSION=2.3.5
428     AC_DEFINE(HAVE_GTK_DRAW_INSERTION_CURSOR,1,[Have gtk_draw_insertion_cursor ().])
429   fi
430   GTK_BINARY_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
431   GTK_LIBDIR=`$PKG_CONFIG --variable=libdir gtk+-2.0`
432   if test -z "$GTK_LIBDIR)"; then
433     GTK_LIBDIR="$libdir"
434   fi
435   GTK_IM_MODULEDIR=$GTK_LIBDIR/gtk-2.0/$GTK_BINARY_VERSION/immodules
436   AC_SUBST(GTK_LIBDIR)
437   AC_SUBST(GTK_IM_MODULEDIR)
438   AC_SUBST(GTK_VERSION)
439   AC_SUBST(GTK_BINARY_VERSION)
440 fi
441
442 # Check if we have gthread
443 PKG_CHECK_MODULES(GTHREAD2,[gthread-2.0 >= 2.0.0],
444                   [SCIM_HAS_GTHREAD2=yes],
445                   [SCIM_HAS_GTHREAD2=no])
446
447 # Checks for X11 header files.
448 AC_PATH_XTRA
449
450 # Add -lX11 to X_LIBS
451 if test "$have_x" = "yes"; then
452   X_LIBS="$X_LIBS -lX11"
453 fi
454
455 case $host_cpu in
456   *arm* ) TARGET=ARM;;
457       * ) TARGET=X86;;
458 esac
459 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
460
461 ###########################################################
462 ##             Definiation of compile args.              ##
463 ###########################################################
464 AC_ARG_WITH(gtk-im-module-dir,
465             AS_HELP_STRING([--with-gtk-im-module-dir=dir],
466                            [Select gtk immodule dir]),
467             GTK_IM_MODULEDIR=$with_gtk_im_module_dir)
468
469 AC_ARG_WITH(efl-im-module-dir,
470             AS_HELP_STRING([--with-efl-im-module-dir=dir],
471                            [Select efl immodule dir]),
472             EFL_IM_MODULEDIR=$with_efl_im_module_dir)
473
474 AC_ARG_WITH(wayland-im-module-dir,
475             AS_HELP_STRING([--with-wayland-im-module-dir=dir],
476                            [Select wayland immodule dir]),
477             WAYLAND_IM_MODULEDIR=$with_wayland_im_module_dir)
478
479 AC_ARG_WITH(ro-app-dir,
480             AS_HELP_STRING([--with-ro-app-dir=dir],
481                            [Select Read only application dir]),
482             RO_APP_DIR=$with_ro_app_dir)
483
484 AC_ARG_WITH(ro-packages-dir,
485             AS_HELP_STRING([--with-ro-app-dir=dir],
486                            [Select Read only packages dir]),
487             RO_PACKAGES_DIR=$with_ro_packages_dir)
488
489 AC_ARG_ENABLE(ld-version-script,
490               [  --enable-ld-version-script Use ld version script to limit exported symbols],
491               enable_ld_version_script=yes,
492               enable_ld_version_script=no)
493
494 AC_ARG_ENABLE(debug,
495               [  --enable-debug            Turn on debugging],
496               enable_debug=yes,
497               enable_debug=no)
498
499 AC_ARG_ENABLE(x86,
500               [  --enable-x86              Build for x86 host],
501               enable_x86=yes,
502               enable_x86=no)
503
504 AC_ARG_ENABLE(hash-map,
505               [  --enable-hash-map         Use hast_map instead of std::map internally],
506               enable_hash_map=yes,
507               enable_hash_map=no)
508
509 AC_ARG_ENABLE(config-simple,
510               [  --disable-config-simple   Do not build Simple Config module],
511               enable_config_simple=no,
512               enable_config_simple=yes)
513
514 AC_ARG_ENABLE(config-socket,
515               [  --disable-config-socket   Do not build Socket Config module],
516               enable_config_socket=no,
517               enable_config_socket=yes)
518
519 AC_ARG_ENABLE(frontend-x11,
520               [  --disable-frontend-x11    Do not build X11 FrontEnd module],
521               enable_frontend_x11=no,
522               enable_frontend_x11=yes)
523
524 AC_ARG_ENABLE(frontend-socket,
525               [  --disable-frontend-socket Do not build Socket FrontEnd module],
526               enable_frontend_socket=no,
527               enable_frontend_socket=yes)
528
529 AC_ARG_ENABLE(im-socket,
530               [  --disable-im-socket       Do not build Socket IMEngine module],
531               enable_im_socket=no,
532               enable_im_socket=yes)
533
534 AC_ARG_ENABLE(filter-sctc,
535               [  --disable-filter-sctc     Do not build Simplified/Traditional Chinese conversion Filter module],
536               enable_filter_sctc=no,
537               enable_filter_sctc=yes)
538
539 AC_ARG_ENABLE(gtk2-immodule,
540               [  --disable-gtk2-immodule   Do not build GTK2 IMModule],
541               enable_gtk2_immodule=no,
542               enable_gtk2_immodule=yes)
543
544 AC_ARG_ENABLE(efl-immodule,
545               [  --disable-efl-immodule    Do not build EFL IMModule],
546               enable_efl_immodule=no,
547               enable_efl_immodule=yes)
548
549 AC_ARG_ENABLE(wayland-immodule,
550               [  --disable-wayland-immodule    Do not build Wayland IMModule],
551               enable_wayland_immodule=no,
552               enable_wayland_immodule=yes)
553
554 AC_ARG_ENABLE(panel-efl,
555               [  --disable-panel-efl       Do not build EFL Panel],
556               enable_panel_efl=no,
557               enable_panel_efl=check)
558
559 AC_ARG_ENABLE(open-input,
560               [  --disable-open-input     Do not build Open Input],
561               enable_open_input=no,
562               enable_open_input=check)
563
564 AC_ARG_ENABLE(tray-icon,
565               [  --disable-tray-icon       Do not build Tray Icon],
566               enable_tray_icon=no,
567               enable_tray_icon=yes)
568
569 AC_ARG_ENABLE(multiwindow-support,
570               [  --disable-multiwindow-support       Do not build Multiwindow Support],
571               enable_multiwindow_support=no,
572               enable_multiwindow_support=yes)
573
574 AC_ARG_ENABLE(lazy-launch,
575               [  --enable-lazy-launch      Launch ISF when focusing in entry],
576               enable_lazy_launch=yes,
577               enable_lazy_launch=no)
578
579 AC_ARG_ENABLE(ime-embed-app,
580               [  --disable-ime-embed-app      Do not load IME in application when socket invalidate],
581               enable_ime_embed_app=no,
582               enable_ime_embed_app=yes)
583
584 AC_ARG_ENABLE(candidate-ui,
585               [  --disable-candidate-ui     Do not build Candidate UI],
586               enable_candidate_ui=no,
587               enable_candidate_ui=check)
588
589 if test "$have_x" = "yes"; then
590   SCIM_BUILD_X11_UTILS=1
591   enable_x11_utils=yes
592 else
593   SCIM_BUILD_X11_UTILS=0
594   enable_x11_utils=no
595 fi
596
597 if test "$enable_hash_map" = "yes"; then
598   AC_DEFINE(ENABLE_HASH_MAP,1,[Use hash map instead of map in libscim])
599 fi
600
601 if test "$enable_debug" = "yes"; then
602   AC_DEFINE(ENABLE_DEBUG,1,[Define this to enable the debug facility in libscim])
603   CFLAGS="$CFLAGS -g"
604   CXXFLAGS="$CXXFLAGS -g"
605 fi
606
607 if test "$enable_x86" = "yes"; then
608   AC_DEFINE(ENABLE_X86_HOST,1,[Build for x86 host])
609 fi
610
611 if test "$enable_tests" = "yes"; then
612   SCIM_BUILD_TESTS=1
613 else
614   SCIM_BUILD_TESTS=0
615   enable_tests=no
616 fi
617
618 if test "$enable_config_simple" = "yes"; then
619   SCIM_BUILD_CONFIG_SIMPLE=1
620 else
621   SCIM_BUILD_CONFIG_SIMPLE=0
622   enable_config_simple=no
623 fi
624
625 if test "$enable_config_socket" = "yes" -a "$socket_ok" = "yes"; then
626   SCIM_BUILD_CONFIG_SOCKET=1
627 else
628   SCIM_BUILD_CONFIG_SOCKET=0
629   enable_config_socket=no
630 fi
631
632 if test "$enable_frontend_x11" = "yes" -a "$have_x" = "yes"; then
633   SCIM_BUILD_FRONTEND_X11=1
634 else
635   SCIM_BUILD_FRONTEND_X11=0
636   enable_frontend_x11=no
637 fi
638
639 if test "$enable_frontend_socket" = "yes" -a "$socket_ok" = "yes"; then
640   SCIM_BUILD_FRONTEND_SOCKET=1
641 else
642   SCIM_BUILD_FRONTEND_SOCKET=0
643   enable_frontend_socket=no
644 fi
645
646 if test "$enable_im_rawcode" = "yes"; then
647   SCIM_BUILD_IMENGINE_RAWCODE=1
648 else
649   SCIM_BUILD_IMENGINE_RAWCODE=0
650   enable_im_rawcode=no
651 fi
652
653 if test "$enable_im_socket" = "yes" -a "$socket_ok" = "yes"; then
654   SCIM_BUILD_IMENGINE_SOCKET=1
655 else
656   SCIM_BUILD_IMENGINE_SOCKET=0
657   enable_im_socket=no
658 fi
659
660 if test "$enable_filter_sctc" = "yes"; then
661   SCIM_BUILD_FILTER_SCTC=1
662 else
663   SCIM_BUILD_FILTER_SCTC=0
664   enable_filter_sctc=no
665 fi
666
667 if test "$enable_gtk2_immodule" = "yes" -a "$SCIM_HAS_GTK2" = "yes"; then
668   SCIM_BUILD_GTK2_IMMODULE=1
669 else
670   SCIM_BUILD_GTK2_IMMODULE=0
671   enable_gtk2_immodule=no
672 fi
673
674 if test "$SCIM_HAS_GTK2" = "yes"; then
675   enable_gtk_utils=yes
676   SCIM_BUILD_GTK_UTILS=1
677 else
678   enable_gtk_utils=no
679   SCIM_BUILD_GTK_UTILS=0
680 fi
681
682 if test "$enable_tray_icon" = "yes"; then
683   if test "$SCIM_HAS_GTK2_2" = "yes" -a "$no_x" != "yes"; then
684     enable_tray_icon=yes
685     AC_DEFINE(ENABLE_TRAY_ICON,1,[Enable the TrayIcon code.])
686   fi
687 else
688   enable_tray_icon=no
689 fi
690
691 if test "$enable_multiwindow_support" = "yes"; then
692   enable_multiwindow_support=yes
693   AC_DEFINE(ENABLE_MULTIWINDOW_SUPPORT,1,[Enable the Multi Window code.])
694 else
695   enable_multiwindow_support=no
696 fi
697
698 if test "$enable_efl_immodule" = "yes" -a "$ISF_HAS_ECORE_IMF" = "yes"; then
699   ISF_BUILD_EFL_IMMODULE=1
700 else
701   ISF_BUILD_EFL_IMMODULE=0
702   enable_efl_immodule=no
703 fi
704
705 if test "$enable_wayland_immodule" = "yes" -a "$ISF_HAS_ECORE_IMF" = "yes"; then
706   ISF_BUILD_WAYLAND_IMMODULE=1
707 else
708   ISF_BUILD_WAYLAND_IMMODULE=0
709   enable_wayland_immodule=no
710 fi
711
712 ISF_BUILD_PANEL_EFL=0
713 ISF_BUILD_CANDIDATE_UI=0
714 if test "$enable_panel_efl" != "no"; then
715   enable_panel_efl=no
716   if test "$ISF_HAS_ELM" = "yes"; then
717     ISF_BUILD_PANEL_EFL=1
718     enable_panel_efl=yes
719     if test "$enable_candidate_ui" = "yes"; then
720       ISF_BUILD_CANDIDATE_UI=1
721       enable_candidate_ui=yes
722     else
723       enable_candidate_ui=no
724     fi
725   else
726     enable_candidate_ui=no
727   fi
728 else
729   enable_candidate_ui=no
730 fi
731
732 ISF_BUILD_OPEN_INPUT=0
733 ISF_BUILD_REMOTE_INPUT=0
734 if test "$enable_remote_input" = "yes"; then
735   ISF_BUILD_REMOTE_INPUT=1
736   enable_remote_input=yes
737   AC_DEFINE(ENABLE_REMOTE_INPUT,1,[Enable remote input.])
738   if test "$enable_open_input" = "yes" && test "$ISF_HAS_LIBWEBSOCKETS" = "yes" && test "$enable_libwebsocket" = "yes"; then
739     ISF_BUILD_OPEN_INPUT=1
740     enable_open_input=yes
741     AC_DEFINE(ENABLE_OPEN_INPUT,1,[Enable open input.])
742   else
743     enable_open_input=no
744   fi
745
746   if test "$enable_libwebsocket" = "no"; then
747     AC_MSG_NOTICE([LIBWEBSOCKET forced disable.])
748   fi
749 else
750   enable_open_input=no
751   enable_remote_input=no
752 fi
753
754 #if nothing needs libscim-gtkutils, just disable it
755 if test "$enable_panel_gtk" != "yes"; then
756   enable_gtk_utils=no
757   SCIM_BUILD_GTK_UTILS=0
758 fi
759
760 AM_CONDITIONAL(HAVE_X,
761                 [test "$have_x" = "yes"])
762
763 if test "$enable_lazy_launch" = "yes"; then
764   AC_DEFINE(ENABLE_LAZY_LAUNCH,1,[Launch ISF when focusing in entry])
765   ISF_INSTALL_SYSTEMD_SCRIPT=0
766 else
767   ISF_INSTALL_SYSTEMD_SCRIPT=1
768 fi
769
770 if test "$enable_ime_embed_app" = "yes"; then
771   AC_DEFINE(ENABLE_IME_EMBED_APP,1,[Load imengine in application side when socket invalidate])
772 fi
773
774 AM_CONDITIONAL(SCIM_LD_VERSION_SCRIPT,
775                 [test "$enable_ld_version_script" = "yes"])
776
777 AM_CONDITIONAL(SCIM_BUILD_TESTS,
778                 [test "$enable_tests" = "yes"])
779
780 AM_CONDITIONAL(SCIM_BUILD_CONFIG_SIMPLE,
781                 [test "$enable_config_simple" = "yes"])
782
783 AM_CONDITIONAL(SCIM_BUILD_CONFIG_SOCKET,
784                 [test "$enable_config_socket" = "yes"])
785
786 AM_CONDITIONAL(SCIM_BUILD_FRONTEND_X11,
787                 [test "$enable_frontend_x11" = "yes"])
788
789 AM_CONDITIONAL(SCIM_BUILD_FRONTEND_SOCKET,
790                 [test "$enable_frontend_socket" = "yes"])
791
792 AM_CONDITIONAL(SCIM_BUILD_IMENGINE_SOCKET,
793                 [test "$enable_im_socket" = "yes"])
794
795 AM_CONDITIONAL(SCIM_BUILD_IMENGINE_RAWCODE,
796                 [test "$enable_im_rawcode" = "yes"])
797
798 AM_CONDITIONAL(SCIM_BUILD_GTK2_IMMODULE,
799                 [test "$enable_gtk2_immodule" = "yes"])
800
801 AM_CONDITIONAL(SCIM_BUILD_FILTER_SCTC,
802                 [test "$enable_filter_sctc" = "yes"])
803
804 AM_CONDITIONAL(SCIM_BUILD_GTK_UTILS,
805                 [test "$enable_gtk_utils" = "yes"])
806
807 AM_CONDITIONAL(SCIM_BUILD_X11_UTILS,
808                 [test "$enable_x11_utils" = "yes"])
809
810 AM_CONDITIONAL(SCIM_BUILD_TRAY_ICON,
811                 [test "$enable_tray_icon" = "yes"])
812
813 AM_CONDITIONAL(ISF_BUILD_EFL_IMMODULE,
814                 [test "$enable_efl_immodule" = "yes"])
815
816 AM_CONDITIONAL(ISF_BUILD_WAYLAND_IMMODULE,
817                 [test "$enable_wayland_immodule" = "yes"])
818
819 AM_CONDITIONAL(ISF_BUILD_PANEL_EFL,
820                 [test "$enable_panel_efl" = "yes"])
821
822 AM_CONDITIONAL(ISF_BUILD_REMOTE_INPUT,
823                 [test "$enable_remote_input" = "yes"])
824
825 AM_CONDITIONAL(ISF_BUILD_OPEN_INPUT,
826                 [test "$enable_open_input" = "yes"])
827
828 AM_CONDITIONAL(ISF_BUILD_DB_UTIL,
829                 [test "$ISF_HAS_DB_UTIL" = "yes"])
830
831 AM_CONDITIONAL(ISF_INSTALL_SYSTEMD_SCRIPT,
832                 [test "$enable_lazy_launch" = "no"])
833
834 AM_CONDITIONAL(ISF_BUILD_CANDIDATE_UI,
835                 [test "$enable_candidate_ui" = "yes"])
836
837 AC_SUBST(SCIM_BUILD_TESTS)
838 AC_SUBST(SCIM_BUILD_CONFIG_SIMPLE)
839 AC_SUBST(SCIM_BUILD_CONFIG_SOCKET)
840 AC_SUBST(SCIM_BUILD_FRONTEND_X11)
841 AC_SUBST(SCIM_BUILD_FRONTEND_SOCKET)
842 AC_SUBST(SCIM_BUILD_IMENGINE_RAWCODE)
843 AC_SUBST(SCIM_BUILD_IMENGINE_TABLE)
844 AC_SUBST(SCIM_BUILD_IMENGINE_SOCKET)
845 AC_SUBST(SCIM_BUILD_FILTER_SCTC)
846 AC_SUBST(SCIM_BUILD_GTK2_IMMODULE)
847 AC_SUBST(SCIM_BUILD_SCIM_SETUP)
848 AC_SUBST(SCIM_BUILD_GTK_UTILS)
849 AC_SUBST(SCIM_BUILD_X11_UTILS)
850 AC_SUBST(ISF_BUILD_EFL_IMMODULE)
851 AC_SUBST(ISF_BUILD_PANEL_EFL)
852 AC_SUBST(ISF_BUILD_REMOTE_INPUT)
853 AC_SUBST(ISF_BUILD_OPEN_INPUT)
854 AC_SUBST(ISF_BUILD_DB_UTIL)
855 AC_SUBST(ISF_INSTALL_SYSTEMD_SCRIPT)
856 AC_SUBST(ISF_BUILD_KBD_MODE_CHANGER)
857 AC_SUBST(ISF_BUILD_CANDIDATE_UI)
858
859 ISF_BUILDING_DLL="-DISF_BUILDING_DLL"
860 AC_SUBST(ISF_BUILDING_DLL)
861
862 # Output All necessary Paths.
863 SCIM_BINDIR="$prefix/bin"
864 SCIM_DATADIR="$datadir/scim"
865 SCIM_SYSCONFDIR="$sysconfdir"
866 SCIM_ICONDIR="$datadir/scim/icons"
867 SCIM_MODULE_PATH="$libdir/scim$SCIM_EPOCH"
868 SCIM_LIBEXECDIR="$libdir/scim$SCIM_EPOCH"
869 SCIM_LOCALEDIR="/usr/share/locale"
870 SCIM_TEMPDIR="/run/.isf"
871
872 AC_SUBST(SCIM_BINDIR)
873 AC_SUBST(SCIM_DATADIR)
874 AC_SUBST(SCIM_SYSCONFDIR)
875 AC_SUBST(SCIM_ICONDIR)
876 AC_SUBST(SCIM_MODULE_PATH)
877 AC_SUBST(SCIM_LIBEXECDIR)
878 AC_SUBST(SCIM_LOCALEDIR)
879 AC_SUBST(SCIM_TEMPDIR)
880
881 AC_SUBST(RO_APP_DIR)
882 AC_SUBST(RO_PACKAGES_DIR)
883
884 ###########################################################
885 ##                      Output files.                    ##
886 ###########################################################
887 AC_SUBST(ac_aux_dir)
888 AC_CONFIG_FILES([Makefile
889                  po/Makefile.in
890                  ism/src/Makefile
891                  ism/src/scim_types.h
892                  ism/utils/Makefile
893                  ism/data/Makefile
894                  ism/data/icons/Makefile
895                  ism/data/pixmaps/Makefile
896                  ism/modules/Makefile
897                  ism/modules/frontend/imdkit/Makefile
898                  ism/modules/frontend/Makefile
899                  ism/modules/imengine/Makefile
900                  ism/modules/filter/Makefile
901                  ism/modules/config/Makefile
902                  ism/modules/panelagent/ecoresocket/Makefile
903                  ism/modules/panelagent/wayland/Makefile
904                  ism/modules/panelagent/socketconfigserver/Makefile
905                  ism/configs/Makefile
906                  ism/extras/Makefile
907                  ism/extras/gtk2_immodule/Makefile
908                  ism/extras/efl_immodule/Makefile
909                  ism/extras/wayland_immodule/Makefile
910                  ism/extras/efl_panel/Makefile
911                  ism/extras/kbd_mode_changer/Makefile
912                  ism/extras/pkgmgr_parser/Makefile
913                  ism/demos/Makefile
914                  intltool-extract
915                  intltool-merge
916                  intltool-update
917                  isf.pc
918                  scim.pc
919                  scim-gtkutils.pc
920                  scim.spec
921                  isf-control.pc
922                  isf-control.spec
923                  engine-loader/Makefile])
924 AC_OUTPUT
925
926 AC_MSG_RESULT([
927 Build options:
928   Version                  $ISF_VERSION
929   Install prefix           $prefix
930   Build shared libs        $enable_shared
931   Build static libs        $enable_static
932   Enable debug             $enable_debug
933   Build for x86 host       $enable_x86
934   Enable ld version script $enable_ld_version_script
935
936 Module options:
937   Simple config module     $enable_config_simple
938   Socket config module     $enable_config_socket
939
940   X11 FrontEnd module      $enable_frontend_x11
941   Socket FrontEnd module   $enable_frontend_socket
942
943   Socket IMEngine module   $enable_im_socket
944
945   SCTC Filter module       $enable_filter_sctc
946
947   GTK2 Utility Library     $enable_gtk_utils
948   X11 Utility Library      $enable_x11_utils
949
950   GTK2 IMModule            $enable_gtk2_immodule
951   GTK2 IMModule dir        $GTK_IM_MODULEDIR
952
953   EFL  IMModule            $enable_efl_immodule
954   EFL  IMModule dir        $EFL_IM_MODULEDIR
955
956   Wayland IMModule         $enable_wayland_immodule
957   Wayland IMModule dir     $WAYLAND_IM_MODULEDIR
958
959   EFL  Panel GUI           $enable_panel_efl
960   EFL  Panel Candidate GUI $enable_candidate_ui
961
962   Enable TrayIcon          $enable_tray_icon
963   Enable MultiWindow       $enable_multiwindow_support
964   Enable LazyLaunch        $enable_lazy_launch
965   Enable IME Embed         $enable_ime_embed_app
966   Enable Remote Input      $enable_remote_input
967   Enable OpenInput         $enable_open_input
968 ])
969