File: configure.in

package info (click to toggle)
mlterm 2.9.4-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 16,728 kB
  • ctags: 5,338
  • sloc: ansic: 74,649; sh: 8,532; cpp: 1,451; makefile: 1,126; perl: 496; sed: 16
file content (708 lines) | stat: -rw-r--r-- 19,024 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
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
AC_INIT()

AC_CONFIG_HEADER(common/c_config.h)
AC_CONFIG_AUX_DIR(script)

if test -d ${top_srcdir-$srcdir}/mkf -a -d ${top_srcdir-$srcdir}/kiklib ; then
	mkdir -p mkf kiklib
	ln -sf ../kiklib ${top_srcdir-$srcdir}/mkf
	ln -sf ../kiklib mkf
	SUBDIRS="kiklib mkf"
	MKF_LIBS='${top_builddir}/mkf/lib/libmkf.la'
	MKF_CFLAGS='-I${top_builddir}/mkf/include'
	KIK_LIBS='${top_builddir}/kiklib/src/libkik.la'
	KIK_CFLAGS='-I${top_builddir}/kiklib/include'
else
	MKF_LIBS="-lmkf"
	KIK_LIBS="-lkik"
fi
AC_SUBST(MKF_LIBS)
AC_SUBST(MKF_CFLAGS)
AC_SUBST(KIK_LIBS)
AC_SUBST(KIK_CFLAGS)

AC_CANONICAL_HOST
AC_CANONICAL_BUILD

dnl For cross-compile,  
dnl PKG_CONFIG must be overridden by a full path to pkg-config
dnl but AC_PATH_TOOL does not exist in autoconf 2.13.
dnl Try to find something usable by AC_PATH_PROG for now.
dnl The ugly part should be replaced by:
dnl  AC_PATH_TOOL(PKG_CONFIG, pkg-config)

if test x"${build}" != x"${host}"; then
	AC_CHECK_TOOL(CC, gcc)
	AC_CHECK_TOOL(AR, ar)
	AC_CHECK_TOOL(RANLIB, ranlib)
	AC_CHECK_TOOL(LD, ld)
	if test -d "/usr/$target_alias/lib/pkgconfig"; then
		PKG_CONFIG_LIBDIR="/usr/$target_alias/lib/pkgconfig"
		export PKG_CONFIG_LIBDIR
	else
	        PKG_CONFIG_CROSS_TARGET=$target_alias
	        export PKG_CONFIG_CROSS_TARGET
		AC_CHECK_TOOL(PKG_CONFIG, pkg-config)
		AC_PATH_PROG(PKG_CONFIG, $PKG_CONFIG, :)
	fi
fi

AC_PROG_CC
AC_PROG_INSTALL

AC_C_INLINE

AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_DLOPEN
AC_ARG_WITH(libtool,
	[  --with-libtool          libtool path[default=without]],
	libtool=$with_libtool)
if test "${libtool}" != "" ; then
	LIBTOOL=${libtool}
else
	AM_PROG_LIBTOOL
	LIBTOOL='${top_builddir}/libtool'
fi
AC_SUBST(LIBTOOL)

AC_CHECK_LIB(socket,connect,SOCK_LIBS=-lsocket)
AC_SUBST(SOCK_LIBS)

AC_PATH_XTRA

# Li18nux Xlib-I18N defines X_HAVE_UTF8_STRING but has no Xutf8LookupString.
ldflags="$LDFLAGS" cflags="$CFLAGS"
LDFLAGS="$LDFLAGS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS" CFLAGS="$X_CFLAGS $CFLAGS"
AC_CHECK_LIB(X11,Xutf8LookupString,XUTF8_CFLAGS="-DHAVE_XUTF8_LOOKUP_STRING")
LDFLAGS="$ldflags" CFLAGS="$cflags"
AC_SUBST(XUTF8_CFLAGS)

AC_ARG_ENABLE(debug,
	[  --enable-debug          debug[default=disabled]],
	debug=$enable_debug)
if test "$debug" = "yes" ; then
	DEB_CFLAGS="-DDEBUG -DKIK_DEBUG"
fi
AC_SUBST(DEB_CFLAGS)
AC_SUBST(OPT_CFLAGS)

AC_ARG_ENABLE(fribidi,
	[  --enable-fribidi        bidi[default=disabled]],
	fribidi=$enable_fribidi, fribidi="no")
