Update package version to 3.0.186
[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 if test "$ISF_HAS_VCONF" = "yes"; then
358   AC_DEFINE(HAVE_VCONF,1,[Have VConf functions.])
359 fi
360
361 if test "$ISF_HAS_BLUETOOTH" = "yes"; then
362   AC_DEFINE(HAVE_BLUETOOTH,1,[Have Bluetooth functions.])
363 fi
364
365 if test "$ISF_HAS_FEEDBACK" = "yes"; then
366   AC_DEFINE(HAVE_FEEDBACK,1,[Have Feedback functions.])
367 fi
368
369 if test "$ISF_HAS_NOTIFICATION" = "yes"; then
370   AC_DEFINE(HAVE_NOTIFICATION,1,[Have Notification functions.])
371 fi
372
373 if test "$ISF_HAS_PKGMGR_INFO" = "yes"; then
374   AC_DEFINE(HAVE_PKGMGR_INFO,1,[Have Package manager functions.])
375 fi
376
377 # Check GTK2 library
378 PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0 pango >= 1.1.0 gdk-pixbuf-2.0 >= 2.4.0],
379                   [SCIM_HAS_GTK2=yes],
380                   [SCIM_HAS_GTK2=no])
381
382 SCIM_HAS_GTK2_2=no
383 if test "$SCIM_HAS_GTK2" = "yes"; then
384   if $PKG_CONFIG --exists "gtk+-2.0 >= 2.2" ; then
385     SCIM_HAS_GTK2_2=yes
386     GTK_VERSION=2.2.0
387     AC_DEFINE(GDK_MULTIHEAD_SAFE,1,[Force use of GDK's multihead-safe APIs.])
388   fi
389   if $PKG_CONFIG --exists "gtk+-2.0 >= 2.3.5" ; then
390     SCIM_HAS_GTK2_4=yes
391     GTK_VERSION=2.3.5
392     AC_DEFINE(HAVE_GTK_DRAW_INSERTION_CURSOR,1,[Have gtk_draw_insertion_cursor ().])
393   fi
394   GTK_BINARY_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
395   GTK_LIBDIR=`$PKG_CONFIG --variable=libdir gtk+-2.0`
396   if test -z "$GTK_LIBDIR)"; then
397     GTK_LIBDIR="$libdir"
398   fi
399   GTK_IM_MODULEDIR=$GTK_LIBDIR/gtk-2.0/$GTK_BINARY_VERSION/immodules
400   AC_SUBST(GTK_LIBDIR)
401   AC_SUBST(GTK_IM_MODULEDIR)
402   AC_SUBST(GTK_VERSION)
403   AC_SUBST(GTK_BINARY_VERSION)
404 fi
405
406 # Check if we have gthread
407 PKG_CHECK_MODULES(GTHREAD2,[gthread-2.0 >= 2.0.0],
408                   [SCIM_HAS_GTHREAD2=yes],
409                   [SCIM_HAS_GTHREAD2=no])
410
411 # Checks for X11 header files.
412 AC_PATH_XTRA
413
414 # Add -lX11 to X_LIBS
415 if test "$have_x" = "yes"; then
416   X_LIBS="$X_LIBS -lX11"
417 fi
418
419 case $host_cpu in
420   *arm* ) TARGET=ARM;;
421       * ) TARGET=X86;;
422 esac
423 AM_CONDITIONAL(ARM, test x$TARGET = xARM)
424
425 ###########################################################
426 ##             Definiation of compile args.              ##
427 ###########################################################
428 AC_ARG_WITH(gtk-im-module-dir,
429             AS_HELP_STRING([--with-gtk-im-module-dir=dir],
430                            [Select gtk immodule dir]),
431             GTK_IM_MODULEDIR=$with_gtk_im_module_dir)
432
433 AC_ARG_WITH(efl-im-module-dir,
434             AS_HELP_STRING([--with-efl-im-module-dir=dir],
435                            [Select efl immodule dir]),
436             EFL_IM_MODULEDIR=$with_efl_im_module_dir)
437
438 AC_ARG_WITH(wayland-im-module-dir,
439             AS_HELP_STRING([--with-wayland-im-module-dir=dir],
440                            [Select wayland immodule dir]),
441             WAYLAND_IM_MODULEDIR=$with_wayland_im_module_dir)
442
443 AC_ARG_WITH(ro-app-dir,
444             AS_HELP_STRING([--with-ro-app-dir=dir],
445                            [Select Read only application dir]),
446             RO_APP_DIR=$with_ro_app_dir)
447
448 AC_ARG_WITH(ro-packages-dir,
449             AS_HELP_STRING([--with-ro-app-dir=dir],
450                            [Select Read only packages dir]),
451             RO_PACKAGES_DIR=$with_ro_packages_dir)
452
453 AC_ARG_ENABLE(ld-version-script,
454               [  --enable-ld-version-script Use ld version script to limit exported symbols],
455               enable_ld_version_script=yes,
456               enable_ld_version_script=no)
457
458 AC_ARG_ENABLE(debug,
459               [  --enable-debug            Turn on debugging],
460               enable_debug=yes,
461               enable_debug=no)
462
463 AC_ARG_ENABLE(x86,
464               [  --enable-x86              Build for x86 host],
465               enable_x86=yes,
466               enable_x86=no)
467
468 AC_ARG_ENABLE(hash-map,
469               [  --enable-hash-map         Use hast_map instead of std::map internally],
470               enable_hash_map=yes,
471               enable_hash_map=no)
472
473 AC_ARG_ENABLE(config-simple,
474               [  --disable-config-simple   Do not build Simple Config module],
475               enable_config_simple=no,
476               enable_config_simple=yes)
477
478 AC_ARG_ENABLE(config-socket,
479               [  --disable-config-socket   Do not build Socket Config module],
480               enable_config_socket=no,
481               enable_config_socket=yes)
482
483 AC_ARG_ENABLE(frontend-x11,
484               [  --disable-frontend-x11    Do not build X11 FrontEnd module],
485               enable_frontend_x11=no,
486               enable_frontend_x11=yes)
487
488 AC_ARG_ENABLE(frontend-socket,
489               [  --disable-frontend-socket Do not build Socket FrontEnd module],
490               enable_frontend_socket=no,
491               enable_frontend_socket=yes)
492
493 AC_ARG_ENABLE(im-socket,
494               [  --disable-im-socket       Do not build Socket IMEngine module],
495               enable_im_socket=no,
496               enable_im_socket=yes)
497
498 AC_ARG_ENABLE(filter-sctc,
499               [  --disable-filter-sctc     Do not build Simplified/Traditional Chinese conversion Filter module],
500               enable_filter_sctc=no,
501               enable_filter_sctc=yes)
502
503 AC_ARG_ENABLE(gtk2-immodule,
504               [  --disable-gtk2-immodule   Do not build GTK2 IMModule],
505               enable_gtk2_immodule=no,
506               enable_gtk2_immodule=yes)
507
508 AC_ARG_ENABLE(efl-immodule,
509               [  --disable-efl-immodule    Do not build EFL IMModule],
510               enable_efl_immodule=no,
511               enable_efl_immodule=yes)
512
513 AC_ARG_ENABLE(wayland-immodule,
514               [  --disable-wayland-immodule    Do not build Wayland IMModule],
515               enable_wayland_immodule=no,
516               enable_wayland_immodule=yes)
517
518 AC_ARG_ENABLE(panel-efl,
519               [  --disable-panel-efl       Do not build EFL Panel],
520               enable_panel_efl=no,
521               enable_panel_efl=check)
522
523 AC_ARG_ENABLE(tray-icon,
524               [  --disable-tray-icon       Do not build Tray Icon],
525               enable_tray_icon=no,
526               enable_tray_icon=yes)
527
528 AC_ARG_ENABLE(multiwindow-support,
529               [  --disable-multiwindow-support       Do not build Multiwindow Support],
530               enable_multiwindow_support=no,
531               enable_multiwindow_support=yes)
532
533 AC_ARG_ENABLE(lazy-launch,
534               [  --enable-lazy-launch      Launch ISF when focusing in entry],
535               enable_lazy_launch=yes,
536               enable_lazy_launch=no)
537
538 AC_ARG_ENABLE(ime-embed-app,
539               [  --disable-ime-embed-app      Do not load IME in application when socket invalidate],
540               enable_ime_embed_app=no,
541               enable_ime_embed_app=yes)
542
543 if test "$have_x" = "yes"; then
544   SCIM_BUILD_X11_UTILS=1
545   enable_x11_utils=yes
546 else
547   SCIM_BUILD_X11_UTILS=0
548   enable_x11_utils=no
549 fi
550
551 if test "$enable_hash_map" = "yes"; then
552   AC_DEFINE(ENABLE_HASH_MAP,1,[Use hash map instead of map in libscim])
553 fi
554
555 if test "$enable_debug" = "yes"; then
556   AC_DEFINE(ENABLE_DEBUG,1,[Define this to enable the debug facility in libscim])
557   CFLAGS="$CFLAGS -g"
558   CXXFLAGS="$CXXFLAGS -g"
559 fi
560
561 if test "$enable_x86" = "yes"; then
562   AC_DEFINE(ENABLE_X86_HOST,1,[Build for x86 host])
563 fi
564
565 if test "$enable_tests" = "yes"; then
566   SCIM_BUILD_TESTS=1
567 else
568   SCIM_BUILD_TESTS=0
569   enable_tests=no
570 fi
571
572 if test "$enable_config_simple" = "yes"; then
573   SCIM_BUILD_CONFIG_SIMPLE=1
574 else
575   SCIM_BUILD_CONFIG_SIMPLE=0
576   enable_config_simple=no
577 fi
578
579 if test "$enable_config_socket" = "yes" -a "$socket_ok" = "yes"; then
580   SCIM_BUILD_CONFIG_SOCKET=1
581 else
582   SCIM_BUILD_CONFIG_SOCKET=0
583   enable_config_socket=no
584 fi
585
586 if test "$enable_frontend_x11" = "yes" -a "$have_x" = "yes"; then
587   SCIM_BUILD_FRONTEND_X11=1
588 else
589   SCIM_BUILD_FRONTEND_X11=0
590   enable_frontend_x11=no
591 fi
592
593 if test "$enable_frontend_socket" = "yes" -a "$socket_ok" = "yes"; then
594   SCIM_BUILD_FRONTEND_SOCKET=1
595 else
596   SCIM_BUILD_FRONTEND_SOCKET=0
597   enable_frontend_socket=no
598 fi
599
600 if test "$enable_im_rawcode" = "yes"; then
601   SCIM_BUILD_IMENGINE_RAWCODE=1
602 else
603   SCIM_BUILD_IMENGINE_RAWCODE=0
604   enable_im_rawcode=no
605 fi
606
607 if test "$enable_im_socket" = "yes" -a "$socket_ok" = "yes"; then
608   SCIM_BUILD_IMENGINE_SOCKET=1
609 else
610   SCIM_BUILD_IMENGINE_SOCKET=0
611   enable_im_socket=no
612 fi
613
614 if test "$enable_filter_sctc" = "yes"; then
615   SCIM_BUILD_FILTER_SCTC=1
616 else
617   SCIM_BUILD_FILTER_SCTC=0
618   enable_filter_sctc=no
619 fi
620
621 if test "$enable_gtk2_immodule" = "yes" -a "$SCIM_HAS_GTK2" = "yes"; then
622   SCIM_BUILD_GTK2_IMMODULE=1
623 else
624   SCIM_BUILD_GTK2_IMMODULE=0
625   enable_gtk2_immodule=no
626 fi
627
628 if test "$SCIM_HAS_GTK2" = "yes"; then
629   enable_gtk_utils=yes
630   SCIM_BUILD_GTK_UTILS=1
631 else
632   enable_gtk_utils=no
633   SCIM_BUILD_GTK_UTILS=0
634 fi
635
636 if test "$enable_tray_icon" = "yes"; then
637   if test "$SCIM_HAS_GTK2_2" = "yes" -a "$no_x" != "yes"; then
638     enable_tray_icon=yes
639     AC_DEFINE(ENABLE_TRAY_ICON,1,[Enable the TrayIcon code.])
640   fi
641 else
642   enable_tray_icon=no
643 fi
644
645 if test "$enable_multiwindow_support" = "yes"; then
646   enable_multiwindow_support=yes
647   AC_DEFINE(ENABLE_MULTIWINDOW_SUPPORT,1,[Enable the Multi Window code.])
648 else
649   enable_multiwindow_support=no
650 fi
651
652 if test "$enable_efl_immodule" = "yes" -a "$ISF_HAS_ECORE_IMF" = "yes"; then
653   ISF_BUILD_EFL_IMMODULE=1
654 else
655   ISF_BUILD_EFL_IMMODULE=0
656   enable_efl_immodule=no
657 fi
658
659 if test "$enable_wayland_immodule" = "yes" -a "$ISF_HAS_ECORE_IMF" = "yes"; then
660   ISF_BUILD_WAYLAND_IMMODULE=1
661 else
662   ISF_BUILD_WAYLAND_IMMODULE=0
663   enable_wayland_immodule=no
664 fi
665
666 ISF_BUILD_PANEL_EFL=0
667 if test "$enable_panel_efl" != "no"; then
668   enable_panel_efl=no
669   if test "$ISF_HAS_ELM" = "yes"; then
670     ISF_BUILD_PANEL_EFL=1
671     enable_panel_efl=yes
672   fi
673 fi
674
675 ISF_BUILD_REMOTE_INPUT=0
676 if test "$enable_remote_input" != "no"; then
677   enable_remote_input=no
678   if test "$ISF_HAS_LIBWEBSOCKETS" = "yes"; then
679     ISF_BUILD_REMOTE_INPUT=1
680     enable_remote_input=yes
681   fi
682 fi
683
684 #if nothing needs libscim-gtkutils, just disable it
685 if test "$enable_panel_gtk" != "yes"; then
686   enable_gtk_utils=no
687   SCIM_BUILD_GTK_UTILS=0
688 fi
689
690 AM_CONDITIONAL(HAVE_X,
691                 [test "$have_x" = "yes"])
692
693 if test "$enable_lazy_launch" = "yes"; then
694   AC_DEFINE(ENABLE_LAZY_LAUNCH,1,[Launch ISF when focusing in entry])
695   ISF_INSTALL_SYSTEMD_SCRIPT=0
696 else
697   ISF_INSTALL_SYSTEMD_SCRIPT=1
698 fi
699
700 if test "$enable_ime_embed_app" = "yes"; then
701   AC_DEFINE(ENABLE_IME_EMBED_APP,1,[Load imengine in application side when socket invalidate])
702 fi
703
704 AM_CONDITIONAL(SCIM_LD_VERSION_SCRIPT,
705                 [test "$enable_ld_version_script" = "yes"])
706
707 AM_CONDITIONAL(SCIM_BUILD_TESTS,
708                 [test "$enable_tests" = "yes"])
709
710 AM_CONDITIONAL(SCIM_BUILD_CONFIG_SIMPLE,
711                 [test "$enable_config_simple" = "yes"])
712
713 AM_CONDITIONAL(SCIM_BUILD_CONFIG_SOCKET,
714                 [test "$enable_config_socket" = "yes"])
715
716 AM_CONDITIONAL(SCIM_BUILD_FRONTEND_X11,
717                 [test "$enable_frontend_x11" = "yes"])
718
719 AM_CONDITIONAL(SCIM_BUILD_FRONTEND_SOCKET,
720                 [test "$enable_frontend_socket" = "yes"])
721
722 AM_CONDITIONAL(SCIM_BUILD_IMENGINE_SOCKET,
723                 [test "$enable_im_socket" = "yes"])
724
725 AM_CONDITIONAL(SCIM_BUILD_IMENGINE_RAWCODE,
726                 [test "$enable_im_rawcode" = "yes"])
727
728 AM_CONDITIONAL(SCIM_BUILD_GTK2_IMMODULE,
729                 [test "$enable_gtk2_immodule" = "yes"])
730
731 AM_CONDITIONAL(SCIM_BUILD_FILTER_SCTC,
732                 [test "$enable_filter_sctc" = "yes"])
733
734 AM_CONDITIONAL(SCIM_BUILD_GTK_UTILS,
735                 [test "$enable_gtk_utils" = "yes"])
736
737 AM_CONDITIONAL(SCIM_BUILD_X11_UTILS,
738                 [test "$enable_x11_utils" = "yes"])
739
740 AM_CONDITIONAL(SCIM_BUILD_TRAY_ICON,
741                 [test "$enable_tray_icon" = "yes"])
742
743 AM_CONDITIONAL(ISF_BUILD_EFL_IMMODULE,
744                 [test "$enable_efl_immodule" = "yes"])
745
746 AM_CONDITIONAL(ISF_BUILD_WAYLAND_IMMODULE,
747                 [test "$enable_wayland_immodule" = "yes"])
748
749 AM_CONDITIONAL(ISF_BUILD_PANEL_EFL,
750                 [test "$enable_panel_efl" = "yes"])
751
752 AM_CONDITIONAL(ISF_BUILD_REMOTE_INPUT,
753                 [test "$enable_remote_input" = "yes"])
754
755 AM_CONDITIONAL(ISF_BUILD_DB_UTIL,
756                 [test "$ISF_HAS_DB_UTIL" = "yes"])
757
758 AM_CONDITIONAL(ISF_INSTALL_SYSTEMD_SCRIPT,
759                 [test "$enable_lazy_launch" = "no"])
760
761 AC_SUBST(SCIM_BUILD_TESTS)
762 AC_SUBST(SCIM_BUILD_CONFIG_SIMPLE)
763 AC_SUBST(SCIM_BUILD_CONFIG_SOCKET)
764 AC_SUBST(SCIM_BUILD_FRONTEND_X11)
765 AC_SUBST(SCIM_BUILD_FRONTEND_SOCKET)
766 AC_SUBST(SCIM_BUILD_IMENGINE_RAWCODE)
767 AC_SUBST(SCIM_BUILD_IMENGINE_TABLE)
768 AC_SUBST(SCIM_BUILD_IMENGINE_SOCKET)
769 AC_SUBST(SCIM_BUILD_FILTER_SCTC)
770 AC_SUBST(SCIM_BUILD_GTK2_IMMODULE)
771 AC_SUBST(SCIM_BUILD_SCIM_SETUP)
772 AC_SUBST(SCIM_BUILD_GTK_UTILS)
773 AC_SUBST(SCIM_BUILD_X11_UTILS)
774 AC_SUBST(ISF_BUILD_EFL_IMMODULE)
775 AC_SUBST(ISF_BUILD_PANEL_EFL)
776 AC_SUBST(ISF_BUILD_REMOTE_INPUT)
777 AC_SUBST(ISF_BUILD_DB_UTIL)
778 AC_SUBST(ISF_INSTALL_SYSTEMD_SCRIPT)
779 AC_SUBST(ISF_BUILD_KBD_MODE_CHANGER)
780
781 ISF_BUILDING_DLL="-DISF_BUILDING_DLL"
782 AC_SUBST(ISF_BUILDING_DLL)
783
784 # Output All necessary Paths.
785 SCIM_BINDIR="$prefix/bin"
786 SCIM_DATADIR="$datadir/scim"
787 SCIM_SYSCONFDIR="$sysconfdir"
788 SCIM_ICONDIR="$datadir/scim/icons"
789 SCIM_MODULE_PATH="$libdir/scim$SCIM_EPOCH"
790 SCIM_LIBEXECDIR="$libdir/scim$SCIM_EPOCH"
791 SCIM_LOCALEDIR="/usr/share/locale"
792 SCIM_TEMPDIR="/tmp"
793
794 AC_SUBST(SCIM_BINDIR)
795 AC_SUBST(SCIM_DATADIR)
796 AC_SUBST(SCIM_SYSCONFDIR)
797 AC_SUBST(SCIM_ICONDIR)
798 AC_SUBST(SCIM_MODULE_PATH)
799 AC_SUBST(SCIM_LIBEXECDIR)
800 AC_SUBST(SCIM_LOCALEDIR)
801 AC_SUBST(SCIM_TEMPDIR)
802
803 AC_SUBST(RO_APP_DIR)
804 AC_SUBST(RO_PACKAGES_DIR)
805
806 ###########################################################
807 ##                      Output files.                    ##
808 ###########################################################
809 AC_SUBST(ac_aux_dir)
810 AC_CONFIG_FILES([Makefile
811                  po/Makefile.in
812                  ism/src/Makefile
813                  ism/src/scim_types.h
814                  ism/utils/Makefile
815                  ism/data/Makefile
816                  ism/data/icons/Makefile
817                  ism/data/pixmaps/Makefile
818                  ism/modules/Makefile
819                  ism/modules/frontend/imdkit/Makefile
820                  ism/modules/frontend/Makefile
821                  ism/modules/imengine/Makefile
822                  ism/modules/filter/Makefile
823                  ism/modules/config/Makefile
824                  ism/modules/panelagent/ecoresocket/Makefile
825                  ism/modules/panelagent/wayland/Makefile
826                  ism/modules/panelagent/socketconfigserver/Makefile
827                  ism/configs/Makefile
828                  ism/extras/Makefile
829                  ism/extras/gtk2_immodule/Makefile
830                  ism/extras/efl_immodule/Makefile
831                  ism/extras/wayland_immodule/Makefile
832                  ism/extras/efl_panel/Makefile
833                  ism/extras/kbd_mode_changer/Makefile
834                  ism/extras/pkgmgr_parser/Makefile
835                  ism/demos/Makefile
836                  intltool-extract
837                  intltool-merge
838                  intltool-update
839                  isf.pc
840                  scim.pc
841                  scim-gtkutils.pc
842                  scim.spec])
843 AC_OUTPUT
844
845 AC_MSG_RESULT([
846 Build options:
847   Version                  $ISF_VERSION
848   Install prefix           $prefix
849   Build shared libs        $enable_shared
850   Build static libs        $enable_static
851   Enable debug             $enable_debug
852   Build for x86 host       $enable_x86
853   Enable ld version script $enable_ld_version_script
854
855 Module options:
856   Simple config module     $enable_config_simple
857   Socket config module     $enable_config_socket
858
859   X11 FrontEnd module      $enable_frontend_x11
860   Socket FrontEnd module   $enable_frontend_socket
861
862   Socket IMEngine module   $enable_im_socket
863
864   SCTC Filter module       $enable_filter_sctc
865
866   GTK2 Utility Library     $enable_gtk_utils
867   X11 Utility Library      $enable_x11_utils
868
869   GTK2 IMModule            $enable_gtk2_immodule
870   GTK2 IMModule dir        $GTK_IM_MODULEDIR
871
872   EFL  IMModule            $enable_efl_immodule
873   EFL  IMModule dir        $EFL_IM_MODULEDIR
874
875   Wayland IMModule         $enable_wayland_immodule
876   Wayland IMModule dir     $WAYLAND_IM_MODULEDIR
877
878   EFL  Panel GUI           $enable_panel_efl
879
880   Enable TrayIcon          $enable_tray_icon
881   Enable MultiWindow       $enable_multiwindow_support
882   Enable LazyLaunch        $enable_lazy_launch
883   Enable IME Embed         $enable_ime_embed_app
884   Enable Remote Input      $enable_remote_input
885 ])
886