File: configure.ac

package info (click to toggle)
kazehakase 0.5.8-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 8,184 kB
  • ctags: 7,837
  • sloc: ansic: 64,119; sh: 19,622; cpp: 12,601; ruby: 1,590; makefile: 1,437; xml: 464
file content (689 lines) | stat: -rw-r--r-- 20,375 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)

AC_INIT(kazehakase, 0.5.8)
AM_INIT_AUTOMAKE(1.6)
AM_CONFIG_HEADER(config.h)

AC_CANONICAL_HOST

AC_MSG_CHECKING([for native Win32])
case "$host" in
  *-*-mingw*)
    os_win32=yes
    ;;
  *)
    os_win32=no
    ;;
esac
AC_MSG_RESULT([$os_win32])

AC_MSG_CHECKING([for some Win32 platform])
case "$host" in
  *-*-mingw*|*-*-cygwin*)
    platform="win32"
    ;;
  *-apple-darwin*)
    platform="os x"
    ;;
  *)
    platform="unix"
    ;;
esac
AC_MSG_RESULT([$platform])

AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform" = "win32")
AM_CONDITIONAL(PLATFORM_OSX, test "$platform" = "os x")

AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)

AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
DOLT

LT_CURRENT=1
LT_REVISION=0
LT_AGE=1
LT_VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE"
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_SUBST(LT_VERSION_INFO)

LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
AC_SUBST(LT_CURRENT_MINUS_AGE)

LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
AC_SUBST(LIBTOOL_EXPORT_OPTIONS)

AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])

AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_AWK

dnl disable RTTI by default
AC_ARG_ENABLE(cpp-rtti,
        [  --enable-cpp-rtti       Enable C++ RTTI (for cvs gcc)],,
        enable_cpp_rtti=no)

if test "x$enable_cpp_rtti" = "xno"; then
  AM_CXXFLAGS="-fno-rtti $AM_CXXFLAGS"
fi

dnl **************************************************************
dnl Configure for module direcotry.
dnl **************************************************************
kzlibdir="\$(libdir)/\$(PACKAGE)"
AC_SUBST(kzlibdir)

dnl **************************************************************
dnl Configure for embed module.
dnl **************************************************************
embeddir="\$(kzlibdir)/embed"
AC_SUBST(embeddir)

dnl **************************************************************
dnl Check for GtkMozEmbed.
dnl **************************************************************

KAZEHAKASE_GECKO_CHECK

dnl **************************************************************
dnl Check for Gtk+2.
dnl **************************************************************
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified
dnl in MODULES, pass to pkg-config
AM_PATH_GTK_2_0(2.17.7, , ,[gthread])
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)

dnl **************************************************************
dnl Check for GIO
dnl **************************************************************
PKG_CHECK_MODULES(GIO, gio-2.0)

dnl **************************************************************
dnl Check for D-Bus GLib
dnl **************************************************************
PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1)

dnl **************************************************************
dnl Check for MozWebView
dnl **************************************************************

moz_web_view_exists=no
PKG_CHECK_MODULES(MOZ_WEB_VIEW, libmozwebview >= 0.0.1,
		  [moz_web_view_exists=yes], [moz_web_view_exists=no])
AC_SUBST([MOZ_WEB_VIEW_CFLAGS])
AC_SUBST([MOZ_WEB_VIEW_LIBS])
if test x"$moz_web_view_exists" = "xyes"; then
  moz_web_view_available=yes
else
  moz_web_view_available=no
fi

AM_CONDITIONAL([WITH_MOZ_WEB_VIEW], [test $moz_web_view_available = "yes"])


dnl **************************************************************
dnl Check for GtkIEEmbed
dnl **************************************************************

gtk_ie_embed_exists=no
PKG_CHECK_MODULES(GTKIEEMBED, gtkieembed >= 0.9.1,
		  [gtk_ie_embed_exists=yes], [gtk_ie_embed_exists=no])
AC_SUBST([GTKIEEMBED_CFLAGS])
AC_SUBST([GTKIEEMBED_LIBS])
if test x"$gtk_ie_embed_exists" = "xyes"; then
  gtk_ie_embed_available=yes
  AC_DEFINE(WITH_GTK_IE_EMBED, 1, [Define to 1 if you use GtkIEEmbed])