if test "$fribidi" = "yes" ; then
	AC_CHECK_PROG(fribidi_config,fribidi-config,yes,fribidi="no")
	if test "$fribidi_config" = "yes" ; then
		FRIBIDI_CFLAGS="`fribidi-config --cflags` -DUSE_FRIBIDI"
		FRIBIDI_LIBS="`fribidi-config --libs`"
	fi
fi
AC_SUBST(FRIBIDI_CFLAGS)
AC_SUBST(FRIBIDI_LIBS)

# default value
IMAGELIB_NAME=none
AC_ARG_WITH(imagelib,
	[  --with-imagelib[=ARG]   image library (imlib|gdk-pixbuf)],
	imagelib=$with_imagelib)
case ${imagelib} in
imlib)
	AC_CHECK_PROG(imlib_config,imlib-config,yes,no)
	if test "x$imlib_config" = "xno" ; then
		echo ""
		echo "** ERROR **"
		echo "Could not find imlib-config."
		echo ""
		exit 1
	fi
	IMAGELIB_CFLAGS="`imlib-config --cflags` -DUSE_IMLIB"
	IMAGELIB_LIBS="`imlib-config --libs`"
	IMAGELIB_NAME=imlib
	;;
gdk-pixbuf)
	PKG_CHECK_MODULES(IMAGELIB, gdk-pixbuf-2.0, [
		IMAGELIB_NAME=gdk
		IMAGELIB_CFLAGS="${IMAGELIB_CFLAGS} -DUSE_GDK_PIXBUF"
	])
	if test "x$IMAGELIB_NAME" = "xnone" ; then
		AC_CHECK_PROG(pkg_config,gdk-pixbuf-config,yes)
		if test "$pkg_config" = "yes" ; then
			IMAGELIB_CFLAGS="`gdk-pixbuf-config --cflags` -DUSE_GDK_PIXBUF"
			IMAGELIB_LIBS="`gdk-pixbuf-config --libs`"
			IMAGELIB_NAME=gdk
		fi
	fi
	;;
gdk-pixbuf2)
	PKG_CHECK_MODULES(IMAGELIB, gdk-pixbuf-2.0, [
		IMAGELIB_NAME=gdk
		IMAGELIB_CFLAGS="${IMAGELIB_CFLAGS} -DUSE_GDK_PIXBUF"
	])
	;;
gdk-pixbuf1)
	AC_CHECK_PROG(pkg_config,gdk-pixbuf-config,yes)
	if test "$pkg_config" = "yes" ; then
		IMAGELIB_CFLAGS="`gdk-pixbuf-config --cflags` -DUSE_GDK_PIXBUF"
		IMAGELIB_LIBS="`gdk-pixbuf-config --libs`"
		IMAGELIB_NAME=gdk
	fi
	;;
*)
	if test "${imagelib}" != "" ; then
		echo ""
		echo "** ERROR **"
		echo "${imagelib} library is NOT supported."
		echo ""
		exit 1
	fi
	;;
esac
AC_SUBST(IMAGELIB_CFLAGS)
AC_SUBST(IMAGELIB_LIBS)
AC_SUBST(IMAGELIB_NAME)

# --enable-anti-alias is backward compatibility for --with-type-engines
AC_ARG_ENABLE(anti_alias,
	[  --enable-anti-alias     (obsoleted by --with-type-engines)anti alias[default=disabled]],
	anti_alias=$enable_anti_alias)
	
AC_ARG_WITH(type_engines,
	[  --with-type-engines     type engines(xcore, xft)[default=xcore]],
	type_engines=$with_type_engines)

if test "$anti_alias" = "yes" ; then
	type_engines="xcore xft"
fi

if test "$type_engines" = ""; then
	type_engines="xcore"
fi

type_engines=`echo ${type_engines} | sed 's/,/ /g'`
for type_engine in ${type_engines} ; do
case ${type_engine} in
xft)
	PKG_CHECK_MODULES(XFT, xft, have_xft=yes, have_xft=no)
	if test "$have_xft" = "yes" ; then
		AA_CFLAGS="-DUSE_TYPE_XFT  ${XFT_CFLAGS} ${AA_CFLAGS}"
		AA_LIBS="${XFT_LIBS} ${AA_LIBS}"
	else
		AA_CFLAGS="-DUSE_TYPE_XFT ${AA_CFLAGS}"
		AA_LIBS="-lXft ${AA_LIBS}"
	fi
	type_engines_result="$type_engines_result xft"
	;;
