File: configure.in

package info (click to toggle)
mgp 1.13a+upstream20090219-11
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,128 kB
  • sloc: ansic: 32,387; sh: 4,295; lisp: 1,405; yacc: 945; lex: 264; makefile: 158; perl: 117; awk: 9
file content (519 lines) | stat: -rw-r--r-- 15,182 bytes parent folder | download | duplicates (4)
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
dnl NOTE:
dnl This 'configure' and 'Imakefile.in' are written to be directory
dnl independent (using srcdir), however, xmkmf and Imake.tmpl do not
dnl allow us to switch compilation directory.
dnl
dnl $Id: configure.in,v 1.105 2009/02/15 11:35:19 nishida Exp $
AC_INIT(image/imagetypes.c)

dnl Checks for programs.
AC_PROG_MAKE_SET
AC_CANONICAL_HOST
dnl  AC_PROG_CC cannot be specified here, since imake may not like the
dnl  compiler probed by AC_PROG_CC (i.e. gcc).
dnl AC_PROG_CC
AC_PROG_CPP
AC_PROG_AWK
AC_PROG_YACC
AC_PROG_LEX
AC_PATH_PROGS(mgp_cv_path_perl, perl5 perl, no)
AC_SUBST(mgp_cv_path_perl)
AC_PATH_PROGS(mgp_cv_path_uuencode, uuencode, no)
AC_SUBST(mgp_cv_path_uuencode)
AC_PATH_PROGS(mgp_cv_path_gzip, gzip, no)
AC_SUBST(mgp_cv_path_gzip)
AC_PATH_PROGS(mgp_cv_path_uudecode, uudecode, no)
AC_PATH_PROGS(mgp_cv_path_gunzip, gunzip, no)

OPTFLAGS=
AC_SUBST(OPTFLAGS)
DEPLIBS=
AC_SUBST(DEPLIBS)

dnl AS_15_01_2005: Added Variable SHLIBEXT which contains extensions of shared libaries
SHLIBEXT=so
case $host_os in
freebsd5*|freebsd4*|freebsd3*|freebsd2.2.6*|freebsd2.2.7*|freebsd2.2.8*)
	OPTFLAGS="$OPTFLAGS -DUUDECODEOPT=\\\"-s\\\""
	;;
darwin*)
	SHLIBEXT=dylib
	;;
esac
OPTFLAGS="$OPTFLAGS -DUUDECODE=\\\"$mgp_cv_path_uudecode\\\""
OPTFLAGS="$OPTFLAGS -DGUNZIP=\\\"$mgp_cv_path_gunzip\\\""

dnl Checks for debugging option.
AC_MSG_CHECKING(if debugging is enabled)
AC_ARG_ENABLE(debug,
	[  --enable-debug          compile debugging information in.],
	[mgp_debug="$enableval"],
	[mgp_debug="no"])
if test "$mgp_debug" = "yes"; then
  OPTFLAGS="$OPTFLAGS -g -DDEBUG -Wall"
fi
AC_MSG_RESULT($mgp_debug)

dnl Checks for locale option.
AC_MSG_CHECKING(if setlocale() should be used)
AC_ARG_ENABLE(locale,
	[  --enable-locale         perform setlocale() on invocation.],
	[mgp_locale="$enableval"],
	[mgp_locale="no"])
if test $mgp_locale = "yes"; then
  OPTFLAGS="$OPTFLAGS -DUSE_SETLOCALE"
fi
AC_MSG_RESULT($mgp_locale)

AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h strings.h sys/file.h unistd.h sys/time.h sys/select.h stdarg.h varargs.h termios.h locale.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_CHECK_TYPE(u_int, unsigned int)
AC_CHECK_TYPE(u_char, unsigned char)

dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(poll strstr _setbufend)
AC_REPLACE_FUNCS(usleep strsep strdup mkstemp snprintf memcmp strlcpy strlcat)

dnl Checks for libraries.
LIBS="-lm $LIBS"