else
  gtk_ie_embed_available=no
fi

AM_CONDITIONAL([WITH_GTK_IE_EMBED], [test $gtk_ie_embed_available = "yes"])

dnl **************************************************************
dnl Check for WebKit/GTK+
dnl **************************************************************

webkit_gtk_exists=no
PKG_CHECK_MODULES(WEBKITGTK, webkit-1.0 >= 1.1.1,
		  [webkit_gtk_exists=yes], [webkit_gtk_exists=no])
AC_SUBST([WEBKITGTK_CFLAGS])
AC_SUBST([WEBKITGTK_LIBS])
if test x"$webkit_gtk_exists" = "xyes"; then
  webkit_gtk_available=yes
  AC_DEFINE(WITH_WEBKIT_GTK, 1, [Define to 1 if you use WebKit/GTK+])
else
  webkit_gtk_available=no
fi

AM_CONDITIONAL([WITH_WEBKIT_GTK], [test $webkit_gtk_available = "yes"])

dnl **************************************************************
dnl Check for GNU TLS
dnl **************************************************************
AC_ARG_ENABLE(ssl, [  --disable-ssl
 			  Disable GNU TLS suport],,
			  disable_ssl=no)
if test x"$disable_ssl" = "xno"; then
   PKG_CHECK_MODULES(LIBGNUTLS, gnutls >= 1.2.0,
	AC_DEFINE(USE_SSL, 1, [Define using GNU TLS]),
	AC_MSG_WARN([[libgnutls was not found.]]))
fi
AC_SUBST([LIBGNUTLS_CFLAGS])
AC_SUBST([LIBGNUTLS_LIBS])
AM_CONDITIONAL(ENABLE_SSL, test x"$disable_ssl" = "xno")

dnl **************************************************************
dnl Check for Session Management
dnl **************************************************************

EGG_CFLAGS="$GTK_CFLAGS"
EGG_LIBS="$GTK_LIBS"
AC_SUBST(EGG_CFLAGS)
AC_SUBST(EGG_LIBS)

AC_PATH_XTRA

SM_LIBS=""
sm_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"

HAVE_SM=true
AC_CHECK_LIB(SM, SmcSaveYourselfDone,
	[SM_LIBS="$X_LIBS -lSM -lICE"],HAVE_SM=false,
	$X_LIBS -lICE)
AC_CHECK_HEADERS(X11/SM/SMlib.h,,HAVE_SM=false)
if test "$HAVE_SM" = true; then
	AC_DEFINE(HAVE_LIBSM, 1, [Define to 1 if you have libSM installed])
fi

AC_SUBST(SM_LIBS)
CPPFLAGS="$sm_save_cppflags"

dnl **************************************************************
dnl Check for gettext.
dnl **************************************************************
IT_PROG_INTLTOOL([0.35.0])

AM_GLIB_GNU_GETTEXT
dnl should run after AM_GLIB_GNU_GETTEXT
AC_CONFIG_COMMANDS([rgettext], [
sed \
  -i'' \
  -e "s/EXTRA_DISTFILES = /EXTRA_DISTFILES = rgettext.mk.in /
      s/^itlocaledir = /itlocaledir = \$(datadir)\/locale\n#itlocaledir = /
      /	\$(GENPOT)/r po/rgettext.mk
     " \
  po/Makefile
])

GETTEXT_PACKAGE=kazehakase
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext domain])

dnl **************************************************************
dnl Checks for programs.
dnl **************************************************************

AC_ARG_ENABLE(Werror, [  --enable-Werror         Enable -Werror option for GCC])