xcore)
	AA_CFLAGS="-DUSE_TYPE_XCORE ${AA_CFLAGS}"
	type_engines_result="$type_engines_result xcore"
	;;
*)
	echo "${type_engine} is unknown type engine."
	;;
esac
done

if test "${AA_CFLAGS}" = "" ; then
	echo "no type engine specified."
	exit 1
fi

AC_SUBST(AA_CFLAGS)
AC_SUBST(AA_LIBS)
AC_SUBST(PROG)

AC_ARG_ENABLE(ind,
	[  --enable-ind            libind[default=disabled]],
	ind=$enable_ind, ind="no")
if test "$ind" = "yes" ; then
	AC_CHECK_LIB(ind,indian_init,
		[
		IND_CFLAGS="-DUSE_IND"
		IND_LIBS="-lind"
		], ind="no")
fi
AC_SUBST(IND_LIBS)
AC_SUBST(IND_CFLAGS)

AC_ARG_ENABLE(utmp,
	[  --enable-utmp           utmp (Experimental) [default=disabled]],
	utmp=$enable_utmp, utmp="no")
if test "$utmp" = "yes" ; then
	UTMP_CFLAGS="-DUSE_UTMP"
	has_utmp=`grep utmp /etc/group 2>/dev/null`
	if test "$has_utmp" ; then
		INSTALL_OPT="-m 2755 -g utmp"
	else
		INSTALL_OPT="-m 4755 -o root"
	fi
else
	INSTALL_OPT="-m 755"
fi
AC_SUBST(UTMP_CFLAGS)
AC_SUBST(INSTALL_OPT)

PKG_CHECK_MODULES(GTK, gtk+-2.0, have_gtk2=yes, have_gtk2=no)
if test "$have_gtk2" = "yes" ; then
	gtk_config=yes
	GTK_CONFIG="$PKG_CONFIG gtk+-2.0"
else
	AC_CHECK_PROG(gtk_config,gtk-config,yes)
	if test "$gtk_config" = "yes" ; then
		AC_PATH_PROG(GTK_CONFIG,gtk-config,/usr/local/bin/gtk-config,$PATH)
	else
		# for Daichi Goto-san:)
		AC_CHECK_PROG(gtk_config,gtk12-config,yes)
		if test "$gtk_config" = "yes" ; then
			AC_PATH_PROG(GTK_CONFIG,gtk12-config,/usr/X11R6/bin/gtk12-config,$PATH)
		fi
	fi
	GTK_CFLAGS='gtk-config --cflags'
	GTK_LIBS='gtk-config --libs'

	AC_SUBST(GTK_CFLAGS)
	AC_SUBST(GTK_LIBS)
fi
AC_SUBST(GTK_CONFIG)

tools="mlclient,mlconfig,mlterm-menu,mlcc"
AC_ARG_WITH(tools,
	[  --with-tools[=ARG]      external tools [default=mlclient,mlconfig,mlterm-menu,mlcc]],
	[
	# If given --without-tools or --with-tools with no args.
	if test "${with_tools}" = "no" ; then
		tools=""
	elif test "${with_tools}" != "yes" ; then
		tools=${with_tools}
	fi
	])
tools=`echo ${tools} | sed 's/,/ /g'`
for tool in ${tools} ; do
case ${tool} in
mlconfig)
	if test "${gtk_config}" = "yes" ; then
		MAKE_DIRS="tool/mlconfig ${MAKE_DIRS}"
		OUTPUT_FILES="tool/mlconfig/Makefile tool/mlconfig/po/Makefile.in ${OUTPUT_FILES}"
		tools_result="$tools_result $tool"
	else
		echo ""
		echo "** WARNING  **"
		echo " couldn't compile mlconfig since headers/libraries of GTK are missing."
		echo ""
	fi
	;;
mlterm-menu)
	if test "${gtk_config}" = "yes" ; then
		MAKE_DIRS="contrib/tool/mlterm-menu ${MAKE_DIRS}"
		OUTPUT_FILES="contrib/tool/mlterm-menu/Makefile ${OUTPUT_FILES}"
		tools_result="$tools_result $tool"
	else
		echo ""
		echo "** WARNING  **"
		echo " couldn't compile mlterm-menu since headers/libraries of GTK are missing."
		echo ""
	fi
	;;
