1 dnl w3m autoconf macros
3 # ----------------------------------------------------------------
5 # ----------------------------------------------------------------
6 AC_DEFUN([AC_W3M_VERSION],
7 [AC_SUBST(CURRENT_VERSION)
8 cvsver=`$AWK '\$[1] ~ /Id:/ { print \$[3]}' $srcdir/ChangeLog`
9 sed -e 's/define CURRENT_VERSION "\(.*\)+cvs/define CURRENT_VERSION "\1+cvs-'$cvsver'/' $srcdir/version.c.in > version.c
10 CURRENT_VERSION=`sed -n 's/.*define CURRENT_VERSION *"w3m\/\(.*\)".*$/\1/p' version.c`])
12 # ----------------------------------------------------------------
14 # ----------------------------------------------------------------
15 AC_DEFUN([AC_W3M_COLOR],
17 AC_MSG_CHECKING(if color escape sequence for kterm/pxvt is enabled)
19 [ --disable-color disable color for vt100 terminal],,
21 test x"$enable_color" = xyes && AC_DEFINE(USE_COLOR)
22 AC_MSG_RESULT($enable_color)])
24 # ----------------------------------------------------------------
26 # ----------------------------------------------------------------
27 AC_DEFUN([AC_W3M_ANSI_COLOR],
28 [AC_SUBST(USE_ANSI_COLOR)
29 AC_MSG_CHECKING(if ansi color escape sequence support is enabled)
30 AC_ARG_ENABLE(ansi_color,
31 [ --disable-ansi-color disable ansi color escape sequence],,
32 [enable_ansi_color="$enable_color"])
33 test x"$enable_ansi_color" = xyes && AC_DEFINE(USE_ANSI_COLOR)
34 AC_MSG_RESULT($enable_ansi_color)])
36 # ----------------------------------------------------------------
38 # ----------------------------------------------------------------
39 AC_DEFUN([AC_W3M_BG_COLOR],
40 [AC_SUBST(USE_BG_COLOR)
41 AC_MSG_CHECKING(if background color support is enabled)
42 AC_ARG_ENABLE(bgcolor,
43 [ --disable-bgcolor disable to set background color],,
44 [enable_bgcolor="$enable_color"])
45 test x"$enable_bgcolor" = xyes && AC_DEFINE(USE_BG_COLOR)
46 AC_MSG_RESULT($enable_bgcolor)])
48 # ----------------------------------------------------------------
50 # ----------------------------------------------------------------
51 AC_DEFUN([AC_W3M_MENU],
53 AC_MSG_CHECKING(if popup menu is enabled)
55 [ --disable-menu disable popup menu],,
57 test x"$enable_menu" = xyes && AC_DEFINE(USE_MENU)
58 AC_MSG_RESULT($enable_menu)])
60 # ----------------------------------------------------------------
62 # ----------------------------------------------------------------
63 AC_DEFUN([AC_W3M_MOUSE],
65 AC_MSG_CHECKING(if mouse operation enabled)
67 [ --disable-mouse disable mouse operation],,
69 test x"$enable_mouse" = xyes && AC_DEFINE(USE_MOUSE)
70 AC_MSG_RESULT($enable_mouse)])
72 # ----------------------------------------------------------------
74 # ----------------------------------------------------------------
75 AC_DEFUN([AC_W3M_COOKIE],
77 AC_MSG_CHECKING(if cookie is enabled)
79 [ --disable-cookie disable cookie],,
80 [enable_cookie="yes"])
81 test x"$enable_cookie" = xyes && AC_DEFINE(USE_COOKIE)
82 AC_MSG_RESULT($enable_cookie)])
84 # ----------------------------------------------------------------
86 # ----------------------------------------------------------------
87 AC_DEFUN([AC_W3M_DICT],
89 AC_MSG_CHECKING(if dictionary lookup is enabled)
91 [ --disable-dict disable dictionary lookup (see README.dict)],,
93 test x"$enable_dict" = xyes && AC_DEFINE(USE_DICT)
94 AC_MSG_RESULT($enable_dict)])
96 # ----------------------------------------------------------------
98 # ----------------------------------------------------------------
99 AC_DEFUN([AC_W3M_HISTORY],
100 [AC_SUBST(USE_HISTORY)
101 AC_MSG_CHECKING(if URL history is enabled)
102 AC_ARG_ENABLE(history,
103 [ --disable-history disable URL history],,
104 [enable_history="yes"])
105 test x"$enable_history" = xyes && AC_DEFINE(USE_HISTORY)
106 AC_MSG_RESULT($enable_history)])
108 # ----------------------------------------------------------------
110 # ----------------------------------------------------------------
111 AC_DEFUN([AC_W3M_NNTP],
113 AC_MSG_CHECKING(if nntp is enabled)
115 [ --disable-nntp disable NNTP],,
117 test x"$enable_nntp" = xyes && AC_DEFINE(USE_NNTP)
118 AC_MSG_RESULT($enable_nntp)])
120 # ----------------------------------------------------------------
122 # ----------------------------------------------------------------
123 AC_DEFUN([AC_W3M_GOPHER],
124 [AC_SUBST(USE_GOPHER)
125 AC_MSG_CHECKING(if gopher is enabled)
126 AC_ARG_ENABLE(gopher,
127 [ --enable-gopher enable GOPHER],,
128 [enable_gopher="no"])
129 test x"$enable_gopher" = xyes && AC_DEFINE(USE_GOPHER)
130 AC_MSG_RESULT($enable_gopher)])
132 # ----------------------------------------------------------------
134 # ----------------------------------------------------------------
136 AC_DEFUN([AC_W3M_M17N],
138 AC_SUBST(USE_UNICODE)
141 AC_SUBST(DISPLAY_CHARSET)
142 AC_SUBST(SYSTEM_CHARSET)
143 AC_SUBST(DOCUMENT_CHARSET)
146 WCTARGET=""; WCCFLAGS=""; wcinclude=""; wclib=""
147 AC_MSG_CHECKING(if m17n support is enabled)
149 [ --disable-m17n do not use m17n],,
151 AC_MSG_RESULT($enable_m17n)
152 if test x"$enable_m17n" = xno; then
158 display_charset='WC_CES_US_ASCII'
159 system_charset='WC_CES_US_ASCII'
160 document_charset='WC_CES_US_ASCII'
163 WCTARGET="libwc/libwc.a"
164 WCCFLAGS='-I$(srcdir) -I$(srcdir)/..'
165 wcinclude='-I$(srcdir)/libwc'
166 wclib="-L./libwc -lwc"
167 AC_MSG_CHECKING(if unicode support is enabled)
168 AC_ARG_ENABLE(unicode,
169 [ --disable-unicode do not use unicode],,
170 [enable_unicode="yes"])
171 AC_MSG_RESULT($enable_unicode)
172 if test x"$enable_m17n" = xyes; then
177 if test x"$enable_unicode" = xyes; then
178 WCCFLAGS="-DUSE_UNICODE $WCCFLAGS"
179 if test x"$charset" = xUS-ASCII; then
182 AC_DEFINE(USE_UNICODE)
184 AC_MSG_CHECKING(if message l10n)
185 AC_ARG_ENABLE(messagel10n,
186 [ --enable-messagel10n=LL message l10n instead of NLS],,
187 [enable_messagel10n="no"])
188 if test x$enable_messagel10n = xyes; then
189 enable_messagel10n="ja";
191 AC_MSG_RESULT($enable_messagel10n)
192 if test x$enable_messagel10n = xno; then
195 POSUBST="\$(top_srcdir)/posubst"
196 POLANG="$enable_messagel10n"
198 AC_MSG_CHECKING(if japanese support is enabled)
199 AC_ARG_ENABLE(japanese,
200 [ --enable-japanese=CODE support Japanese CODE=(S|E|J|U)],,
201 [enable_japanese="no"])
202 AC_MSG_RESULT($enable_japanese)
203 if test x"$enable_japanese" = xno; then
207 case "$enable_japanese" in
209 S*) charset=Shift_JIS;;
210 J*) charset=ISO-2022-JP;;
214 display_charset=$charset
215 AC_MSG_CHECKING(which charset is used for display)
217 [ --with-charset=CHARSET],
218 [test x"with_charset" = xyes || display_charset="$with_charset"])
219 AC_MSG_RESULT($display_charset)
220 display_charset=`awk '$[1] == "'$display_charset'" {print $[2]}' $srcdir/charset-list`
221 case "$display_charset" in
223 system_charset=WC_CES_EUC_JP
224 document_charset=WC_CES_EUC_JP
227 system_charset=$display_charset
229 document_charset=WC_CES_EUC_JP
231 WC_CES_ISO_2022_CN|WC_CES_HZ_GB_2312)
232 system_charset=WC_CES_EUC_CN
233 document_charset=WC_CES_EUC_CN
236 system_charset=$display_charset
238 document_charset=WC_CES_EUC_TW
241 system_charset=WC_CES_EUC_KR
242 document_charset=WC_CES_EUC_KR
245 system_charset=$display_charset
246 document_charset=$display_charset
250 W3M_LANGDEF=`echo $w3m_lang | tr 'a-z' 'A-Z'`
251 W3M_LANG=$W3M_LANGDEF
252 AC_DEFINE_UNQUOTED(W3M_LANG, $W3M_LANG)
253 AC_DEFINE_UNQUOTED(WCTARGET, "$WCTARGET")
254 AC_DEFINE_UNQUOTED(WCCFLAGS, "$WCCFLAGS")
255 CFLAGS="$CFLAGS $wcinclude"
256 W3M_LIBS="$W3M_LIBS $wclib"
257 AC_DEFINE_UNQUOTED(DISPLAY_CHARSET, $display_charset)
258 AC_DEFINE_UNQUOTED(SYSTEM_CHARSET, $system_charset)
259 AC_DEFINE_UNQUOTED(DOCUMENT_CHARSET, $document_charset)])
261 # ----------------------------------------------------------------
263 # ----------------------------------------------------------------
264 AC_DEFUN([AC_W3M_KEYMAP],
265 [AC_SUBST(KEYMAP_FILE)
266 AC_MSG_CHECKING(default keymap)
267 AC_ARG_ENABLE(keymap,
268 [ --enable-keymap[=w3m|lynx] default keybind style(w3m or lynx)],,
269 [enable_keymap="w3m"])
270 AC_MSG_RESULT($enable_keymap)
271 case x"$enable_keymap" in
273 KEYMAP_FILE="keybind";;
275 KEYMAP_FILE="keybind_lynx";;
277 AC_MSG_ERROR([keymap should be either w3m or lynx.]);;
280 HELP_FILE=w3mhelp-${enable_keymap}_$w3m_lang.html
281 AC_DEFINE_UNQUOTED(HELP_FILE, "$HELP_FILE")
283 AC_DEFINE_UNQUOTED(KEYBIND, $enable_keymap)])
285 # ----------------------------------------------------------------
287 # ----------------------------------------------------------------
288 AC_DEFUN([AC_W3M_DIGEST_AUTH],
289 [AC_SUBST(USE_DIGEST_AUTH)
290 AC_MSG_CHECKING(if digest auth is enabled)
291 AC_ARG_ENABLE(digest_auth,
292 [ --disable-digest-auth disable digest auth],,
293 [enable_digest_auth="yes"])
294 test x"$enable_digest_auth" = xyes && AC_DEFINE(USE_DIGEST_AUTH)
295 AC_MSG_RESULT($enable_digest_auth)])
297 # ----------------------------------------------------------------
299 # ----------------------------------------------------------------
300 AC_DEFUN([AC_W3M_MIGEMO],
301 [AC_SUBST(USE_MIGEMO)
302 AC_SUBST(DEF_MIGEMO_COMMAND)
303 migemo_command="migemo -t egrep /usr/local/share/migemo/migemo-dict"
304 AC_MSG_CHECKING(if migemo is supported with)
306 [ --with-migemo=MIGEMO_COMMAND migemo command],
307 [test x"$with_migemo" = xyes || migemo_command="$with_migemo"])
308 if test "${with_migemo+set}" = set -a "$with_migemo" != "no"; then
309 AC_DEFINE(USE_MIGEMO)
311 AC_MSG_RESULT($migemo_command)
312 AC_DEFINE_UNQUOTED(DEF_MIGEMO_COMMAND, "$migemo_command")])
314 # ----------------------------------------------------------------
316 # ----------------------------------------------------------------
317 AC_DEFUN([AC_W3M_EDITOR],
318 [AC_SUBST(DEF_EDITOR)
319 w3m_editor="/usr/bin/vi"
320 AC_MSG_CHECKING(which editor is used by default)
322 [ --with-editor=EDITOR default editor (/usr/bin/vi)],
323 [w3m_editor="$with_editor"])
324 AC_MSG_RESULT($w3m_editor)
325 AC_DEFINE_UNQUOTED(DEF_EDITOR, "$w3m_editor")])
327 # ----------------------------------------------------------------
329 # ----------------------------------------------------------------
330 AC_DEFUN([AC_W3M_MAILER],
331 [AC_SUBST(DEF_MAILER)
332 w3m_mailer="/usr/bin/mail"
333 AC_MSG_CHECKING(which mailer is used by default)
335 [ --with-mailer=MAILER default mailer (/usr/bin/mail)],
336 [w3m_mailer="$with_mailer"])
337 AC_MSG_RESULT($w3m_mailer)
338 AC_DEFINE_UNQUOTED(DEF_MAILER, "$w3m_mailer")])
340 # ----------------------------------------------------------------
342 # ----------------------------------------------------------------
343 AC_DEFUN([AC_W3M_EXT_BROWSER],
344 [AC_SUBST(DEF_EXT_BROWSER)
345 w3m_browser="/usr/bin/mozilla"
346 AC_MSG_CHECKING(which external browser is used by default)
348 [ --with-browser=BROWSER default browser (/usr/bin/mozilla)],
349 [w3m_browser="$with_browser"])
350 AC_MSG_RESULT($w3m_browser)
351 AC_DEFINE_UNQUOTED(DEF_EXT_BROWSER, "$w3m_browser")])
353 # ----------------------------------------------------------------
355 # ----------------------------------------------------------------
356 AC_DEFUN([AC_W3M_HELP_CGI],
357 [AC_SUBST(USE_HELP_CGI)
358 AC_MSG_CHECKING(if help cgi is enabled)
359 AC_ARG_ENABLE(help_cgi,
360 [ --disable-help-cgi disable help cgi],,
361 [enable_help_cgi="yes"])
362 test x"$enable_help_cgi" = xyes && AC_DEFINE(USE_HELP_CGI)
363 AC_MSG_RESULT($enable_help_cgi)])
365 # ----------------------------------------------------------------
366 # AC_W3M_EXTERNAL_URI_LOADER
367 # ----------------------------------------------------------------
368 AC_DEFUN([AC_W3M_EXTERNAL_URI_LOADER],
369 [AC_SUBST(USE_EXTERNAL_URI_LOADER)
370 AC_MSG_CHECKING(if external URI loader is enabled)
371 AC_ARG_ENABLE(external_uri_loader,
372 [ --disable-external-uri-loader disable external URI loader],,
373 [enable_external_uri_loader="yes"])
374 test x"$enable_external_uri_loader" = xyes && AC_DEFINE(USE_EXTERNAL_URI_LOADER)
375 AC_MSG_RESULT($enable_external_uri_loader)])
377 # ----------------------------------------------------------------
379 # ----------------------------------------------------------------
380 AC_DEFUN([AC_W3M_W3MMAILER],
381 [AC_SUBST(USE_W3MMAILER)
382 AC_MSG_CHECKING(if w3mmail is used)
383 AC_ARG_ENABLE(w3mmailer,
384 [ --disable-w3mmailer disable w3mmailer],,
385 [enable_w3mmailer="$enable_external_uri_loader"])
386 test x"$enable_external_uri_loader" = xno && enable_w3mmailer=no
387 test x"$enable_w3mmailer" = xyes && AC_DEFINE(USE_W3MMAILER)
388 AC_MSG_RESULT($enable_w3mmailer)])
390 # ----------------------------------------------------------------
391 # AC_W3M_EXTLIBS(libs)
392 # ----------------------------------------------------------------
393 AC_DEFUN([AC_W3M_EXTLIBS],
395 AC_MSG_CHECKING(for -l$lib)
397 for dir in /lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib
399 if test -f $dir/lib$lib.a -o -f $dir/lib$lib.so ; then
401 extlib="found at $dir"
405 AC_MSG_RESULT($extlib)])
407 # ----------------------------------------------------------------
409 # ----------------------------------------------------------------
410 AC_DEFUN([AC_W3M_TERMLIB],
411 [AC_MSG_CHECKING(terminal library)
413 [ --with-termlib[=LIBS] terminal library
414 LIBS is space separated list of:
415 terminfo mytinfo termcap ncurses curses],,
416 [with_termlib="yes"])
417 AC_MSG_RESULT($with_termlib)
418 test x"$with_termlib" = xyes && with_termlib="terminfo mytinfo termlib termcap ncurses curses"
419 for lib in $with_termlib; do
420 AC_CHECK_LIB($lib, tgetent, [W3M_LIBS="$W3M_LIBS -l$lib"; break])
424 # ----------------------------------------------------------------
426 # ----------------------------------------------------------------
427 AC_DEFUN([AC_W3M_GC],
428 [AC_MSG_CHECKING(GC library exists)
430 [ --with-gc[=PREFIX] libgc PREFIX],
431 [test x"$with_gc" = xno && AC_MSG_ERROR([You can not build w3m without gc])],
433 AC_MSG_RESULT($with_gc)
434 test x"$with_gc" = xyes && with_gc="/usr /usr/local ${HOME}"
435 unset ac_cv_header_gc_h
436 AC_CHECK_HEADER(gc.h)
437 if test x"$ac_cv_header_gc_h" = xno; then
438 AC_MSG_CHECKING(GC header location)
439 AC_MSG_RESULT($with_gc)
441 for dir in $with_gc; do
442 for inc in include include/gc; do
444 CPPFLAGS="$CPPFLAGS -I$dir/$inc"
445 AC_MSG_CHECKING($dir/$inc)
446 unset ac_cv_header_gc_h
447 AC_CHECK_HEADER(gc.h, [gcincludedir="$dir/$inc"; CFLAGS="$CFLAGS -I$dir/$inc"; break])
450 if test x"$gcincludedir" != xno; then
454 if test x"$gcincludedir" = xno; then
455 AC_MSG_ERROR([gc.h not found])
458 unset ac_cv_lib_gc_GC_init
459 AC_CHECK_LIB(gc, GC_init, [LIBS="$LIBS -lgc"])
460 if test x"$ac_cv_lib_gc_GC_init" = xno; then
461 AC_MSG_CHECKING(GC library location)
462 AC_MSG_RESULT($with_gc)
464 for dir in $with_gc; do
466 LDFLAGS="$LDFLAGS -L$dir/lib"
467 AC_MSG_CHECKING($dir)
468 unset ac_cv_lib_gc_GC_init
469 AC_CHECK_LIB(gc, GC_init, [gclibdir="$dir/lib"; LIBS="$LIBS -L$dir/lib -lgc"; break])
472 if test x"$gclibdir" = xno; then
473 AC_MSG_ERROR([libgc not found])
477 # ----------------------------------------------------------------
479 # ----------------------------------------------------------------
480 AC_DEFUN([AC_W3M_SSL],
482 AC_SUBST(USE_SSL_VERIFY)
483 AC_MSG_CHECKING(if SSL is suported)
485 [ --with-ssl[=PREFIX] support https protocol],,
487 AC_MSG_RESULT($with_ssl)
488 if test x"$with_ssl" != xno; then
489 PKG_CHECK_MODULES(SSL, openssl,,[
490 AC_MSG_CHECKING(for SSL library/header)
491 test x"$with_ssl" = xyes && with_ssl="/usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local"
492 AC_MSG_RESULT($with_ssl)
495 if test -f "$dir/include/openssl/ssl.h"; then
496 SSL_CFLAGS="$SSL_CFLAGS -I$dir/include/openssl"
497 if test "$dir" != "/usr"; then
498 SSL_CFLAGS="$SSL_CFLAGS -I$dir/include"
500 elif test "$dir" != "/usr" -a -f "$dir/include/ssl.h"; then
501 SSL_CFLAGS="$SSL_CFLAGS -I$dir/include"
503 if test "$dir" != "/usr" -a -f "$dir/lib/libssl.a"; then
504 SSL_LIBS="$SSL_LIBS -L$dir/lib"
508 AC_CHECK_LIB(ssl, SSL_new,
509 [w3m_ssl="found"; CFLAGS="$CFLAGS $SSL_CFLAGS" W3M_LIBS="$W3M_LIBS $SSL_LIBS -lssl -lcrypto"],
510 [w3m_ssl="not found"],
511 [$SSL_LIBS -lcrypto])
513 if test x"$w3m_ssl" = xfound; then
515 AC_MSG_CHECKING(if SSL certificate verify is enabled)
516 AC_ARG_ENABLE(sslverify,
517 [ --disable-sslverify verify SSL certificate],,
518 [enable_sslverify="yes"])
519 test x"$enable_sslverify" = xyes && AC_DEFINE(USE_SSL_VERIFY)
520 AC_MSG_RESULT($enable_sslverify)
524 # ----------------------------------------------------------------
526 # ----------------------------------------------------------------
527 AC_DEFUN([AC_W3M_ALARM],
529 AC_MSG_CHECKING(if alarm is enabled)
531 [ --disable-alarm disable alarm],,
532 [enable_alarm="yes"])
533 AC_MSG_RESULT($enable_alarm)
534 if test x"$enable_alarm" = xyes; then
537 #include <signal.h>],
540 [AC_DEFINE(USE_ALARM)])
543 # ----------------------------------------------------------------
544 # AC_W3M_CHECK_VER(name, version, major, minor, micro,
545 # action-if-ok, message-if-badver, action-if-nover)
546 # ----------------------------------------------------------------
547 AC_DEFUN([AC_W3M_CHECK_VER],
549 if test x"$version" != x; then
550 AC_MSG_CHECKING($1 version)
551 AC_MSG_RESULT($version)
552 set -- `echo "$version" | sed 's/[[^0-9]]/ /g'`
553 if test "$[1]" -ne "$3" -o "$[2]" -lt "$4" || test "$[2]" -eq "$4" -a "$[3]" -lt "$5"; then
554 AC_MSG_WARN([$1 is too old. Install $1 (version >= $3.$4.$5)])
560 AC_MSG_WARN([$1 is not installed. Install $1 (version >= $3.$4.$5)])
564 # ----------------------------------------------------------------
566 # ----------------------------------------------------------------
567 AC_DEFUN([AC_W3M_IMAGE],
569 AC_SUBST(USE_W3MIMG_X11)
570 AC_SUBST(USE_W3MIMG_FB)
571 AC_SUBST(W3MIMGDISPLAY_SETUID)
572 AC_SUBST(INSTALL_W3MIMGDISPLAY)
573 INSTALL_W3MIMGDISPLAY='${INSTALL_PROGRAM}'
574 AC_DEFINE(INSTALL_W3MIMGDISPLAY, $INSTALL_W3MIMGDISPLAY)
575 AC_SUBST(USE_GDKPIXBUF)
581 AC_SUBST(IMGX11CFLAGS)
582 AC_SUBST(IMGX11LDFLAGS)
583 AC_SUBST(IMGFBCFLAGS)
584 AC_SUBST(IMGFBLDFLAGS)
585 AC_MSG_CHECKING(if image is enabled)
587 [ --enable-image[=DEVS] enable inline image handler for DEVS
588 DEVS may be comma separeted: x11,fb,fb+s
589 default: autodetected.
590 'no' means disable inline image],,
591 [enable_image="yes"])
592 AC_MSG_RESULT($enable_image)
593 if test x"$enable_image" != xno; then
595 if test x"$enable_image" = xyes; then
599 if test -c /dev/fb0; then
604 save_ifs="$IFS"; IFS=",";
605 for img in $enable_image; do
610 AC_DEFINE(W3MIMGDISPLAY_SETUID)
611 INSTALL_W3MIMGDISPLAY='${INSTALL} -o root -m 4755 -s'
612 AC_DEFINE(INSTALL_W3MIMGDISPLAY, $INSTALL_W3MIMGDISPLAY);;
618 AC_MSG_CHECKING(image library)
619 AC_ARG_WITH(imagelib,
620 [ --with-imagelib=IMAGELIBS image library
621 IMAGELIBS may be space separeted list of:
622 gtk2 gdk-pixbuf imlib imlib2],,
624 [with_imagelib="yes"])
625 if test x"$with_imagelib" = xyes; then
626 with_imagelib="gtk2 gdk-pixbuf imlib imlib2"
628 AC_MSG_RESULT($with_imagelib)
633 for imagelib in $with_imagelib
638 if test x"$IMLIB_CONFIG" = x; then
639 IMLIB_CONFIG=imlib-config
643 if test x"$IMLIB2_CONFIG" = x; then
644 IMLIB2_CONFIG=imlib2-config
648 if test x"$GDKPIXBUF_CONFIG" = x; then
649 GDKPIXBUF_CONFIG=gdk-pixbuf-config
653 if test x"$PKG_CONFIG" = x; then
654 PKG_CONFIG=pkg-config
661 if test x"$with_gtk2" = xyes; then
662 AC_W3M_CHECK_VER([GdkPixbuf],
663 [`$PKG_CONFIG --modversion gdk-pixbuf-2.0 2>/dev/null`],
665 [have_gdkpixbuf="yes"; have_gtk2="yes"],
666 [have_gdkpixbuf="no"; have_gtk2="no"])
668 if test x"$with_gdkpixbuf" = xyes; then
669 if test x"$have_gdkpixbuf" != xyes; then
670 AC_W3M_CHECK_VER([GdkPixbuf],
671 [`$GDKPIXBUF_CONFIG --version 2>/dev/null`],
673 [have_gdkpixbuf="yes"],
674 [have_gdkpixbuf="no"])
677 if test x"$with_imlib" = xyes; then
678 AC_W3M_CHECK_VER([Imlib],
679 [`$IMLIB_CONFIG --version 2>/dev/null`],
684 if test x"$with_imlib2" = xyes; then
685 AC_W3M_CHECK_VER([Imlib2],
686 [`$IMLIB2_CONFIG --version 2>/dev/null`],
691 if test x"$x11" = xyes; then
692 if test x"$have_gtk2" = xyes; then
693 AC_DEFINE(USE_W3MIMG_X11)
694 IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
696 AC_DEFINE(USE_GDKPIXBUF)
698 IMGX11CFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
699 IMGX11LDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
700 elif test x"$have_gdkpixbuf" = xyes; then
701 AC_DEFINE(USE_W3MIMG_X11)
702 IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
704 AC_DEFINE(USE_GDKPIXBUF)
705 IMGX11CFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
706 IMGX11LDFLAGS="`${GDKPIXBUF_CONFIG} --libs` -lgdk_pixbuf_xlib"
707 elif test x"$have_imlib" = xyes; then
708 AC_DEFINE(USE_W3MIMG_X11)
709 IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
712 IMGX11CFLAGS="`${IMLIB_CONFIG} --cflags`"
713 IMGX11LDFLAGS="`${IMLIB_CONFIG} --libs`"
715 elif test x"$have_imlib2" = xyes; then
716 AC_DEFINE(USE_W3MIMG_X11)
717 IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
719 AC_DEFINE(USE_IMLIB2)
720 IMGX11CFLAGS="`${IMLIB2_CONFIG} --cflags`"
721 IMGX11LDFLAGS="`${IMLIB2_CONFIG} --libs`"
723 AC_MSG_WARN([unable to build w3mimgdisplay with X11 support])
726 if test x"$fb" = xyes; then
727 if test x"$have_gtk2" = xyes; then
728 AC_DEFINE(USE_W3MIMG_FB)
729 IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
730 IMGTARGETS="${IMGTARGETS} fb"
731 AC_DEFINE(USE_GDKPIXBUF)
733 IMGFBCFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gtk+-2.0`"
734 IMGFBLDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gtk+-2.0`"
735 elif test x"$have_gdkpixbuf" = xyes; then
736 AC_DEFINE(USE_W3MIMG_FB)
737 IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
738 IMGTARGETS="${IMGTARGETS} fb"
739 AC_DEFINE(USE_GDKPIXBUF)
740 IMGFBCFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
741 IMGFBLDFLAGS="`${GDKPIXBUF_CONFIG} --libs`"
742 elif test x"$have_imlib2" = xyes; then
743 AC_DEFINE(USE_W3MIMG_FB)
744 IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
745 IMGTARGETS="${IMGTARGETS} fb"
746 AC_DEFINE(USE_IMLIB2)
747 IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
748 IMGFBCFLAGS="`${IMLIB2_CONFIG} --cflags`"
749 IMGFBLDFLAGS="`${IMLIB2_CONFIG} --libs`"
751 AC_MSG_WARN([unable to build w3mimgdisplay with FB support])
754 AC_DEFINE(IMGTARGETS, "$IMGTARGETS")
755 AC_DEFINE(IMGOBJS, "$IMGOBJS")
756 AC_DEFINE(IMGX11CFLAGS, "$IMGX11CFLAGS")
757 AC_DEFINE(IMGX11LDFLAGS, "$IMGX11LDFLAGS")
758 AC_DEFINE(IMGFBCFLAGS, "$IMGFBCFLAGS")
759 AC_DEFINE(IMGFBLDFLAGS, "$IMGLDFLAGS")
761 # ----------------------------------------------------------------
763 # ----------------------------------------------------------------
764 AC_DEFUN([AC_W3M_XFACE],
766 AC_MSG_CHECKING(if xface is enabled)
768 [ --disable-xface disable xface support],,
769 [enable_xface="$enable_image"])
770 test x"$enable_xface" = xyes && AC_DEFINE(USE_XFACE)
771 AC_MSG_RESULT($enable_xface)
772 AC_CHECK_PROG(uncompface, uncompface, "yes", "no")
773 test "$uncompface" = "no" && AC_MSG_WARN([uncompface is not installed.])
776 # ----------------------------------------------------------------
778 # ----------------------------------------------------------------
779 AC_DEFUN([AC_W3M_IPv6],
780 [AC_MSG_CHECKING(if IPv6 support is enabled)
782 [ --disable-ipv6 disable IPv6],,
784 AC_MSG_RESULT($enable_ipv6)
786 if test x"$enable_ipv6" = xyes; then
787 AC_MSG_CHECKING(if IPv6 API available)
789 AC_CHECK_FUNC(getaddrinfo,
792 if test x"$enable_ipv6" = xno; then
793 AC_MSG_CHECKING(for libinet6)
794 for dir in /usr/local/v6/lib /usr/local/lib /usr/lib
796 if test -f $dir/libinet6.a; then
797 if test $dir != "/usr/lib"; then
798 W3M_LIBS="$W3M_LIBS -L$dir"
800 AC_CHECK_LIB(inet6, getaddrinfo,
802 use_libinet6="found"; W3M_LIBS="$W3M_LIBS -linet6"; break],
803 [use_libinet6="not found"])
806 AC_MSG_RESULT($use_libinet6)
808 if test x"$enable_ipv6" = xyes; then
809 AC_SUBST(HAVE_OLD_SS_FAMILY)
810 AC_MSG_CHECKING(if struct sockaddr_storage has an ss_family member)
812 #include <sys/types.h>
813 #include <sys/socket.h>
815 struct sockaddr_storage ss;
816 int i = ss.ss_family;
818 [AC_MSG_RESULT(yes)],
820 #include <sys/types.h>
821 #include <sys/socket.h>
824 struct sockaddr_storage ss;
825 int i = ss.__ss_family;
827 [AC_MSG_RESULT(no, but __ss_family exists)
828 AC_DEFINE(HAVE_OLD_SS_FAMILY)],
830 AC_MSG_WARN(IPv6 support is disabled)
834 if test x"$enable_ipv6" = xyes; then
839 # ----------------------------------------------------------------
841 # ----------------------------------------------------------------
842 AC_DEFUN([AC_W3M_SYS_ERRLIST],
843 [AC_SUBST(HAVE_SYS_ERRLIST)
844 AC_MSG_CHECKING(for sys_errlist)
846 changequote(<<,>>)dnl
847 <<extern char *sys_errlist[];>>,
848 <<printf(sys_errlist[0]);>>,
850 [have_sys_errlist="yes"; AC_DEFINE(HAVE_SYS_ERRLIST)],
851 [have_sys_errlist="no"])
852 AC_MSG_RESULT($have_sys_errlist)])
854 # ----------------------------------------------------------------
856 # ----------------------------------------------------------------
857 AC_DEFUN([AC_W3M_SIGSETJMP],
858 [AC_SUBST(HAVE_SIGSETJMP)
859 AC_MSG_CHECKING(for sigsetjmp)
861 [#include <setjmp.h>],
863 if (sigsetjmp(env, 1) != 0) { exit(0); } siglongjmp(env, 1);],
864 [have_sigsetjmp="yes"; AC_DEFINE(HAVE_SIGSETJMP)],
865 [have_sigsetjmp="no"])
866 AC_MSG_RESULT($have_sigsetjmp)])
868 # ----------------------------------------------------------------
869 # AC_W3M_SIGNAL_RETURN
870 # ----------------------------------------------------------------
871 AC_DEFUN([AC_W3M_SIGNAL],
874 AC_SUBST(SIGNAL_RETURN)
875 if test x"$ac_cv_type_signal" = xvoid; then
876 AC_DEFINE(SIGNAL_RETURN,return)
878 AC_DEFINE(SIGNAL_RETURN,return 0)