if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
  *[\ \	]-Wall[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wall" ;;
  esac

  case " $CFLAGS " in
  *[\ \	]-Wmissing-declarations[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
  esac

  case " $CFLAGS " in
  *[\ \	]-Wmissing-prototypes[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
  esac

  case " $CFLAGS " in
  *[\ \	]-Wpointer-arith[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
  esac

  case " $CFLAGS " in
  *[\ \	]-Wcast-align[\ \	]*) ;;
  *) CFLAGS="$CFLAGS -Wcast-align" ;;
  esac

  if test "x$enable_Werror" = "xyes"; then
    case " $CFLAGS " in
    *[\ \	]-Werror[\ \	]*) ;;
    *) CFLAGS="$CFLAGS -Werror" ;;
    esac
  fi

  if test "x$enable_ansi" = "xyes"; then
    case " $CFLAGS " in
    *[\ \	]-ansi[\ \	]*) ;;
    *) CFLAGS="$CFLAGS -ansi" ;;
    esac

    case " $CFLAGS " in
    *[\ \	]-pedantic[\ \	]*) ;;
    *) CFLAGS="$CFLAGS -pedantic" ;;
    esac
  fi
fi

dnl **************************************************************
dnl Checks for libraries.
dnl **************************************************************
# FIXME: Replace `main' with a function in `-le':
AC_CHECK_LIB([e], [main])
# FIXME: Replace `main' with a function in `-links':
AC_CHECK_LIB([inks], [main])


AC_CHECK_HEADER(winsock2.h,
[AC_CACHE_CHECK([for socket in -lwsock32], [ac_kz_lib_wsock32],
   [LIBS_save=$LIBS
    LIBS="-lwsock32 $LIBS"
    AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <winsock2.h>
                                    ],
				    [socket(0,0,0)])],
		   [AS_VAR_SET([ac_kz_lib_wsock32], [yes])
		    SOCKET_LIBS="-lwsock32 $SOCKET_LIBS"],
		   [AS_VAR_SET([ac_kz_lib_wsock32], [no])])
    LIBS=$LIBS_save])

 AC_CACHE_CHECK([for WSASocket in -lws2_32], [ac_kz_lib_ws2_32],
   [LIBS_save=$LIBS
    LIBS="-lws2_32 $LIBS"
    AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <winsock2.h>
                                    ],
				    [WSASocket(0,0,0,0,0,0)])],
		   [AS_VAR_SET([ac_kz_lib_ws2_32], [yes])
		    SOCKET_LIBS="-lws2_32 $SOCKET_LIBS"],
		   [AS_VAR_SET([ac_kz_lib_ws2_32], [no])])
    LIBS=$LIBS_save])])
AC_SUBST(SOCKET_LIBS)

dnl chekc zlib
AC_CHECK_HEADER(zlib.h,
    [
    dnl zlib.h was found
    HAVE_ZLIB_H="1"
    dnl if the lib wasn't found already, try again with the new paths
    if test "$HAVE_LIBZ" != "1"; then
      AC_CHECK_LIB(z, gzread,
                   [
                   dnl the lib was found!
                   HAVE_LIBZ="1"
                   ],
                   [ CPPFLAGS=$_cppflags
                   LDFLAGS=$_ldflags])
    fi
    ],
    [
      dnl zlib.h was not found, restore the flags
      CPPFLAGS=$_cppflags
      LDFLAGS=$_ldflags]
    )
if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
    then
    AC_MSG_WARN([configure found only the libz lib, not the header file!])
elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
    then
    AC_MSG_WARN([configure found only the libz header file, not the lib!])
elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
    then
    ZLIB_LIBS=-lz
    AC_SUBST(ZLIB_LIBS)
fi

dnl **************************************************************
dnl Checks for header files.
dnl **************************************************************
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h libintl.h stdlib.h string.h unistd.h])
AC_CHECK_HEADERS([sys/utsname.h])


dnl **************************************************************
dnl Checks for typedefs, structures, and compiler characteristics.
dnl **************************************************************
AC_C_CONST


dnl **************************************************************
dnl Checks for library functions.
dnl **************************************************************
AC_CHECK_FUNCS([setlocale strchr strtol uname memmove strerror])
AC_CHECK_FUNC([strptime], [have_strptime=yes], [have_strptime=no])
AM_CONDITIONAL(HAVE_STRPTIME, test x"$have_strptime" = "xyes")
if test x"$have_strptime" = "xyes"; then
  AC_DEFINE(HAVE_STRPTIME, 1, [Define strptime])
fi

dnl **************************************************************
dnl Migemo
dnl **************************************************************

AC_ARG_ENABLE([migemo],
              AS_HELP_STRING([--enable-migemo]
                             [Enable Migemo (Japanese incremental search)]))
