summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www-client/elinks/ChangeLog8
-rw-r--r--www-client/elinks/Manifest28
-rw-r--r--www-client/elinks/elinks-0.11.3.ebuild152
-rw-r--r--www-client/elinks/files/digest-elinks-0.11.36
-rw-r--r--www-client/elinks/files/elinks-0.11.3-lua-5.patch1418
5 files changed, 1603 insertions, 9 deletions
diff --git a/www-client/elinks/ChangeLog b/www-client/elinks/ChangeLog
index 54418055aca6..6ccb83a0f0ab 100644
--- a/www-client/elinks/ChangeLog
+++ b/www-client/elinks/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for www-client/elinks
# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/www-client/elinks/ChangeLog,v 1.77 2007/04/25 13:44:25 eroyf Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-client/elinks/ChangeLog,v 1.78 2007/05/13 10:03:50 spock Exp $
+
+*elinks-0.11.3 (13 May 2007)
+
+ 13 May 2007; Michał Januszewski <spock@gentoo.org>
+ +files/elinks-0.11.3-lua-5.patch, +elinks-0.11.3.ebuild:
+ Version bump.
25 Apr 2007; Alexander Færøy <eroyf@gentoo.org> elinks-0.11.2.ebuild:
Stable on MIPS.
diff --git a/www-client/elinks/Manifest b/www-client/elinks/Manifest
index 4730760065a2..1795cc6b8e58 100644
--- a/www-client/elinks/Manifest
+++ b/www-client/elinks/Manifest
@@ -33,9 +33,14 @@ AUX elinks-0.11.2-lua-5.patch 2125 RMD160 be94e085a7b231dad1681566c533699b2a6d27
MD5 84aca7f1d1866fc20dd811ef3f4927f3 files/elinks-0.11.2-lua-5.patch 2125
RMD160 be94e085a7b231dad1681566c533699b2a6d2745 files/elinks-0.11.2-lua-5.patch 2125
SHA256 4e0f7b622111696e52e15745d8ac35249a95def36eb5aa782487c7901125260c files/elinks-0.11.2-lua-5.patch 2125
+AUX elinks-0.11.3-lua-5.patch 46208 RMD160 669b17051f4110fadec480c48bd8944faa8f1be4 SHA1 92136a83d07bb303e65239a145d75c0775520c38 SHA256 b4682cd96f34e0f66085f511f2855fcec05bf05b2aa8fcdc37d49f0f9d0b81b2
+MD5 10b1cc3e9b0e1a817477d54aa475d377 files/elinks-0.11.3-lua-5.patch 46208
+RMD160 669b17051f4110fadec480c48bd8944faa8f1be4 files/elinks-0.11.3-lua-5.patch 46208
+SHA256 b4682cd96f34e0f66085f511f2855fcec05bf05b2aa8fcdc37d49f0f9d0b81b2 files/elinks-0.11.3-lua-5.patch 46208
DIST elinks-0.10.4.conf.bz2 5370 RMD160 5a0935ed8b035cd2f7636516b0e226a8065d1c70 SHA1 7f7b009b1b6cb746e90835d2b612f1aa6b5d3a1e SHA256 cb0fcd10cc592697de5d8d9358447a770d2b4613b17b629c0f0e05965baa6209
DIST elinks-0.11.1.tar.bz2 2612791 RMD160 2c5039a2e3d7ee3fc283d3041cac40f3c7853520 SHA1 dfa18f2745976e34ce3ee27227ce9bce81495a77 SHA256 d18c723840a91989e79273215363391567b9a48b901efa458fb3974e8487327d
DIST elinks-0.11.2.tar.bz2 2497270 RMD160 a9d938cfdfa71be282b7596e1fed5797f2efd6a5 SHA1 47669c38e1e5ebb35015a9a9a8f9c898821bd408 SHA256 91ac894715efcde78548dfe4703ae702f08fb4a94187288eb9ba2b30258d5585
+DIST elinks-0.11.3.tar.bz2 2516793 RMD160 936f0cd4dbc69f70c329cf0ef5d7acd722652b6e SHA1 e4d8b0edd5fa4ec4310662242f0b5cf32864ed11 SHA256 c10e657fbd884eae4f01b91b32407bbfcbcae0ad5017fb24ea365aebc71d2af1
EBUILD elinks-0.11.1.ebuild 4612 RMD160 58c1652b75ec9b2f27d5f53f14db6c0576429b02 SHA1 c2f19bcc9b8808dadf11225126710c6f57a5ed4d SHA256 df85b590f94d49d1e6ffd92b666a87c4c411f4dc1dbefce37ed18a9b2fc16e3b
MD5 6af9b0e28c10f01dad8cc63a64a9cd26 elinks-0.11.1.ebuild 4612
RMD160 58c1652b75ec9b2f27d5f53f14db6c0576429b02 elinks-0.11.1.ebuild 4612
@@ -44,10 +49,14 @@ EBUILD elinks-0.11.2.ebuild 4849 RMD160 3601b6b26cd53a17a4fef6fbfea46bb7c949107f
MD5 6c67587ec7449ea432a371c86873ba35 elinks-0.11.2.ebuild 4849
RMD160 3601b6b26cd53a17a4fef6fbfea46bb7c949107f elinks-0.11.2.ebuild 4849
SHA256 857c5fa69af12264a736ed481e920906f7bf3d53a239b4f511668542169a3eac elinks-0.11.2.ebuild 4849
-MISC ChangeLog 18063 RMD160 41dfd479b0b69433208bd21f310236ddf7fedf97 SHA1 f5dab1a75272a415f215b14baaed06b781b90b6b SHA256 f1d587b37174c0f8ab527f27b4951fd1acb147e0fb5a71ae939ad28b0ea3088b
-MD5 6e56b3942baa974ce273529a35f83b8b ChangeLog 18063
-RMD160 41dfd479b0b69433208bd21f310236ddf7fedf97 ChangeLog 18063
-SHA256 f1d587b37174c0f8ab527f27b4951fd1acb147e0fb5a71ae939ad28b0ea3088b ChangeLog 18063
+EBUILD elinks-0.11.3.ebuild 4717 RMD160 f04fb91b27b8221e1ddc1f72f45213486e7dbc75 SHA1 c01da846313a01bffb1cabd6f1fcaebdbe688197 SHA256 fea134071ab04bc550bd181e246ad4bf4d24ea03e40e2bd4780dc3cddc720acd
+MD5 59df0fd1a78abd4e70d693d5b4520af5 elinks-0.11.3.ebuild 4717
+RMD160 f04fb91b27b8221e1ddc1f72f45213486e7dbc75 elinks-0.11.3.ebuild 4717
+SHA256 fea134071ab04bc550bd181e246ad4bf4d24ea03e40e2bd4780dc3cddc720acd elinks-0.11.3.ebuild 4717
+MISC ChangeLog 18223 RMD160 f5b34838015bc4cffb17e6990fc6c323f6a7a2ce SHA1 92a0d0a72ff9451573e160ee1a941b6a4aeb7cc8 SHA256 52cad4230f0ba18510dc980d798a73fa66dc2d437677f1ac2c4b31d88310ee61
+MD5 a3226e271e9b917b251c77937e1250a7 ChangeLog 18223
+RMD160 f5b34838015bc4cffb17e6990fc6c323f6a7a2ce ChangeLog 18223
+SHA256 52cad4230f0ba18510dc980d798a73fa66dc2d437677f1ac2c4b31d88310ee61 ChangeLog 18223
MISC metadata.xml 255 RMD160 399f78e98260d4f311124e71c6d294e368a76976 SHA1 61f663af9ea0cb4967a12878352e65b095dcd473 SHA256 b2dfe92cb4cae7ec4ecb4af91e94b9aa507a3c8214af32f75cf44f6011a13cc5
MD5 d94d306da3804e41296e1bf04c7c9cae metadata.xml 255
RMD160 399f78e98260d4f311124e71c6d294e368a76976 metadata.xml 255
@@ -58,10 +67,13 @@ SHA256 0074385608ba5c7e0b6193b003b5218c75d179e3bbdb1d1134328332f71ffc6b files/di
MD5 347a412177c8b073af1160e65e777faf files/digest-elinks-0.11.2 488
RMD160 ca4e65389badb922c60d3868caa2fab0ae977804 files/digest-elinks-0.11.2 488
SHA256 64a75a4378c0194214ae924b00385c215e1463cd0bfd71dd04d56ce00a5f7483 files/digest-elinks-0.11.2 488
+MD5 8512c43988ba78773657615251c22d4b files/digest-elinks-0.11.3 488
+RMD160 02d9eb5ca13629b09703418c70dd7da6bef9e2eb files/digest-elinks-0.11.3 488
+SHA256 07212a85189d571790777d937ad45aca72a20e4fbb54d784a5feb9b2d4c8dcbd files/digest-elinks-0.11.3 488
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.6 (GNU/Linux)
+Version: GnuPG v2.0.4 (GNU/Linux)
-iD8DBQFGL1rb6Xxn2nLwtdQRAsGaAJ9CdNlAx8yXOQ4DELxdWPKdo7bLIACg3EN+
-pWQuR14jdRIwDMvkVAmpQ5s=
-=VfAF
+iD8DBQFGRuJ2chej4aZK9/cRAmGNAJ9OCXVfyv31lb66RNdkyygkEQGe7QCfZGbu
+LEnfD3tO8cZwbAfN6W7RWTY=
+=pMai
-----END PGP SIGNATURE-----
diff --git a/www-client/elinks/elinks-0.11.3.ebuild b/www-client/elinks/elinks-0.11.3.ebuild
new file mode 100644
index 000000000000..b490bc5ef5ad
--- /dev/null
+++ b/www-client/elinks/elinks-0.11.3.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-client/elinks/elinks-0.11.3.ebuild,v 1.1 2007/05/13 10:03:50 spock Exp $
+
+WANT_AUTOCONF="latest"
+WANT_AUTOMAKE="1.4"
+
+inherit eutils autotools flag-o-matic
+
+MY_P="${P/_/}"
+DESCRIPTION="Advanced and well-established text-mode web browser"
+HOMEPAGE="http://elinks.or.cz/"
+SRC_URI="http://elinks.or.cz/download/${MY_P}.tar.bz2
+ http://dev.gentoo.org/~spock/portage/distfiles/elinks-0.10.4.conf.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE="bittorrent bzip2 debug finger ftp gopher gpm guile idn ipv6 \
+ javascript lua nls nntp perl ruby ssl unicode X zlib"
+RESTRICT="test"
+
+DEPEND=">=dev-libs/expat-1.95.4
+ bzip2? ( >=app-arch/bzip2-1.0.2 )
+ ssl? ( >=dev-libs/openssl-0.9.6g )
+ X? ( || ( ( x11-libs/libX11 x11-libs/libXt )
+ virtual/x11 ) )
+ zlib? ( >=sys-libs/zlib-1.1.4 )
+ lua? ( >=dev-lang/lua-5 )
+ gpm? ( >=sys-libs/ncurses-5.2 >=sys-libs/gpm-1.20.0-r5 )
+ guile? ( >=dev-scheme/guile-1.6.4-r1 )
+ idn? ( net-dns/libidn )
+ perl? ( sys-devel/libperl )
+ ruby? ( dev-lang/ruby )
+ !hppa? ( !mips? ( !alpha? ( javascript? ( dev-lang/spidermonkey ) ) ) )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ if use guile && has_version ">dev-scheme/guile-1.6.8" &&
+ ! built_with_use -a dev-scheme/guile deprecated discouraged; then
+ eerror "To install elinks with the 'guile' USE flag, dev-scheme/guile has to"
+ eerror "be built with 'deprecated' and 'discouraged' USE flags."
+ die "dev-scheme/guile not built with deprecated/discouraged"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ epatch ${FILESDIR}/${PN}-0.10.4.conf-syscharset.diff
+ mv "${PN}-0.10.4.conf" "${PN}.conf"
+ if ! use ftp ; then
+ sed -i -e 's/\(.*protocol.ftp.*\)/# \1/' ${PN}.conf
+ fi
+ sed -i -e 's/\(.*set protocol.ftp.use_epsv.*\)/# \1/' ${PN}.conf
+ cd ${S}
+ epatch ${FILESDIR}/${PN}-0.11.3-lua-5.patch
+
+ if use lua && has_version ">=dev-lang/lua-5.1"; then
+ epatch ${FILESDIR}/${PN}-0.11.2-lua-5.1.patch
+ fi
+
+ if use unicode ; then
+ epatch ${FILESDIR}/elinks-0.10.1-utf_8_io-default.patch
+ fi
+
+ sed -i -e 's/-Werror//' configure*
+}
+
+src_compile() {
+ # NOTE about GNUTSL SSL support (from the README -- 25/12/2002)
+ # As GNUTLS is not yet 100% stable and its support in ELinks is not so well
+ # tested yet, it's recommended for users to give a strong preference to OpenSSL whenever possible.
+ local myconf=""
+
+ eautoreconf
+
+ if use debug ; then
+ myconf="--enable-debug"
+ else
+ myconf="--enable-fastmem"
+ fi
+
+ if use ssl ; then
+ myconf="${myconf} --with-openssl"
+ else
+ myconf="${myconf} --without-openssl --without-gnutls"
+ fi
+
+ econf \
+ --sysconfdir=/etc/elinks \
+ --enable-leds \
+ --enable-88-colors \
+ --enable-256-colors \
+ --enable-html-highlight \
+ $(use_with gpm) \
+ $(use_with zlib) \
+ $(use_with bzip2 bzlib) \
+ $(use_with X x) \
+ $(use_with lua) \
+ $(use_with guile) \
+ $(use_with perl) \
+ $(use_with ruby) \
+ $(use_with idn) \
+ $(use_with javascript spidermonkey) \
+ $(use_enable bittorrent) \
+ $(use_enable nls) \
+ $(use_enable ipv6) \
+ $(use_enable ftp) \
+ $(use_enable gopher) \
+ $(use_enable nntp) \
+ $(use_enable finger) \
+ ${myconf} || die
+
+ emake || die "compile problem"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die
+
+ insopts -m 644 ; insinto /etc/elinks
+ doins "${WORKDIR}"/elinks.conf
+ newins contrib/keybind-full.conf keybind-full.sample
+ newins contrib/keybind.conf keybind.conf.sample
+
+ dodoc AUTHORS BUGS ChangeLog INSTALL NEWS README SITES THANKS TODO doc/*.*
+ docinto contrib ; dodoc contrib/{README,colws.diff,elinks[-.]vim*}
+ insinto /usr/share/doc/${PF}/contrib/lua ; doins contrib/lua/{*.lua,elinks-remote}
+ insinto /usr/share/doc/${PF}/contrib/conv ; doins contrib/conv/*.*
+ insinto /usr/share/doc/${PF}/contrib/guile ; doins contrib/guile/*.scm
+
+ # Remove some conflicting files on OSX. The files provided by OSX 10.4
+ # are more or less the same. -- Fabian Groffen (2005-06-30)
+ rm -f "${D}"/usr/share/locale/locale.alias "${D}"/usr/lib/charset.alias
+}
+
+pkg_postinst() {
+ einfo "This ebuild provides a default config for ELinks."
+ einfo "Please check /etc/elinks/elinks.conf"
+ einfo
+ einfo "You may want to convert your html.cfg and links.cfg of"
+ einfo "Links or older ELinks versions to the new ELinks elinks.conf"
+ einfo "using /usr/share/doc/${PF}/contrib/conv/conf-links2elinks.pl"
+ einfo
+ einfo "Please have a look at /etc/elinks/keybind-full.sample and"
+ einfo "/etc/elinks/keybind.conf.sample for some bindings examples."
+ einfo
+ einfo "You will have to set your TERM variable to 'xterm-256color'"
+ einfo "to be able to use 256 colors in elinks."
+ echo
+}
diff --git a/www-client/elinks/files/digest-elinks-0.11.3 b/www-client/elinks/files/digest-elinks-0.11.3
new file mode 100644
index 000000000000..3b0c808fe4f8
--- /dev/null
+++ b/www-client/elinks/files/digest-elinks-0.11.3
@@ -0,0 +1,6 @@
+MD5 09e76c99955076aac144e9097f22a36f elinks-0.10.4.conf.bz2 5370
+RMD160 5a0935ed8b035cd2f7636516b0e226a8065d1c70 elinks-0.10.4.conf.bz2 5370
+SHA256 cb0fcd10cc592697de5d8d9358447a770d2b4613b17b629c0f0e05965baa6209 elinks-0.10.4.conf.bz2 5370
+MD5 a0eb50e18a2ac8e77d6b0df8f94bb5a6 elinks-0.11.3.tar.bz2 2516793
+RMD160 936f0cd4dbc69f70c329cf0ef5d7acd722652b6e elinks-0.11.3.tar.bz2 2516793
+SHA256 c10e657fbd884eae4f01b91b32407bbfcbcae0ad5017fb24ea365aebc71d2af1 elinks-0.11.3.tar.bz2 2516793
diff --git a/www-client/elinks/files/elinks-0.11.3-lua-5.patch b/www-client/elinks/files/elinks-0.11.3-lua-5.patch
new file mode 100644
index 000000000000..06df7e28e260
--- /dev/null
+++ b/www-client/elinks/files/elinks-0.11.3-lua-5.patch
@@ -0,0 +1,1418 @@
+diff -Naurp elinks-0.11.3-orig/configure.in elinks-0.11.3/configure.in
+--- elinks-0.11.3-orig/configure.in 2007-05-13 11:51:34.000000000 +0200
++++ elinks-0.11.3/configure.in 2007-05-13 11:52:30.000000000 +0200
+@@ -727,7 +727,7 @@ if test -z "$disable_lua"; then
+ for luadir in "$withval" "" /usr /usr/local; do
+ for suffix in "" 50 51; do
+ if test "$cf_result" = no; then
+- LUA_LIBS="-llua$suffix -llualib$suffix -lm"
++ LUA_LIBS="`pkg-config --libs lua`"
+
+ if test ! -z "$luadir"; then
+ LUA_LIBS="-L$luadir/lib $LUA_LIBS"
+diff -Naurp elinks-0.11.3-orig/configure.in.orig elinks-0.11.3/configure.in.orig
+--- elinks-0.11.3-orig/configure.in.orig 1970-01-01 01:00:00.000000000 +0100
++++ elinks-0.11.3/configure.in.orig 2007-04-15 22:51:02.000000000 +0200
+@@ -0,0 +1,1342 @@
++dnl Process this file with autoconf to produce a configure script.
++
++AC_PREREQ(2.13)
++AC_INIT(src/main/main.c)
++AC_CONFIG_AUX_DIR(config)
++
++PACKAGE=elinks
++VERSION=0.11.3
++AC_SUBST(PACKAGE)
++AC_SUBST(VERSION)
++AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Package version])
++AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Package version])
++AC_CONFIG_HEADERS(config.h)
++
++AC_CHECK_PROG(ACLOCAL,[aclocal],[aclocal],[config/missing aclocal])
++AC_CHECK_PROG(AUTOCONF,[autoconf],[autoconf],[config/missing autoconf])
++AC_CHECK_PROG(AUTOHEADER,[autoheader],[autoheader],[config/missing autoheader])
++
++MAKE=
++
++for make in gnumake gmake make false; do
++ if test "x$MAKE" = x; then
++ AC_PATH_PROGS(MAKE, "$make")
++ fi
++done
++
++builddir="`pwd`"
++
++# Cleanup if we are configuring with a previous build in the tree
++if test -e Makefile.config; then
++ AC_MSG_CHECKING([for previous build to clean])
++ "$MAKE" -C "$builddir/src" cleanall >/dev/null 2>/dev/null
++ AC_MSG_RESULT(done)
++fi
++
++dnl ===================================================================
++dnl Load feature configuration file and start logging features.
++dnl ===================================================================
++
++features="features.conf"
++AC_CHECK_FILE("$srcdir/$features", [ . $srcdir/$features ])
++AC_CHECK_FILE("$builddir/$features", [ . $builddir/$features ])
++echo "Feature summary:" > features.log
++
++dnl ===================================================================
++dnl Checks for programs.
++dnl ===================================================================
++
++AC_PROG_CC
++AC_PROG_AWK
++AC_PATH_PROGS(AWK, "$AWK")
++AC_PROG_RANLIB
++AC_PROG_INSTALL
++
++AC_PATH_PROGS(CG_COMMIT_ID, "cg-commit-id")
++AC_PATH_PROGS(SPARSE, "sparse")
++
++CONFIG_ASCIIDOC="no"
++CONFIG_POD2HTML="no"
++CONFIG_XMLTO="no"
++CONFIG_JW="no"
++
++if test "x$CONFIG_DOC" != xno; then
++ AC_PATH_PROGS(ASCIIDOC, "asciidoc")
++ if test "x$ASCIIDOC" != "x"; then
++ EL_CONFIG(CONFIG_ASCIIDOC, [AsciiDoc])
++ EL_CONFIG(MANUAL_ASCIIDOC, [HTML (one file)])
++ EL_CONFIG(MAN_ASCIIDOC, [HTML])
++
++ echo > config.asciidoc-unsafe.txt
++ if "$ASCIIDOC" --unsafe config.asciidoc-unsafe.txt >/dev/null 2>/dev/null; then
++ ASCIIDOC_FLAGS=--unsafe
++ fi
++ rm config.asciidoc-unsafe.*
++ fi
++
++ AC_PATH_PROGS(XMLTO, "xmlto")
++ if test "x$XMLTO" != "x"; then
++ EL_CONFIG(CONFIG_XMLTO, [XmlTo])
++ EL_CONFIG(MANUAL_XMLTO, [HTML (multiple files)])
++ EL_CONFIG(MAN_XMLTO, [man (groff)])
++ fi
++
++ AC_PATH_PROGS(JW, "jw")
++ if test "x$JW" != "x"; then
++ EL_CONFIG(CONFIG_JW, [JadeWrapper])
++ EL_CONFIG(MANUAL_JW, [PDF])
++ fi
++
++ AC_PATH_PROGS(POD2HTML, "pod2html")
++ if test "x$POD2HTML" != "x"; then
++ EL_CONFIG(CONFIG_POD2HTML, [Pod2HTML])
++ fi
++fi
++
++AC_SUBST(ASCIIDOC_FLAGS)
++AC_SUBST(CONFIG_ASCIIDOC)
++AC_SUBST(CONFIG_POD2HTML)
++AC_SUBST(CONFIG_XMLTO)
++AC_SUBST(CONFIG_JW)
++
++EL_CONFIG_DEPENDS(CONFIG_DOC, [CONFIG_ASCIIDOC CONFIG_XMLTO CONFIG_JW CONFIG_POD2HTML], [Documentation Tools])
++EL_CONFIG_DEPENDS(CONFIG_MANUAL, [MANUAL_ASCIIDOC MANUAL_XMLTO MANUAL_JW], [Manual Formats])
++EL_CONFIG_DEPENDS(CONFIG_MANPAGE, [MAN_ASCIIDOC MAN_XMLTO], [Man Page Formats])
++
++dnl gcc specific options (to be continued at the bottom of configure)
++if test "x$ac_cv_prog_gcc" = "xyes"; then
++ dnl We want to see all warnings and live with none.
++ dnl We can't set up -Werror here as there may be some warnings in test
++ dnl suite of configure, and we don't want to fail them.
++ CFLAGS="$CFLAGS -Wall"
++fi
++
++dnl ===================================================================
++dnl Checks for special OSes.
++dnl ===================================================================
++
++dnl EL_CHECK_COMPILER_MACRO(define, name, flagname)
++AC_DEFUN([EL_CHECK_COMPILER_MACROS],
++[
++ AC_MSG_CHECKING([for $2])
++
++ for flag in $3; do
++ AC_TRY_COMPILE(, [#ifndef $flag
++kill me!
++#endif ], $1=yes, $1=no)
++ if test "[$]$1" = yes; then
++ EL_CONFIG([$1], [$2])
++ break
++ fi
++ done
++
++ AC_MSG_RESULT([$]$1)
++])
++
++EL_CHECK_COMPILER_MACROS(CONFIG_BEOS, [BEOS], [__BEOS__])
++AC_SUBST(CONFIG_BEOS)
++
++EL_CHECK_COMPILER_MACROS(CONFIG_RISCOS, [RISCOS], [__riscos__])
++AC_SUBST(CONFIG_RISCOS)
++
++EL_CHECK_COMPILER_MACROS(CONFIG_WIN32, [WIN32], [_WIN32 __WIN32__])
++AC_SUBST(CONFIG_WIN32)
++
++EL_CHECK_COMPILER_MACROS(CONFIG_OS2, [EMX], [__EMX__])
++AC_SUBST(CONFIG_OS2)
++test "$CONFIG_OS2" = yes && LDFLAGS=`echo "$LDFLAGS" | sed "s/-Zexe//g"`
++
++AC_MSG_CHECKING([for UNIX])
++dnl FIXME: some depend kind of mechanism
++if test "$CONFIG_BEOS" = no && \
++ test "$CONFIG_RISCOS" = no && \
++ test "$CONFIG_WIN32" = no && \
++ test "$CONFIG_OS2" = no; then
++ EL_CONFIG(CONFIG_UNIX, [UNIX])
++else
++ CONFIG_UNIX=no
++fi
++AC_MSG_RESULT($CONFIG_UNIX)
++AC_SUBST(CONFIG_UNIX)
++
++dnl ===================================================================
++dnl Checks for header files.
++dnl ===================================================================
++
++AC_HEADER_DIRENT
++AC_HEADER_STDC
++AC_HEADER_SYS_WAIT
++AC_HEADER_TIME
++
++AC_CHECK_HEADERS(fcntl.h limits.h time.h unistd.h)
++AC_CHECK_HEADERS(sigaction.h)
++AC_CHECK_HEADERS(arpa/inet.h)
++AC_CHECK_HEADERS(netinet/in_systm.h netinet/in_system.h netinet/ip.h)
++AC_CHECK_HEADERS(net/if.h netdb.h netinet/in.h netinet/in6_var.h)
++AC_CHECK_HEADERS(ifaddrs.h)
++AC_CHECK_HEADERS(sys/cygwin.h io.h)
++AC_CHECK_HEADERS(sys/fmutex.h)
++AC_CHECK_HEADERS(sys/ioctl.h sys/sockio.h)
++AC_CHECK_HEADERS(sys/resource.h)
++AC_CHECK_HEADERS(sys/select.h)
++AC_CHECK_HEADERS(sys/signal.h)
++AC_CHECK_HEADERS(sys/socket.h)
++AC_CHECK_HEADERS(sys/time.h)
++AC_CHECK_HEADERS(sys/utsname.h)
++AC_CHECK_HEADERS(stdint.h inttypes.h)
++AC_CHECK_HEADERS(locale.h pwd.h)
++AC_CHECK_HEADERS(termios.h)
++
++
++AC_CHECK_HEADERS(sys/un.h,
++ [CONFIG_INTERLINK=yes
++ EL_CONFIG([CONFIG_INTERLINK], [interlinking])],
++ [CONFIG_INTERLINK=no])
++AC_SUBST(CONFIG_INTERLINK)
++
++dnl ===================================================================
++dnl Checks for typedefs, structures, and compiler characteristics.
++dnl ===================================================================
++
++AC_STRUCT_TM
++AC_C_CONST
++AC_C_INLINE
++EL_CHECK_CODE(typeof, HAVE_TYPEOF, [], [int a; typeof(a) b;])
++
++AC_SYS_LARGEFILE
++AC_TYPE_SIZE_T
++AC_TYPE_OFF_T
++EL_CHECK_TYPE(ssize_t, int)
++EL_CHECK_SYS_TYPE(long long, HAVE_LONG_LONG, [])
++EL_CHECK_SYS_TYPE(off_t, HAVE_OFF_T, [])
++EL_CHECK_INT_TYPE(int32_t, HAVE_INT32_T)
++EL_CHECK_INT_TYPE(uint32_t, HAVE_UINT32_T)
++EL_CHECK_INT_TYPE(uint16_t, HAVE_UINT16_T)
++
++AC_CHECK_SIZEOF(char, 1)
++AC_CHECK_SIZEOF(short, 2)
++AC_CHECK_SIZEOF(int, 4)
++AC_CHECK_SIZEOF(long, 4)
++test "x$HAVE_LONG_LONG" = xyes && AC_CHECK_SIZEOF(long long, 8)
++test "x$HAVE_OFF_T" = xyes && AC_CHECK_SIZEOF(off_t, 4)
++
++dnl Check for variadic macros
++EL_CHECK_CODE([variadic macros], HAVE_VARIADIC_MACROS,
++ [#include <stdio.h>
++ #define a(b,c...) printf(b,##c)],
++ [a("foo");a("%s","bar");a("%s%s","baz","quux");])
++
++dnl Check for -rdynamic
++dnl FIXME: This check doesn't work. Something to do with the compiler
++dnl happily ignoring it and stderr not being checked for error messages.
++AC_MSG_CHECKING([for -rdynamic])
++LDFLAGS_X="$LDFLAGS"
++LDFLAGS="$LDFLAGS -rdynamic"
++AC_TRY_LINK([], [], have_rdynamic=yes, have_rdynamic=no)
++test "$have_rdynamic" = no && LDFLAGS="$LDFLAGS_X"
++AC_MSG_RESULT($have_rdynamic)
++
++dnl ===================================================================
++dnl Check for POSIX <regex.h>
++dnl ===================================================================
++
++EL_CHECK_SYS_TYPE(regex_t, HAVE_REGEX_H, [#include <regex.h>])
++
++dnl ===================================================================
++dnl Checks for library functions.
++dnl ===================================================================
++
++AC_PROG_GCC_TRADITIONAL
++AC_FUNC_MEMCMP
++AC_FUNC_MMAP
++AC_FUNC_STRFTIME
++AC_CHECK_FUNCS(cfmakeraw gethostbyaddr herror strerror)
++AC_CHECK_FUNCS(popen uname access chmod alarm timegm mremap)
++AC_CHECK_FUNCS(strcasecmp strncasecmp strcasestr strstr strchr strrchr)
++AC_CHECK_FUNCS(memmove bcopy stpcpy strdup index isdigit mempcpy memrchr)
++AC_CHECK_FUNCS(snprintf vsnprintf asprintf vasprintf)
++AC_CHECK_FUNCS(getifaddrs getpwnam inet_pton inet_ntop)
++AC_CHECK_FUNCS(fflush fsync fseeko ftello sigaction)
++AC_CHECK_FUNCS(gettimeofday clock_gettime)
++
++AC_HAVE_FUNCS(cygwin_conv_to_full_win32_path)
++
++AC_CHECK_FUNCS(setenv putenv, HAVE_SETENV_OR_PUTENV=yes)
++AC_CHECK_FUNCS(getuid, HAVE_GETUID=yes)
++AC_CHECK_FUNCS(geteuid, HAVE_GETEUID=yes)
++
++dnl These aren't probably needed now, as they are commented in links.h.
++dnl I've no idea about their historical background, but I keep them here
++dnl just in the case they will help later. --pasky
++AC_CHECK_FUNCS(getpid, HAVE_GETPID=yes)
++AC_CHECK_FUNCS(setpgid getpgid setpgrp getpgrp)
++AC_CHECK_FUNCS(raise, HAVE_RAISE=yes)
++AC_CHECK_FUNCS(kill, HAVE_KILL=yes)
++
++if test x"$HAVE_RAISE" = x; then
++ if test x"$HAVE_KILL" = x || test x"$HAVE_GETPID" = x; then
++ AC_ERROR([Unable to emulate raise()])
++ fi
++fi
++
++AC_CACHE_CHECK([for __va_copy],el_cv_HAVE_VA_COPY,[
++AC_TRY_LINK([#include <stdarg.h>
++va_list ap1,ap2;], [__va_copy(ap1,ap2);],
++el_cv_HAVE_VA_COPY=yes,el_cv_HAVE_VA_COPY=no)])
++if test x"$el_cv_HAVE_VA_COPY" = x"yes"; then
++ EL_DEFINE(HAVE_VA_COPY, __va_copy)
++fi
++
++AC_CACHE_CHECK([for sysconf(_SC_PAGE_SIZE)],el_cv_HAVE_SC_PAGE_SIZE,[
++AC_TRY_LINK([#include <unistd.h>
++], [int page_size = sysconf(_SC_PAGE_SIZE);],
++el_cv_HAVE_SC_PAGE_SIZE=yes,el_cv_HAVE_SC_PAGE_SIZE=no)])
++if test x"$el_cv_HAVE_SC_PAGE_SIZE" = x"yes"; then
++ EL_DEFINE(HAVE_SC_PAGE_SIZE, _SC_PAGE_SIZE)
++fi
++
++AC_CACHE_CHECK([for C99 vsnprintf],el_cv_HAVE_C99_VSNPRINTF,[
++AC_TRY_RUN([
++#include <stdio.h>
++#include <stdarg.h>
++#include <stdlib.h>
++#include <string.h>
++
++char buf[8];
++
++int bar(char *buf, const char *format, va_list ap)
++{
++ return vsnprintf(buf, 0, format, ap);
++}
++
++void foo(const char *format, ...) {
++ va_list ap;
++ int len;
++
++ va_start(ap, format);
++ len = bar(buf, format, ap);
++ va_end(ap);
++ if ((len != 6) && (len != 7)) exit(1); /* \n -> \r\n */
++
++ va_start(ap, format);
++ len = bar(buf, format, ap);
++ va_end(ap);
++ if ((len != 6) && (len != 7)) exit(1);
++
++ if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
++
++ exit(0);
++}
++main() { foo("hello\n"); }
++],
++el_cv_HAVE_C99_VSNPRINTF=yes,el_cv_HAVE_C99_VSNPRINTF=no,el_cv_HAVE_C99_VSNPRINTF=cross)])
++if test x"$el_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
++ EL_DEFINE(HAVE_C99_VSNPRINTF, [C99 compliant vsnprintf()])
++fi
++
++AC_CHECK_LIB(dl, dlopen) # OpenSSL and Lua frequently needs it
++
++dnl ===================================================================
++dnl Checks for libraries.
++dnl ===================================================================
++
++dnl Replace `main' with a function in -lsocket:
++AC_CHECK_FUNC(socket, cf_result=yes, cf_result=no)
++if test "$cf_result" = no; then
++ AC_CHECK_LIB(socket, socket)
++fi
++
++AC_CHECK_FUNC(setsockopt, cf_result=yes, cf_result=no)
++if test "$cf_result" = no; then
++ AC_CHECK_LIB(socket, setsockopt)
++fi
++
++AC_CHECK_FUNC(gethostbyname, cf_result=yes, cf_result=no)
++if test "$cf_result" = no; then
++ AC_CHECK_LIB(socket, gethostbyname, cf_result=yes, cf_result=no)
++ if test "$cf_result" = no; then
++ AC_CHECK_LIB(nsl, gethostbyname)
++ else
++ test -z "`echo $LIBS | grep -- -lsocket`" && LIBS="$LIBS -lsocket"
++ fi
++fi
++
++dnl ===================================================================
++dnl Checks for packaging specific options.
++dnl ===================================================================
++
++AC_ARG_WITH(xterm, [ --with-xterm how to invoke the X terminal emulator],
++ [ if test "$withval" != no && test "$withval" != yes; then
++ AC_DEFINE_UNQUOTED(XTERM, "$withval", [How to invoke XTerm])
++ fi ])
++
++dnl ===================================================================
++dnl Checks for a libraries, optional even if installed.
++dnl ===================================================================
++
++dnl EL_CHECK_OPTIONAL_LIBRARY(define, name, header, lib, function)
++AC_DEFUN([EL_CHECK_OPTIONAL_LIBRARY],
++[
++ AC_MSG_CHECKING([for $2 support])
++
++ if test "[$]$1" != no; then
++ AC_MSG_RESULT(yes)
++ EL_SAVE_FLAGS
++ if test -n "$withval" && test -d "$withval"; then
++ CFLAGS="$CFLAGS -I$withval/include";
++ CPPFLAGS="$CPPFLAGS -I$withval/include";
++ LDFLAGS="$LDFLAGS -L$withval/lib";
++ fi
++
++ AC_CHECK_HEADERS([$3], [$1=yes], [$1=no; break;])
++ if test "[$]$1" = yes; then
++ AC_CHECK_LIB([$4], [$5], [$1=yes], [$1=no])
++ fi
++
++ if test "[$]$1" = yes; then
++ EL_CONFIG([$1], [$2])
++ LIBS="$LIBS -l$4"
++ else
++ if test -n "[$]WITHVAL_$1" &&
++ test "[$]WITHVAL_$1" != xno; then
++ AC_MSG_ERROR([$2 not found])
++ fi
++ EL_RESTORE_FLAGS
++ fi
++ else
++ AC_MSG_RESULT(disabled)
++ fi
++])
++
++dnl EL_CONFIG_OPTIONAL_LIBRARY(define, name, header, lib, function, confhelp)
++AC_DEFUN([EL_CONFIG_OPTIONAL_LIBRARY],
++[
++ $1=yes
++ WITHVAL_$1=
++
++ AC_ARG_WITH([$2], [$6], [WITHVAL_$1="[$]withval"])
++ if test "x[$]WITHVAL_$1" = xno; then $1=no; fi
++
++ EL_CHECK_OPTIONAL_LIBRARY([$1], [$2], [$3], [$4], [$5])
++
++ EL_LOG_CONFIG([$1], [$2], [])
++])
++
++EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GPM, gpm, gpm.h, gpm, Gpm_Open,
++ [ --without-gpm disable gpm (mouse) support])
++
++EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GZIP, zlib, zlib.h, z, gzdopen,
++ [ --without-zlib disable zlib support])
++
++EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_BZIP2, bzlib, bzlib.h, bz2, BZ2_bzReadOpen,
++ [ --without-bzlib disable bzlib support])
++
++EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN, idn, idna.h, idn, stringprep_check_version,
++ [ --without-idn disable international domain names support])
++
++dnl ===================================================================
++dnl Bookmark and XBEL support
++dnl ===================================================================
++
++EL_SAVE_FLAGS
++
++EL_ARG_ENABLE(CONFIG_BOOKMARKS, bookmarks, [Bookmarks],
++ [ --disable-bookmarks disable bookmark support])
++
++# Check whether --enable-xbel or --disable-xbel was given.
++if test "x${enable_xbel}" != xno; then
++ AC_CHECK_HEADERS(expat.h, HAVE_LIBEXPAT=yes, HAVE_LIBEXPAT=no)
++
++ if test "$HAVE_LIBEXPAT" = yes; then
++ AC_CHECK_LIB(expat, XML_ParserCreate, HAVE_LIBEXPAT=yes, HAVE_LIBEXPAT=no)
++ if test "$HAVE_LIBEXPAT" = yes; then
++ LIBS="$LIBS -lexpat"
++ fi
++ fi
++fi
++
++
++EL_ARG_DEPEND(CONFIG_XBEL_BOOKMARKS, xbel, [CONFIG_BOOKMARKS:yes HAVE_LIBEXPAT:yes],
++ [XBEL bookmarks],
++ [ --disable-xbel disable XBEL bookmark support (requires expat)])
++
++if test "$CONFIG_XBEL_BOOKMARKS" != yes; then
++ EL_RESTORE_FLAGS
++fi
++
++dnl ===================================================================
++dnl Checks for BSD sysmouse
++dnl ===================================================================
++
++HAVE_SYSMOUSE_HEADER="no"
++
++# Either of these header files provides the (same) sysmouse interface
++AC_CHECK_HEADERS(sys/consio.h machine/console.h, [HAVE_SYSMOUSE_HEADER="yes"])
++
++dnl ===================================================================
++dnl Checks for OS/2
++dnl ===================================================================
++
++if test "$CONFIG_OS2" = yes; then
++ EL_CONFIG_OS2
++fi
++
++dnl ===================================================================
++dnl Checks for Win32
++dnl ===================================================================
++
++if test "$CONFIG_WIN32" = yes; then
++ EL_CONFIG_WIN32
++fi
++
++dnl ===================================================================
++dnl Check for SpiderMonkey, optional even if installed.
++dnl ===================================================================
++
++AC_ARG_WITH(spidermonkey, [ --without-spidermonkey disable SpiderMonkey Mozilla JavaScript engine support],
++ [if test "$withval" = no; then disable_spidermonkey=yes; fi])
++AC_MSG_CHECKING([for SpiderMonkey])
++
++EL_SAVE_FLAGS
++cf_result=no
++
++if test -z "$disable_spidermonkey"; then
++ if test ! -d "$withval"; then
++ withval="";
++ fi
++ for spidermonkeydir in "$withval" "" /usr /usr/local /opt/spidermonkey /opt/js; do
++ for spidermonkeyinclude in "/include" "/include/js" "/include/smjs"; do
++ for spidermonkeylib in js smjs; do
++ if test "$cf_result" = no; then
++ SPIDERMONKEY_LIBS="-l$spidermonkeylib"
++
++ if test ! -z "$spidermonkeydir"; then
++ SPIDERMONKEY_LIBS="-L$spidermonkeydir/lib $SPIDERMONKEY_LIBS"
++ SPIDERMONKEY_CFLAGS="-I$spidermonkeydir$spidermonkeyinclude"
++ fi
++
++ LIBS="$SPIDERMONKEY_LIBS $LIBS_X"
++ CFLAGS="$CFLAGS_X $SPIDERMONKEY_CFLAGS"
++ CPPFLAGS="$CPPFLAGS_X $SPIDERMONKEY_CFLAGS"
++
++ AC_TRY_LINK([#define XP_UNIX
++ #include <jsapi.h>],
++ [JS_GetImplementationVersion()],
++ cf_result=yes, cf_result=no)
++ fi
++ done
++ done
++ done
++fi
++
++AC_MSG_RESULT($cf_result)
++
++if test "$cf_result" != yes; then
++ EL_RESTORE_FLAGS
++else
++ EL_CONFIG(CONFIG_SPIDERMONKEY, [SpiderMonkey])
++
++ CFLAGS="$CFLAGS_X"
++ AC_SUBST(SPIDERMONKEY_LIBS)
++ AC_SUBST(SPIDERMONKEY_CFLAGS)
++fi
++
++AC_SUBST(CONFIG_SPIDERMONKEY)
++
++EL_CONFIG_DEPENDS(CONFIG_ECMASCRIPT, [CONFIG_SPIDERMONKEY], [ECMAScript (JavaScript)])
++
++
++dnl ===================================================================
++dnl Check for Guile, optional even if installed.
++dnl ===================================================================
++
++enable_guile="no";
++
++AC_ARG_WITH(guile, [ --with-guile enable Guile support],
++ [ if test "x$withval" != xno; then enable_guile=yes; fi ])
++
++# The following is probably bad, ugly and so on. Stolen from Guile's (1.4)
++# GUILE_FLAGS but I really don't want to require people to have Guile in order
++# to compile CVS. Also, the macro seems to be really stupid regarding searching
++# for Guile in $PATH etc. --pasky
++
++AC_MSG_CHECKING([for Guile])
++
++if test "$enable_guile" = "yes"; then
++ AC_MSG_RESULT(yes);
++ ## Based on the GUILE_FLAGS macro.
++
++ if test -d "$withval"; then
++ GUILE_PATH="$withval:$PATH"
++ else
++ GUILE_PATH="$PATH"
++ fi
++
++ AC_PATH_PROG(GUILE_CONFIG, guile-config, no, $GUILE_PATH)
++
++ ## First, let's just see if we can find Guile at all.
++ if test "$GUILE_CONFIG" != no; then
++ cf_result="yes";
++
++ GUILE_LIBS="`guile-config link`"
++ GUILE_CFLAGS="`guile-config compile`"
++ LIBS="$GUILE_LIBS $LIBS"
++ CPPFLAGS="$CPPFLAGS $GUILE_CFLAGS"
++ EL_CONFIG(CONFIG_GUILE, [Guile])
++ AC_SUBST(GUILE_CFLAGS)
++ cat <<EOF
++***********************************************************************
++The Guile support is incomplete and not so well integrated to ELinks
++yet. That means, e.g., that you have no Guile console and there might
++not be all the necessary hooks. Also, the Guile interface is not too
++well tested (success stories heartily welcomed!). See
++src/scripting/guile/README for further details and hints.
++***********************************************************************
++EOF
++ else
++ if test -n "$withval" && test "x$withval" != xno; then
++ AC_MSG_ERROR([Guile not found])
++ else
++ AC_MSG_WARN([Guile support disabled])
++ fi
++ fi
++else
++ AC_MSG_RESULT(no);
++fi
++
++dnl ===================================================================
++dnl Check for Perl
++dnl ===================================================================
++enable_perl="no";
++
++AC_ARG_WITH(perl, [ --with-perl enable Perl support],
++ [
++if test "$withval" = yes; then
++ # FIXME: If withval is a valid directory append it to PATH
++ # so that you can specify one of several perl installations.
++ withval="";
++ enable_perl=yes;
++fi
++ ])
++
++AC_MSG_CHECKING([for Perl])
++
++cf_result=no
++
++EL_SAVE_FLAGS
++
++if test "$enable_perl" = "yes"; then
++ PERL_LIBS="`perl -MExtUtils::Embed -e ldopts`"
++ PERL_CFLAGS="`perl -MExtUtils::Embed -e ccopts`"
++ LIBS="$PERL_LIBS $LIBS"
++ CFLAGS="$PERL_CFLAGS $CFLAGS"
++ CPPFLAGS="$CPPFLAGS $PERL_CFLAGS"
++ AC_TRY_LINK([
++#include <EXTERN.h>
++#include <perl.h>
++#include <perlapi.h>
++],
++ [PerlInterpreter *my_perl = perl_alloc();],
++ cf_result=yes, cf_result=no)
++fi
++
++if test "$cf_result" != "yes"; then
++ EL_RESTORE_FLAGS
++else
++ EL_CONFIG(CONFIG_PERL, [Perl])
++
++ CFLAGS="$CFLAGS_X"
++ AC_SUBST(PERL_LIBS)
++ AC_SUBST(PERL_CFLAGS)
++fi
++
++if test "$cf_result"; then AC_MSG_RESULT($cf_result); fi
++dnl ===================================================================
++dnl Check for Python
++dnl ===================================================================
++enable_python="no";
++
++AC_ARG_WITH(python, [ --with-python enable Python support],
++ [
++if test "$withval" = yes; then
++ # FIXME: If withval is a valid directory append it to PATH
++ # so that you can specify one of several Python installations.
++ withval="";
++ enable_python=yes;
++ cat <<EOF
++***********************************************************************
++The Python support is incomplete and not so well integrated to ELinks
++yet. That means, e.g.., that you have no Python console and there might
++not be all the necessary hooks. Also, the Python interface is not too
++well tested (success stories heartily welcomed!).
++***********************************************************************
++EOF
++fi
++ ])
++
++AC_MSG_CHECKING([for Python])
++
++cf_result=no
++
++EL_SAVE_FLAGS
++
++if test "$enable_python" = "yes"; then
++ PYTHON_LIBS="-lpython`python -c 'from distutils import sysconfig; print sysconfig.get_config_var("VERSION")' 2> /dev/null`"
++ PYTHON_CFLAGS="-I`python -c 'from distutils import sysconfig; print sysconfig.get_python_inc()' 2> /dev/null`"
++ LIBS="$PYTHON_LIBS $LIBS"
++ CFLAGS="$PYTHON_CFLAGS $CFLAGS"
++ CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
++ AC_TRY_LINK([
++#include <Python.h>
++],
++ [Py_Initialize();],
++ cf_result=yes, cf_result=no)
++fi
++
++if test "$cf_result" != "yes"; then
++ EL_RESTORE_FLAGS
++else
++ EL_CONFIG(CONFIG_PYTHON, [Python])
++
++ CFLAGS="$CFLAGS_X"
++ AC_SUBST(PYTHON_LIBS)
++ AC_SUBST(PYTHON_CFLAGS)
++fi
++
++if test "$cf_result"; then AC_MSG_RESULT($cf_result); fi
++
++
++dnl ===================================================================
++dnl Check for Lua, optional even if installed.
++dnl ===================================================================
++
++dnl Do this the long way, as FreeBSD reportedly needs -L<dir> for
++dnl anything other than /usr/lib, and Lua is very often in /usr/local/lib.
++
++AC_ARG_WITH(lua, [ --without-lua disable Lua support],
++ [if test "$withval" = no; then disable_lua=yes; fi])
++AC_MSG_CHECKING([for Lua])
++
++EL_SAVE_FLAGS
++cf_result=no
++
++if test -z "$disable_lua"; then
++ if test ! -d "$withval"; then
++ withval="";
++ fi
++ for luadir in "$withval" "" /usr /usr/local; do
++ for suffix in "" 50 51; do
++ if test "$cf_result" = no; then
++ LUA_LIBS="-llua$suffix -llualib$suffix -lm"
++
++ if test ! -z "$luadir"; then
++ LUA_LIBS="-L$luadir/lib $LUA_LIBS"
++ LUA_CFLAGS="-I$luadir/include -I$luadir/include/lua$suffix"
++ fi
++
++ LIBS="$LUA_LIBS $LIBS_X"
++ CFLAGS="$CFLAGS_X $LUA_CFLAGS"
++ CPPFLAGS="$CPPFLAGS_X $LUA_CFLAGS"
++
++ # Check that it is a compatible Lua version
++ AC_TRY_LINK([ #include <lua.h>
++ #include <lualib.h>],
++ [ lua_State *L = lua_open();
++ luaopen_base(L);
++ luaopen_table(L);
++ luaopen_io(L);
++ luaopen_string(L);
++ luaopen_math(L);
++ lua_pushboolean(L, 1);
++ lua_close(L);],
++ cf_result=yes, cf_result=no)
++ fi
++ done
++ done
++fi
++
++AC_MSG_RESULT($cf_result)
++
++if test "$cf_result" != yes; then
++ EL_RESTORE_FLAGS
++else
++ EL_CONFIG(CONFIG_LUA, [Lua])
++ AC_CHECK_HEADERS(lauxlib.h)
++
++ CFLAGS="$CFLAGS_X"
++ AC_SUBST(LUA_LIBS)
++ AC_SUBST(LUA_CFLAGS)
++fi
++
++
++dnl ===================================================================
++dnl Check for Ruby, optional even if installed.
++dnl ===================================================================
++
++EL_CONFIG_RUBY
++
++dnl ===================================================================
++dnl Optional Spidermonkey-based ECMAScript browser scripting
++dnl ===================================================================
++
++AC_ARG_ENABLE(sm-scripting,
++ [ --disable-sm-scripting ECMAScript browser scripting (requires Spidermonkey)],
++ [if test "$enableval" != no; then enableval="yes"; fi
++ CONFIG_SM_SCRIPTING="$enableval";])
++
++if test "x$CONFIG_SPIDERMONKEY" = xyes &&
++ test "x$CONFIG_SM_SCRIPTING" = xyes; then
++ EL_CONFIG(CONFIG_SM_SCRIPTING, [SpiderMonkey])
++else
++ CONFIG_SM_SCRIPTING=no
++fi
++
++dnl ===================================================================
++dnl Setup global scripting
++dnl ===================================================================
++
++EL_CONFIG_DEPENDS(CONFIG_SCRIPTING, [CONFIG_GUILE CONFIG_LUA CONFIG_PERL CONFIG_PYTHON CONFIG_RUBY CONFIG_SM_SCRIPTING], [Browser scripting])
++AC_SUBST(CONFIG_GUILE)
++AC_SUBST(CONFIG_LUA)
++AC_SUBST(CONFIG_PERL)
++AC_SUBST(CONFIG_PYTHON)
++AC_SUBST(CONFIG_RUBY)
++AC_SUBST(CONFIG_SM_SCRIPTING)
++AC_SUBST(CONFIG_SCRIPTING)
++
++
++dnl ===================================================================
++dnl Check for SSL support.
++dnl ===================================================================
++
++dnl We by default use OpenSSL, and we always prefer it. However, when GNUTLS
++dnl is enabled, we won't try to use OpenSSL anymore.
++
++dnl For wiping SSL hooks..
++#ifdef CONFIG_SSL
++
++disable_openssl=""
++disable_gnutls=""
++enable_gnutls=""
++
++AC_ARG_WITH(gnutls, [ --without-gnutls disable GNUTLS SSL support],
++ [if test "$with_gnutls" = no; then disable_gnutls=yes; fi])
++AC_ARG_WITH(gnutls, [ --with-gnutls[=DIR] enable GNUTLS SSL support],
++ [if test "$with_gnutls" != no; then enable_gnutls=yes; fi])
++gnutls_withval="$withval"
++
++if test "$enable_gnutls" = yes; then
++ disable_openssl=yes;
++fi
++
++AC_ARG_WITH(openssl, [ --without-openssl disable OpenSSL support],
++ [if test "$with_openssl" = no; then disable_openssl=yes; fi])
++AC_ARG_WITH(openssl, [ --with-openssl[=DIR] enable OpenSSL support (default)])
++openssl_withval="$withval"
++
++dnl ---- OpenSSL
++
++AC_MSG_CHECKING([for OpenSSL])
++
++EL_SAVE_FLAGS
++cf_result="no"
++
++if test "$disable_openssl" = yes; then
++ cf_result="not used"
++else
++ for ssldir in "$openssl_withval" "" /usr /usr/local/openssl \
++ /usr/lib/openssl /usr/local/ssl \
++ /usr/local/www /usr/lib/ssl /usr/local \
++ /usr/pkg /opt /opt/openssl; do
++ if test "$cf_result" = no; then
++ if test -d "$ssldir"; then
++ OPENSSL_CFLAGS="-I$ssldir/include"
++ LIBS="-L$ssldir/lib -lssl -lcrypto $LIBS_X"
++ CFLAGS="$CFLAGS_X $OPENSSL_CFLAGS"
++ CPPFLAGS="$CPPFLAGS_X $OPENSSL_CFLAGS"
++# # FIXME: This created serious portability problems. --pasky
++# if test "$CC" == "gcc"; then
++# # I'm not sure about compatibility here. --pasky
++# LIBS="$LIBS -R$ssldir/lib"
++# fi
++ else
++ LIBS="-lssl -lcrypto $LIBS_X"
++ fi
++ AC_TRY_LINK([#include <openssl/ssl.h>],
++ [OpenSSL_add_all_algorithms()],
++ cf_result=yes, cf_result=no)
++ if test "$cf_result" != yes; then
++ AC_TRY_LINK([#include <openssl/ssl.h>],
++ [SSLeay_add_ssl_algorithms()],
++ cf_result=yes, cf_result=no)
++ fi
++ fi
++ done
++
++ if test "$cf_result" != yes; then
++ if test -n "$openssl_withval" && test "x$openssl_withval" != xno; then
++ AC_MSG_ERROR([OpenSSL not found])
++ fi
++ EL_RESTORE_FLAGS
++ else
++ EL_CONFIG(CONFIG_OPENSSL, [OpenSSL])
++
++ CFLAGS="$CFLAGS_X"
++ AC_SUBST(OPENSSL_CFLAGS)
++ fi
++fi
++
++AC_MSG_RESULT($cf_result)
++
++CONFIG_GNUTLS_OPENSSL_COMPAT=no
++dnl ---- GNU TLS
++dnl We can't have AC_MSG_CHECKING here, because AC_PATH_PROG prints its own and
++dnl it looks ugly then.
++
++if test "$cf_result" = yes; then
++ cf_result="not used"
++
++else
++ EL_SAVE_FLAGS
++ cf_result="no"
++
++ if test -z "$disable_gnutls"; then
++ # Sure, we maybe _could_ use their macro, but how to ensure
++ # that the ./configure script won't fail if the macro won't be
++ # found..? :( --pasky
++
++ GNUTLS_PATH="$PATH:/usr/local/gnutls:/opt:/opt/gnutls"
++
++ if test -d "$gnutls_withval"; then
++ GNUTLS_PATH="$gnutls_withval:$GNUTLS_PATH"
++ fi
++
++ AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no, $GNUTLS_PATH)
++
++ if test "$LIBGNUTLS_CONFIG" = "no" ; then
++ cf_result=no
++ else
++ GNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG --cflags`
++ GNUTLS_LIBS=`$LIBGNUTLS_CONFIG --libs`
++
++ LIBS="$GNUTLS_LIBS $LIBS_X"
++ CFLAGS="$CFLAGS_X $GNUTLS_CFLAGS"
++ CPPFLAGS="$CPPFLAGS_X $GNUTLS_CFLAGS"
++
++ # Verify if it's really usable. gnutls_session was
++ # renamed to gnutls_session_t before GNU TLS 1.2.0
++ # (on 2004-06-13); ELinks now requires this.
++ AC_TRY_LINK([#include <gnutls/gnutls.h>],
++ [gnutls_session_t dummy;
++ gnutls_check_version(NULL)],
++ cf_result=yes, cf_result=no)
++ fi
++
++ if test "$cf_result" = yes; then
++ EL_CONFIG(CONFIG_GNUTLS, [GNUTLS])
++
++ CFLAGS="$CFLAGS_X"
++ AC_SUBST(GNUTLS_CFLAGS)
++
++ # Verify if the MD5 compatibility layer is usable.
++ CONFIG_GNUTLS_OPENSSL_COMPAT=yes
++ EL_CHECK_OPTIONAL_LIBRARY(CONFIG_GNUTLS_OPENSSL_COMPAT,
++ [GNU TLS OpenSSL compatibility],
++ gnutls/openssl.h, gnutls-openssl,
++ MD5_Init)
++ else
++ if test -n "$gnutls_withval" && test "x$gnutls_withval" != xno; then
++ AC_MSG_ERROR([GNUTLS (1.2 or later) not found. ELinks no longer supports GNUTLS 1.1.])
++ fi
++ EL_RESTORE_FLAGS
++ fi
++ fi
++fi
++
++AC_MSG_CHECKING([for GNU TLS (1.2 or later)])
++AC_MSG_RESULT($cf_result)
++
++dnl Final SSL setup
++
++EL_CONFIG_DEPENDS(CONFIG_SSL, [CONFIG_OPENSSL CONFIG_GNUTLS], [SSL])
++AC_SUBST(CONFIG_GNUTLS_OPENSSL_COMPAT)
++AC_SUBST(CONFIG_OPENSSL)
++AC_SUBST(CONFIG_GNUTLS)
++
++#endif
++
++AC_MSG_CHECKING([whether to be or not to be])
++AC_MSG_RESULT([needs to be determined experimentally])
++
++dnl ===================================================================
++dnl Check for IPv6 support and related functions.
++dnl ===================================================================
++
++EL_CHECK_NET_TYPE(struct sockaddr_storage, HAVE_SA_STORAGE, [])
++EL_CHECK_NET_TYPE(struct sockaddr_in6, HAVE_SA_IN6, [#include <netinet/in.h>])
++EL_CHECK_NET_TYPE(struct addrinfo, HAVE_ADDRINFO, [#include <netdb.h>])
++
++AC_CHECK_FUNC(getaddrinfo, HAVE_GETADDRINFO=yes, HAVE_GETADDRINFO=no)
++if test "$HAVE_GETADDRINFO" != yes; then
++ AC_CHECK_LIB(inet6, getaddrinfo, HAVE_GETADDRINFO=yes, HAVE_GETADDRINFO=no)
++ if test "$HAVE_GETADDRINFO" = yes; then
++ LIBS="$LIBS -linet6"
++ fi
++fi
++
++
++dnl ===================================================================
++dnl Checking for X11 (window title restoring).
++dnl ===================================================================
++
++AC_PATH_X
++if test x"$no_x" != xyes; then
++ if test -n "$x_includes"; then
++ X_CFLAGS="-I$x_includes"
++ CPPFLAGS="$CPPFLAGS -I$x_includes"
++ fi
++ if test -n "$x_libraries"; then
++ LDFLAGS="$LDFLAGS -L$x_libraries"
++ fi
++ LIBS="-lX11 $LIBS"
++ EL_DEFINE(HAVE_X11, [X11 for restoring window titles])
++ AC_SUBST(X_CFLAGS)
++fi
++
++
++dnl ===================================================================
++dnl Backtraces displaying support.
++dnl ===================================================================
++
++AC_CHECK_HEADERS(execinfo.h, HAVE_EXECINFO=yes, HAVE_EXECINFO=no)
++# possible checks for other system-specific means go here
++
++
++dnl ===================================================================
++dnl SMB protocol support.
++dnl ===================================================================
++
++AC_CHECK_PROG(HAVE_SMBCLIENT, smbclient, yes, no)
++
++
++dnl ===================================================================
++dnl Gettext grey zone. Beware.
++dnl ===================================================================
++
++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"
++
++AM_GNU_GETTEXT
++
++dnl AC_MSG_CHECKING([how many characters your English alphabet has])
++dnl # f33r d4 l33t... I hope it's portable. :)
++dnl cf_result=$((48#z - 48#a + 1));
++dnl AC_MSG_RESULT($cf_result)
++
++
++dnl ===================================================================
++dnl Compile-time features control
++dnl ===================================================================
++
++EL_ARG_ENABLE(CONFIG_COOKIES, cookies, [Cookies],
++ [ --disable-cookies disable cookie support])
++
++EL_ARG_ENABLE(CONFIG_FORMHIST, formhist, [Form history],
++ [ --disable-formhist disable form history support])
++
++EL_ARG_ENABLE(CONFIG_GLOBHIST, globhist, [Global history],
++ [ --disable-globhist disable global history support])
++
++
++EL_ARG_ENABLE(CONFIG_MAILCAP, mailcap, [Mailcap],
++ [ --disable-mailcap disable mailcap support])
++
++EL_ARG_ENABLE(CONFIG_MIMETYPES, mimetypes, [Mimetypes files],
++ [ --disable-mimetypes disable mimetypes files support])
++
++
++EL_ARG_DEPEND(CONFIG_IPV6, ipv6,
++ [HAVE_SA_STORAGE:yes HAVE_SA_IN6:yes HAVE_ADDRINFO:yes HAVE_GETADDRINFO:yes],
++ [IPv6],
++ [ --disable-ipv6 disable IPv6 support])
++
++EL_ARG_ENABLE(CONFIG_BITTORRENT, bittorrent, [BitTorrent protocol],
++ [ --enable-bittorrent enable BitTorrent protocol support])
++
++EL_ARG_ENABLE(CONFIG_DATA, data, [Data protocol],
++ [ --disable-data disable data protocol support])
++
++EL_ARG_ENABLE(CONFIG_URI_REWRITE, uri-rewrite, [URI rewriting],
++ [ --disable-uri-rewrite disable URI rewrite support])
++
++EL_ARG_DEPEND(CONFIG_CGI, cgi, [HAVE_SETENV_OR_PUTENV:yes], [Local CGI],
++ [ --enable-cgi enable local CGI support])
++
++EL_ARG_ENABLE(CONFIG_FINGER, finger, [Finger protocol],
++ [ --enable-finger enable finger protocol support])
++
++dnl ===================================================================
++dnl FSP protocol
++dnl ===================================================================
++EL_SAVE_FLAGS
++
++if test "x${enable_fsp}" != xno; then
++ AC_CHECK_HEADERS(fsplib.h, HAVE_FSPLIB=yes, HAVE_FSPLIB=no)
++
++ if test "$HAVE_FSPLIB" = yes; then
++ AC_CHECK_LIB(fsplib, fsp_open_session, HAVE_FSPLIB=yes, HAVE_FSPLIB=no)
++ if test "$HAVE_FSPLIB" = yes; then
++ LIBS="$LIBS -lfsplib"
++ else
++ AC_CHECK_LIB(fsp, fsp_open_session, HAVE_FSPLIB=yes, HAVE_FSPLIB=no)
++ if test "$HAVE_FSPLIB" = yes; then
++ LIBS="$LIBS -lfsp"
++ fi
++ fi
++ fi
++fi
++
++EL_ARG_DEPEND(CONFIG_FSP, fsp, [HAVE_FSPLIB:yes], [FSP protocol],
++ [ --enable-fsp enable FSP protocol support])
++
++if test "x$CONFIG_FSP" = xno; then
++ EL_RESTORE_FLAGS
++fi
++
++EL_ARG_ENABLE(CONFIG_FTP, ftp, [FTP protocol],
++ [ --disable-ftp disable ftp protocol support])
++
++EL_ARG_ENABLE(CONFIG_GOPHER, gopher, [Gopher protocol],
++ [ --enable-gopher enable gopher protocol support])
++
++EL_ARG_ENABLE(CONFIG_NNTP, nntp, [NNTP protocol],
++ [ --enable-nntp enable nntp protocol support])
++
++dnl Force disable SMB before EL_ARG_DEPEND so that it logs the correct value.
++if test "${enable_smb-no}" != no || test "${CONFIG_SMB-no}" != no; then
++ AC_MSG_WARN([Forcing --disable-smb because of vulnerability CVE-2006-5925.
++If you want to use SMB, please vote for bug 844 or post a patch.])
++fi
++enable_smb=no
++CONFIG_SMB=no
++EL_ARG_DEPEND(CONFIG_SMB, smb, [HAVE_SMBCLIENT:yes], [SMB protocol],
++ [ --enable-smb not currently allowed])
++dnl EL_ARG_DEPEND(CONFIG_SMB, smb, [HAVE_SMBCLIENT:yes], [SMB protocol],
++dnl [ --disable-smb disable SMB protocol support (requires smbclient)])
++
++
++EL_ARG_ENABLE(CONFIG_MOUSE, mouse, [Mouse handling],
++ [ --disable-mouse disable mouse support])
++
++# GPM mouse is Linux specific, so ...
++CONFIG_SYSMOUSE=yes
++EL_ARG_DEPEND(CONFIG_SYSMOUSE, sysmouse,
++ [CONFIG_MOUSE:yes CONFIG_GPM:no HAVE_SYSMOUSE_HEADER:yes],
++ [BSD sysmouse],
++ [ --disable-sysmouse disable BSD sysmouse support])
++
++EL_ARG_ENABLE(CONFIG_88_COLORS, 88-colors, [88 colors],
++ [ --enable-88-colors enable 88 color support])
++
++EL_ARG_ENABLE(CONFIG_256_COLORS, 256-colors, [256 colors],
++ [ --enable-256-colors enable 256 color support])
++
++
++EL_ARG_ENABLE(CONFIG_EXMODE, exmode, [Exmode interface],
++ [ --enable-exmode enable exmode (CLI) interface])
++
++EL_ARG_ENABLE(CONFIG_LEDS, leds, [LEDs],
++ [ --disable-leds disable LEDs support])
++
++EL_ARG_ENABLE(CONFIG_MARKS, marks, [Marks],
++ [ --disable-marks disable document marks support])
++
++
++EL_ARG_ENABLE(CONFIG_CSS, css, [Cascading Style Sheets],
++ [ --disable-css disable Cascading Style Sheet support])
++
++EL_ARG_DEPEND(CONFIG_HTML_HIGHLIGHT, html-highlight, [CONFIG_CSS:yes], [HTML highlighting],
++ [ --enable-html-highlight HTML highlighting using DOM engine])
++
++dnl Everything in the tree already uses CONFIG_DOM
++dnl so resolve CONFIG_HTML_HIGHLIGHT to CONFIG_DOM
++EL_CONFIG_DEPENDS(CONFIG_DOM, [CONFIG_HTML_HIGHLIGHT], [DOM engine])
++
++EL_ARG_DEPEND(CONFIG_BACKTRACE, backtrace, [HAVE_EXECINFO:yes], [Backtrace],
++ [ --disable-backtrace disable backtrace support])
++
++EL_ARG_DEPEND(CONFIG_NO_ROOT_EXEC, no-root, [HAVE_GETUID:yes HAVE_GETEUID:yes], [No root exec],
++ [ --enable-no-root enable prevention of usage by root])
++
++
++EL_ARG_ENABLE(CONFIG_DEBUG, debug, [Debug mode],
++ [ --enable-debug enable leak debug and internal error checking])
++
++EL_ARG_DEPEND(CONFIG_FASTMEM, fastmem, [CONFIG_DEBUG:no], [Fast mode],
++ [ --enable-fastmem enable direct use of system allocation functions, not usable with --enable-debug])
++
++EL_ARG_ENABLE(CONFIG_OWN_LIBC, own-libc, [Own libc stubs],
++ [ --enable-own-libc force use of internal functions instead of those of system libc])
++
++EL_ARG_ENABLE(CONFIG_SMALL, small, [Small binary],
++ [ --enable-small reduce binary size as far as possible (but see the bottom of doc/small.txt!)])
++
++if test "$CONFIG_OPENSSL" != yes &&
++ test "$CONFIG_GNUTLS_OPENSSL_COMPAT" != yes ||
++ test "$CONFIG_OWN_LIBC" = yes;
++then
++ AC_MSG_CHECKING(for built-in MD5 support)
++ AC_MSG_RESULT(yes)
++ EL_CONFIG(CONFIG_MD5, [Built-in MD5])
++fi
++
++AC_SUBST(CONFIG_MD5)
++
++if test "$CONFIG_BITTORRENT" = yes; then
++ if test "$CONFIG_OPENSSL" != yes ||
++ test "$CONFIG_OWN_LIBC" = yes;
++ then
++ AC_MSG_CHECKING(for built-in SHA1 support)
++ AC_MSG_RESULT(yes)
++ EL_CONFIG(CONFIG_SHA1, [Built-in SHA1])
++ fi
++fi
++
++AC_SUBST(CONFIG_SHA1)
++
++if test "$CONFIG_CSS" = yes || test "$CONFIG_DOM" = yes;
++then
++ EL_CONFIG(CONFIG_SCANNER, [Built-in scanner])
++fi
++AC_SUBST(CONFIG_SCANNER)
++
++AC_ARG_ENABLE(weehoofooboomookerchoo,
++ [
++ Also check out the features.conf file for more information about features!
++ ],
++ [AC_MSG_ERROR(Are you strange, or what?)])
++
++
++dnl == EMX hack
++
++test "$CONFIG_OS2" = yes && LDFLAGS="$LDFLAGS -Zexe"
++test "$CONFIG_OS2" = yes && LDFLAGS=`echo "$LDFLAGS" | sed "s/-Zbin-files//g"`
++
++
++dnl ===================================================================
++dnl Export directory paths
++dnl ===================================================================
++
++# Set up the ``entry points'' if they were not supplied by builder
++test "x$prefix" = xNONE && prefix=$ac_default_prefix
++test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
++
++# Create CONFDIR #define for config.h
++
++# XXX: This may be dependent on a particular version of autoconf. Whatever,
++# it's autoconf fault to force us to do such hacks ;p.
++if test x"$sysconfdir" = x"\${prefix}/etc"; then
++ # sysconfdir is set to its default value... fine, let's append /elinks/
++ # XXX: We can't modify listing of the default in ./configure --help :-(
++ sysconfdir_n=`eval echo "$sysconfdir"`
++ sysconfdir=$sysconfdir_n
++ (echo "$sysconfdir" | grep elinks >/dev/null 2>/dev/null) || \
++ sysconfdir="$sysconfdir/elinks"
++fi
++
++CONFDIR=$sysconfdir
++AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR", [Directory containing default config])
++AC_SUBST(CONFDIR)
++
++# Create LOCALEDIR #define for config.h
++LOCALEDIR=`eval echo "$datadir/locale"`
++AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR", [Directory containing locales])
++AC_SUBST(LOCALEDIR)
++
++# Create LIBDIR #define for config.h
++LIBDIR=`eval echo "$libdir"`
++AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [Directory containing libraries])
++AC_SUBST(LIBDIR)
++
++EL_LOG_CONFIG(CONFDIR, [System configuration directory], [])
++EL_LOG_CONFIG(LOCALEDIR, [Locale catalogs directory], [])
++
++dnl ===================================================================
++dnl A little fine tuning of gcc specific options (continued)
++dnl ===================================================================
++
++if test "x$ac_cv_prog_gcc" = "xyes"; then
++ if test "$CONFIG_DEBUG" = "yes"; then
++ dnl We want to see all warnings and live with none (in debug mode).
++ CFLAGS="$CFLAGS -Werror"
++ fi
++
++ case "`$CC -dumpversion`" in
++ 3.0|3.1|3.2)
++ # These should be ok using -Werror
++ ;;
++ 3.*)
++ # If gcc is version 3.3 (or higher?) it emits lots of false positive
++ # "dereferencing type-punned pointer will break strict-aliasing rules"
++ # warnings. Disable them by not doing any strict-aliasing. The
++ # alternative is just too ugly. Thanks gcc guys!! ;)
++ CFLAGS="$CFLAGS -fno-strict-aliasing"
++ ;;
++ 4.*)
++ # Do not show warnings related to (char * | unsigned char *) type
++ # difference.
++ CFLAGS="$CFLAGS -fno-strict-aliasing -Wno-pointer-sign"
++ ;;
++ *)
++ # These should be ok using -Werror
++ ;;
++ esac
++fi
++
++# CFLAGS doesn't contain all compile flags. Some will be added only when
++# needed in the respective source directory. To get all compile flags
++# easily just add CPPFLAGS.
++ALL_CFLAGS="$CFLAGS $CPPFLAGS"
++
++EL_LOG_CONFIG(ALL_CFLAGS, [Compiler options (CFLAGS)], [])
++EL_LOG_CONFIG(LIBS, [Linker options (LIBS)], [])
++
++dnl ===================================================================
++dnl Colored make output
++dnl ===================================================================
++
++if test $(`which tput` colors) -ge 4; then
++ MAKE_COLOR=1
++ AC_SUBST(MAKE_COLOR)
++fi
++
++dnl ===================================================================
++dnl Generated files
++dnl ===================================================================
++
++AC_OUTPUT([ \
++ Makefile.config \
++ contrib/elinks.spec \
++ contrib/lua/hooks.lua \
++ contrib/conv/w3m2links.awk \
++ doc/man/man1/elinks.1 \
++ src/intl/gettext/ref-add.sed \
++ src/intl/gettext/ref-del.sed
++])
++
++abs_srcdir="$(cd "$srcdir" && pwd)"
++# builddir is always absolute!
++if test "$abs_srcdir" != "$builddir"; then
++ # Bootstrap the Makefile creation
++ echo "include $abs_srcdir/Makefile" > "$builddir/Makefile"
++ "$MAKE" "SRC=$abs_srcdir" init
++ # Make cg-status ignore this build directory
++ echo "*" > "$builddir/.gitignore"
++fi
++
++
++dnl ===================================================================
++dnl Configuration summary
++dnl ===================================================================
++
++AC_MSG_RESULT(The following feature summary has been saved to features.log)
++cat features.log
+diff -Naurp elinks-0.11.3-orig/configure.in.rej elinks-0.11.3/configure.in.rej
+--- elinks-0.11.3-orig/configure.in.rej 1970-01-01 01:00:00.000000000 +0100
++++ elinks-0.11.3/configure.in.rej 2007-05-13 11:51:49.000000000 +0200
+@@ -0,0 +1,23 @@
++***************
++*** 742,751 ****
++ AC_TRY_LINK([ #include <lua.h>
++ #include <lualib.h>],
++ [ lua_State *L = lua_open();
++- lua_baselibopen(L);
++- lua_mathlibopen(L);
++- lua_strlibopen(L);
++- lua_tablibopen(L);
++ lua_pushboolean(L, 1);
++ lua_close(L);],
++ cf_result=yes, cf_result=no)
++--- 742,751 ----
++ AC_TRY_LINK([ #include <lua.h>
++ #include <lualib.h>],
++ [ lua_State *L = lua_open();
+++ luaopen_base(L);
+++ luaopen_math(L);
+++ luaopen_string(L);
+++ luaopen_table(L);
++ lua_pushboolean(L, 1);
++ lua_close(L);],
++ cf_result=yes, cf_result=no)
+diff -Naurp elinks-0.11.3-orig/src/scripting/lua/core.c elinks-0.11.3/src/scripting/lua/core.c
+--- elinks-0.11.3-orig/src/scripting/lua/core.c 2007-05-13 11:51:34.000000000 +0200
++++ elinks-0.11.3/src/scripting/lua/core.c 2007-05-13 11:51:49.000000000 +0200
+@@ -633,7 +633,7 @@ do_hooks_file(LS, unsigned char *prefix,
+ if (file_can_read(file)) {
+ int oldtop = lua_gettop(S);
+
+- if (lua_dofile(S, file) != 0)
++ if (luaL_dofile(S, file) != 0)
+ sleep(3); /* Let some time to see error messages. */
+ lua_settop(S, oldtop);
+ }
+@@ -755,7 +755,7 @@ handle_ret_eval(struct session *ses)
+ int oldtop = lua_gettop(L);
+
+ if (prepare_lua(ses) == 0) {
+- lua_dostring(L, expr);
++ luaL_dostring(L, expr);
+ lua_settop(L, oldtop);
+ finish_lua();
+ }
+diff -Naurp elinks-0.11.3-orig/src/scripting/lua/hooks.c elinks-0.11.3/src/scripting/lua/hooks.c
+--- elinks-0.11.3-orig/src/scripting/lua/hooks.c 2007-05-13 11:51:34.000000000 +0200
++++ elinks-0.11.3/src/scripting/lua/hooks.c 2007-05-13 11:51:49.000000000 +0200
+@@ -200,7 +200,7 @@ static enum evhook_status
+ script_hook_quit(va_list ap, void *data)
+ {
+ if (!prepare_lua(NULL)) {
+- lua_dostring(lua_state, "if quit_hook then quit_hook() end");
++ luaL_dostring(lua_state, "if quit_hook then quit_hook() end");
+ finish_lua();
+ }
+