mlclient)
	MAKE_DIRS="tool/mlclient ${MAKE_DIRS}"
	OUTPUT_FILES="tool/mlclient/Makefile ${OUTPUT_FILES}"
	tools_result="$tools_result $tool"
	;;
w3mmlconfig)
	AC_PATH_PROG(PERL,perl,$PATH)
	if test "x$PERL" = x ; then
		echo ""
		echo "** WARNING  **"
		echo " couldn't find perl in PATH environment variable."
		echo ""
		PERL="/usr/local/bin/perl" # should be "/usr/bin/env perl"?
	fi
	MAKE_DIRS="tool/w3mmlconfig ${MAKE_DIRS}"
	OUTPUT_FILES="tool/w3mmlconfig/Makefile tool/w3mmlconfig/mlconfig.cgi tool/w3mmlconfig/w3mmlconfig ${OUTPUT_FILES}"
	tools_result="$tools_result $tool"
	;;
mlcc)
	MAKE_DIRS="contrib/tool/mlcc ${MAKE_DIRS}"
	OUTPUT_FILES="contrib/tool/mlcc/Makefile ${OUTPUT_FILES}"
	tools_result="$tools_result $tool"
	;;
mlmenu)
	MAKE_DIRS="tool/mlmenu ${MAKE_DIRS}"
	OUTPUT_FILES="tool/mlmenu/Makefile ${OUTPUT_FILES}"
	tools_result="$tools_result $tool"
	;;
mlterm-zoom)
	MAKE_DIRS="contrib/tool/mlterm-zoom ${MAKE_DIRS}"
	OUTPUT_FILES="contrib/tool/mlterm-zoom/Makefile ${OUTPUT_FILES}"
	tools_result="$tools_result $tool"
	;;
*)
	echo "${tool} is unknown tool."
	;;
esac
done

#
# --- libltdl ---
#
AC_ARG_WITH(libltdl,
	[  --with-libltdl[=PREFIX] load modules with libltdl[default=without]],,
	[with_libltdl=no])
# We don't check here wheter libltdl is installed. (See kiklib/src/configure.in)

#
# --- Xdnd ---
#
AC_ARG_ENABLE(dnd,
	[  --disable-dnd           dnd [default=enabled]],
	dnd=$enable_dnd, dnd="yes")
if test "$dnd" = "no" ; then
	DND_CFLAGS="-DDISABLE_XDND"
else
	DND_LIBS="x_dnd.o"
fi
AC_SUBST(DND_CFLAGS)
AC_SUBST(DND_LIBS)


IM_CFLAGS=""
DL_LIBS_IM=""

#
# --- kbd ---
#
AC_ARG_ENABLE(kbd,
	[  --disable-kbd           input method for Arabic and Indic [default=enabled]],
	kbd=$enable_kbd)
if test "$kbd" != "no" ; then
	IM_CFLAGS="$IM_CFLAGS -DUSE_KBD"
	MAKE_DIRS="inputmethod/kbd ${MAKE_DIRS}"
	OUTPUT_FILES="inputmethod/kbd/Makefile ${OUTPUT_FILES}"
	if test "x$with_libltdl" != "xno" ; then
		DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/kbd/libim-kbd.la ${DL_LIBS_IM}"
	fi
	input_methods_result="$input_methods_result kbd"
fi

#
# --- uim ---
#
AC_ARG_ENABLE(uim,
	[  --enable-uim            uim (Experimental) [default=disabled]],
	uim=$enable_uim)
if test "x$uim" = xyes ; then
	PKG_CHECK_MODULES(UIM, uim >= 1.0.0, have_uim=yes, have_uim=no)
	if test "x$have_uim" = xyes ; then
		IM_CFLAGS="$IM_CFLAGS -DUSE_UIM"
		MAKE_DIRS="inputmethod/uim ${MAKE_DIRS}"
		OUTPUT_FILES="inputmethod/uim/Makefile ${OUTPUT_FILES}"
		if test "x$with_libltdl" != xno ; then
			DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/uim/libim-uim.la ${DL_LIBS_IM}"
		fi
		input_methods_result="$input_methods_result uim"
	fi
