1
# Process this file with autoconf to produce a configure script
2
AC_INIT(scim, 1.4.9, suzhe@tsinghua.org.cn)
3
AC_CONFIG_SRCDIR([src/scim.h])
5
###########################################################
6
## Some definitions of Version macros. ##
7
###########################################################
13
SCIM_VERSION=$SCIM_MAJOR_VERSION.$SCIM_MINOR_VERSION.$SCIM_MICRO_VERSION
15
AC_SUBST(SCIM_MAJOR_VERSION)
16
AC_SUBST(SCIM_MINOR_VERSION)
17
AC_SUBST(SCIM_MICRO_VERSION)
18
AC_SUBST(SCIM_VERSION)
20
# libtool versioning for SCIM
22
# increment if the interface has additions, changes, removals.
25
# increment any time the source changes; set to 0 if you increment CURRENT
28
# increment if any interfaces have been added; set to 0
29
# if any interfaces have been removed. removal has
30
# precedence over adding, so set to 0 if both happened.
33
AC_SUBST(SCIM_CURRENT)
34
AC_SUBST(SCIM_REVISION)
37
# Define a string for the earliest version that this release cannot
38
# coexist with. This is used for directory hierarchies.
43
# Define a string for the earliest version that this release has
44
# binary compatibility with. This is used for module locations.
46
SCIM_BINARY_VERSION=1.4.0
47
AC_SUBST(SCIM_BINARY_VERSION)
49
AC_DEFINE_UNQUOTED(SCIM_BINARY_VERSION, "$SCIM_BINARY_VERSION", [The binary version of SCIM library.])
50
AC_DEFINE_UNQUOTED(SCIM_VERSION, "$SCIM_VERSION", [The release version of SCIM library.])
51
AC_DEFINE_UNQUOTED(SCIM_MAJOR_VERSION, $SCIM_MAJOR_VERSION, [The Major version of SCIM library.])
52
AC_DEFINE_UNQUOTED(SCIM_MINOR_VERSION, $SCIM_MINOR_VERSION, [The Minor version of SCIM library.])
53
AC_DEFINE_UNQUOTED(SCIM_MICRO_VERSION, $SCIM_MICRO_VERSION, [The Micro version of SCIM library.])
56
AC_SUBST(GETTEXT_PACKAGE)
57
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext domain])
59
###########################################################
60
## Start Configuration. ##
61
###########################################################
65
AM_CONFIG_HEADER([config.h])
68
ALL_LINGUAS="as bn_IN ca cs de es fi fr gu hi it ja kn ko ml mr nl pa pt_BR ru sk sv ta te vi zh_CN zh_TW"
75
AC_SUBST(LIBTOOL_DEPS)
77
# libtool option to control which symbols are exported
78
# right now, symbols starting with _ are not exported
79
# !!! DO NOT USE IT !!!
80
LIBTOOL_EXPORT_OPTIONS=''
81
AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
83
# Checks for programs.
88
# Checks if doxygen is avaiable
90
AC_ARG_WITH([doxygen],
91
AS_HELP_STRING([--without-doxygen], [Don't build API documentation]) )
94
if test "x$with_doxygen" != "xno"; then
95
AC_PATH_PROG(DOXYGEN, doxygen, no)
98
AM_CONDITIONAL(HAVE_DOXYGEN, test x$DOXYGEN != xno)
101
# Checks if graphviz is available
102
AC_CHECK_PROG(HAVE_GRAPHVIZ, dot, YES, NO)
103
AC_PATH_PROG(DOT, dot)
107
AC_PATH_PROG(PERL, perl)
110
# Checks if xsltproc is available
111
AC_PATH_PROG(XSLTPROC, xsltproc, no)
112
AM_CONDITIONAL(HAVE_XSLTPROC, test x$XSLTPROC != xno)
115
# Checks if docbook-style-xsl is available
117
[/usr/share/sgml/docbook/xsl-stylesheets/html/tldp-html.xsl],
118
[DOCBOOK_XSL=/usr/share/sgml/docbook/xsl-stylesheets/html/tldp-html.xsl],
120
[/usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl],
121
[DOCBOOK_XSL=/usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl],
123
[/usr/share/xml/docbook/stylesheet/nwalsh/current/html/docbook.xsl],
124
[DOCBOOK_XSL=/usr/share/xml/docbook/stylesheet/nwalsh/current/html/docbook.xsl],
130
AC_SUBST(DOCBOOK_XSL)
132
AM_CONDITIONAL(HAVE_DOCBOOK, test x$DOCBOOK_XSL != xno)
133
AM_CONDITIONAL(BUILD_MANUAL, test x$XSLTPROC != xno -a x$DOCBOOK_XSL != xno)
136
IT_PROG_INTLTOOL([0.33], [no-xml])
138
# Checks for libraries.
141
AC_CHECK_HEADERS([langinfo.h libintl.h string.h dirent.h hash_map ext/hash_map])
143
# Checks for typedefs, structures, and compiler characteristics.
148
if test x$ac_cv_type_size_t != xyes; then
149
AC_MSG_ERROR([No type size_t, but SCIM needs it!])
152
AC_CHECK_SIZEOF(char)
153
AC_CHECK_SIZEOF(unsigned short int)
154
AC_CHECK_SIZEOF(unsigned int)
155
AC_CHECK_SIZEOF(unsigned long int)
156
AC_CHECK_SIZEOF(unsigned long long int)
157
AC_CHECK_HEADERS([stdint.h],[has_stdint=yes],[has_stdint=no])
159
if test x$ac_cv_sizeof_unsigned_short_int = x2 && test x$ac_cv_sizeof_char = x1 ; then
164
*** sizeof (unsigned short int) == 2
165
*** sizeof (char) == 1
166
*** You might want to consider using the GNU C compiler.
170
if test x$ac_cv_sizeof_wchar_t = x0 ; then
172
*** SCIM requires a compiler that supports wchar_t,
173
*** You might want to consider using the GNU C compiler.
177
if test x$has_stdint = xyes; then
178
INCLUDE_STDINT="#include <stdint.h>"
183
INCLUDE_STDINT="//#include <stdint.h>"
184
UINT16="unsigned short int"
185
if test x$ac_cv_sizeof_unsigned_int = x4; then
186
UINT32="unsigned int"
188
if test x$ac_cv_sizeof_unsigned_long_int = x4; then
189
UINT32="unsigned long int"
191
AC_MSG_ERROR([*** No suitable integer type for uint32 found.])
194
if test x$ac_cv_sizeof_unsigned_long_long_int = x8; then
195
UINT64="unsigned long long int"
197
AC_MSG_ERROR([*** No suitable integer type for uint64 found.])
200
AC_SUBST(INCLUDE_STDINT)
205
# Checks for library functions.
207
AC_CHECK_FUNCS([gettimeofday memmove memset nl_langinfo setlocale daemon])
208
AC_CHECK_FUNCS([opendir closedir readdir])
209
AC_CHECK_FUNCS([usleep nanosleep])
210
AC_CHECK_FUNCS([gethostbyname gethostbyname_r socket bind accept connect listen],
218
# Check if we should build scim-panel-gtk daemon
219
PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0 pango >= 1.1.0 gdk-pixbuf-2.0 >= 2.4.0],
224
if test "$SCIM_HAS_GTK2" = "yes"; then
225
if $PKG_CONFIG --exists "gtk+-2.0 >= 2.2" ; then
228
AC_DEFINE(GDK_MULTIHEAD_SAFE,1,[Force use of GDK's multihead-safe APIs.])
230
if $PKG_CONFIG --exists "gtk+-2.0 >= 2.3.5" ; then
233
AC_DEFINE(HAVE_GTK_DRAW_INSERTION_CURSOR,1,[Have gtk_draw_insertion_cursor ().])
235
GTK_BINARY_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
236
GTK_LIBDIR=`$PKG_CONFIG --variable=libdir gtk+-2.0`
237
if test -z "$GTK_LIBDIR)"; then
240
GTK_IM_MODULEDIR=$GTK_LIBDIR/gtk-2.0/immodules
242
AC_SUBST(GTK_IM_MODULEDIR)
243
AC_SUBST(GTK_VERSION)
244
AC_SUBST(GTK_BINARY_VERSION)
247
# Check if we have gthread
248
PKG_CHECK_MODULES(GTHREAD2,[gthread-2.0 >= 2.0.0],
249
[SCIM_HAS_GTHREAD2=yes],
250
[SCIM_HAS_GTHREAD2=no])
252
# Checks for X11 header files.
255
# Add -lX11 to X_LIBS
256
if test "$have_x" = "yes"; then
257
X_LIBS="$X_LIBS -lX11"
260
###########################################################
261
## Definiation of compile args. ##
262
###########################################################
263
AC_ARG_WITH(gtk-im-module-dir,
264
AS_HELP_STRING([--with-gtk-im-module-dir=dir],
265
[Select gtk immodule dir]),
266
GTK_IM_MODULEDIR=$with_gtk_im_module_dir)
268
AC_ARG_ENABLE(ld-version-script,
269
[ --enable-ld-version-script Use ld version script to limit exported symbols], ,
270
enable_ld_version_script=no)
273
[ --enable-debug Turn on debugging], ,
277
[ --enable-tests Build tests/*], ,
280
AC_ARG_ENABLE(hash-map,
281
[ --enable-hash-map Use hast_map instead of std::map internally], ,
284
AC_ARG_ENABLE(config-simple,
285
[ --disable-config-simple Do not build Simple Config module], ,
286
enable_config_simple=yes)
288
AC_ARG_ENABLE(config-socket,
289
[ --disable-config-socket Do not build Socket Config module], ,
290
enable_config_socket=yes)
292
AC_ARG_ENABLE(frontend-x11,
293
[ --disable-frontend-x11 Do not build X11 FrontEnd module], ,
294
enable_frontend_x11=yes)
296
AC_ARG_ENABLE(frontend-socket,
297
[ --disable-frontend-socket Do not build Socket FrontEnd module], ,
298
enable_frontend_socket=yes)
300
AC_ARG_ENABLE(im-rawcode,
301
[ --disable-im-rawcode Do not build RawCode IMEngine module], ,
302
enable_im_rawcode=yes)
304
AC_ARG_ENABLE(im-socket,
305
[ --disable-im-socket Do not build Socket IMEngine module], ,
306
enable_im_socket=yes)
308
AC_ARG_ENABLE(filter-sctc,
309
[ --disable-filter-sctc Do not build Simplified/Traditional Chinese conversion Filter module], ,
310
enable_filter_sctc=yes)
312
AC_ARG_ENABLE(gtk2-immodule,
313
[ --disable-gtk2-immodule Do not build GTK2 IMModule], ,
314
enable_gtk2_immodule=yes)
316
AC_ARG_ENABLE(panel-gtk,
317
[ --disable-panel-gtk Do not build GTK2 Panel], ,
318
enable_panel_gtk=check)
320
AC_ARG_ENABLE(setup-ui,
321
[ --disable-setup-ui Do not build Setup UI], ,
324
if test "$have_x" = "yes"; then
325
SCIM_BUILD_X11_UTILS=1
328
SCIM_BUILD_X11_UTILS=0
332
if test "$enable_hash_map" = "yes"; then
333
AC_DEFINE(ENABLE_HASH_MAP,1,[Use hash map instead of map in libscim])
336
if test "$enable_debug" = "yes"; then
337
AC_DEFINE(ENABLE_DEBUG,1,[Define this to enable the debug facility in libscim])
339
CXXFLAGS="$CXXFLAGS -g"
342
if test "$enable_tests" = "yes"; then
349
if test "$enable_config_simple" = "yes"; then
350
SCIM_BUILD_CONFIG_SIMPLE=1
352
SCIM_BUILD_CONFIG_SIMPLE=0
353
enable_config_simple=no
356
if test "$enable_config_socket" = "yes" -a "$socket_ok" = "yes"; then
357
SCIM_BUILD_CONFIG_SOCKET=1
359
SCIM_BUILD_CONFIG_SOCKET=0
360
enable_config_socket=no
363
if test "$enable_frontend_x11" = "yes" -a "$have_x" = "yes"; then
364
SCIM_BUILD_FRONTEND_X11=1
366
SCIM_BUILD_FRONTEND_X11=0
367
enable_frontend_x11=no
370
if test "$enable_frontend_socket" = "yes" -a "$socket_ok" = "yes"; then
371
SCIM_BUILD_FRONTEND_SOCKET=1
373
SCIM_BUILD_FRONTEND_SOCKET=0
374
enable_frontend_socket=no
377
if test "$enable_im_rawcode" = "yes"; then
378
SCIM_BUILD_IMENGINE_RAWCODE=1
380
SCIM_BUILD_IMENGINE_RAWCODE=0
384
if test "$enable_im_socket" = "yes" -a "$socket_ok" = "yes"; then
385
SCIM_BUILD_IMENGINE_SOCKET=1
387
SCIM_BUILD_IMENGINE_SOCKET=0
391
if test "$enable_filter_sctc" = "yes"; then
392
SCIM_BUILD_FILTER_SCTC=1
394
SCIM_BUILD_FILTER_SCTC=0
395
enable_filter_sctc=no
398
if test "$enable_gtk2_immodule" = "yes" -a "$SCIM_HAS_GTK2" = "yes"; then
399
SCIM_BUILD_GTK2_IMMODULE=1
401
SCIM_BUILD_GTK2_IMMODULE=0
402
enable_gtk2_immodule=no
405
if test "$enable_setup_ui" = "yes" -a "$SCIM_HAS_GTK2" = "yes"; then
406
SCIM_BUILD_SCIM_SETUP=1
407
AC_DEFINE(HAVE_SCIM_SETUP,1,[Have scim-setup program.])
409
SCIM_BUILD_SCIM_SETUP=0
413
if test "$SCIM_HAS_GTK2" = "yes"; then
415
SCIM_BUILD_GTK_UTILS=1
418
SCIM_BUILD_GTK_UTILS=0
422
if test "$SCIM_HAS_GTK2_2" = "yes" -a "$no_x" != "yes"; then
424
AC_DEFINE(ENABLE_TRAY_ICON,1,[Enable the TrayIcon code.])
427
SCIM_BUILD_PANEL_GTK=0
428
if test "$enable_panel_gtk" != "no"; then
430
if test "$SCIM_HAS_GTHREAD2" = "yes" -a "$SCIM_HAS_GTK2" = "yes"; then
431
SCIM_BUILD_PANEL_GTK=1
436
#if nothing needs libscim-gtkutils, just disable it
437
if test "$enable_panel_gtk" != "yes" -a "$enable_setup_ui" != "yes"; then
439
SCIM_BUILD_GTK_UTILS=0
442
AM_CONDITIONAL(SCIM_LD_VERSION_SCRIPT,
443
[test "$enable_ld_version_script" = "yes"])
445
AM_CONDITIONAL(SCIM_BUILD_TESTS,
446
[test "$enable_tests" = "yes"])
448
AM_CONDITIONAL(SCIM_BUILD_CONFIG_SIMPLE,
449
[test "$enable_config_simple" = "yes"])
451
AM_CONDITIONAL(SCIM_BUILD_CONFIG_SOCKET,
452
[test "$enable_config_socket" = "yes"])
454
AM_CONDITIONAL(SCIM_BUILD_FRONTEND_X11,
455
[test "$enable_frontend_x11" = "yes"])
457
AM_CONDITIONAL(SCIM_BUILD_FRONTEND_SOCKET,
458
[test "$enable_frontend_socket" = "yes"])
460
AM_CONDITIONAL(SCIM_BUILD_IMENGINE_SOCKET,
461
[test "$enable_im_socket" = "yes"])
463
AM_CONDITIONAL(SCIM_BUILD_IMENGINE_RAWCODE,
464
[test "$enable_im_rawcode" = "yes"])
466
AM_CONDITIONAL(SCIM_BUILD_GTK2_IMMODULE,
467
[test "$enable_gtk2_immodule" = "yes"])
469
AM_CONDITIONAL(SCIM_BUILD_FILTER_SCTC,
470
[test "$enable_filter_sctc" = "yes"])
472
AM_CONDITIONAL(SCIM_BUILD_SCIM_SETUP,
473
[test "$enable_setup_ui" = "yes"])
475
AM_CONDITIONAL(SCIM_BUILD_GTK_UTILS,
476
[test "$enable_gtk_utils" = "yes"])
478
AM_CONDITIONAL(SCIM_BUILD_X11_UTILS,
479
[test "$enable_x11_utils" = "yes"])
481
AM_CONDITIONAL(SCIM_BUILD_TRAY_ICON,
482
[test "$enable_tray_icon" = "yes"])
484
AM_CONDITIONAL(SCIM_BUILD_PANEL_GTK,
485
[test "$enable_panel_gtk" = "yes"])
487
AC_SUBST(SCIM_BUILD_TESTS)
488
AC_SUBST(SCIM_BUILD_CONFIG_SIMPLE)
489
AC_SUBST(SCIM_BUILD_CONFIG_SOCKET)
490
AC_SUBST(SCIM_BUILD_FRONTEND_X11)
491
AC_SUBST(SCIM_BUILD_FRONTEND_SOCKET)
492
AC_SUBST(SCIM_BUILD_IMENGINE_RAWCODE)
493
AC_SUBST(SCIM_BUILD_IMENGINE_TABLE)
494
AC_SUBST(SCIM_BUILD_IMENGINE_SOCKET)
495
AC_SUBST(SCIM_BUILD_FILTER_SCTC)
496
AC_SUBST(SCIM_BUILD_GTK2_IMMODULE)
497
AC_SUBST(SCIM_BUILD_SCIM_SETUP)
498
AC_SUBST(SCIM_BUILD_PANEL_GTK)
499
AC_SUBST(SCIM_BUILD_GTK_UTILS)
500
AC_SUBST(SCIM_BUILD_X11_UTILS)
502
# Output All necessary Paths.
503
SCIM_DATADIR="$datadir/scim"
504
SCIM_SYSCONFDIR="$sysconfdir"
505
SCIM_ICONDIR="$datadir/scim/icons"
506
SCIM_MODULE_PATH="$libdir/scim$SCIM_EPOCH"
507
SCIM_LIBEXECDIR="$libdir/scim$SCIM_EPOCH"
508
SCIM_LOCALEDIR="$datadir/locale"
511
AC_SUBST(SCIM_DATADIR)
512
AC_SUBST(SCIM_SYSCONFDIR)
513
AC_SUBST(SCIM_ICONDIR)
514
AC_SUBST(SCIM_MODULE_PATH)
515
AC_SUBST(SCIM_LIBEXECDIR)
516
AC_SUBST(SCIM_LOCALEDIR)
517
AC_SUBST(SCIM_TEMPDIR)
519
###########################################################
521
###########################################################
523
AC_CONFIG_FILES([Makefile
532
data/pixmaps/Makefile
534
modules/FrontEnd/IMdkit/Makefile
535
modules/FrontEnd/Makefile
536
modules/IMEngine/Makefile
537
modules/Filter/Makefile
538
modules/Config/Makefile
539
modules/SetupUI/Makefile
543
docs/manual/zh_CN/Makefile
544
docs/manual/zh_CN/figures/Makefile
547
extras/gtk2_immodule/Makefile
548
extras/setup/Makefile
549
extras/setup/scim-setup
550
extras/panel/Makefile
563
Version $SCIM_VERSION
564
Install prefix $prefix
565
Build shared libs $enable_shared
566
Build static libs $enable_static
567
Build tests/* $enable_tests
568
Enable debug $enable_debug
569
Enable ld version script $enable_ld_version_script
572
Simple config module $enable_config_simple
573
Socket config module $enable_config_socket
575
X11 FrontEnd module $enable_frontend_x11
576
Socket FrontEnd module $enable_frontend_socket
578
RawCode IMEngine module $enable_im_rawcode
579
Socket IMEngine module $enable_im_socket
581
SCTC Filter module $enable_filter_sctc
583
GTK2 Utility Library $enable_gtk_utils
584
X11 Utility Library $enable_x11_utils
586
GTK2 IMModule $enable_gtk2_immodule
587
GTK2 IMModule dir $GTK_IM_MODULEDIR
589
GUI Setup Utility $enable_setup_ui
591
GTK2 Panel GUI $enable_panel_gtk
593
Enable TrayIcon $enable_tray_icon