if test -z $enable_migemo; then
  enable_migemo=no
fi

if test x"$enable_migemo" = "xyes"; then
   AC_DEFINE(USE_MIGEMO, 1, [Define using Migemo support])
fi

dnl **************************************************************
dnl Configure for extentions.
dnl **************************************************************
extdir="\$(kzlibdir)/ext"
AC_SUBST(extdir)

dnl **************************************************************
dnl Extention: Check for Ruby.
dnl **************************************************************
ruby_available="no"
AC_ARG_WITH([ruby],
            AS_HELP_STRING([--with-ruby=PATH],
                           [Ruby interpreter path (default: auto-detect)]),
            [RUBY="$withval"])

if test "$RUBY" = "no"; then
  : # ignore
elif test "$RUBY" = ""; then
  AC_PATH_PROG(RUBY, ruby, none)
  if test "$RUBY" != "none"; then
    ruby_available="yes"
  fi
else
  AC_CHECK_FILE([$RUBY],
                [ruby_available="yes"],
                [AC_MSG_WARN([$RUBY is not found. Disable Ruby extension.])])
fi

if test "$ruby_available" = "yes"; then
  rbconfig="$RUBY -rrbconfig -e "

  changequote(<<, >>)
  for var_name in archdir sitearchdir CFLAGS LIBRUBYARG LIBS libdir; do
    rbconfig_tmp=`$rbconfig "print Config::CONFIG['$var_name']"`
    eval "rbconfig_$var_name=\"$rbconfig_tmp\""
  done
  changequote([, ])

  RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_archdir "
  RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_sitearchdir "
  RUBY_CFLAGS="$RUBY_CFLAGS $rbconfig_CFLAGS "
  RUBY_LIBS="$rbconfig_LIBRUBYARG $rbconfig_LIBS"
  RUBY_LDFLAGS="-L$rbconfig_libdir"

  AC_SUBST(RUBY_CFLAGS)
  AC_SUBST(RUBY_LIBS)
  AC_SUBST(RUBY_LDFLAGS)

  _SAVE_CFLAGS=$CFLAGS
  ruby_undef_package_macros="
#undef PACKAGE_NAME
#undef PACKAGE_TARNAME
#undef PACKAGE_STRING
#undef PACKAGE_VERSION
"
  ruby_disable_message="Disable Ruby extension."
  CFLAGS="$CFLAGS $RUBY_CFLAGS"
  AC_CHECK_HEADERS(ruby.h, [],
                   [ruby_available="no"
                    AC_MSG_WARN([$ruby_disable_message])],
                   [$ruby_undef_package_macros])
  if test "x$ruby_available" = "xyes"; then
    CFLAGS="$CFLAGS $GTK_CFLAGS"
    AC_CHECK_HEADERS(rbgtk.h, [],
		     [ruby_available="no"
		      AC_MSG_WARN([$ruby_disable_message])],
		     [$ruby_undef_package_macros])
  fi
  CFLAGS=$_SAVE_CFLAGS
fi

AM_CONDITIONAL([WITH_RUBY], [test "$ruby_available" = "yes"])


dnl **************************************************************
dnl Configure for gettext from Ruby scripts
dnl **************************************************************
AC_ARG_WITH([rgettext],
	    AS_HELP_STRING([--with-rgettext=PATH],
			   [rgettext path (default: auto-detect)]),
	    [RGETTEXT="$withval"])

if test "$RGETTEXT" = "no"; then
  RGETTEXT=""
elif test "$RGETTEXT" = ""; then
  AC_PATH_PROG(RGETTEXT, rgettext, none)
  if test "$RGETTEXT" = "none"; then
    RGETTEXT=""
  fi
else
  rgettext_message="$RGETTEXT is not found. Disable gettext from Ruby scripts."
  AC_CHECK_FILE([$RGETTEXT], [],
		[RGETTEXT=""
		 AC_MSG_WARN([$rgettext_message])])
fi

RGETTEXT_TARGETS=""
if test "$RGETTEXT" != ""; then
  changequote(<<, >>)
  for dir in ${srcdir}/data/ext/ruby; do
    tmp_targets="`find $dir -name '*.rb' -exec echo \$\(top_srcdir\)/\{\} \;`"
    RGETTEXT_TARGETS="$RGETTEXT_TARGETS `echo $tmp_targets | xargs echo`"
  done
  changequote([, ])