dnl AS_15_01_2005
dnl Addes Path Variable for Libs/Includes searching
AC_ARG_WITH(searchpath,
	[  --with-searchpath=PATH  additional path for searching includes & libaries.],
	[SEARCHPATH="$SEARCHPATH $withval"],
	[])


AC_MSG_CHECKING(if freetype1 is used)
AC_ARG_ENABLE(freetype,
 	[  --disable-freetype      DON'T use freetype1 routines.],
 	[mgp_use_freetype="$enableval"],
 	[mgp_use_freetype="yes"])
AC_MSG_RESULT($mgp_use_freetype)

dnl echo $target 

if test "$mgp_use_freetype" = "yes"; then
  # XXX: freetype2 may use freetype-config
 	AC_MSG_CHECKING(for freetype1 library/header)
 	for dir in $SEARCHPATH /usr/local/freetype /usr/local /opt/freetype /usr/pkg /usr /usr/include/freetype1 /sw; do
 		ac_cv_ft_lib=no
 		ac_cv_ft_include=no
		shlib=`echo $dir/lib/libttf.$SHLIBEXT* | head -n 1 | sed -e 's/.*\///'`
		if test x$shlib = x; then
			shlib=no
		fi
		if test -d $dir/lib -a -f $dir/lib/$shlib; then
 			ac_cv_ft_lib="$dir/lib"
 			ac_cv_ft_libpath="$shlib"
 		elif test -d $dir/lib -a -f $dir/lib/libttf.a; then
 			ac_cv_ft_lib="$dir/lib"
 			ac_cv_ft_libpath="libttf.a"
 		fi
 		if test -d $dir/include -a -f $dir/include/freetype.h; then
 			ac_cv_ft_include="$dir/include"
 		elif test -d $dir/include/freetype -a -f $dir/include/freetype/freetype.h; then
 			ac_cv_ft_include="$dir/include/freetype"
		fi
 		if test "$ac_cv_ft_lib" != "no" -a "$ac_cv_ft_include" != "no"; then
 			LIBS="-L$ac_cv_ft_lib $LIBS"
 			CFLAGS="-I$ac_cv_ft_include $CFLAGS"
 			break
 		fi
 	done
 	if test "$ac_cv_ft_lib" = "no" -a "$ac_cv_ft_include" = "no"; then
 		AC_MSG_RESULT(no - not using freetype)
 		mgp_use_freetype=no
 	else
 		AC_MSG_RESULT($ac_cv_ft_lib and $ac_cv_ft_include)
 	fi
        if test "$mgp_use_freetype" = "yes"; then
	  LIBS="-L$ac_cv_ft_lib $LIBS"
	  OPTFLAGS="-I$ac_cv_ft_include $OPTFLAGS"
	  DEPLIBS="$ac_cv_ft_lib/$ac_cv_ft_libpath $DEPLIBS"
	  AC_CHECK_LIB(intl, dgettext)
 	  AC_CHECK_LIB(ttf, TT_Init_FreeType, [],
		[echo "Fatal: libttf.a not found"
		exit 1])
 	  AC_TRY_COMPILE([#include <freetype.h>], [], [], [dnl
 		echo "Fatal: freetype.h not found"
 		exit 1])
 	  AC_DEFINE(FREETYPE)
	  AC_MSG_CHECKING(for num_CharMaps field in TT_Face_Properties)
 	  AC_TRY_COMPILE([#include <freetype.h>],
		[TT_Face_Properties x; return x.num_CharMaps;],
		[result=yes; AC_DEFINE(HAVE_TT_FACE_PROPERTIES_CHARMAPS)],
		[result=no])
	  AC_MSG_RESULT($result)
       fi
fi

AC_MSG_CHECKING(if vflib is used)
AC_ARG_ENABLE(vflib,
	[  --disable-vflib         DON'T use vflib routines.],
	[mgp_use_vflib="$enableval"],
	[mgp_use_vflib="yes"])
AC_MSG_RESULT($mgp_use_vflib)

if test "$mgp_use_vflib" = "yes"; then
	AC_MSG_CHECKING(for VFlib library/header)
	for dir in $SEARCHPATH /usr/local/VFlib /usr/local/vflib /usr/local /usr/pkg /usr; do
		ac_cv_vf_libname=VFlib
		ac_cv_vf_libdir=no
		ac_cv_vf_hdrdir=no
		shlib1=`echo $dir/lib/libVFlib.so* | head -n 1 | sed -e 's/.*\///'`
		shlib2=`echo $dir/lib/libVFlib2.so* | head -n 1 | sed -e 's/.*\///'`
		if test x$shlib1 = x; then
			$shlib1=no
		fi
		if test x$shlib2 = x; then
			$shlib2=no
		fi
		if test -d $dir/lib -a -f $dir/lib/$shlib1; then
			ac_cv_vf_libdir="$dir/lib"
 			ac_cv_vf_libpath=$shlib1
		elif test -d $dir/lib -a -f $dir/lib/libVFlib.a; then
			ac_cv_vf_libdir="$dir/lib"
			ac_cv_vf_libpath="libVFlib.a"
		elif test -d $dir/lib -a -f $dir/lib/$shlib2; then
			ac_cv_vf_libname=VFlib2
			ac_cv_vf_libdir="$dir/lib"
 			ac_cv_vf_libpath=$shlib2
		elif test -d $dir/lib -a -f $dir/lib/libVFlib2.a; then
			ac_cv_vf_libname=VFlib2
			ac_cv_vf_libdir="$dir/lib"
			ac_cv_vf_libpath="libVFlib2.a"
		fi
		if test -d $dir/include -a -f $dir/include/VF.h; then
			ac_cv_vf_hdrdir="$dir/include"
		fi
		if test "$ac_cv_vf_libdir" != "no" -a "$ac_cv_vf_hdrdir" != "no"; then
			LIBS="-L$ac_cv_vf_libdir $LIBS"
			CFLAGS="-I$ac_cv_vf_hdrdir $CFLAGS"
			break
		fi
	done
	if test "$ac_cv_vf_libdir" = "no" -o "$ac_cv_vf_hdrdir" = "no"; then
		AC_MSG_RESULT(no - not using VFlib)
		mgp_use_vflib=no
	else
		AC_MSG_RESULT($ac_cv_vf_libdir and $ac_cv_vf_hdrdir)
	fi
fi
if test "$mgp_use_vflib" = "yes"; then
	LIBS="-L$ac_cv_vf_libdir -l$ac_cv_vf_libname $LIBS"
	OPTFLAGS="-I$ac_cv_vf_hdrdir $OPTFLAGS"
	DEPLIBS="$ac_cv_vf_libdir/$ac_cv_vf_libpath $DEPLIBS"
	AC_CHECK_LIB($ac_cv_vf_libname, VF_Init,
		[mgp_cv_vflib_a=$ac_cv_vf_libpath],
		[echo "Fatal: $ac_cv_vf_libpath not found"
		exit 1])
	AC_TRY_COMPILE([#include <VF.h>], [], [], [dnl
		echo "Fatal: VF.h not found"
		exit 1])
	AC_DEFINE(VFLIB)

	AC_MSG_CHECKING(for VFlib configuration file)
	AC_ARG_WITH(vfontcap, [  --with-vfontcap=PATH    use PATH as vfontcap])
	ac_cv_vf_fontcap="no"
	if test -f "$with_vfontcap"; then
		ac_cv_vf_fontcap=$with_vfontcap;
	else
		for ac_dir in /usr/local/lib /usr/local/lib/tex \
		    /usr/local/lib/VFlib /usr/local/lib/fonts/vf \
		    /usr/local/lib /usr/local/etc /etc \
		    /usr/local/libdata/vflib /usr/local/share/VFlib \
		    /usr/local/share/VFlib/* \
		    ../../VFlib* ../VFlib* VFlib*; do
			if test -d $ac_dir -a -f $ac_dir/vfontcap; then
				ac_cv_vf_fontcap=$ac_dir/vfontcap;
				break
			fi
		done
	fi
	AC_MSG_RESULT($ac_cv_vf_fontcap)
	if test "$ac_cv_vf_fontcap" = "no"; then
		echo Fatal: no vfontcap file found.  cannot continue.
		echo Please use the option --with-vfontcap=PATH to specify the path to vfontcap.
		exit 1
	fi
	AC_DEFINE_UNQUOTED(VFCAP, "$ac_cv_vf_fontcap")
	AC_SUBST(mgp_cv_vflib_a)
fi

if test "$mgp_use_freetype" = "yes"; then
	AC_MSG_CHECKING(if freetype-charset16 is enabled)
	AC_ARG_ENABLE(freetype-charset16,
		[  --enable-freetype-charset16         use freetype for chaset16.],
		[mgp_use_freetype_c16="$enableval"],
		[mgp_use_freetype_c16="no"])
	AC_MSG_RESULT($mgp_use_freetype_c16)

	if test "$mgp_use_freetype_c16" = "yes"; then
		AC_DEFINE(FREETYPE_CHARSET16)
	fi
fi

if type pkg-config > /dev/null 2>&1; then
  for pnglib in libpng libpng12 libpng10
  do
     if pkg-config $pnglib; then
       LIBS="$LIBS `pkg-config --libs $pnglib`"
       OPTFLAGS="$OPTFLAGS `pkg-config --cflags $pnglib`"
       AC_DEFINE(USE_PNG)
       break
     fi
  done
fi
if test "$use_libpng" = ""; then
for i in $SEARCHPATH /usr/pkg /usr/local /usr; do
	if test -f $i/include/png.h; then 
		if test -f $i/lib/libpng.a ; then
			DEPLIBS="$DEPLIBS $i/lib/libpng.a"
		elif test -f $i/lib/libpng.so ; then
			DEPLIBS="$DEPLIBS $i/lib/libpng.so"
		else
			break;
		fi
		LIBS="$LIBS -L$i/lib"
		OPTFLAGS="$OPTFLAGS -I$i/include"
		AC_CHECK_LIB(png, png_read_image, 
			[LIBS="$LIBS -lpng"
			 AC_DEFINE(USE_PNG)], 
		[AC_CHECK_LIB(png, png_set_gray_1_2_4_to_8,
			[LIBS="$LIBS -lpng -lz"
			 AC_DEFINE(USE_PNG)],
			[], [-lz])])
		break
	fi
  done
fi

for i in /usr/pkg /usr/local /usr; do
	if test -f $i/include/libmng.h; then 
		if test -f $i/lib/libmng.a ; then
			DEPLIBS="$DEPLIBS $i/lib/libmng.a"
		elif test -f $i/lib/libmng.so ; then
			DEPLIBS="$DEPLIBS $i/lib/libmng.so"
		else
			break;
		fi
		LIBS="$LIBS -L$i/lib"
		OPTFLAGS="$OPTFLAGS -I$i/include"
		AC_CHECK_LIB(mng, mng_initialize, 
			[LIBS="$LIBS -lmng"
			 AC_DEFINE(MNG)], 
		[AC_CHECK_LIB(mng, mng_readdisplay,
			[LIBS="$LIBS -lmng -ljpeg"
			 AC_DEFINE(MNG)],
			[], [-ljpeg])])
		break
	fi
done

dnl Checks for header files.
AC_PATH_X
if test "$no_x" != yes; then
	if test "$x_libraries" != ""; then
		LIBS="$LIBS -L$x_libraries"
	fi
	if test "$x_includes" != ""; then
		OPTFLAGS="$OPTFLAGS -I$x_includes"
	fi
fi

AC_MSG_CHECKING(if Xft2 is used)
AC_ARG_ENABLE(xft2,
	[  --disable-xft2           DON'T use xft2 libraries.],
	[mgp_use_xft2="$enableval"],
	[mgp_use_xft2="yes"])
AC_MSG_RESULT($mgp_use_xft2)
if test "$mgp_use_xft2" = "yes"; then
  if type pkg-config > /dev/null 2>&1; then
     if pkg-config xft; then
        OPTFLAGS="`pkg-config --cflags xft` $OPTFLAGS"
        LIBS="$LIBS `pkg-config --libs xft`"
        AC_DEFINE(USE_XFT2)
		mgp_xft2_found="yes";
     fi
  fi 
  if test "$mgp_xft2_found" != "yes"; then
	AC_MSG_CHECKING(for xft2 and ft2 and fc header..)
	for dir in /usr/include /usr/include/Xft2 /usr/X11R6/include \
			    /usr/X11R6/include/freetype2					\
				/usr/local/include /usr/include/freetype2; do
		if test -f $dir/X11/Xft/Xft.h; then
			ac_cv_xft2_hdrdir="$dir"
		fi
		if test -f $dir/fontconfig/fontconfig.h; then
			ac_cv_fc_hdrdir="$dir"
		fi
		if test -f $dir/freetype/freetype.h; then
			ac_cv_ft2_hdrdir="$dir"
		fi
	done
	if test -z "$ac_cv_xft2_hdrdir" -o -z "$ac_cv_fc_hdrdir"; then 
		AC_MSG_RESULT(no - not using xft2)
		mgp_use_xft2=no
	else
		AC_MSG_RESULT($ac_cv_xft2_hdrdir and $ac_cv_ft2_hdrdir and $ac_cv_fc_hdrdir)
		if test $ac_cv_xft2_hdrdir != "/usr/include" ; then
			OPTFLAGS="-I$ac_cv_xft2_hdrdir $OPTFLAGS"
		fi
		if test $ac_cv_ft2_hdrdir != "/usr/include" ; then
			OPTFLAGS="-I$ac_cv_ft2_hdrdir $OPTFLAGS"
		fi
		if test $ac_cv_fc_hdrdir != "/usr/include" ; then
			OPTFLAGS="-I$ac_cv_fc_hdrdir $OPTFLAGS"
		fi
	fi
    if test "$mgp_use_xft2" = "yes"; then
  	  AC_MSG_CHECKING(for xft2 library..)
	  AC_CHECK_LIB(Xft, XftFontOpen, 
		[LIBS="$LIBS -lXft -lfontconfig"
		 AC_DEFINE(USE_XFT2) 
		 mgp_xft2_found=yes], [], [-lfontconfig])
    fi
  fi
fi
if test "$mgp_xft2_found" = "yes"; then
	AC_MSG_CHECKING(for iconv..)
	AC_CHECK_FUNC(iconv_open, [AC_DEFINE(HAVE_ICONV)],
	[AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; AC_DEFINE(HAVE_ICONV)],
	[AC_CHECK_LIB(iconv, libiconv_open, 
		[LIBS="$LIBS -liconv"; AC_DEFINE(HAVE_ICONV)])])])
fi

AC_CHECK_HEADERS(fontconfig/fontconfig.h)

AC_MSG_CHECKING(if gif handling is enabled)
AC_ARG_ENABLE(gif,
	[  --enable-gif            compile gif support in (need libungif).],
	[mgp_gif="$enableval"],
	[mgp_gif="yes"])
AC_MSG_RESULT($mgp_gif)
if test $mgp_gif = "yes"; then
	AC_CHECK_LIB(ungif, DGifOpenFileHandle,
		[gif_ok=yes
		GIFLIB="-lungif"
		AC_DEFINE(USE_GIF)],
	[AC_CHECK_LIB(gif, DGifOpenFileHandle,
		[gif_ok=yes
		GIFLIB="-lgif"
		AC_DEFINE(USE_GIF)],
	[AC_CHECK_LIB(ungif, DGifOpenFileName,
		[gif_ok=yes
		GIFLIB="-lungif"
		AC_DEFINE(USE_GIF)],
	[AC_CHECK_LIB(gif, DGifOpenFilename,
		[gif_ok=yes
		GIFLIB="-lgif"
		AC_DEFINE(USE_GIF)], 
		[], [-L$x_libraries -lX11])], [-L$x_libraries -lX11])])])
	if test "x$gif_ok" != "xyes"; then
		echo 'FATAL: You need libungif to use gif images.  pass proper LIBS to configure.'
		exit 1
	fi
	for i in /usr/pkg /usr/local /usr; do
		if test -f $i/include/gif_lib.h; then
			gif_h_ok=yes
			OPTFLAGS="$OPTFLAGS -I$i/include"
			break
		fi
	done
	if test -f /usr/include/gif_lib.h; then
		gif_h_ok=yes
	fi
	if test "x$gif_h_ok" != "xyes"; then
		AC_CHECK_HEADER(gif_lib.h, gif_h_ok=yes)
	fi
	if test "x$gif_h_ok" != "xyes"; then
		echo 'FATAL: cannot find gif_lib.h.  pass proper CPPFLAGS to configure.'
		exit 1
	fi
fi

USE_IMLIB=0
AC_SUBST(USE_IMLIB)
AC_MSG_CHECKING(if imlib is used)
AC_ARG_ENABLE(imlib,
	[  --enable-imlib          use imlib2 exclusively to load images.],
	[mgp_imlib="$enableval"],
	[mgp_imlib="yes"])
AC_MSG_RESULT($mgp_imlib)
if test $mgp_imlib = "yes"; then
  if type pkg-config > /dev/null 2>&1; then
     if pkg-config imlib2; then
        LIBS="$LIBS `pkg-config --libs imlib2`"
        OPTFLAGS="$OPTFLAGS `pkg-config --cflags imlib2`"
	AC_DEFINE(USE_IMLIB)
	USE_IMLIB=1
     fi
  else
	AC_CHECK_LIB(Imlib2, imlib_load_image,
		[imlib_ok=yes
		LIBS="$LIBS -lImlib2"
		AC_DEFINE(USE_IMLIB)
		USE_IMLIB=1],
		[], [-L$x_libraries -lX11 -lXext])
	if test "x$imlib_ok" != "xyes"; then
		echo 'FATAL: You need libImlib2 to use Imlib loading.  pass proper LIBS to configure.'
		exit 1
	fi
	for i in /usr/pkg /usr/local; do
		if test -f $i/include/Imlib2.h; then
			imlib_h_ok=yes
			OPTFLAGS="$OPTFLAGS -I$i/include"
			break
		fi
	done
	if test -f /usr/include/Imlib2.h; then
		imlib_h_ok=yes
	fi
	if test "x$gif_h_ok" != "xyes"; then
		AC_CHECK_HEADER(Imlib2.h, imlib_h_ok=yes)
	fi
	if test "x$imlib_h_ok" != "xyes"; then
		echo 'FATAL: cannot find Imlib2.h.  pass proper CPPFLAGS to configure.'
		exit 1
	fi
  fi
fi

dnl add GIFLIB to LIBS
if test -n "$GIFLIB"; then
	LIBS="$LIBS $GIFLIB"
fi

AC_ARG_WITH(m17n-lib, [  --with-m17n-lib         use the m17n library])
if test "x$with_m17n_lib" = "xyes"; then
	AC_CHECK_PROG(HAVE_M17NLIB, m17n-config, yes)
	if test "x$HAVE_M17NLIB" = "xyes"; then
		AC_DEFINE(USE_M17N)
		OPTFLAGS="$OPTFLAGS `m17n-config X --cflags`"
		LIBS="$LIBS `m17n-config X --libs` -lm17n-core"
	fi
fi

dnl keyword substitution.
mgp_keywords=`$mgp_cv_path_perl $srcdir/keywords.pl $srcdir/globals.c`
AC_SUBST(mgp_keywords)
 
AC_OUTPUT(Imakefile image/Imakefile sample/Imakefile
	contrib/mgp2html.pl contrib/mgp2latex.pl contrib/mgpnet mgpembed.pl)

/bin/rm -f Makefile image/Makefile

echo "be sure to generate Makefile from Imakefile, by xmkmf and make Makefiles"