1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT(src/main/main.c)
5 AC_CONFIG_AUX_DIR(config)
11 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Package version])
12 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Package version])
13 AC_CONFIG_HEADERS(config.h)
15 AC_CHECK_PROG(ACLOCAL,[aclocal],[aclocal],[config/missing aclocal])
16 AC_CHECK_PROG(AUTOCONF,[autoconf],[autoconf],[config/missing autoconf])
17 AC_CHECK_PROG(AUTOHEADER,[autoheader],[autoheader],[config/missing autoheader])
21 for make in gnumake gmake make false; do
22 if test "x$MAKE" = x; then
23 AC_PATH_PROGS(MAKE, "$make")
29 # Cleanup if we are configuring with a previous build in the tree
30 if test -e Makefile.config; then
31 AC_MSG_CHECKING([for previous build to clean])
32 "$MAKE" -C "$builddir/src" cleanall >/dev/null 2>/dev/null
36 dnl ===================================================================
37 dnl Load feature configuration file and start logging features.
38 dnl ===================================================================
40 features="features.conf"
41 AC_CHECK_FILE("$srcdir/$features", [ . $srcdir/$features ])
42 AC_CHECK_FILE("$builddir/$features", [ . $builddir/$features ])
43 echo "Feature summary:" > features.log
45 dnl ===================================================================
46 dnl Checks for programs.
47 dnl ===================================================================
51 AC_PATH_PROGS(AWK, "$AWK")
55 AC_PATH_PROGS(CG_COMMIT_ID, "cg-commit-id")
56 AC_PATH_PROGS(SPARSE, "sparse")
63 if test "x$CONFIG_DOC" != xno; then
64 AC_PATH_PROGS(ASCIIDOC, "asciidoc")
65 if test "x$ASCIIDOC" != "x"; then
66 EL_CONFIG(CONFIG_ASCIIDOC, [AsciiDoc])
67 EL_CONFIG(MANUAL_ASCIIDOC, [HTML (one file)])
68 EL_CONFIG(MAN_ASCIIDOC, [HTML])
70 echo > config.asciidoc-unsafe.txt
71 if "$ASCIIDOC" --unsafe config.asciidoc-unsafe.txt >/dev/null 2>/dev/null; then
72 ASCIIDOC_FLAGS=--unsafe
74 rm config.asciidoc-unsafe.*
77 AC_PATH_PROGS(XMLTO, "xmlto")
78 if test "x$XMLTO" != "x"; then
79 EL_CONFIG(CONFIG_XMLTO, [XmlTo])
80 EL_CONFIG(MANUAL_XMLTO, [HTML (multiple files)])
81 EL_CONFIG(MAN_XMLTO, [man (groff)])
84 AC_PATH_PROGS(JW, "jw")
85 if test "x$JW" != "x"; then
86 EL_CONFIG(CONFIG_JW, [JadeWrapper])
87 EL_CONFIG(MANUAL_JW, [PDF])
90 AC_PATH_PROGS(POD2HTML, "pod2html")
91 if test "x$POD2HTML" != "x"; then
92 EL_CONFIG(CONFIG_POD2HTML, [Pod2HTML])
96 AC_SUBST(ASCIIDOC_FLAGS)
97 AC_SUBST(CONFIG_ASCIIDOC)
98 AC_SUBST(CONFIG_POD2HTML)
99 AC_SUBST(CONFIG_XMLTO)
102 EL_CONFIG_DEPENDS(CONFIG_DOC, [CONFIG_ASCIIDOC CONFIG_XMLTO CONFIG_JW CONFIG_POD2HTML], [Documentation Tools])
103 EL_CONFIG_DEPENDS(CONFIG_MANUAL, [MANUAL_ASCIIDOC MANUAL_XMLTO MANUAL_JW], [Manual Formats])
104 EL_CONFIG_DEPENDS(CONFIG_MANPAGE, [MAN_ASCIIDOC MAN_XMLTO], [Man Page Formats])
106 dnl gcc specific options (to be continued at the bottom of configure)
107 if test "x$ac_cv_prog_gcc" = "xyes"; then
108 dnl We want to see all warnings and live with none.
109 dnl We can't set up -Werror here as there may be some warnings in test
110 dnl suite of configure, and we don't want to fail them.
111 CFLAGS="$CFLAGS -Wall"
114 dnl ===================================================================
115 dnl Checks for special OSes.
116 dnl ===================================================================
118 dnl EL_CHECK_COMPILER_MACRO(define, name, flagname)
119 AC_DEFUN([EL_CHECK_COMPILER_MACROS],
121 AC_MSG_CHECKING([for $2])
124 AC_TRY_COMPILE(, [#ifndef $flag
126 #endif ], $1=yes, $1=no)
127 if test "[$]$1" = yes; then
128 EL_CONFIG([$1], [$2])
136 EL_CHECK_COMPILER_MACROS(CONFIG_OS_BEOS, [BEOS], [__BEOS__])
137 AC_SUBST(CONFIG_OS_BEOS)
139 EL_CHECK_COMPILER_MACROS(CONFIG_OS_RISCOS, [RISCOS], [__riscos__])
140 AC_SUBST(CONFIG_OS_RISCOS)
142 EL_CHECK_COMPILER_MACROS(CONFIG_OS_WIN32, [WIN32], [_WIN32 __WIN32__])
143 AC_SUBST(CONFIG_OS_WIN32)
145 EL_CHECK_COMPILER_MACROS(CONFIG_OS_OS2, [EMX], [__EMX__])
146 AC_SUBST(CONFIG_OS_OS2)
147 test "$CONFIG_OS_OS2" = yes && LDFLAGS=`echo "$LDFLAGS" | sed "s/-Zexe//g"`
149 AC_MSG_CHECKING([for UNIX])
150 dnl FIXME: some depend kind of mechanism
151 if test "$CONFIG_OS_BEOS" = no && \
152 test "$CONFIG_OS_RISCOS" = no && \
153 test "$CONFIG_OS_WIN32" = no && \
154 test "$CONFIG_OS_OS2" = no; then
155 EL_CONFIG(CONFIG_OS_UNIX, [UNIX])
159 AC_MSG_RESULT($CONFIG_OS_UNIX)
160 AC_SUBST(CONFIG_OS_UNIX)
162 dnl ===================================================================
163 dnl Checks for header files.
164 dnl ===================================================================
171 AC_CHECK_HEADERS(fcntl.h limits.h time.h unistd.h)
172 AC_CHECK_HEADERS(sigaction.h)
173 AC_CHECK_HEADERS(arpa/inet.h)
174 AC_CHECK_HEADERS(netinet/in_systm.h netinet/in_system.h netinet/ip.h)
175 AC_CHECK_HEADERS(net/if.h netdb.h netinet/in.h netinet/in6_var.h)
176 AC_CHECK_HEADERS(ifaddrs.h)
177 AC_CHECK_HEADERS(sys/cygwin.h io.h)
178 AC_CHECK_HEADERS(sys/fmutex.h)
179 AC_CHECK_HEADERS(sys/ioctl.h sys/sockio.h)
180 AC_CHECK_HEADERS(sys/resource.h)
181 AC_CHECK_HEADERS(sys/select.h)
182 AC_CHECK_HEADERS(sys/signal.h)
183 AC_CHECK_HEADERS(sys/socket.h)
184 AC_CHECK_HEADERS(sys/time.h)
185 AC_CHECK_HEADERS(sys/utsname.h)
186 AC_CHECK_HEADERS(stdint.h inttypes.h)
187 AC_CHECK_HEADERS(locale.h pwd.h)
188 AC_CHECK_HEADERS(termios.h)
191 AC_CHECK_HEADERS(sys/un.h,
192 [CONFIG_INTERLINK=yes
193 EL_CONFIG([CONFIG_INTERLINK], [interlinking])],
194 [CONFIG_INTERLINK=no])
195 AC_SUBST(CONFIG_INTERLINK)
197 dnl ===================================================================
198 dnl Checks for typedefs, structures, and compiler characteristics.
199 dnl ===================================================================
204 EL_CHECK_CODE(typeof, HAVE_TYPEOF, [], [int a; typeof(a) b;])
209 EL_CHECK_TYPE(ssize_t, int)
210 EL_CHECK_SYS_TYPE(long long, HAVE_LONG_LONG, [])
211 EL_CHECK_INT_TYPE(int32_t, HAVE_INT32_T)
212 EL_CHECK_INT_TYPE(uint32_t, HAVE_UINT32_T)
213 EL_CHECK_INT_TYPE(uint16_t, HAVE_UINT16_T)
215 AC_CHECK_SIZEOF(char, 1)
216 AC_CHECK_SIZEOF(short, 2)
217 AC_CHECK_SIZEOF(int, 4)
218 AC_CHECK_SIZEOF(long, 4)
219 test "x$HAVE_LONG_LONG" = xyes && AC_CHECK_SIZEOF(long long, 8)
221 dnl Check for variadic macros
222 EL_CHECK_CODE([variadic macros], HAVE_VARIADIC_MACROS,
224 #define a(b,c...) printf(b,##c)],
225 [a("foo");a("%s","bar");a("%s%s","baz","quux");])
227 dnl Check for -rdynamic
228 dnl FIXME: This check doesn't work. Something to do with the compiler
229 dnl happily ignoring it and stderr not being checked for error messages.
230 AC_MSG_CHECKING([for -rdynamic])
232 LDFLAGS="$LDFLAGS -rdynamic"
233 AC_TRY_LINK([], [], have_rdynamic=yes, have_rdynamic=no)
234 test "$have_rdynamic" = no && LDFLAGS="$LDFLAGS_X"
235 AC_MSG_RESULT($have_rdynamic)
237 dnl ===================================================================
238 dnl Check for POSIX <regex.h>
239 dnl ===================================================================
241 EL_CHECK_SYS_TYPE(regex_t, HAVE_REGEX_H, [#include <regex.h>])
243 dnl ===================================================================
244 dnl Checks for library functions.
245 dnl ===================================================================
247 AC_PROG_GCC_TRADITIONAL
251 AC_CHECK_FUNCS(cfmakeraw gethostbyaddr herror strerror)
252 AC_CHECK_FUNCS(popen uname access chmod alarm timegm mremap)
253 AC_CHECK_FUNCS(strcasecmp strncasecmp strcasestr strstr strchr strrchr)
254 AC_CHECK_FUNCS(memmove bcopy stpcpy strdup index isdigit mempcpy memrchr)
255 AC_CHECK_FUNCS(snprintf vsnprintf asprintf vasprintf)
256 AC_CHECK_FUNCS(getifaddrs getpwnam inet_pton inet_ntop)
257 AC_CHECK_FUNCS(fflush fsync fseeko ftello sigaction)
258 AC_CHECK_FUNCS(gettimeofday clock_gettime)
260 AC_HAVE_FUNCS(cygwin_conv_to_full_win32_path)
262 AC_CHECK_FUNCS(setenv putenv, HAVE_SETENV_OR_PUTENV=yes)
263 AC_CHECK_FUNCS(getuid, HAVE_GETUID=yes)
264 AC_CHECK_FUNCS(geteuid, HAVE_GETEUID=yes)
266 dnl These aren't probably needed now, as they are commented in links.h.
267 dnl I've no idea about their historical background, but I keep them here
268 dnl just in the case they will help later. --pasky
269 AC_CHECK_FUNCS(getpid, HAVE_GETPID=yes)
270 AC_CHECK_FUNCS(setpgid getpgid setpgrp getpgrp)
271 AC_CHECK_FUNCS(raise, HAVE_RAISE=yes)
272 AC_CHECK_FUNCS(kill, HAVE_KILL=yes)
274 if test x"$HAVE_RAISE" = x; then
275 if test x"$HAVE_KILL" = x || test x"$HAVE_GETPID" = x; then
276 AC_ERROR([Unable to emulate raise()])
280 AC_CACHE_CHECK([for __va_copy],el_cv_HAVE_VA_COPY,[
281 AC_TRY_LINK([#include <stdarg.h>
282 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
283 el_cv_HAVE_VA_COPY=yes,el_cv_HAVE_VA_COPY=no)])
284 if test x"$el_cv_HAVE_VA_COPY" = x"yes"; then
285 EL_DEFINE(HAVE_VA_COPY, __va_copy)
288 AC_CACHE_CHECK([for sysconf(_SC_PAGE_SIZE)],el_cv_HAVE_SC_PAGE_SIZE,[
289 AC_TRY_LINK([#include <unistd.h>
290 ], [int page_size = sysconf(_SC_PAGE_SIZE);],
291 el_cv_HAVE_SC_PAGE_SIZE=yes,el_cv_HAVE_SC_PAGE_SIZE=no)])
292 if test x"$el_cv_HAVE_SC_PAGE_SIZE" = x"yes"; then
293 EL_DEFINE(HAVE_SC_PAGE_SIZE, _SC_PAGE_SIZE)
296 AC_CACHE_CHECK([for C99 vsnprintf],el_cv_HAVE_C99_VSNPRINTF,[
305 int bar(char *buf, const char *format, va_list ap)
307 return vsnprintf(buf, 0, format, ap);
310 void foo(const char *format, ...) {
314 va_start(ap, format);
315 len = bar(buf, format, ap);
317 if ((len != 6) && (len != 7)) exit(1); /* \n -> \r\n */
319 va_start(ap, format);
320 len = bar(buf, format, ap);
322 if ((len != 6) && (len != 7)) exit(1);
324 if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
328 main() { foo("hello\n"); }
330 el_cv_HAVE_C99_VSNPRINTF=yes,el_cv_HAVE_C99_VSNPRINTF=no,el_cv_HAVE_C99_VSNPRINTF=cross)])
331 if test x"$el_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
332 EL_DEFINE(HAVE_C99_VSNPRINTF, [C99 compliant vsnprintf()])
335 AC_CHECK_LIB(dl, dlopen) # OpenSSL and Lua frequently needs it
337 dnl ===================================================================
338 dnl Checks for libraries.
339 dnl ===================================================================
341 dnl Replace `main' with a function in -lsocket:
342 AC_CHECK_FUNC(socket, cf_result=yes, cf_result=no)
343 if test "$cf_result" = no; then
344 AC_CHECK_LIB(socket, socket)
347 AC_CHECK_FUNC(setsockopt, cf_result=yes, cf_result=no)
348 if test "$cf_result" = no; then
349 AC_CHECK_LIB(socket, setsockopt)
352 AC_CHECK_FUNC(gethostbyname, cf_result=yes, cf_result=no)
353 if test "$cf_result" = no; then
354 AC_CHECK_LIB(socket, gethostbyname, cf_result=yes, cf_result=no)
355 if test "$cf_result" = no; then
356 AC_CHECK_LIB(nsl, gethostbyname)
358 test -z "`echo $LIBS | grep -- -lsocket`" && LIBS="$LIBS -lsocket"
362 dnl ===================================================================
363 dnl Checks for packaging specific options.
364 dnl ===================================================================
366 AC_ARG_WITH(xterm, [ --with-xterm how to invoke the X terminal emulator],
367 [ if test "$withval" != no && test "$withval" != yes; then
368 AC_DEFINE_UNQUOTED(XTERM, "$withval", [How to invoke XTerm])
371 dnl ===================================================================
372 dnl Checks for a libraries, optional even if installed.
373 dnl ===================================================================
375 dnl EL_CHECK_OPTIONAL_LIBRARY(define, name, header, lib, function)
376 AC_DEFUN([EL_CHECK_OPTIONAL_LIBRARY],
378 AC_MSG_CHECKING([for $2 support])
380 if test "[$]$1" != no; then
383 if test -n "$withval" && test -d "$withval"; then
384 # Be a little more careful when setting
385 # include and lib directories. This way
386 # $withval will work when includes are
387 # there but the library is in the common
388 # /usr/lib ... Does the right thing when
389 # looking for gc on Debian.
390 if test -d "$withval/include"; then
391 CFLAGS="$CFLAGS -I$withval/include"
392 CPPFLAGS="$CPPFLAGS -I$withval/include"
394 CFLAGS="$CFLAGS -I$withval"
395 CPPFLAGS="$CPPFLAGS -I$withval"
397 if test -d "$withval/lib"; then
398 LDFLAGS="$LDFLAGS -L$withval/lib"
402 AC_CHECK_HEADERS([$3], [$1=yes], [$1=no; break;])
403 if test "[$]$1" = yes; then
404 AC_CHECK_LIB([$4], [$5], [$1=yes], [$1=no])
407 if test "[$]$1" = yes; then
408 EL_CONFIG([$1], [$2])
411 if test -n "[$]WITHVAL_$1" &&
412 test "[$]WITHVAL_$1" != xno; then
413 AC_MSG_ERROR([$2 not found])
418 AC_MSG_RESULT(disabled)
422 dnl EL_CONFIG_OPTIONAL_LIBRARY(define, name, header, lib, function, confhelp)
423 AC_DEFUN([EL_CONFIG_OPTIONAL_LIBRARY],
428 AC_ARG_WITH([$2], [$6], [WITHVAL_$1="[$]withval"])
429 if test "x[$]WITHVAL_$1" = xno; then $1=no; fi
431 EL_CHECK_OPTIONAL_LIBRARY([$1], [$2], [$3], [$4], [$5])
433 EL_LOG_CONFIG([$1], [$2], [])
436 EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GPM, gpm, gpm.h, gpm, Gpm_Open,
437 [ --without-gpm disable gpm (mouse) support])
439 EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GZIP, zlib, zlib.h, z, gzdopen,
440 [ --without-zlib disable zlib support])
442 EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_BZIP2, bzlib, bzlib.h, bz2, BZ2_bzReadOpen,
443 [ --without-bzlib disable bzlib support])
445 EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN, idn, idna.h, idn, stringprep_check_version,
446 [ --without-idn disable international domain names support])
448 if test "x{with_gc}" != xno; then
449 EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GC, gc, gc.h, gc, GC_init,
450 [ --with-gc enable Boehm's garbage collector])
453 EL_ARG_ENABLE(CONFIG_LZMA, lzma, [lzma],
454 [ --enable-lzma enable lzma encoding support])
455 dnl ===================================================================
456 dnl Check for GSSAPI, optional even if installed.
457 dnl ===================================================================
461 AC_ARG_WITH(gssapi, [ --with-gssapi enable GSSAPI support],
462 [ if test "x$withval" != xno; then enable_gssapi=yes; fi ])
464 AC_MSG_CHECKING([for GSSAPI])
466 if test "$enable_gssapi" = "yes"; then
468 GSSAPI_CFLAGS=`krb5-config --cflags gssapi`
469 GSSAPI_LIBS=`krb5-config --libs gssapi`
470 CFLAGS="$GSSAPI_CFLAGS $CFLAGS"
471 LIBS="$GSSAPI_LIBS $LIBS"
472 EL_CONFIG(CONFIG_GSSAPI, [GssApi])
477 AC_SUBST(CONFIG_GSSAPI)
479 dnl ===================================================================
480 dnl Bookmark and XBEL support
481 dnl ===================================================================
485 EL_ARG_ENABLE(CONFIG_BOOKMARKS, bookmarks, [Bookmarks],
486 [ --disable-bookmarks disable bookmark support])
488 # Check whether --enable-xbel or --disable-xbel was given.
489 if test "x${enable_xbel}" != xno; then
490 AC_CHECK_HEADERS(expat.h, HAVE_LIBEXPAT=yes, HAVE_LIBEXPAT=no)
492 if test "$HAVE_LIBEXPAT" = yes; then
493 AC_CHECK_LIB(expat, XML_ParserCreate, HAVE_LIBEXPAT=yes, HAVE_LIBEXPAT=no)
494 if test "$HAVE_LIBEXPAT" = yes; then
501 EL_ARG_DEPEND(CONFIG_XBEL_BOOKMARKS, xbel, [CONFIG_BOOKMARKS:yes HAVE_LIBEXPAT:yes],
503 [ --disable-xbel disable XBEL bookmark support (requires expat)])
505 if test "$CONFIG_XBEL_BOOKMARKS" != yes; then
509 dnl ===================================================================
510 dnl Checks for BSD sysmouse
511 dnl ===================================================================
513 HAVE_SYSMOUSE_HEADER="no"
515 # Either of these header files provides the (same) sysmouse interface
516 AC_CHECK_HEADERS(sys/consio.h machine/console.h, [HAVE_SYSMOUSE_HEADER="yes"])
518 dnl ===================================================================
520 dnl ===================================================================
522 if test "$CONFIG_OS_OS2" = yes; then
526 dnl ===================================================================
528 dnl ===================================================================
530 if test "$CONFIG_OS_WIN32" = yes; then
534 dnl ===================================================================
535 dnl Check for SEE (Simple Ecmascript Engine)
536 dnl ===================================================================
537 AC_ARG_WITH(see, [ --with-see enable Simple Ecmascript Engine (SEE) support],
538 [ if test "x$withval" != xno; then enable_see=yes; fi ])
540 # The following is probably bad, ugly and so on. Stolen from Guile's (1.4)
541 # SEE_FLAGS but I really don't want to require people to have Guile in order
542 # to compile CVS. Also, the macro seems to be really stupid regarding searching
543 # for Guile in $PATH etc. --pasky
545 AC_MSG_CHECKING([for SEE])
547 CONFIG_ECMASCRIPT_SEE=no
549 if test "$enable_see" = "yes"; then
551 ## Based on the SEE_FLAGS macro.
553 if test -d "$withval"; then
554 SEE_PATH="$withval:$PATH"
559 AC_PATH_PROG(SEE_CONFIG, libsee-config, no, $SEE_PATH)
561 ## First, let's just see if we can find Guile at all.
562 if test "$SEE_CONFIG" != no; then
565 SEE_LIBS="`$SEE_CONFIG --libs`"
566 SEE_CFLAGS="`$SEE_CONFIG --cppflags`"
567 LIBS="$SEE_LIBS $LIBS"
568 CPPFLAGS="$CPPFLAGS $SEE_CFLAGS"
569 EL_CONFIG(CONFIG_ECMASCRIPT_SEE, [SEE])
572 if test -n "$withval" && test "x$withval" != xno; then
573 AC_MSG_ERROR([SEE not found])
575 AC_MSG_WARN([SEE support disabled])
583 dnl ===================================================================
584 dnl Check for SpiderMonkey, optional even if installed.
585 dnl ===================================================================
587 AC_ARG_WITH(spidermonkey, [ --without-spidermonkey disable SpiderMonkey Mozilla JavaScript engine support],
588 [if test "$withval" = no; then disable_spidermonkey=yes; fi])
589 AC_MSG_CHECKING([for SpiderMonkey])
594 if test -z "$disable_spidermonkey"; then
595 if test ! -d "$withval"; then
598 for spidermonkeydir in "$withval" "" /usr /usr/local /opt/spidermonkey /opt/js; do
599 for spidermonkeyinclude in "/include" "/include/js" "/include/smjs" "/include/mozjs"; do
600 for spidermonkeylib in js smjs mozjs; do
601 if test "$cf_result" = no; then
602 SPIDERMONKEY_LIBS="-l$spidermonkeylib"
604 if test ! -z "$spidermonkeydir"; then
605 SPIDERMONKEY_LIBS="-L$spidermonkeydir/lib $SPIDERMONKEY_LIBS"
606 SPIDERMONKEY_CFLAGS="-I$spidermonkeydir$spidermonkeyinclude"
609 LIBS="$SPIDERMONKEY_LIBS $LIBS_X"
610 CFLAGS="$CFLAGS_X $SPIDERMONKEY_CFLAGS"
611 CPPFLAGS="$CPPFLAGS_X $SPIDERMONKEY_CFLAGS"
613 AC_TRY_LINK([#define XP_UNIX
615 [JS_GetImplementationVersion()],
616 cf_result=yes, cf_result=no)
623 AC_MSG_RESULT($cf_result)
624 CONFIG_SPIDERMONKEY="$cf_result"
627 if test "x$CONFIG_SPIDERMONKEY" = xyes &&
628 test "x$CONFIG_ECMASCRIPT_SEE" != xyes; then
629 EL_CONFIG(CONFIG_ECMASCRIPT_SMJS, [SpiderMonkey document scripting])
631 CONFIG_ECMASCRIPT_SMJS=no
634 EL_CONFIG_DEPENDS(CONFIG_ECMASCRIPT, [CONFIG_ECMASCRIPT_SEE CONFIG_ECMASCRIPT_SMJS], [ECMAScript (JavaScript)])
635 AC_SUBST(CONFIG_ECMASCRIPT_SEE)
636 AC_SUBST(CONFIG_ECMASCRIPT_SMJS)
639 dnl ===================================================================
640 dnl Optional Spidermonkey-based ECMAScript browser scripting
641 dnl ===================================================================
643 AC_ARG_ENABLE(sm-scripting,
644 [ --disable-sm-scripting ECMAScript browser scripting (requires Spidermonkey)],
645 [if test "$enableval" != no; then enableval="yes"; fi
646 CONFIG_SCRIPTING_SPIDERMONKEY="$enableval";])
648 if test "x$CONFIG_SPIDERMONKEY" = xyes &&
649 test "x$CONFIG_SCRIPTING_SPIDERMONKEY" = xyes; then
650 EL_CONFIG(CONFIG_SCRIPTING_SPIDERMONKEY, [SpiderMonkey])
652 CONFIG_SCRIPTING_SPIDERMONKEY=no
655 if test "x$CONFIG_ECMASCRIPT_SMJS" = xyes ||
656 test "x$CONFIG_SCRIPTING_SPIDERMONKEY" = xyes; then
657 LIBS="$LIBS $SPIDERMONKEY_LIBS"
658 AC_SUBST(SPIDERMONKEY_LIBS)
659 AC_SUBST(SPIDERMONKEY_CFLAGS)
660 AC_SUBST(CONFIG_SPIDERMONKEY)
663 dnl ===================================================================
664 dnl Check for Guile, optional even if installed.
665 dnl ===================================================================
669 AC_ARG_WITH(guile, [ --with-guile enable Guile support],
670 [ if test "x$withval" != xno; then enable_guile=yes; fi ])
672 # The following is probably bad, ugly and so on. Stolen from Guile's (1.4)
673 # GUILE_FLAGS but I really don't want to require people to have Guile in order
674 # to compile CVS. Also, the macro seems to be really stupid regarding searching
675 # for Guile in $PATH etc. --pasky
677 AC_MSG_CHECKING([for Guile])
679 if test "$enable_guile" = "yes"; then
681 ## Based on the GUILE_FLAGS macro.
683 if test -d "$withval"; then
684 GUILE_PATH="$withval:$PATH"
689 AC_PATH_PROG(GUILE_CONFIG, guile-config, no, $GUILE_PATH)
691 ## First, let's just see if we can find Guile at all.
692 if test "$GUILE_CONFIG" != no; then
695 GUILE_LIBS="`guile-config link`"
696 GUILE_CFLAGS="`guile-config compile`"
697 LIBS="$GUILE_LIBS $LIBS"
698 CPPFLAGS="$CPPFLAGS $GUILE_CFLAGS"
699 EL_CONFIG(CONFIG_SCRIPTING_GUILE, [Guile])
700 AC_SUBST(GUILE_CFLAGS)
702 ***********************************************************************
703 The Guile support is incomplete and not so well integrated to ELinks
704 yet. That means, e.g., that you have no Guile console and there might
705 not be all the necessary hooks. Also, the Guile interface is not too
706 well tested (success stories heartily welcomed!). See
707 src/scripting/guile/README for further details and hints.
708 ***********************************************************************
711 if test -n "$withval" && test "x$withval" != xno; then
712 AC_MSG_ERROR([Guile not found])
714 AC_MSG_WARN([Guile support disabled])
721 dnl ===================================================================
723 dnl ===================================================================
726 AC_ARG_WITH(perl, [ --with-perl enable Perl support],
728 if test "$withval" = yes; then
729 # FIXME: If withval is a valid directory append it to PATH
730 # so that you can specify one of several perl installations.
736 AC_MSG_CHECKING([for Perl])
742 if test "$enable_perl" = "yes"; then
743 PERL_LIBS="`perl -MExtUtils::Embed -e ldopts`"
744 PERL_CFLAGS="`perl -MExtUtils::Embed -e ccopts`"
745 LIBS="$PERL_LIBS $LIBS"
746 CFLAGS="$PERL_CFLAGS $CFLAGS"
747 CPPFLAGS="$CPPFLAGS $PERL_CFLAGS"
753 [PerlInterpreter *my_perl = perl_alloc();],
754 cf_result=yes, cf_result=no)
757 if test "$cf_result" != "yes"; then
760 EL_CONFIG(CONFIG_SCRIPTING_PERL, [Perl])
764 AC_SUBST(PERL_CFLAGS)
767 if test "$cf_result"; then AC_MSG_RESULT($cf_result); fi
768 dnl ===================================================================
770 dnl ===================================================================
773 AC_ARG_WITH(python, [ --with-python=[prefix] enable Python support],
775 if test "$withval" != no; then
776 # FIXME: If withval is a valid directory append it to PATH
777 # so that you can specify one of several Python installations.
778 if test "$withval" != yes; then
779 python_prefix="$withval"
785 ***********************************************************************
786 The Python support is incomplete and not so well integrated to ELinks
787 yet. That means, e.g.., that you have no Python console and there might
788 not be all the necessary hooks. Also, the Python interface is not too
789 well tested (success stories heartily welcomed!).
790 ***********************************************************************
800 if test "$enable_python" = "yes"; then
801 if test -n "$python_prefix" && test -d "$python_prefix/bin"; then
802 PYTHON_PATH="$python_prefix/bin:$PATH"
806 AC_PATH_PROG(PYTHON, python, no, $PYTHON_PATH)
807 if test "$PYTHON" = "no" ; then
810 PYTHON_CFLAGS="-I`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_python_inc()' 2> /dev/null`"
811 PYTHON_LIBS="-lpython`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var("VERSION")' 2> /dev/null`"
812 if test -n "$python_prefix" && test -d "$python_prefix/lib"; then
813 PYTHON_LIBS="-L$python_prefix/lib $PYTHON_LIBS"
815 LIBS="$PYTHON_LIBS $LIBS"
816 CFLAGS="$PYTHON_CFLAGS $CFLAGS"
817 AC_TRY_LINK([#include <Python.h>],
819 cf_result=yes, cf_result=no)
821 if test "$cf_result" != "yes"; then
824 EL_CONFIG(CONFIG_SCRIPTING_PYTHON, [Python])
827 AC_SUBST(PYTHON_LIBS)
828 AC_SUBST(PYTHON_CFLAGS)
833 AC_MSG_CHECKING([for Python])
834 if test "$cf_result"; then AC_MSG_RESULT($cf_result); fi
837 dnl ===================================================================
838 dnl Check for Lua, optional even if installed.
839 dnl ===================================================================
841 dnl Do this the long way, as FreeBSD reportedly needs -L<dir> for
842 dnl anything other than /usr/lib, and Lua is very often in /usr/local/lib.
844 AC_ARG_WITH(lua, [ --without-lua disable Lua support],
845 [if test "$withval" = no; then disable_lua=yes; fi])
846 AC_MSG_CHECKING([for Lua])
851 if test -z "$disable_lua"; then
852 if test ! -d "$withval"; then
855 for luadir in "$withval" "" /usr /usr/local; do
856 for suffix in "" 50 51; do
857 if test "$cf_result" = no; then
858 LUA_LIBS="-llua$suffix -llualib$suffix -lm"
860 if test ! -z "$luadir"; then
861 LUA_LIBS="-L$luadir/lib $LUA_LIBS"
862 LUA_CFLAGS="-I$luadir/include -I$luadir/include/lua$suffix"
865 LIBS="$LUA_LIBS $LIBS_X"
866 CFLAGS="$CFLAGS_X $LUA_CFLAGS"
867 CPPFLAGS="$CPPFLAGS_X $LUA_CFLAGS"
869 # Check that it is a compatible Lua version
870 AC_TRY_LINK([ #include <lua.h>
871 #include <lualib.h>],
872 [ lua_State *L = lua_open();
878 lua_pushboolean(L, 1);
880 cf_result=yes, cf_result=no)
886 AC_MSG_RESULT($cf_result)
888 if test "$cf_result" != yes; then
891 EL_CONFIG(CONFIG_SCRIPTING_LUA, [Lua])
892 AC_CHECK_HEADERS(lauxlib.h)
900 dnl ===================================================================
901 dnl Check for Ruby, optional even if installed.
902 dnl ===================================================================
904 EL_CONFIG_SCRIPTING_RUBY
906 dnl ===================================================================
907 dnl Setup global scripting
908 dnl ===================================================================
910 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])
911 AC_SUBST(CONFIG_SCRIPTING_GUILE)
912 AC_SUBST(CONFIG_SCRIPTING_LUA)
913 AC_SUBST(CONFIG_SCRIPTING_PERL)
914 AC_SUBST(CONFIG_SCRIPTING_PYTHON)
915 AC_SUBST(CONFIG_SCRIPTING_RUBY)
916 AC_SUBST(CONFIG_SCRIPTING_SPIDERMONKEY)
917 AC_SUBST(CONFIG_SCRIPTING)
920 dnl ===================================================================
921 dnl Check for SSL support.
922 dnl ===================================================================
924 dnl We by default use OpenSSL, and we always prefer it. However, when GNUTLS
925 dnl is enabled, we won't try to use OpenSSL anymore.
927 dnl For wiping SSL hooks..
934 AC_ARG_WITH(gnutls, [ --without-gnutls disable GNUTLS SSL support],
935 [if test "$with_gnutls" = no; then disable_gnutls=yes; fi])
936 AC_ARG_WITH(gnutls, [ --with-gnutls[=DIR] enable GNUTLS SSL support],
937 [if test "$with_gnutls" != no; then enable_gnutls=yes; fi])
938 gnutls_withval="$withval"
940 if test "$enable_gnutls" = yes; then
944 AC_ARG_WITH(openssl, [ --without-openssl disable OpenSSL support],
945 [if test "$with_openssl" = no; then disable_openssl=yes; fi])
946 AC_ARG_WITH(openssl, [ --with-openssl[=DIR] enable OpenSSL support (default)])
947 openssl_withval="$withval"
951 AC_MSG_CHECKING([for OpenSSL])
956 if test "$disable_openssl" = yes; then
959 for ssldir in "$openssl_withval" "" /usr /usr/local/openssl \
960 /usr/lib/openssl /usr/local/ssl \
961 /usr/local/www /usr/lib/ssl /usr/local \
962 /usr/pkg /opt /opt/openssl; do
963 if test "$cf_result" = no; then
964 if test -d "$ssldir"; then
965 OPENSSL_CFLAGS="-I$ssldir/include"
966 LIBS="-L$ssldir/lib -lssl -lcrypto $LIBS_X"
967 CFLAGS="$CFLAGS_X $OPENSSL_CFLAGS"
968 CPPFLAGS="$CPPFLAGS_X $OPENSSL_CFLAGS"
969 # # FIXME: This created serious portability problems. --pasky
970 # if test "$CC" == "gcc"; then
971 # # I'm not sure about compatibility here. --pasky
972 # LIBS="$LIBS -R$ssldir/lib"
975 LIBS="-lssl -lcrypto $LIBS_X"
977 AC_TRY_LINK([#include <openssl/ssl.h>],
978 [OpenSSL_add_all_algorithms()],
979 cf_result=yes, cf_result=no)
980 if test "$cf_result" != yes; then
981 AC_TRY_LINK([#include <openssl/ssl.h>],
982 [SSLeay_add_ssl_algorithms()],
983 cf_result=yes, cf_result=no)
988 if test "$cf_result" != yes; then
989 if test -n "$openssl_withval" && test "x$openssl_withval" != xno; then
990 AC_MSG_ERROR([OpenSSL not found])
994 EL_CONFIG(CONFIG_OPENSSL, [OpenSSL])
997 AC_SUBST(OPENSSL_CFLAGS)
1001 AC_MSG_RESULT($cf_result)
1003 CONFIG_GNUTLS_OPENSSL_COMPAT=no
1005 dnl We can't have AC_MSG_CHECKING here, because AC_PATH_PROG prints its own and
1006 dnl it looks ugly then.
1008 if test "$cf_result" = yes; then
1009 cf_result="not used"
1015 if test -z "$disable_gnutls"; then
1016 # Sure, we maybe _could_ use their macro, but how to ensure
1017 # that the ./configure script won't fail if the macro won't be
1018 # found..? :( --pasky
1020 GNUTLS_PATH="$PATH:/usr/local/gnutls:/opt:/opt/gnutls"
1022 if test -d "$gnutls_withval"; then
1023 GNUTLS_PATH="$gnutls_withval:$GNUTLS_PATH"
1026 AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no, $GNUTLS_PATH)
1028 if test "$LIBGNUTLS_CONFIG" = "no" ; then
1031 GNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG --cflags`
1032 GNUTLS_LIBS=`$LIBGNUTLS_CONFIG --libs`
1034 LIBS="$GNUTLS_LIBS $LIBS_X"
1035 CFLAGS="$CFLAGS_X $GNUTLS_CFLAGS"
1036 CPPFLAGS="$CPPFLAGS_X $GNUTLS_CFLAGS"
1038 # Verify if it's really usable. gnutls_session was
1039 # renamed to gnutls_session_t before GNU TLS 1.2.0
1040 # (on 2004-06-13); ELinks now requires this.
1041 AC_TRY_LINK([#include <gnutls/gnutls.h>],
1042 [gnutls_session_t dummy;
1043 gnutls_check_version(NULL)],
1044 cf_result=yes, cf_result=no)
1047 if test "$cf_result" = yes; then
1048 EL_CONFIG(CONFIG_GNUTLS, [GNUTLS])
1051 AC_SUBST(GNUTLS_CFLAGS)
1053 # Verify if the MD5 compatibility layer is usable.
1054 CONFIG_GNUTLS_OPENSSL_COMPAT=yes
1055 EL_CHECK_OPTIONAL_LIBRARY(CONFIG_GNUTLS_OPENSSL_COMPAT,
1056 [GNU TLS OpenSSL compatibility],
1057 gnutls/openssl.h, gnutls-openssl,
1060 if test -n "$gnutls_withval" && test "x$gnutls_withval" != xno; then
1061 AC_MSG_ERROR([GNUTLS (1.2 or later) not found. ELinks no longer supports GNUTLS 1.1.])
1068 AC_MSG_CHECKING([for GNU TLS (1.2 or later)])
1069 AC_MSG_RESULT($cf_result)
1073 EL_CONFIG_DEPENDS(CONFIG_SSL, [CONFIG_OPENSSL CONFIG_GNUTLS], [SSL])
1074 AC_SUBST(CONFIG_GNUTLS_OPENSSL_COMPAT)
1075 AC_SUBST(CONFIG_OPENSSL)
1076 AC_SUBST(CONFIG_GNUTLS)
1080 AC_MSG_CHECKING([whether to be or not to be])
1081 AC_MSG_RESULT([needs to be determined experimentally])
1083 dnl ===================================================================
1084 dnl Check for IPv6 support and related functions.
1085 dnl ===================================================================
1087 EL_CHECK_NET_TYPE(struct sockaddr_storage, HAVE_SA_STORAGE, [])
1088 EL_CHECK_NET_TYPE(struct sockaddr_in6, HAVE_SA_IN6, [#include <netinet/in.h>])
1089 EL_CHECK_NET_TYPE(struct addrinfo, HAVE_ADDRINFO, [#include <netdb.h>])
1091 AC_CHECK_FUNC(getaddrinfo, HAVE_GETADDRINFO=yes, HAVE_GETADDRINFO=no)
1092 if test "$HAVE_GETADDRINFO" != yes; then
1093 AC_CHECK_LIB(inet6, getaddrinfo, HAVE_GETADDRINFO=yes, HAVE_GETADDRINFO=no)
1094 if test "$HAVE_GETADDRINFO" = yes; then
1095 LIBS="$LIBS -linet6"
1100 dnl ===================================================================
1101 dnl Checking for X11 (window title restoring).
1102 dnl ===================================================================
1105 if test x"$no_x" != xyes; then
1106 if test -n "$x_includes"; then
1107 X_CFLAGS="-I$x_includes"
1108 CPPFLAGS="$CPPFLAGS -I$x_includes"
1110 if test -n "$x_libraries"; then
1111 LDFLAGS="$LDFLAGS -L$x_libraries"
1114 EL_DEFINE(HAVE_X11, [X11 for restoring window titles])
1119 dnl ===================================================================
1120 dnl Backtraces displaying support.
1121 dnl ===================================================================
1123 AC_CHECK_HEADERS(execinfo.h, HAVE_EXECINFO=yes, HAVE_EXECINFO=no)
1124 # possible checks for other system-specific means go here
1127 dnl ===================================================================
1128 dnl SMB protocol support.
1129 dnl ===================================================================
1131 AC_CHECK_PROG(HAVE_SMBCLIENT, smbclient, yes, no)
1134 dnl ===================================================================
1135 dnl Gettext grey zone. Beware.
1136 dnl ===================================================================
1138 ALL_LINGUAS="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"
1142 dnl AC_MSG_CHECKING([how many characters your English alphabet has])
1143 dnl # f33r d4 l33t... I hope it's portable. :)
1144 dnl cf_result=$((48#z - 48#a + 1));
1145 dnl AC_MSG_RESULT($cf_result)
1148 dnl ===================================================================
1149 dnl Compile-time features control
1150 dnl ===================================================================
1152 EL_ARG_ENABLE(CONFIG_COOKIES, cookies, [Cookies],
1153 [ --disable-cookies disable cookie support])
1155 EL_ARG_ENABLE(CONFIG_FORMHIST, formhist, [Form history],
1156 [ --disable-formhist disable form history support])
1158 EL_ARG_ENABLE(CONFIG_GLOBHIST, globhist, [Global history],
1159 [ --disable-globhist disable global history support])
1162 EL_ARG_ENABLE(CONFIG_MAILCAP, mailcap, [Mailcap],
1163 [ --disable-mailcap disable mailcap support])
1165 EL_ARG_ENABLE(CONFIG_MIMETYPES, mimetypes, [Mimetypes files],
1166 [ --disable-mimetypes disable mimetypes files support])
1169 EL_ARG_DEPEND(CONFIG_IPV6, ipv6,
1170 [HAVE_SA_STORAGE:yes HAVE_SA_IN6:yes HAVE_ADDRINFO:yes HAVE_GETADDRINFO:yes],
1172 [ --disable-ipv6 disable IPv6 support])
1174 EL_ARG_ENABLE(CONFIG_BITTORRENT, bittorrent, [BitTorrent protocol],
1175 [ --enable-bittorrent enable BitTorrent protocol support])
1177 EL_ARG_ENABLE(CONFIG_DATA, data, [Data protocol],
1178 [ --disable-data disable data protocol support])
1180 EL_ARG_ENABLE(CONFIG_URI_REWRITE, uri-rewrite, [URI rewriting],
1181 [ --disable-uri-rewrite disable URI rewrite support])
1183 EL_ARG_DEPEND(CONFIG_CGI, cgi, [HAVE_SETENV_OR_PUTENV:yes], [Local CGI],
1184 [ --enable-cgi enable local CGI support])
1186 EL_ARG_ENABLE(CONFIG_FINGER, finger, [Finger protocol],
1187 [ --enable-finger enable finger protocol support])
1189 dnl ===================================================================
1191 dnl ===================================================================
1194 if test "x${enable_fsp}" != xno; then
1195 AC_CHECK_HEADERS(fsplib.h, HAVE_FSPLIB=yes, HAVE_FSPLIB=no)
1197 if test "$HAVE_FSPLIB" = yes; then
1198 AC_CHECK_LIB(fsplib, fsp_open_session, HAVE_FSPLIB=yes, HAVE_FSPLIB=no)
1199 if test "$HAVE_FSPLIB" = yes; then
1200 LIBS="$LIBS -lfsplib"
1202 AC_CHECK_LIB(fsp, fsp_open_session, HAVE_FSPLIB=yes, HAVE_FSPLIB=no)
1203 if test "$HAVE_FSPLIB" = yes; then
1210 EL_ARG_DEPEND(CONFIG_FSP, fsp, [HAVE_FSPLIB:yes], [FSP protocol],
1211 [ --enable-fsp enable FSP protocol support])
1213 if test "x$CONFIG_FSP" = xno; then
1217 EL_ARG_ENABLE(CONFIG_FTP, ftp, [FTP protocol],
1218 [ --disable-ftp disable ftp protocol support])
1220 EL_ARG_ENABLE(CONFIG_GOPHER, gopher, [Gopher protocol],
1221 [ --enable-gopher enable gopher protocol support])
1223 EL_ARG_ENABLE(CONFIG_NNTP, nntp, [NNTP protocol],
1224 [ --enable-nntp enable nntp protocol support])
1226 EL_ARG_DEPEND(CONFIG_SMB, smb, [HAVE_SMBCLIENT:yes], [SMB protocol],
1227 [ --disable-smb disable SMB protocol support (requires smbclient)])
1230 EL_ARG_ENABLE(CONFIG_MOUSE, mouse, [Mouse handling],
1231 [ --disable-mouse disable mouse support])
1233 # GPM mouse is Linux specific, so ...
1235 EL_ARG_DEPEND(CONFIG_SYSMOUSE, sysmouse,
1236 [CONFIG_MOUSE:yes CONFIG_GPM:no HAVE_SYSMOUSE_HEADER:yes],
1238 [ --disable-sysmouse disable BSD sysmouse support])
1240 EL_ARG_ENABLE(CONFIG_88_COLORS, 88-colors, [88 colors],
1241 [ --enable-88-colors enable 88 color support])
1243 EL_ARG_ENABLE(CONFIG_256_COLORS, 256-colors, [256 colors],
1244 [ --enable-256-colors enable 256 color support])
1247 EL_ARG_ENABLE(CONFIG_EXMODE, exmode, [Exmode interface],
1248 [ --enable-exmode enable exmode (CLI) interface])
1250 EL_ARG_ENABLE(CONFIG_LEDS, leds, [LEDs],
1251 [ --disable-leds disable LEDs support])
1253 EL_ARG_ENABLE(CONFIG_MARKS, marks, [Marks],
1254 [ --disable-marks disable document marks support])
1257 EL_ARG_ENABLE(CONFIG_CSS, css, [Cascading Style Sheets],
1258 [ --disable-css disable Cascading Style Sheet support])
1260 EL_ARG_DEPEND(CONFIG_HTML_HIGHLIGHT, html-highlight, [CONFIG_CSS:yes], [HTML highlighting],
1261 [ --enable-html-highlight HTML highlighting using DOM engine])
1263 dnl Everything in the tree already uses CONFIG_DOM
1264 dnl so resolve CONFIG_HTML_HIGHLIGHT to CONFIG_DOM
1265 EL_CONFIG_DEPENDS(CONFIG_DOM, [CONFIG_HTML_HIGHLIGHT], [DOM engine])
1267 EL_ARG_DEPEND(CONFIG_BACKTRACE, backtrace, [HAVE_EXECINFO:yes], [Backtrace],
1268 [ --disable-backtrace disable backtrace support])
1270 EL_ARG_DEPEND(CONFIG_NO_ROOT_EXEC, no-root, [HAVE_GETUID:yes HAVE_GETEUID:yes], [No root exec],
1271 [ --enable-no-root enable prevention of usage by root])
1274 EL_ARG_ENABLE(CONFIG_DEBUG, debug, [Debug mode],
1275 [ --enable-debug enable leak debug and internal error checking])
1277 EL_ARG_DEPEND(CONFIG_FASTMEM, fastmem, [CONFIG_DEBUG:no], [Fast mode],
1278 [ --enable-fastmem enable direct use of system allocation functions, not usable with --enable-debug])
1280 EL_ARG_ENABLE(CONFIG_OWN_LIBC, own-libc, [Own libc stubs],
1281 [ --enable-own-libc force use of internal functions instead of those of system libc])
1283 EL_ARG_ENABLE(CONFIG_SMALL, small, [Small binary],
1284 [ --enable-small reduce binary size as far as possible (but see the bottom of doc/small.txt!)])
1286 AC_ARG_ENABLE(weehoofooboomookerchoo,
1288 Also check out the features.conf file for more information about features!
1290 [AC_MSG_ERROR(Are you strange, or what?)])
1295 test "$CONFIG_OS_OS2" = yes && LDFLAGS="$LDFLAGS -Zexe"
1296 test "$CONFIG_OS_OS2" = yes && LDFLAGS=`echo "$LDFLAGS" | sed "s/-Zbin-files//g"`
1299 dnl ===================================================================
1300 dnl Export directory paths
1301 dnl ===================================================================
1303 # Set up the ``entry points'' if they were not supplied by builder
1304 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1305 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1307 # Create CONFDIR #define for config.h
1309 # XXX: This may be dependent on a particular version of autoconf. Whatever,
1310 # it's autoconf fault to force us to do such hacks ;p.
1311 if test x"$sysconfdir" = x"\${prefix}/etc"; then
1312 # sysconfdir is set to its default value... fine, let's append /elinks/
1313 # XXX: We can't modify listing of the default in ./configure --help :-(
1314 sysconfdir_n=`eval echo "$sysconfdir"`
1315 sysconfdir=$sysconfdir_n
1316 (echo "$sysconfdir" | grep elinks >/dev/null 2>/dev/null) || \
1317 sysconfdir="$sysconfdir/elinks"
1321 AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR", [Directory containing default config])
1324 # Create LOCALEDIR #define for config.h
1325 LOCALEDIR=`eval echo "$datadir/locale"`
1326 AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR", [Directory containing locales])
1329 # Create LIBDIR #define for config.h
1330 LIBDIR=`eval echo "$libdir"`
1331 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [Directory containing libraries])
1334 EL_LOG_CONFIG(CONFDIR, [System configuration directory], [])
1335 EL_LOG_CONFIG(LOCALEDIR, [Locale catalogs directory], [])
1337 dnl ===================================================================
1338 dnl A little fine tuning of gcc specific options (continued)
1339 dnl ===================================================================
1341 if test "x$ac_cv_prog_gcc" = "xyes"; then
1342 if test "$CONFIG_DEBUG" = "yes"; then
1343 dnl We want to see all warnings and live with none (in debug mode).
1344 CFLAGS="$CFLAGS -Werror"
1347 case "`$CC -dumpversion`" in
1349 # These should be ok using -Werror
1352 # If gcc is version 3.3 (or higher?) it emits lots of false positive
1353 # "dereferencing type-punned pointer will break strict-aliasing rules"
1354 # warnings. Disable them by not doing any strict-aliasing. The
1355 # alternative is just too ugly. Thanks gcc guys!! ;)
1356 CFLAGS="$CFLAGS -fno-strict-aliasing"
1359 # Do not show warnings related to (char * | unsigned char *) type
1361 CFLAGS="$CFLAGS -fno-strict-aliasing -Wno-pointer-sign"
1364 # These should be ok using -Werror
1369 # CFLAGS doesn't contain all compile flags. Some will be added only when
1370 # needed in the respective source directory. To get all compile flags
1371 # easily just add CPPFLAGS.
1372 ALL_CFLAGS="$CFLAGS $CPPFLAGS"
1374 EL_LOG_CONFIG(ALL_CFLAGS, [Compiler options (CFLAGS)], [])
1375 EL_LOG_CONFIG(LIBS, [Linker options (LIBS)], [])
1377 dnl ===================================================================
1378 dnl Colored make output
1379 dnl ===================================================================
1381 if test $(`which tput` colors) -ge 4; then
1383 AC_SUBST(MAKE_COLOR)
1386 dnl ===================================================================
1388 dnl ===================================================================
1392 contrib/elinks.spec \
1393 contrib/lua/hooks.lua \
1394 contrib/conv/w3m2links.awk \
1395 doc/man/man1/elinks.1 \
1396 src/intl/gettext/ref-add.sed \
1397 src/intl/gettext/ref-del.sed
1400 abs_srcdir="$(cd "$srcdir" && pwd)"
1401 # builddir is always absolute!
1402 if test "$abs_srcdir" != "$builddir"; then
1403 # Bootstrap the Makefile creation
1404 echo "include $abs_srcdir/Makefile" > "$builddir/Makefile"
1405 "$MAKE" "SRC=$abs_srcdir" init
1407 # Make cg-status ignore this build directory
1408 echo "*" > "$builddir/.gitignore"
1411 dnl ===================================================================
1412 dnl Configuration summary
1413 dnl ===================================================================
1415 AC_MSG_RESULT(The following feature summary has been saved to features.log)