fi
AC_SUBST(RGETTEXT_TARGETS)

dnl **************************************************************
dnl Configure for UI XML
dnl **************************************************************
if test "$ruby_available" = "yes" ; then
  UI_XML_RUBY_START=""
  UI_XML_RUBY_END=""
else
  UI_XML_RUBY_START="<!--"
  UI_XML_RUBY_END="-->"
fi

AC_SUBST([UI_XML_RUBY_START])
AC_SUBST([UI_XML_RUBY_END])

GECKO_VERSION="\$(GECKO)-\$(MOZILLA_COMPONENT_VERSION)"
AC_SUBST([GECKO_VERSION])

dnl **************************************************************
dnl Configure for history search module.
dnl **************************************************************
searchdir="\$(kzlibdir)/search"
AC_SUBST(searchdir)

dnl **************************************************************
dnl Check for Hyper Estraier.
dnl **************************************************************

est_exists=no
AC_ARG_ENABLE([heyper-estraier],
              AS_HELP_STRING([--disable-hyper-estraier],
	                     [Disable Hyper Estraier support]))
if test "x$enable_hyper_estraier" = "x" -o \
        "x$enable_hyper_estraier" = "xyes"; then
  PKG_CHECK_MODULES(EST, hyperestraier,
		    [est_exists=yes], [est_exists=no])
fi

AM_CONDITIONAL([WITH_EST], [test "$est_exists" = "yes"])

dnl **************************************************************
dnl Check for Anthy
dnl **************************************************************

anthy_exists=no
PKG_CHECK_MODULES(ANTHY, anthy,
                  [anthy_exists=yes], [anthy_exists=no])

AC_PATH_PROG(MECAB_CONFIG, mecab-config, "none")
if test x"$MECAB_CONFIG" = x"none"; then
  mecab_exists=no
  MECAB_LIBS=""
  MECAB_CFLAGS=""
else
  mecab_exists=yes
  MECAB_LIBS=`$MECAB_CONFIG --libs`
  MECAB_CFLAGS=`$MECAB_CONFIG --cflags`
fi
AC_SUBST([MECAB_CFLAGS])
AC_SUBST([MECAB_LIBS])

if test x"$anthy_exists" = "xyes" -a x"$mecab_exists" = "xyes" ; then
  anthy_trainer_available="yes"
else
  anthy_trainer_available="no"
fi

anthy_trainer_available="no"
AM_CONDITIONAL([WITH_ANTHY_TRAINER], [test x"$anthy_trainer_available" = "xyes"])
if test x"$anthy_trainer_available" = "xyes" ; then
  AC_DEFINE(WITH_ANTHY_TRAINER, 1, [Define to 1 if Anthy and Mecab is found])
fi

dnl **************************************************************
dnl Check for MinGW
dnl **************************************************************

AC_ARG_ENABLE([mingw-debug],
              AS_HELP_STRING([--enable-mingw-debug],
	                     [Enable MinGW debug]))
case $host_os in
mingw*)
  if test "x$enable_mingw_debug" != "xno"; then
    LDFLAGS="$LDFLAGS -mwindows"
  fi
  AC_CHECK_TOOL(WINDRES, windres)
  ;;
esac
AM_CONDITIONAL([HAVE_WINDRES], [test x"$WINDRES" != x])

dnl **************************************************************
dnl Check for Cutter
dnl **************************************************************
m4_ifdef([AC_CHECK_GCUTTER], [
AC_CHECK_GCUTTER(>= 1.0.6)
],
[ac_cv_use_cutter="no"])

AM_CONDITIONAL([WITH_CUTTER], [test "$ac_cv_use_cutter" != "no"])
if test "$ac_cv_use_cutter" != "no"; then
  AC_DEFINE(WITH_CUTTER, 1, [Define to 1 if you use Cutter])
fi

m4_ifdef([AC_CHECK_COVERAGE], [AC_CHECK_COVERAGE])
GENHTML_OPTIONS="--title 'Kazehakase Code Coverage'"

