1 dnl Process this file with autoconf to produce a configure script.
3 dnl Autoconf 2.13 generates an incomplete config.h.in; see ELinks bug 936.
4 dnl Autoconf 2.59 is installed in the computer that generates our nightly
5 dnl snapshots, so we need to be compatible with that.
8 AC_CONFIG_SRCDIR([src/main/main.c])
9 AC_CONFIG_AUX_DIR(config)
15 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Package version])
16 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Package version])
17 AC_CONFIG_HEADERS(config.h)
19 AC_CHECK_PROG(ACLOCAL,[aclocal],[aclocal],[config/missing aclocal])
20 AC_CHECK_PROG(AUTOCONF,[autoconf],[autoconf],[config/missing autoconf])
21 AC_CHECK_PROG(AUTOHEADER,[autoheader],[autoheader],[config/missing autoheader])
25 for make in gnumake gmake make false; do
26 if test "x$MAKE" = x; then
27 AC_PATH_PROGS(MAKE, "$make")
33 # Cleanup if we are configuring with a previous build in the tree
34 if test -e Makefile.config; then
35 AC_MSG_CHECKING([for previous build to clean])
36 "$MAKE" -C "$builddir/src" cleanall >/dev/null 2>/dev/null
40 dnl ===================================================================
41 dnl Load feature configuration file and start logging features.
42 dnl ===================================================================
44 features="features.conf"
45 AC_CHECK_FILE("$srcdir/$features", [ . $srcdir/$features ])
46 AC_CHECK_FILE("$builddir/$features", [ . $builddir/$features ])
47 echo "Feature summary:" > features.log
49 dnl ===================================================================
50 dnl Checks for programs.
51 dnl ===================================================================
55 AC_PATH_PROGS(AWK, "$AWK")
59 AC_PATH_PROGS(CG_COMMIT_ID, "cg-commit-id")
60 AC_PATH_PROGS(SPARSE, "sparse")
67 if test "x$CONFIG_DOC" != xno; then
68 AC_PATH_PROGS(ASCIIDOC, "asciidoc")
69 if test "x$ASCIIDOC" != "x"; then
70 EL_CONFIG(CONFIG_ASCIIDOC, [AsciiDoc])
71 EL_CONFIG(MANUAL_ASCIIDOC, [HTML (one file)])
72 EL_CONFIG(MAN_ASCIIDOC, [HTML])
74 echo > config.asciidoc-unsafe.txt
75 if "$ASCIIDOC" --unsafe config.asciidoc-unsafe.txt >/dev/null 2>/dev/null; then
76 ASCIIDOC_FLAGS=--unsafe
78 rm config.asciidoc-unsafe.*
81 AC_PATH_PROGS(XMLTO, "xmlto")
82 if test "x$XMLTO" != "x"; then
83 EL_CONFIG(CONFIG_XMLTO, [XmlTo])
84 EL_CONFIG(MANUAL_XMLTO, [HTML (multiple files)])
85 EL_CONFIG(MAN_XMLTO, [man (groff)])
88 AC_PATH_PROGS(JW, "jw")
89 if test "x$JW" != "x"; then
90 EL_CONFIG(CONFIG_JW, [JadeWrapper])
91 EL_CONFIG(MANUAL_JW, [PDF])
94 AC_PATH_PROGS(POD2HTML, "pod2html")
95 if test "x$POD2HTML" != "x"; then
96 EL_CONFIG(CONFIG_POD2HTML, [Pod2HTML])
99 AC_PATH_PROGS(DOXYGEN, "doxygen")
100 if test "x$DOXYGEN" != "x"; then
101 EL_CONFIG(CONFIG_DOXYGEN, [Doxygen])
102 api_srcdir="$(cd "$srcdir" && pwd)/src"
107 AC_SUBST(ASCIIDOC_FLAGS)
108 AC_SUBST(CONFIG_ASCIIDOC)
109 AC_SUBST(CONFIG_DOXYGEN)
110 AC_SUBST(CONFIG_POD2HTML)
111 AC_SUBST(CONFIG_XMLTO)
114 EL_CONFIG_DEPENDS(CONFIG_DOC, [CONFIG_ASCIIDOC CONFIG_XMLTO CONFIG_JW CONFIG_POD2HTML], [Documentation Tools])
115 EL_CONFIG_DEPENDS(CONFIG_MANUAL, [MANUAL_ASCIIDOC MANUAL_XMLTO MANUAL_JW], [Manual Formats])
116 EL_CONFIG_DEPENDS(CONFIG_MANPAGE, [MAN_ASCIIDOC MAN_XMLTO], [Man Page Formats])
117 EL_CONFIG_DEPENDS(CONFIG_APIDOCS, [CONFIG_DOXYGEN], [API Documentation])
119 dnl gcc specific options (to be continued at the bottom of configure)
120 if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
121 dnl We want to see all warnings and live with none.
122 dnl We can't set up -Werror here as there may be some warnings in test
123 dnl suite of configure, and we don't want to fail them.
124 CFLAGS="$CFLAGS -Wall"
127 dnl ===================================================================
128 dnl Checks for special OSes.
129 dnl ===================================================================
131 dnl EL_CHECK_COMPILER_MACRO(define, name, flagname)
132 AC_DEFUN([EL_CHECK_COMPILER_MACROS],
134 AC_MSG_CHECKING([for $2])
137 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#ifndef $flag
139 #endif ]])],[$1=yes],[$1=no])
140 if test "[$]$1" = yes; then
141 EL_CONFIG([$1], [$2])
149 EL_CHECK_COMPILER_MACROS(CONFIG_OS_BEOS, [BEOS], [__BEOS__])
150 AC_SUBST(CONFIG_OS_BEOS)
152 EL_CHECK_COMPILER_MACROS(CONFIG_OS_RISCOS, [RISCOS], [__riscos__])
153 AC_SUBST(CONFIG_OS_RISCOS)
155 EL_CHECK_COMPILER_MACROS(CONFIG_OS_WIN32, [WIN32], [_WIN32 __WIN32__])
156 AC_SUBST(CONFIG_OS_WIN32)
158 EL_CHECK_COMPILER_MACROS(CONFIG_OS_OS2, [EMX], [__EMX__])
159 AC_SUBST(CONFIG_OS_OS2)
160 test "$CONFIG_OS_OS2" = yes && LDFLAGS=`echo "$LDFLAGS" | sed "s/-Zexe//g"`
162 AC_MSG_CHECKING([for UNIX])
163 dnl FIXME: some depend kind of mechanism
164 if test "$CONFIG_OS_BEOS" = no && \
165 test "$CONFIG_OS_RISCOS" = no && \
166 test "$CONFIG_OS_WIN32" = no && \
167 test "$CONFIG_OS_OS2" = no; then
168 EL_CONFIG(CONFIG_OS_UNIX, [UNIX])
172 AC_MSG_RESULT($CONFIG_OS_UNIX)
173 AC_SUBST(CONFIG_OS_UNIX)
175 dnl ===================================================================
176 dnl Checks for header files.
177 dnl ===================================================================
184 AC_CHECK_HEADERS(wchar.h wctype.h)
185 AC_CHECK_HEADERS(fcntl.h limits.h time.h unistd.h)
186 AC_CHECK_HEADERS(sigaction.h)
187 AC_CHECK_HEADERS(arpa/inet.h)
188 AC_CHECK_HEADERS(netinet/in_systm.h netinet/in_system.h netinet/ip.h)
189 AC_CHECK_HEADERS(net/if.h netdb.h netinet/in.h netinet/in6_var.h)
190 AC_CHECK_HEADERS(ifaddrs.h)
191 AC_CHECK_HEADERS(sys/cygwin.h io.h)
192 AC_CHECK_HEADERS(sys/fmutex.h)
193 AC_CHECK_HEADERS(sys/ioctl.h sys/sockio.h)
194 AC_CHECK_HEADERS(sys/resource.h)
195 AC_CHECK_HEADERS(sys/select.h)
196 AC_CHECK_HEADERS(sys/signal.h)
197 AC_CHECK_HEADERS(sys/socket.h)
198 AC_CHECK_HEADERS(sys/time.h)
199 AC_CHECK_HEADERS(sys/utsname.h)
200 AC_CHECK_HEADERS(stdint.h inttypes.h)
201 AC_CHECK_HEADERS(locale.h pwd.h)
202 AC_CHECK_HEADERS(termios.h)
205 AC_CHECK_HEADERS(sys/un.h,
206 [CONFIG_INTERLINK=yes
207 EL_CONFIG([CONFIG_INTERLINK], [interlinking])],
208 [CONFIG_INTERLINK=no])
209 AC_SUBST(CONFIG_INTERLINK)
211 dnl ===================================================================
212 dnl Checks for typedefs, structures, and compiler characteristics.
213 dnl ===================================================================
218 EL_CHECK_CODE(typeof, HAVE_TYPEOF, [], [int a; typeof(a) b;])
223 EL_CHECK_TYPE(ssize_t, int)
224 EL_CHECK_SYS_TYPE(long long, HAVE_LONG_LONG, [])
225 EL_CHECK_SYS_TYPE(off_t, HAVE_OFF_T, [])
226 EL_CHECK_INT_TYPE(int32_t, HAVE_INT32_T)
227 EL_CHECK_INT_TYPE(uint32_t, HAVE_UINT32_T)
228 EL_CHECK_INT_TYPE(uint16_t, HAVE_UINT16_T)
230 AC_CHECK_SIZEOF(char, 1)
231 AC_CHECK_SIZEOF(short, 2)
232 AC_CHECK_SIZEOF(int, 4)
233 AC_CHECK_SIZEOF(long, 4)
234 test "x$HAVE_LONG_LONG" = xyes && AC_CHECK_SIZEOF(long long, 8)
235 test "x$HAVE_OFF_T" = xyes && AC_CHECK_SIZEOF(off_t, 4)
237 dnl Check for variadic macros
238 EL_CHECK_CODE([variadic macros], HAVE_VARIADIC_MACROS,
240 #define a(b,c...) printf(b,##c)],
241 [a("foo");a("%s","bar");a("%s%s","baz","quux");])
243 dnl Check for -rdynamic
245 dnl gcc -rdynamic calls ld -export-dynamic, which adds all symbols of
246 dnl the executable to its dynamic symbol table. ELinks uses this for
249 dnl 1. If ELinks detects a bug, it can try to display a backtrace by
250 dnl calling backtrace_symbols_fd() in the GNU libc. The glibc-2.3.6
251 dnl manual states users of GNU ld must pass -rdynamic to make the
252 dnl symbols available to the program.
254 dnl 2. It would eventually be nice to dynamically load shared
255 dnl libraries as plugins (bug 73). The plugins must be able to
256 dnl call ELinks functions. This can be implemented either by
257 dnl registering all callable functions in ELinks-specific data
258 dnl structures, or by letting the dynamic linker handle them.
259 dnl The latter way requires something equivalent to -rdynamic.
261 dnl Because backtraces are not needed for correct operation, and bug
262 dnl 73 is not yet being fixed, the configure script and makefiles
263 dnl should not complain to the user if they find that -rdynamic does
264 dnl not work. Besides, it was reported at elinks-users on 2006-09-12
265 dnl that gcc-3.4.2 with "ld: Software Generation Utilities - Solaris
266 dnl Link Editors: 5.8-1.284" on Sun Solaris 8 Sparc does not support
267 dnl -rdynamic but does something equivalent automatically. (This was
268 dnl tested with "nm -D elinks | grep redraw_from_window".)
270 dnl FIXME: This check doesn't work. Something to do with the compiler
271 dnl happily ignoring it and stderr not being checked for error messages.
272 AC_MSG_CHECKING([for -rdynamic])
274 LDFLAGS="$LDFLAGS -rdynamic"
275 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[have_rdynamic=yes],[have_rdynamic=no])
276 test "$have_rdynamic" = no && LDFLAGS="$LDFLAGS_X"
277 AC_MSG_RESULT($have_rdynamic)
279 dnl ===================================================================
280 dnl Check for POSIX <regex.h>
281 dnl ===================================================================
283 EL_CHECK_SYS_TYPE(regex_t, HAVE_REGEX_H, [#include <regex.h>])
285 dnl ===================================================================
286 dnl Checks for library functions.
287 dnl ===================================================================
289 AC_PROG_GCC_TRADITIONAL
293 AC_CHECK_FUNCS(atoll gethostbyaddr herror strerror)
294 AC_CHECK_FUNCS(popen uname access chmod alarm timegm mremap)
295 AC_CHECK_FUNCS(strcasecmp strncasecmp strcasestr strstr strchr strrchr)
296 AC_CHECK_FUNCS(memmove bcopy stpcpy strdup index isdigit mempcpy memrchr)
297 AC_CHECK_FUNCS(snprintf vsnprintf asprintf vasprintf)
298 AC_CHECK_FUNCS(getifaddrs getpwnam inet_pton inet_ntop)
299 AC_CHECK_FUNCS(fflush fsync fseeko ftello sigaction)
300 AC_CHECK_FUNCS(gettimeofday clock_gettime)
302 AC_CHECK_FUNCS([cygwin_conv_to_full_win32_path])
304 AC_CHECK_FUNCS(setenv putenv, HAVE_SETENV_OR_PUTENV=yes)
305 AC_CHECK_FUNCS(getuid, HAVE_GETUID=yes)
306 AC_CHECK_FUNCS(geteuid, HAVE_GETEUID=yes)
308 AC_CHECK_FUNCS(wcwidth)
310 dnl These aren't probably needed now, as they are commented in links.h.
311 dnl I've no idea about their historical background, but I keep them here
312 dnl just in the case they will help later. --pasky
313 AC_CHECK_FUNCS(getpid, HAVE_GETPID=yes)
314 AC_CHECK_FUNCS(setpgid getpgid setpgrp getpgrp)
315 AC_CHECK_FUNCS(raise, HAVE_RAISE=yes)
316 AC_CHECK_FUNCS(kill, HAVE_KILL=yes)
318 if test x"$HAVE_RAISE" = x; then
319 if test x"$HAVE_KILL" = x || test x"$HAVE_GETPID" = x; then
320 AC_MSG_ERROR([Unable to emulate raise()])
324 AC_CACHE_CHECK([for __va_copy],el_cv_HAVE_VA_COPY,[
325 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
326 va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])],[el_cv_HAVE_VA_COPY=yes],[el_cv_HAVE_VA_COPY=no])])
327 if test x"$el_cv_HAVE_VA_COPY" = x"yes"; then
328 EL_DEFINE(HAVE_VA_COPY, __va_copy)
331 AC_CACHE_CHECK([for sysconf(_SC_PAGE_SIZE)],el_cv_HAVE_SC_PAGE_SIZE,[
332 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
333 ]], [[int page_size = sysconf(_SC_PAGE_SIZE);]])],[el_cv_HAVE_SC_PAGE_SIZE=yes],[el_cv_HAVE_SC_PAGE_SIZE=no])])
334 if test x"$el_cv_HAVE_SC_PAGE_SIZE" = x"yes"; then
335 EL_DEFINE(HAVE_SC_PAGE_SIZE, _SC_PAGE_SIZE)
338 AC_CACHE_CHECK([for C99 vsnprintf],el_cv_HAVE_C99_VSNPRINTF,[
339 AC_RUN_IFELSE([AC_LANG_SOURCE([[
347 int bar(char *buf, const char *format, va_list ap)
349 return vsnprintf(buf, 0, format, ap);
352 void foo(const char *format, ...) {
356 va_start(ap, format);
357 len = bar(buf, format, ap);
359 if ((len != 6) && (len != 7)) exit(1); /* \n -> \r\n */
361 va_start(ap, format);
362 len = bar(buf, format, ap);
364 if ((len != 6) && (len != 7)) exit(1);
366 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
370 main() { foo("hello\n"); }
371 ]])],[el_cv_HAVE_C99_VSNPRINTF=yes],[el_cv_HAVE_C99_VSNPRINTF=no],[el_cv_HAVE_C99_VSNPRINTF=cross])])
372 if test x"$el_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
373 EL_DEFINE(HAVE_C99_VSNPRINTF, [C99 compliant vsnprintf()])
376 AC_CHECK_LIB(dl, dlopen) # OpenSSL and Lua frequently needs it
378 dnl ===================================================================
379 dnl Checks for libraries.
380 dnl ===================================================================
382 dnl Replace `main' with a function in -lsocket:
383 AC_CHECK_FUNC(socket, cf_result=yes, cf_result=no)
384 if test "$cf_result" = no; then
385 AC_CHECK_LIB(socket, socket)
388 AC_CHECK_FUNC(setsockopt, cf_result=yes, cf_result=no)
389 if test "$cf_result" = no; then
390 AC_CHECK_LIB(socket, setsockopt)
393 AC_CHECK_FUNC(gethostbyname, cf_result=yes, cf_result=no)
394 if test "$cf_result" = no; then
395 AC_CHECK_LIB(socket, gethostbyname, cf_result=yes, cf_result=no)
396 if test "$cf_result" = no; then
397 AC_CHECK_LIB(nsl, gethostbyname)
399 test -z "`echo $LIBS | grep -- -lsocket`" && LIBS="$LIBS -lsocket"
403 dnl ===================================================================
404 dnl Checks for packaging specific options.
405 dnl ===================================================================
407 AC_ARG_WITH(xterm, [ --with-xterm how to invoke the X terminal emulator],
408 [ if test "$withval" != no && test "$withval" != yes; then
409 AC_DEFINE_UNQUOTED(XTERM, "$withval", [How to invoke XTerm])
412 dnl ===================================================================
413 dnl Checks for a libraries, optional even if installed.
414 dnl ===================================================================
416 dnl EL_CHECK_OPTIONAL_LIBRARY(define, name, header, lib, function)
417 AC_DEFUN([EL_CHECK_OPTIONAL_LIBRARY],
419 AC_MSG_CHECKING([for $2 support])
421 if test "[$]$1" != no; then
424 if test -n "$withval" && test -d "$withval"; then
425 # Be a little more careful when setting
426 # include and lib directories. This way
427 # $withval will work when includes are
428 # there but the library is in the common
429 # /usr/lib ... Does the right thing when
430 # looking for gc on Debian.
431 if test -d "$withval/include"; then
432 CFLAGS="$CFLAGS -I$withval/include"
433 CPPFLAGS="$CPPFLAGS -I$withval/include"
435 CFLAGS="$CFLAGS -I$withval"
436 CPPFLAGS="$CPPFLAGS -I$withval"
438 if test -d "$withval/lib"; then
439 LDFLAGS="$LDFLAGS -L$withval/lib"
443 AC_CHECK_HEADERS([$3], [$1=yes], [$1=no; break;])
444 if test "[$]$1" = yes; then
445 AC_CHECK_LIB([$4], [$5], [$1=yes], [$1=no])
448 if test "[$]$1" = yes; then
449 EL_CONFIG([$1], [$2])
452 if test -n "[$]WITHVAL_$1" &&
453 test "[$]WITHVAL_$1" != xno; then
454 AC_MSG_ERROR([$2 not found])
459 AC_MSG_RESULT(disabled)
463 dnl EL_CONFIG_OPTIONAL_LIBRARY(define, name, header, lib, function, confhelp)
464 AC_DEFUN([EL_CONFIG_OPTIONAL_LIBRARY],
469 AC_ARG_WITH([$2], [$6], [WITHVAL_$1="[$]withval"])
470 if test "x[$]WITHVAL_$1" = xno; then $1=no; fi
472 EL_CHECK_OPTIONAL_LIBRARY([$1], [$2], [$3], [$4], [$5])
474 EL_LOG_CONFIG([$1], [$2], [])
477 EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GPM, gpm, gpm.h, gpm, Gpm_Open,
478 [ --without-gpm disable gpm (mouse) support])
480 EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GZIP, zlib, zlib.h, z, gzclearerr,
481 [ --without-zlib disable zlib support])
483 EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_BZIP2, bzlib, bzlib.h, bz2, BZ2_bzReadOpen,
484 [ --without-bzlib disable bzlib support])
486 EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN, idn, idna.h, idn, stringprep_check_version,
487 [ --without-idn disable international domain names support])
489 if test "x{with_gc}" != xno; then
490 EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GC, gc, gc.h, gc, GC_init,
491 [ --with-gc enable Boehm's garbage collector])
494 EL_ARG_ENABLE(CONFIG_LZMA, lzma, [lzma],
495 [ --enable-lzma enable lzma encoding support])
497 dnl ===================================================================
498 dnl Check for GSSAPI, optional even if installed.
499 dnl ===================================================================
503 AC_ARG_WITH(gssapi, [ --with-gssapi enable GSSAPI support],
504 [ if test "x$withval" != xno; then enable_gssapi=yes; fi ])
506 AC_MSG_CHECKING([for GSSAPI])
508 if test "$enable_gssapi" = "yes"; then
510 GSSAPI_CFLAGS=`krb5-config --cflags gssapi`
511 GSSAPI_LIBS=`krb5-config --libs gssapi`
512 CFLAGS="$GSSAPI_CFLAGS $CFLAGS"
513 LIBS="$GSSAPI_LIBS $LIBS"
514 EL_CONFIG(CONFIG_GSSAPI, [GssApi])
519 AC_SUBST(CONFIG_GSSAPI)
521 dnl ===================================================================
522 dnl Bookmark and XBEL support
523 dnl ===================================================================
527 EL_ARG_ENABLE(CONFIG_BOOKMARKS, bookmarks, [Bookmarks],
528 [ --disable-bookmarks disable bookmark support])
530 # Check whether --enable-xbel or --disable-xbel was given.
531 if test "x${enable_xbel}" != xno; then
532 AC_CHECK_HEADERS(expat.h, HAVE_LIBEXPAT=yes, HAVE_LIBEXPAT=no)
534 if test "$HAVE_LIBEXPAT" = yes; then
535 AC_CHECK_LIB(expat, XML_ParserCreate, HAVE_LIBEXPAT=yes, HAVE_LIBEXPAT=no)
536 if test "$HAVE_LIBEXPAT" = yes; then
543 EL_ARG_DEPEND(CONFIG_XBEL_BOOKMARKS, xbel, [CONFIG_BOOKMARKS:yes HAVE_LIBEXPAT:yes],
545 [ --disable-xbel disable XBEL bookmark support (requires expat)])
547 if test "$CONFIG_XBEL_BOOKMARKS" != yes; then
551 dnl ===================================================================
552 dnl Checks for BSD sysmouse
553 dnl ===================================================================
555 HAVE_SYSMOUSE_HEADER="no"
557 # Either of these header files provides the (same) sysmouse interface
558 AC_CHECK_HEADERS(sys/consio.h machine/console.h, [HAVE_SYSMOUSE_HEADER="yes"])
560 dnl ===================================================================
562 dnl ===================================================================
564 if test "$CONFIG_OS_OS2" = yes; then
568 dnl ===================================================================
570 dnl ===================================================================
572 if test "$CONFIG_OS_WIN32" = yes; then
576 dnl ===================================================================
577 dnl Check for SEE (Simple Ecmascript Engine)
578 dnl ===================================================================
579 AC_ARG_WITH(see, [ --with-see enable Simple Ecmascript Engine (SEE) support],
580 [ if test "x$withval" != xno; then enable_see=yes; fi ])
582 # The following is probably bad, ugly and so on. Stolen from Guile's (1.4)
583 # SEE_FLAGS but I really don't want to require people to have Guile in order
584 # to compile CVS. Also, the macro seems to be really stupid regarding searching
585 # for Guile in $PATH etc. --pasky
587 CONFIG_ECMASCRIPT_SEE=no
589 if test "$enable_see" = "yes"; then
590 if test -d "$withval"; then
591 SEE_PATH="$withval:$PATH"
596 AC_PATH_PROG(SEE_CONFIG, libsee-config, no, $SEE_PATH)
597 AC_MSG_CHECKING([for SEE (2.0.1131 or later)])
598 if test "$SEE_CONFIG" != no; then
600 SEE_LIBS="`$SEE_CONFIG --libs`"
601 SEE_CFLAGS="`$SEE_CONFIG --cppflags`"
602 CPPFLAGS="$SEE_CFLAGS $CPPFLAGS"
603 LIBS="$SEE_LIBS $LIBS_X"
604 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <see/see.h>]], [[#if SEE_VERSION_API_MAJOR < 2
607 ]])],[cf_result=yes],[cf_result=no])
609 if test "$cf_result" = yes; then
610 LIBS="$SEE_LIBS $LIBS"
611 EL_CONFIG(CONFIG_ECMASCRIPT_SEE, [SEE])
614 AC_MSG_RESULT($cf_result)
616 if test -n "$withval" && test "x$withval" != xno; then
617 AC_MSG_ERROR([SEE not found])
619 AC_MSG_WARN([SEE support disabled])
624 dnl ===================================================================
625 dnl Check for SpiderMonkey, optional even if installed.
626 dnl ===================================================================
628 AC_ARG_WITH(spidermonkey, [ --without-spidermonkey disable SpiderMonkey Mozilla JavaScript engine support],
629 [if test "$withval" = no; then disable_spidermonkey=yes; fi])
630 AC_MSG_CHECKING([for SpiderMonkey (1.5 RC3a or later)])
635 if test -z "$disable_spidermonkey"; then
636 if test ! -d "$withval"; then
639 for spidermonkeydir in "$withval" "" /usr /usr/local /opt/spidermonkey /opt/js; do
640 for spidermonkeyinclude in "/include" "/include/js" "/include/smjs" "/include/mozjs"; do
641 for spidermonkeylib in js smjs mozjs; do
642 if test "$cf_result" = no &&
643 test -f "$spidermonkeydir$spidermonkeyinclude/jsapi.h"; then
644 SPIDERMONKEY_LIBS="-L$spidermonkeydir/lib -l$spidermonkeylib"
645 SPIDERMONKEY_CFLAGS="-I$spidermonkeydir$spidermonkeyinclude"
647 LIBS="$SPIDERMONKEY_LIBS $LIBS_X"
648 CFLAGS="$CFLAGS_X $SPIDERMONKEY_CFLAGS"
649 CPPFLAGS="$CPPFLAGS_X $SPIDERMONKEY_CFLAGS"
651 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define XP_UNIX
652 #include <jsapi.h>]], [[JS_GetReservedSlot(NULL, NULL, 0, NULL)]])],[cf_result=yes],[cf_result=no])
659 AC_MSG_RESULT($cf_result)
660 CONFIG_SPIDERMONKEY="$cf_result"
663 if test "x$CONFIG_SPIDERMONKEY" = xyes &&
664 test "x$CONFIG_ECMASCRIPT_SEE" != xyes; then
665 EL_CONFIG(CONFIG_ECMASCRIPT_SMJS, [SpiderMonkey document scripting])
667 CONFIG_ECMASCRIPT_SMJS=no
670 EL_CONFIG_DEPENDS(CONFIG_ECMASCRIPT, [CONFIG_ECMASCRIPT_SEE CONFIG_ECMASCRIPT_SMJS], [ECMAScript (JavaScript)])
671 AC_SUBST(CONFIG_ECMASCRIPT_SEE)
672 AC_SUBST(CONFIG_ECMASCRIPT_SMJS)
675 dnl ===================================================================
676 dnl Optional Spidermonkey-based ECMAScript browser scripting
677 dnl ===================================================================
679 AC_ARG_ENABLE(sm-scripting,
680 [ --disable-sm-scripting ECMAScript browser scripting (requires Spidermonkey)],
681 [if test "$enableval" != no; then enableval="yes"; fi
682 CONFIG_SCRIPTING_SPIDERMONKEY="$enableval";])
684 if test "x$CONFIG_SPIDERMONKEY" = xyes &&
685 test "x$CONFIG_SCRIPTING_SPIDERMONKEY" = xyes; then
686 EL_CONFIG(CONFIG_SCRIPTING_SPIDERMONKEY, [SpiderMonkey])
688 CONFIG_SCRIPTING_SPIDERMONKEY=no
691 if test "x$CONFIG_ECMASCRIPT_SMJS" = xyes ||
692 test "x$CONFIG_SCRIPTING_SPIDERMONKEY" = xyes; then
693 LIBS="$LIBS $SPIDERMONKEY_LIBS"
694 AC_SUBST(SPIDERMONKEY_LIBS)
695 AC_SUBST(SPIDERMONKEY_CFLAGS)
696 AC_SUBST(CONFIG_SPIDERMONKEY)
699 dnl ===================================================================
700 dnl Check for Guile, optional even if installed.
701 dnl ===================================================================
705 AC_ARG_WITH(guile, [ --with-guile enable Guile support],
706 [ if test "x$withval" != xno; then enable_guile=yes; fi ])
708 # The following is probably bad, ugly and so on. Stolen from Guile's (1.4)
709 # GUILE_FLAGS but I really don't want to require people to have Guile in order
710 # to compile CVS. Also, the macro seems to be really stupid regarding searching
711 # for Guile in $PATH etc. --pasky
713 AC_MSG_CHECKING([for Guile])
715 if test "$enable_guile" = "yes"; then
717 ## Based on the GUILE_FLAGS macro.
719 if test -d "$withval"; then
720 GUILE_PATH="$withval:$PATH"
725 AC_PATH_PROG(GUILE_CONFIG, guile-config, no, $GUILE_PATH)
727 ## First, let's just see if we can find Guile at all.
728 if test "$GUILE_CONFIG" != no; then
731 GUILE_LIBS="`guile-config link`"
732 GUILE_CFLAGS="`guile-config compile`"
733 LIBS="$GUILE_LIBS $LIBS"
734 EL_CONFIG(CONFIG_SCRIPTING_GUILE, [Guile])
735 AC_SUBST(GUILE_CFLAGS)
737 ***********************************************************************
738 The Guile support is incomplete and not so well integrated to ELinks
739 yet. That means, e.g., that you have no Guile console and there might
740 not be all the necessary hooks. Also, the Guile interface is not too
741 well tested (success stories heartily welcomed!). See
742 src/scripting/guile/README for further details and hints.
743 ***********************************************************************
746 if test -n "$withval" && test "x$withval" != xno; then
747 AC_MSG_ERROR([Guile not found])
749 AC_MSG_WARN([Guile support disabled])
756 dnl ===================================================================
758 dnl ===================================================================
761 AC_ARG_WITH(perl, [ --with-perl enable Perl support],
763 if test "$withval" = yes; then
764 # FIXME: If withval is a valid directory append it to PATH
765 # so that you can specify one of several perl installations.
771 AC_MSG_CHECKING([for Perl])
777 if test "$enable_perl" = "yes"; then
778 PERL_LIBS="`perl -MExtUtils::Embed -e ldopts`"
779 PERL_CFLAGS="`perl -MExtUtils::Embed -e ccopts`"
780 LIBS="$PERL_LIBS $LIBS"
781 CFLAGS="$PERL_CFLAGS $CFLAGS"
782 CPPFLAGS="$CPPFLAGS $PERL_CFLAGS"
783 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
787 ]], [[PerlInterpreter *my_perl = perl_alloc();]])],[cf_result=yes],[cf_result=no])
790 if test "$cf_result"; then AC_MSG_RESULT($cf_result); fi
792 AC_MSG_CHECKING([whether POPpx works without an n_a variable])
793 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
796 extern PerlInterpreter *my_perl;
797 ]], [[dSP; (void) POPpx;]])],[AC_MSG_RESULT([yes])
798 AC_DEFINE([CONFIG_PERL_POPPX_WITHOUT_N_A], [1],
799 [Define if using Perl 5.8.8 or later, where the "POPpx" macro
800 no longer needs an "n_a" variable like it did in 5.8.7])],[AC_MSG_RESULT([no])])
802 if test "$cf_result" != "yes"; then
805 EL_CONFIG(CONFIG_SCRIPTING_PERL, [Perl])
808 CPPFLAGS="$CPPFLAGS_X"
810 AC_SUBST(PERL_CFLAGS)
813 dnl ===================================================================
815 dnl ===================================================================
818 AC_ARG_WITH(python, [ --with-python=[DIR] enable Python support],
819 [ if test "x$withval" != xno; then enable_python=yes; fi ])
824 AC_MSG_CHECKING([for Python])
826 if test "$enable_python" = "yes"; then
829 if test -d "$withval"; then
830 PYTHON_PATH="$withval:$PATH"
835 AC_PATH_PROG(PYTHON, python, no, $PYTHON_PATH)
837 if test "$PYTHON" != no; then
840 PYTHON_CFLAGS="`$PYTHON -c 'from distutils import sysconfig; print "-I%s -I%s" % (sysconfig.get_python_inc(), sysconfig.get_python_inc(plat_specific=True))'`"
841 PYTHON_LIBS="`$PYTHON -c 'from distutils import sysconfig; var = sysconfig.get_config_var; print "%s %s %s -L%s -lpython%s" % (var("LINKFORSHARED"), var("LIBS"), var("SYSLIBS"), var("LIBPL"), var("VERSION"))'`"
842 LIBS="$PYTHON_LIBS $LIBS"
843 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
844 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <Python.h>]], [[Py_Initialize();]])],[cf_result=yes],[cf_result=no])
846 if test "$cf_result" != "yes"; then
849 EL_CONFIG(CONFIG_SCRIPTING_PYTHON, [Python])
850 AC_SUBST(PYTHON_LIBS)
851 AC_SUBST(PYTHON_CFLAGS)
852 CPPFLAGS="$CPPFLAGS_X"
854 ***********************************************************************
855 The Python support is incomplete and not so well integrated to ELinks
856 yet. That means, e.g., that you have no Python console and there might
857 not be all the necessary hooks. Also, the Python interface is not too
858 well tested (success stories heartily welcomed!).
859 ***********************************************************************
863 if test -n "$withval" && test "x$withval" != xno; then
864 AC_MSG_ERROR([Python not found])
866 AC_MSG_WARN([Python support disabled])
874 dnl ===================================================================
875 dnl Check for Lua, optional even if installed.
876 dnl ===================================================================
878 dnl Do this the long way, as FreeBSD reportedly needs -L<dir> for
879 dnl anything other than /usr/lib, and Lua is very often in /usr/local/lib.
881 AC_ARG_WITH(lua, [ --without-lua disable Lua support],
882 [if test "$withval" = no; then disable_lua=yes; fi])
883 AC_MSG_CHECKING([for Lua])
888 if test -z "$disable_lua"; then
889 if test ! -d "$withval"; then
892 for luadir in "$withval" "" /usr /usr/local; do
893 for suffix in "" 50 51; do
894 if test "$cf_result" = no && ( test -f "$luadir/include/lua.h" || \
895 test -f "$luadir/include/lua$suffix/lua.h" ) ; then
896 LUA_LIBS="-L$luadir/lib -llua$suffix -llualib$suffix -lm"
897 LUA_CFLAGS="-I$luadir/include -I$luadir/include/lua$suffix"
899 LIBS="$LUA_LIBS $LIBS_X"
900 CFLAGS="$CFLAGS_X $LUA_CFLAGS"
901 CPPFLAGS="$CPPFLAGS_X $LUA_CFLAGS"
903 # Check that it is a compatible Lua version
904 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <lua.h>
905 #include <lualib.h>]], [[ lua_State *L = lua_open();
911 lua_pushboolean(L, 1);
912 lua_close(L);]])],[cf_result=yes],[cf_result=no])
918 AC_MSG_RESULT($cf_result)
920 if test "$cf_result" != yes; then
923 EL_CONFIG(CONFIG_SCRIPTING_LUA, [Lua])
924 AC_CHECK_HEADERS(lauxlib.h)
927 CPPFLAGS="$CPPFLAGS_X"
933 dnl ===================================================================
934 dnl Check for Ruby, optional even if installed.
935 dnl ===================================================================
937 EL_CONFIG_SCRIPTING_RUBY
939 dnl ===================================================================
940 dnl Setup global scripting
941 dnl ===================================================================
943 EL_CONFIG_DEPENDS(CONFIG_SCRIPTING, [CONFIG_SCRIPTING_GUILE CONFIG_SCRIPTING_LUA CONFIG_SCRIPTING_PERL CONFIG_SCRIPTING_PYTHON CONFIG_SCRIPTING_RUBY CONFIG_SCRIPTING_SPIDERMONKEY], [Browser scripting])
944 AC_SUBST(CONFIG_SCRIPTING_GUILE)
945 AC_SUBST(CONFIG_SCRIPTING_LUA)
946 AC_SUBST(CONFIG_SCRIPTING_PERL)
947 AC_SUBST(CONFIG_SCRIPTING_PYTHON)
948 AC_SUBST(CONFIG_SCRIPTING_RUBY)
949 AC_SUBST(CONFIG_SCRIPTING_SPIDERMONKEY)
950 AC_SUBST(CONFIG_SCRIPTING)
953 dnl ===================================================================
954 dnl Check for SSL support.
955 dnl ===================================================================
957 dnl We by default use OpenSSL, and we always prefer it. However, when GNUTLS
958 dnl is enabled, we won't try to use OpenSSL anymore.
960 dnl For wiping SSL hooks..
967 AC_ARG_WITH(gnutls, [ --without-gnutls disable GNUTLS SSL support],
968 [if test "$with_gnutls" = no; then disable_gnutls=yes; fi])
969 AC_ARG_WITH(gnutls, [ --with-gnutls[=DIR] enable GNUTLS SSL support],
970 [if test "$with_gnutls" != no; then enable_gnutls=yes; fi])
971 gnutls_withval="$withval"
973 if test "$enable_gnutls" = yes; then
977 AC_ARG_WITH(openssl, [ --without-openssl disable OpenSSL support],
978 [if test "$with_openssl" = no; then disable_openssl=yes; fi])
979 AC_ARG_WITH(openssl, [ --with-openssl[=DIR] enable OpenSSL support (default)])
980 openssl_withval="$withval"
984 AC_MSG_CHECKING([for OpenSSL])
989 if test "$disable_openssl" = yes; then
992 for ssldir in "$openssl_withval" "" /usr /usr/local/openssl \
993 /usr/lib/openssl /usr/local/ssl \
994 /usr/local/www /usr/lib/ssl /usr/local \
995 /usr/pkg /opt /opt/openssl; do
996 if test "$cf_result" = no; then
997 if test -d "$ssldir"; then
998 OPENSSL_CFLAGS="-I$ssldir/include"
999 LIBS="-L$ssldir/lib -lssl -lcrypto $LIBS_X"
1000 CFLAGS="$CFLAGS_X $OPENSSL_CFLAGS"
1001 CPPFLAGS="$CPPFLAGS_X $OPENSSL_CFLAGS"
1002 # # FIXME: This created serious portability problems. --pasky
1003 # if test "$CC" == "gcc"; then
1004 # # I'm not sure about compatibility here. --pasky
1005 # LIBS="$LIBS -R$ssldir/lib"
1008 LIBS="-lssl -lcrypto $LIBS_X"
1010 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h>]], [[OpenSSL_add_all_algorithms()]])],[cf_result=yes],[cf_result=no])
1011 if test "$cf_result" != yes; then
1012 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h>]], [[SSLeay_add_ssl_algorithms()]])],[cf_result=yes],[cf_result=no])
1017 if test "$cf_result" != yes; then
1018 if test -n "$openssl_withval" && test "x$openssl_withval" != xno; then
1019 AC_MSG_ERROR([OpenSSL not found])
1023 EL_CONFIG(CONFIG_OPENSSL, [OpenSSL])
1026 AC_SUBST(OPENSSL_CFLAGS)
1030 AC_MSG_RESULT($cf_result)
1032 CONFIG_GNUTLS_OPENSSL_COMPAT=no
1034 dnl We can't have AC_MSG_CHECKING here, because AC_PATH_PROG prints its own and
1035 dnl it looks ugly then.
1037 if test "$cf_result" = yes; then
1038 cf_result="not used"
1044 if test -z "$disable_gnutls"; then
1045 # Sure, we maybe _could_ use their macro, but how to ensure
1046 # that the ./configure script won't fail if the macro won't be
1047 # found..? :( --pasky
1049 GNUTLS_PATH="$PATH:/usr/local/gnutls:/opt:/opt/gnutls"
1051 if test -d "$gnutls_withval"; then
1052 GNUTLS_PATH="$gnutls_withval:$GNUTLS_PATH"
1055 AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no, $GNUTLS_PATH)
1057 if test "$LIBGNUTLS_CONFIG" = "no" ; then
1060 GNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG --cflags`
1061 GNUTLS_LIBS=`$LIBGNUTLS_CONFIG --libs`
1063 LIBS="$GNUTLS_LIBS $LIBS_X"
1064 CFLAGS="$CFLAGS_X $GNUTLS_CFLAGS"
1065 CPPFLAGS="$CPPFLAGS_X $GNUTLS_CFLAGS"
1067 # Verify if it's really usable. gnutls_session was
1068 # renamed to gnutls_session_t before GNU TLS 1.2.0
1069 # (on 2004-06-13); ELinks now requires this.
1070 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]], [[gnutls_session_t dummy;
1071 gnutls_check_version(NULL)]])],[cf_result=yes],[cf_result=no])
1074 if test "$cf_result" = yes; then
1075 EL_CONFIG(CONFIG_GNUTLS, [GNUTLS])
1078 AC_SUBST(GNUTLS_CFLAGS)
1080 # Verify if the MD5 compatibility layer is usable.
1081 CONFIG_GNUTLS_OPENSSL_COMPAT=yes
1082 EL_CHECK_OPTIONAL_LIBRARY(CONFIG_GNUTLS_OPENSSL_COMPAT,
1083 [GNU TLS OpenSSL compatibility],
1084 gnutls/openssl.h, gnutls-openssl,
1087 if test -n "$gnutls_withval" && test "x$gnutls_withval" != xno; then
1088 AC_MSG_ERROR([GNUTLS (1.2 or later) not found. ELinks no longer supports GNUTLS 1.1.])
1095 AC_MSG_CHECKING([for GNU TLS (1.2 or later)])
1096 AC_MSG_RESULT($cf_result)
1100 EL_CONFIG_DEPENDS(CONFIG_SSL, [CONFIG_OPENSSL CONFIG_GNUTLS], [SSL])
1101 AC_SUBST(CONFIG_GNUTLS_OPENSSL_COMPAT)
1102 AC_SUBST(CONFIG_OPENSSL)
1103 AC_SUBST(CONFIG_GNUTLS)
1107 AC_MSG_CHECKING([whether to be or not to be])
1108 AC_MSG_RESULT([needs to be determined experimentally])
1110 dnl ===================================================================
1111 dnl Check for IPv6 support and related functions.
1112 dnl ===================================================================
1114 EL_CHECK_NET_TYPE(struct sockaddr_storage, HAVE_SA_STORAGE, [])
1115 EL_CHECK_NET_TYPE(struct sockaddr_in6, HAVE_SA_IN6, [#include <netinet/in.h>])
1116 EL_CHECK_NET_TYPE(struct addrinfo, HAVE_ADDRINFO, [#include <netdb.h>])
1118 AC_CHECK_FUNC(getaddrinfo, HAVE_GETADDRINFO=yes, HAVE_GETADDRINFO=no)
1119 if test "$HAVE_GETADDRINFO" != yes; then
1120 AC_CHECK_LIB(inet6, getaddrinfo, HAVE_GETADDRINFO=yes, HAVE_GETADDRINFO=no)
1121 if test "$HAVE_GETADDRINFO" = yes; then
1122 LIBS="$LIBS -linet6"
1127 dnl ===================================================================
1128 dnl Checking for X11 (window title restoring).
1129 dnl ===================================================================
1132 if test x"$no_x" != xyes; then
1134 if test -n "$x_includes"; then
1135 X_CFLAGS="-I$x_includes"
1136 CPPFLAGS="$CPPLAGS $X_CFLAGS"
1137 CFLAGS="$CFLAGS $X_CFLAGS"
1139 if test -n "$x_libraries"; then
1140 LDFLAGS="$LDFLAGS -L$x_libraries"
1143 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>]], [[XrmInitialize()]])],[cf_result=yes],[cf_result=no])
1145 if test "$cf_result" = yes; then
1146 if test -n "$x_libraries"; then
1147 LDFLAGS="$LDFLAGS -L$x_libraries"
1150 EL_DEFINE(HAVE_X11, [X11 for restoring window titles])
1156 dnl ===================================================================
1157 dnl Backtraces displaying support.
1158 dnl ===================================================================
1160 AC_CHECK_HEADERS(execinfo.h, HAVE_EXECINFO=yes, HAVE_EXECINFO=no)
1161 # possible checks for other system-specific means go here
1164 dnl ===================================================================
1165 dnl Gettext grey zone. Beware.
1166 dnl ===================================================================
1168 ALL_LINGUAS="af be bg ca cs da de el es et fi fr gl hr hu id is it lt nl nb pl pt pt_BR ro ru sk sr sv tr uk"
1172 dnl AC_MSG_CHECKING([how many characters your English alphabet has])
1173 dnl # f33r d4 l33t... I hope it's portable. :)
1174 dnl cf_result=$((48#z - 48#a + 1));
1175 dnl AC_MSG_RESULT($cf_result)
1178 dnl ===================================================================
1179 dnl Compile-time features control
1180 dnl ===================================================================
1182 EL_ARG_ENABLE(CONFIG_COOKIES, cookies, [Cookies],
1183 [ --disable-cookies disable cookie support])
1185 EL_ARG_ENABLE(CONFIG_FORMHIST, formhist, [Form history],
1186 [ --disable-formhist disable form history support])
1188 EL_ARG_ENABLE(CONFIG_GLOBHIST, globhist, [Global history],
1189 [ --disable-globhist disable global history support])
1192 EL_ARG_ENABLE(CONFIG_MAILCAP, mailcap, [Mailcap],
1193 [ --disable-mailcap disable mailcap support])
1195 EL_ARG_ENABLE(CONFIG_MIMETYPES, mimetypes, [Mimetypes files],
1196 [ --disable-mimetypes disable mimetypes files support])
1199 EL_ARG_DEPEND(CONFIG_IPV6, ipv6,
1200 [HAVE_SA_STORAGE:yes HAVE_SA_IN6:yes HAVE_ADDRINFO:yes HAVE_GETADDRINFO:yes],
1202 [ --disable-ipv6 disable IPv6 support])
1204 EL_ARG_ENABLE(CONFIG_BITTORRENT, bittorrent, [BitTorrent protocol],
1205 [ --enable-bittorrent enable BitTorrent protocol support])
1207 EL_ARG_ENABLE(CONFIG_DATA, data, [Data protocol],
1208 [ --disable-data disable data protocol support])
1210 EL_ARG_ENABLE(CONFIG_URI_REWRITE, uri-rewrite, [URI rewriting],
1211 [ --disable-uri-rewrite disable URI rewrite support])
1213 EL_ARG_DEPEND(CONFIG_CGI, cgi, [HAVE_SETENV_OR_PUTENV:yes], [Local CGI],
1214 [ --enable-cgi enable local CGI support])
1216 EL_ARG_ENABLE(CONFIG_FINGER, finger, [Finger protocol],
1217 [ --enable-finger enable finger protocol support])
1219 dnl ===================================================================
1221 dnl ===================================================================
1224 if test "x${enable_fsp}" != xno; then
1225 AC_CHECK_HEADERS(fsplib.h, HAVE_FSPLIB=yes, HAVE_FSPLIB=no)
1227 if test "$HAVE_FSPLIB" = yes; then
1228 AC_CHECK_LIB(fsplib, fsp_open_session, HAVE_FSPLIB=yes, HAVE_FSPLIB=no)
1229 if test "$HAVE_FSPLIB" = yes; then
1230 LIBS="$LIBS -lfsplib"
1232 AC_CHECK_LIB(fsp, fsp_open_session, HAVE_FSPLIB=yes, HAVE_FSPLIB=no)
1233 if test "$HAVE_FSPLIB" = yes; then
1240 EL_ARG_DEPEND(CONFIG_FSP, fsp, [HAVE_FSPLIB:yes], [FSP protocol],
1241 [ --enable-fsp enable FSP protocol support])
1243 if test "x$CONFIG_FSP" = xno; then
1247 EL_ARG_ENABLE(CONFIG_FTP, ftp, [FTP protocol],
1248 [ --disable-ftp disable ftp protocol support])
1250 EL_ARG_ENABLE(CONFIG_GOPHER, gopher, [Gopher protocol],
1251 [ --enable-gopher enable gopher protocol support])
1253 EL_ARG_ENABLE(CONFIG_NNTP, nntp, [NNTP protocol],
1254 [ --enable-nntp enable nntp protocol support])
1256 dnl ===================================================================
1257 dnl SMB protocol support.
1258 dnl ===================================================================
1261 if test "x${enable_smb}" != xno; then
1262 AC_CHECK_HEADERS(libsmbclient.h, HAVE_SMBCLIENT=yes, HAVE_SMBCLIENT=no)
1264 if test "$HAVE_SMBCLIENT" = yes; then
1265 AC_CHECK_LIB(smbclient, smbc_init, HAVE_SMBCLIENT=yes, HAVE_SMBCLIENT=no)
1266 if test "$HAVE_SMBCLIENT" = yes; then
1267 LIBS="$LIBS -lsmbclient"
1272 EL_ARG_DEPEND(CONFIG_SMB, smb, [HAVE_SMBCLIENT:yes], [Samba protocol],
1273 [ --enable-smb enable Samba protocol support])
1275 if test "x$CONFIG_SMB" = xno; then
1280 EL_ARG_ENABLE(CONFIG_MOUSE, mouse, [Mouse handling],
1281 [ --disable-mouse disable mouse support])
1283 # GPM mouse is Linux specific, so ...
1285 EL_ARG_DEPEND(CONFIG_SYSMOUSE, sysmouse,
1286 [CONFIG_MOUSE:yes CONFIG_GPM:no HAVE_SYSMOUSE_HEADER:yes],
1288 [ --disable-sysmouse disable BSD sysmouse support])
1290 EL_ARG_ENABLE(CONFIG_88_COLORS, 88-colors, [88 colors],
1291 [ --enable-88-colors enable 88 color support])
1293 EL_ARG_ENABLE(CONFIG_256_COLORS, 256-colors, [256 colors],
1294 [ --enable-256-colors enable 256 color support])
1296 EL_ARG_ENABLE(CONFIG_TRUE_COLOR, true-color, [true color],
1297 [ --enable-true-color enable true color support])
1299 EL_ARG_ENABLE(CONFIG_EXMODE, exmode, [Exmode interface],
1300 [ --enable-exmode enable exmode (CLI) interface])
1302 EL_ARG_ENABLE(CONFIG_LEDS, leds, [LEDs],
1303 [ --disable-leds disable LEDs support])
1305 EL_ARG_ENABLE(CONFIG_MARKS, marks, [Marks],
1306 [ --disable-marks disable document marks support])
1309 EL_ARG_ENABLE(CONFIG_CSS, css, [Cascading Style Sheets],
1310 [ --disable-css disable Cascading Style Sheet support])
1312 EL_ARG_DEPEND(CONFIG_HTML_HIGHLIGHT, html-highlight, [CONFIG_CSS:yes], [HTML highlighting],
1313 [ --enable-html-highlight HTML highlighting using DOM engine])
1315 dnl Everything in the tree already uses CONFIG_DOM
1316 dnl so resolve CONFIG_HTML_HIGHLIGHT to CONFIG_DOM
1317 EL_CONFIG_DEPENDS(CONFIG_DOM, [CONFIG_HTML_HIGHLIGHT], [DOM engine])
1319 EL_ARG_DEPEND(CONFIG_BACKTRACE, backtrace, [HAVE_EXECINFO:yes], [Backtrace],
1320 [ --disable-backtrace disable backtrace support])
1322 EL_ARG_DEPEND(CONFIG_NO_ROOT_EXEC, no-root, [HAVE_GETUID:yes HAVE_GETEUID:yes], [No root exec],
1323 [ --enable-no-root enable prevention of usage by root])
1326 EL_ARG_ENABLE(CONFIG_DEBUG, debug, [Debug mode],
1327 [ --enable-debug enable leak debug and internal error checking])
1329 EL_ARG_DEPEND(CONFIG_FASTMEM, fastmem, [CONFIG_DEBUG:no], [Fast mode],
1330 [ --enable-fastmem enable direct use of system allocation functions, not usable with --enable-debug])
1332 EL_ARG_ENABLE(CONFIG_OWN_LIBC, own-libc, [Own libc stubs],
1333 [ --enable-own-libc force use of internal functions instead of those of system libc])
1335 EL_ARG_ENABLE(CONFIG_SMALL, small, [Small binary],
1336 [ --enable-small reduce binary size as far as possible (but see the bottom of doc/small.txt!)])
1338 EL_ARG_ENABLE(CONFIG_UTF8, utf-8, [UTF-8],
1339 [ --disable-utf-8 disable UTF-8 support])
1342 AC_ARG_ENABLE(weehoofooboomookerchoo,
1344 Also check out the features.conf file for more information about features!
1346 [AC_MSG_ERROR(Are you strange, or what?)])
1351 test "$CONFIG_OS_OS2" = yes && LDFLAGS="$LDFLAGS -Zexe"
1352 test "$CONFIG_OS_OS2" = yes && LDFLAGS=`echo "$LDFLAGS" | sed "s/-Zbin-files//g"`
1355 dnl ===================================================================
1356 dnl Export directory paths
1357 dnl ===================================================================
1359 # Set up the ``entry points'' if they were not supplied by builder
1360 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1361 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1363 # Create CONFDIR #define for config.h
1365 # XXX: This may be dependent on a particular version of autoconf. Whatever,
1366 # it's autoconf fault to force us to do such hacks ;p.
1367 if test x"$sysconfdir" = x"\${prefix}/etc"; then
1368 # sysconfdir is set to its default value... fine, let's append /elinks/
1369 # XXX: We can't modify listing of the default in ./configure --help :-(
1370 sysconfdir_n=`eval echo "$sysconfdir"`
1371 sysconfdir=$sysconfdir_n
1372 (echo "$sysconfdir" | grep elinks >/dev/null 2>/dev/null) || \
1373 sysconfdir="$sysconfdir/elinks"
1377 AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR", [Directory containing default config])
1380 # Create LOCALEDIR #define for config.h
1381 LOCALEDIR=`eval echo "$datadir/locale"`
1382 while echo "$LOCALEDIR" | grep "\\$"
1384 LOCALEDIR=`eval echo "$LOCALEDIR"`
1385 done > /dev/null 2> /dev/null
1386 AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR", [Directory containing locales])
1389 # Create LIBDIR #define for config.h
1390 LIBDIR=`eval echo "$libdir"`
1391 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [Directory containing libraries])
1394 EL_LOG_CONFIG(CONFDIR, [System configuration directory], [])
1395 EL_LOG_CONFIG(LOCALEDIR, [Locale catalogs directory], [])
1397 dnl ===================================================================
1398 dnl A little fine tuning of gcc specific options (continued)
1399 dnl ===================================================================
1401 if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
1402 if test "$CONFIG_DEBUG" = "yes"; then
1403 dnl We want to see all warnings and live with none (in debug mode).
1404 CFLAGS="$CFLAGS -Werror"
1407 case "`$CC -dumpversion`" in
1409 # These should be ok using -Werror
1412 # If gcc is version 3.3 (or higher?) it emits lots of false positive
1413 # "dereferencing type-punned pointer will break strict-aliasing rules"
1414 # warnings. Disable them by not doing any strict-aliasing. The
1415 # alternative is just too ugly. Thanks gcc guys!! ;)
1416 CFLAGS="$CFLAGS -fno-strict-aliasing"
1419 # Do not show warnings related to (char * | unsigned char *) type
1421 CFLAGS="$CFLAGS -fno-strict-aliasing -Wno-pointer-sign"
1424 # These should be ok using -Werror
1428 # GCC 4.2.1 warns if we use the address of an object in Boolean context:
1429 # warning: the address of `builtin_modules' will always evaluate as `true'
1430 # This hits the object_lock and foreach_module macros in particular.
1431 # It would be okay to put something in the macros to avoid the warning,
1432 # but currently this seems to require defining parallel macros that skip
1433 # the NULL check, and that's too ugly. So we instead disable the warning.
1434 # GCC 4.2.1 needs -Wno-address, but GCC 4.2 snapshots need -Wno-always-true.
1435 # GCC 4.1.3 recognizes neither and exits with code 1 if they are given.
1436 for warning_flag in -Wno-address -Wno-always-true; do
1437 AC_MSG_CHECKING([whether $CC accepts $warning_flag])
1439 CFLAGS="$CFLAGS $warning_flag"
1440 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
1441 [AC_MSG_RESULT([yes])
1443 [AC_MSG_RESULT([no])])
1448 EL_LOG_CONFIG(CFLAGS, [Compiler flags (CFLAGS)], [])
1449 EL_LOG_CONFIG(CPPFLAGS, [Preprocessor flags (CPPFLAGS)], [])
1450 EL_LOG_CONFIG(LDFLAGS, [Linker flags (LDFLAGS)], [])
1451 EL_LOG_CONFIG(LIBS, [Library flags (LIBS)], [])
1453 dnl ===================================================================
1454 dnl Colored make output
1455 dnl ===================================================================
1457 if test $(`which tput` colors) -ge 4; then
1459 AC_SUBST(MAKE_COLOR)
1462 dnl ===================================================================
1464 dnl ===================================================================
1468 contrib/elinks.spec \
1469 contrib/lua/hooks.lua \
1470 contrib/conv/w3m2links.awk \
1472 doc/man/man1/elinks.1 \
1473 src/intl/gettext/ref-add.sed \
1474 src/intl/gettext/ref-del.sed
1478 abs_srcdir="$(cd "$srcdir" && pwd)"
1479 # builddir is always absolute!
1480 if test "$abs_srcdir" != "$builddir"; then
1481 # Bootstrap the Makefile creation
1482 echo "include $abs_srcdir/Makefile" > "$builddir/Makefile"
1483 "$MAKE" "SRC=$abs_srcdir" init
1485 # Make cg-status ignore this build directory
1486 echo "*" > "$builddir/.gitignore"
1489 dnl ===================================================================
1490 dnl Configuration summary
1491 dnl ===================================================================
1493 AC_MSG_RESULT(The following feature summary has been saved to features.log)