fi
AC_SUBST(UIM_CFLAGS)
AC_SUBST(UIM_LIBS)

#
# --- IIIMF ---
#
AC_ARG_ENABLE(iiimf,
	[  --enable-iiimf          IIIMF (Experimental) [default=disabled]],
	iiimf=$enable_iiimf)
if test "x$iiimf" = xyes ; then
	if test -d /usr/lib/im/lib ; then
		LIBS="$LIBS -L/usr/lib/im/lib"
		AC_CHECK_LIB(iiimcf, iiimcf_create_context,
			[
			found_iiimcf=yes
			IIIMF_CFLAGS="-I/usr/lib/im/include"
			IIIMF_LIBS="-L/usr/lib/im/lib -liiimcf"
			])
	else
		AC_CHECK_LIB(iiimcf, iiimcf_create_context,
			[
			found_iiimcf=yes
			IIIMF_CFLAGS=""
			IIIMF_LIBS="-liiimcf"
			])
	fi

	if test "x$found_iiimcf" = xyes ; then
		IM_CFLAGS="$IM_CFLAGS -DUSE_IIIMF"
		MAKE_DIRS="inputmethod/iiimf ${MAKE_DIRS}"
		OUTPUT_FILES="inputmethod/iiimf/Makefile ${OUTPUT_FILES}"
		if test "x$with_libltdl" != xno ; then
			echo ""
			echo "** ERROR **"
			echo " IIIMF plugin couldn't be used with libltdl."
			echo ""
			exit 1
		else
			input_methods_result="$input_methods_result IIIMF"
		fi
		AC_CHECK_LIB(iiimcf, iiimcf_create_hotkey_notify_event,
			[
			IIIMF_CFLAGS="$IIIMF_CFLAGS -DHAVE_HOTKEY_NOTFY_EVENT"
			])
		AC_CHECK_LIB(iiimcf, iiimcf_create_aux_getvalues_event,
			[
			IIIMF_CFLAGS="$IIIMF_CFLAGS -DHAVE_AUX_GETVALUES_EVENT"
			])
	fi
fi
AC_SUBST(IIIMF_CFLAGS)
AC_SUBST(IIIMF_LIBS)

#
# --- m17n library ---
#
AC_ARG_ENABLE(m17nlib,
	[  --enable-m17nlib        m17n library (Experimental) [default=disabled]],
	m17nlib=$enable_m17nlib)
if test "x$m17nlib" = xyes ; then
	AC_CHECK_PROG(m17nlib, m17n-config, yes, no)
fi
if test "x$m17nlib" = xyes ; then
	m17n_saved_libs="$LIBS"
	M17NLIB_LIBS=`m17n-config --libs`
	LIBS="$LIBS $M17NLIB_LIBS"
	AC_CHECK_LIB(m17n, minput_open_im,
		[
		IM_CFLAGS="$IM_CFLAGS -DUSE_M17NLIB"
		M17NLIB_CFLAGS="`m17n-config --cflags`"
		MAKE_DIRS="inputmethod/m17nlib ${MAKE_DIRS}"
		OUTPUT_FILES="inputmethod/m17nlib/Makefile ${OUTPUT_FILES}"
		if test "x$with_libltdl" != xno ; then
			DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/m17nlib/libim-m17nlib.la ${DL_LIBS_IM}"
		fi
		input_methods_result="$input_methods_result m17nlib"
		])
	LIBS="$m17n_saved_libs"
fi
AC_SUBST(M17NLIB_CFLAGS)
AC_SUBST(M17NLIB_LIBS)

#
# --- SCIM ---
#
AC_ARG_ENABLE(scim,
	[  --enable-scim           SCIM (Experimental) [default=disabled]],
	scim=$enable_scim)
if test "x$scim" = "xyes" ; then
	AC_PROG_CXX
	PKG_CHECK_MODULES(SCIM, scim >= 1.4.0, have_scim_1_4=yes , have_scim=no)
	PKG_CHECK_MODULES(SCIM, scim >= 1.2.0, have_scim_1_2=yes , have_scim=no)
	if test "x$have_scim_1_4" = xyes ; then
		SCIM_VERSION="1.4"
		have_scim=yes
	elif test "x$have_scim_1_2" = xyes ; then
		SCIM_VERSION="1.2"
		have_scim=yes
	fi
	if test "x$have_scim" = xyes ; then
		IM_CFLAGS="$IM_CFLAGS -DUSE_SCIM"
		MAKE_DIRS="inputmethod/scim ${MAKE_DIRS}"
		OUTPUT_FILES="inputmethod/scim/Makefile ${OUTPUT_FILES}"
		if test "x$with_libltdl" != xno ; then
			DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/scim/libim-scim.la ${DL_LIBS_IM}"
		fi
		input_methods_result="$input_methods_result SCIM"
	fi