KAZEHAKASE_CFLAGS="$GTK_CFLAGS $LIBGNUTLS_CFLAGS $GIO_CFLAGS $DBUS_GLIB_CFLAGS"
KAZEHAKASE_CFLAGS="$KAZEHAKASE_CFLAGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
KAZEHAKASE_CFLAGS="$KAZEHAKASE_CFLAGS -DG_DISABLE_DEPRECATED"
KAZEHAKASE_CFLAGS="$KAZEHAKASE_CFLAGS -DSYSDATADIR=\\\"\"\$(datadir)\"\\\""
KAZEHAKASE_CFLAGS="$KAZEHAKASE_CFLAGS -DLOCALEDIR=\\\"\"\$(localedir)\"\\\""
KAZEHAKASE_CFLAGS="$KAZEHAKASE_CFLAGS -DKZ_DATADIR=\\\"\"\$(datadir)/\$(PACKAGE)\"\\\""
KAZEHAKASE_CFLAGS="$KAZEHAKASE_CFLAGS -DKZ_SYSCONFDIR=\\\"\"\$(sysconfdir)/\$(PACKAGE)\"\\\""
KAZEHAKASE_CFLAGS="$KAZEHAKASE_CFLAGS -DKZ_LIBDIR=\\\"\"\$(kzlibdir)\"\\\""
KAZEHAKASE_CFLAGS="$KAZEHAKASE_CFLAGS -DKZ_EXTDIR=\\\"\"\$(extdir)\"\\\""
KAZEHAKASE_CFLAGS="$KAZEHAKASE_CFLAGS -DKZ_RUBY_EXTDIR=\\\"\"\$(extrubydir)\"\\\""
KAZEHAKASE_CFLAGS="$KAZEHAKASE_CFLAGS -DKZ_SEARCH_MODULEDIR=\\\"\"\$(searchdir)\"\\\""
KAZEHAKASE_CFLAGS="$KAZEHAKASE_CFLAGS -DKZ_EMBED_MODULEDIR=\\\"\"\$(embeddir)\"\\\""
AC_SUBST(KAZEHAKASE_CFLAGS)


AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])

SHAVE_INIT([shave], [enable])
AC_CONFIG_FILES([
Makefile
po/Makefile.in
rgettext.mk
src/Makefile
src/missing/Makefile
src/utils/Makefile
src/net/Makefile
src/actions/Makefile
src/bookmarks/Makefile
src/dialogs/Makefile
src/prefs_ui/Makefile
src/sidebar/Makefile
src/widget/Makefile
dbus/Makefile
libegg/Makefile
libegg/pixbufthumbnail/Makefile
module/Makefile
module/embed/Makefile
module/embed/gecko/Makefile
module/embed/gecko/gtkmozembed/Makefile
module/embed/webkit-gtk/Makefile
module/embed/ie/Makefile
module/embed/moz-web-view/Makefile
module/embed/per-process/Makefile
module/search/Makefile
etc/Makefile
etc/kz-ui-beginner.xml
etc/kz-ui-medium.xml
etc/kz-ui-expert.xml
etc/mozilla/Makefile
ext/Makefile
ext/ruby/Makefile
data/Makefile
data/icons/Makefile
data/ext/Makefile
data/ext/ruby/Makefile
data/ext/ruby/kz/Makefile
data/ext/ruby/kz/actions/Makefile
doc/Makefile
kazehakase.spec
test/Makefile
test/fixtures/Makefile
shave/shave
shave/shave-libtool
])

AC_OUTPUT

dnl **************************************************************
dnl Show configure result
dnl **************************************************************

echo
echo "Configure Result:"
echo
echo "  Gecko Engine     : ${GECKO}-${MOZILLA_COMPONENT_VERSION}"
echo "  MozWebView       : ${moz_web_view_exists}"
echo "  WebKit/GTK+      : ${webkit_gtk_exists}"
echo "  GtkIEEmbed       : ${gtk_ie_embed_exists}"
echo "  Migemo           : ${enable_migemo}"
echo "  Ruby             : ${ruby_available}"
echo "  Hyper Estraier   : ${est_exists}"
echo "  Anthy            : ${anthy_exists}"
echo "  MeCab            : ${mecab_exists}"
echo