fi
AC_SUBST(SCIM_CFLAGS)
AC_SUBST(SCIM_LIBS)
AC_SUBST(SCIM_VERSION)


if test "x$IM_CFLAGS" != x ; then
	IM_CFLAGS="$IM_CFLAGS -DUSE_IM_PLUGIN"
fi
AC_SUBST(IM_CFLAGS)
AC_SUBST(DL_LIBS_IM)


#
# --- scrollbar plugins ---
#

DL_LIBS_SB=""

scrollbars="sample,extra"  # default

AC_ARG_WITH(scrollbars,
	[  --with-scrollbars[=ARG] scrollbar plugins (sample, extra, pixmap_engine)[default=sample,extra]],
	[
	# If given --without-scrollbars or --with-scrollbars with no args.
	if test "${with_scrollbars}" = "no" ; then
		scrollbars=""
	elif test "${with_scrollbars}" != "yes" ; then
		scrollbars=${with_scrollbars}
	fi
	])
scrollbars=`echo ${scrollbars} | sed 's/,/ /g'`
for scrollbar in ${scrollbars} ; do
case ${scrollbar} in
sample)
	MAKE_DIRS="scrollbar/sample ${MAKE_DIRS}"
	OUTPUT_FILES="scrollbar/sample/Makefile ${OUTPUT_FILES}"
	if test "x$with_libltdl" != "xno" ; then
		for name in sample sample2 ; do
			DL_LIBS_SB="-dlopen \$(top_builddir)/scrollbar/sample/lib$name.la ${DL_LIBS_SB}"
		done
	fi
	scrollbars_result="$scrollbars_result $scrollbar"
	;;
extra)
	MAKE_DIRS="contrib/scrollbar/extra ${MAKE_DIRS}"
	OUTPUT_FILES="contrib/scrollbar/extra/Makefile ${OUTPUT_FILES}"
	if test "x$with_libltdl" != "xno" ; then
		for name in athena next motif mozmodern ; do
			DL_LIBS_SB="-dlopen \$(top_builddir)/contrib/scrollbar/extra/lib$name.la ${DL_LIBS_SB}"
		done
	fi
	scrollbars_result="$scrollbars_result $scrollbar"
	;;
pixmap_engine)
	if test "x$allow_undefined_flag" = "xunsupported" ; then
		echo ""
		echo "** ERROR **"
		echo "pixmap_engine has undefined symbols. $host_os does NOT allow it. Please retry"
		echo "to run configure scripts without pixmap_engine"
		echo "(e.g.  --with-scrllbars=sample,extra)"
		echo ""
		exit 1
	fi
	if test "$IMAGELIB_NAME" = "gdk" -o "$IMAGELIB_NAME" = "imlib" ; then
		MAKE_DIRS="contrib/scrollbar/pixmap_engine ${MAKE_DIRS}"
		OUTPUT_FILES="contrib/scrollbar/pixmap_engine/Makefile contrib/scrollbar/pixmap_engine/sample3/Makefile ${OUTPUT_FILES}"
		if test "x$with_libltdl" != "xno" ; then
			DL_LIBS_SB="-export-dynamic -dlopen \$(top_builddir)/contrib/scrollbar/pixmap_engine/libpixmap_engine.la ${DL_LIBS_SB}"
		else
			DL_LIBS_SB="-export-dynamic"
		fi
		scrollbars_result="$scrollbars_result $scrollbar"
	else
		echo ""
		echo "** ERROR **"
		echo "To use pixmap_engine for scrollbar, you need any image library such as"
		echo "gdk-pixbuf and imlib. (e.g. --with-imagelib=imlib)"
		echo ""
		exit 1
	fi
	;;
*)
	echo "${scrollbar} is unknown scrollbar."
	;;
esac
done # for scrollbar in ${scrollbars}

AC_SUBST(DL_LIBS_SB)

AC_ARG_ENABLE(optimize_redrawing,
	[  --enable-optimize-redrawing optimize redrawing a line[default=disabled]],
	optimize_redrawing=$enable_optimize_redrawing,
	optimize_redrawing="no")
if test "$optimize_redrawing" = "yes" ; then
	CFLAGS="$CFLAGS -DOPTIMIZE_REDRAWING"
fi

case "${host_os}" in
mingw32*)
	MAKE_DIRS="mlterm ${MAKE_DIRS}"
#	MAKE_DIRS="${MAKE_DIRS} win32"
	OUTPUT_FILES="Makefile mlterm/Makefile etc/Makefile"
#	OUTPUT_FILES="${OUTPUT_FILES} win32/Makefile"
	ML_PTY_OBJ="ml_pty_win32.o"
	PLATFORM_LIB_LDFLAGS="-no-undefined"
	;;
*)
	MAKE_DIRS="mlterm ${MAKE_DIRS} xwindow man etc"
	OUTPUT_FILES="Makefile mlterm/Makefile xwindow/Makefile man/Makefile etc/Makefile ${OUTPUT_FILES}"
	ML_PTY_OBJ="ml_pty.o"
	PLATFORM_LIB_LDFLAGS=""
	;;
esac
AC_SUBST(ML_PTY_OBJ)
AC_SUBST(MAKE_DIRS)
AC_SUBST(OUTPUT_FILES)
AC_SUBST(PLATFORM_LIB_LDFLAGS)

# gettext
AM_INIT_AUTOMAKE(mlterm,2.9.4)
AM_GNU_GETTEXT([external])

# XXX(maybe not portable)
if test "${USE_NLS}" = "yes" ; then
	AC_CHECK_LIB(intl,gettext,
		[
		INTL_LIBS="-lintl"
		])
fi
AC_SUBST(INTL_LIBS)


#
# --- module related stuffs ---
#

# undefined symbol
AC_MSG_CHECKING([for undefined symbol])
if test "x$allow_undefined_flag" = "xunsupported" ; then
	AC_MSG_RESULT([not supported])
	NO_UNDEFINED_FLAG="-no-undefined"
	KIK_LIBS_FOR_MODULE='-L${top_builddir}/kiklib/src -lkik'
	MKF_LIBS_FOR_MODULE='-L${top_builddir}/mkf/lib -lmkf'
else
	AC_MSG_RESULT(supported)
	NO_UNDEFINED_FLAG=""
	KIK_LIBS_FOR_MODULE=""
	MKF_LIBS_FOR_MODULE=""
fi
AC_SUBST(NO_UNDEFINED_FLAG)
AC_SUBST(KIK_LIBS_FOR_MODULE)
AC_SUBST(MKF_LIBS_FOR_MODULE)

if test "x$with_libltdl" != "xno" ; then
	DL_SELF="-dlopen self"
fi
AC_SUBST(DL_SELF)


# CVS revision
CVS_REVISION=`tail -n 1 ${top_srcdir-$srcdir}/ChangeLog | sed -n 's/^.Id: .* \(.*\) .* .* .* Exp .$/\1/p'`
AC_SUBST(CVS_REVISION)
OUTPUT_FILES="xwindow/version.h ${OUTPUT_FILES}"

if test "${SUBDIRS}" != "" ; then
	AC_CONFIG_SUBDIRS([kiklib mkf])
fi

if test "${MAKE_DIRS}" != "" ; then
	mkdir -p ${MAKE_DIRS}
fi

AC_OUTPUT(${OUTPUT_FILES})

# configuration result

echo
echo
echo "Mlterm was configured as follows"
echo
echo "Installation path prefix          : $prefix"
dnl echo "Character mapping table           : "
dnl echo "Character property table          : "
echo "Build shared libraries            : $enable_shared"
echo "Build static libraries            : $enable_static"
echo "Optimization for redrawing a line : $optimize_redrawing"
echo "BiDi rendering (Fribidi)          : $fribidi"
echo "ISCII rendering (libind)          : $ind"
echo "External tools                    :$tools_result"
echo "Image library                     : $with_imagelib"
echo "utmp support                      : $utmp"
echo "Type engines                      :$type_engines_result"
echo "DnD                               : $dnd"
echo "Input Methods                     : XIM$input_methods_result"
echo "Scrollbars                        : simple${scrollbars_result}"
echo