configure.in 50.1 KB
Newer Older
1
dnl $LynxId: configure.in,v 1.292 2017/07/06 00:48:30 tom Exp $
2
dnl
3
dnl Process this file with autoconf to produce a configure script.
4
dnl
5
dnl created jan/1997
6 7
dnl by T.E.Dickey <dickey@invisible-island.net>
dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>
8
dnl
9
dnl ---------------------------------------------------------------------------
10
dnl Copyright 1997-2016,2017 by Thomas E. Dickey
11
dnl
12 13 14 15 16 17 18 19
dnl Permission to use, copy, modify, and distribute this software and its
dnl documentation for any purpose and without fee is hereby granted,
dnl provided that the above copyright notice appear in all copies and that
dnl both that copyright notice and this permission notice appear in
dnl supporting documentation, and that the name of the above listed
dnl copyright holder(s) not be used in advertising or publicity pertaining
dnl to distribution of the software without specific, written prior
dnl permission.
20
dnl
21 22 23 24 25 26 27 28
dnl THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
dnl TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dnl AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
dnl LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl ---------------------------------------------------------------------------
29 30 31
dnl
dnl ask PRCS to plug-in the project-version for the configure-script.
dnl $Format: "AC_REVISION($ProjectVersion$)"$
32
AC_REVISION(2.8.9dev.16)
33 34 35 36 37 38 39 40

# Save the original $CFLAGS so we can distinguish whether the user set those
# in the environment, or whether autoconf added -O and -g options:
ORIGINAL_CFLAGS="$CFLAGS"

# For autoconf 2.13, make sure we have no cache file at the beginning of this
# script.  That fixes problems with tests whose cached values change from one
# run to the next, as well as with tests that are order-dependent.
41 42
rm -f config.cache

43
AC_PREREQ(2.13.20020210)
44
AC_INIT(userdefs.h)
45 46 47 48 49 50 51

# autoconf 2.5x defaults to no cache file; we need the cache file's information
# for building the config page.  But start with it empty to avoid confusion by
# people who don't do a "make distclean" after applying patches.
cache_file=config.cache
rm -f config.cache; touch config.cache

52 53
CONFIG_H=lynx_cfg.h
AC_CONFIG_HEADER($CONFIG_H:config.hin)
54
AC_SUBST(CONFIG_H)
55

56 57 58 59 60
CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
AC_ARG_WITH(system-type,
[  --with-system-type=XXX  test: override derived host system-type],
[AC_MSG_WARN(overriding system type $host_os to $withval)
 host_os=$withval])
61

62 63
AC_ARG_PROGRAM

64
PACKAGE=lynx
65 66
dnl ask PRCS to plug-in the project-version for the packages.
# $Format: "VERSION=$ProjectVersion$"$
67
VERSION=2.8.9dev.16
68

69 70 71
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)

72 73 74 75 76 77 78
AC_MSG_CHECKING(for DESTDIR)
CF_WITH_PATH(destdir,
[  --with-destdir=XXX      set DESTDIR destination for install],
DESTDIR,
[$DESTDIR],
[$DESTDIR])
AC_MSG_RESULT($DESTDIR)
79 80 81 82 83 84 85 86

AC_PREFIX_DEFAULT(/usr/local)

dnl --------------------------------------------------------------------------
dnl Checks for location of programs
dnl --------------------------------------------------------------------------

dnl Only add to this case statement when a system has a compiler that is not
87
dnl detected by AC_PROG_CC.
88
case $host_os in
89
(openedition)
90 91 92 93 94
	: ${CFLAGS="-D_ALL_SOURCE -Wl,EDIT=NO"}
	: ${CC=c89}
	;;
esac

95
CF_PROG_CC
96
CF_PROG_CPP_COMMENTS
97
AC_PROG_LN_S
98
case $host_os in
99
(mingw*)
100 101 102
LN_S="cp -p"
AC_MSG_RESULT(Override: No symbolic links in mingw.)
	;;
103
(*)
104 105
	;;
esac
106 107
AC_PROG_MAKE_SET
AC_PROG_INSTALL
108
AC_PROG_YACC
109
CF_PROG_LINT
110
CF_MAKEFLAGS
111
CF_MAKE_TAGS
112

113 114 115 116
CF_ACVERSION_CHECK(2.52,
	[AC_PATH_TOOL(WINDRES, windres, none)],
	[AC_PATH_PROG(WINDRES, windres, none)])

117 118
CF_BUILD_CC([#],[])

119 120
CF_PROG_RANLIB
CF_AR_FLAGS
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144

dnl --------------------------------------------------------------------------
dnl Debug/development/test
dnl --------------------------------------------------------------------------

CF_HELP_MESSAGE(
Development Options:)

CF_DISABLE_ECHO

# special case for WWW/*
if test -n "$ECHO_CC" ; then
	DONT_ECHO_CC="$SHOW_CC ;"
else
	DONT_ECHO_CC=''
fi
AC_SUBST(DONT_ECHO_CC)

AC_MSG_CHECKING(if you want to check memory-leaks)
CF_ARG_ENABLE(find-leaks,
	[  --enable-find-leaks     logic for testing memory leaks],
	[with_leak_checks=yes],
	[with_leak_checks=no])
AC_MSG_RESULT($with_leak_checks)
145
test "$with_leak_checks" = "yes" && AC_DEFINE(LY_FIND_LEAKS,1,[Define to 1 if you want to check memory-leaks])
146

147 148 149
# The comment about adding -g to $CFLAGS is unclear.  Autoconf tries to add
# a -g flag; we remove it if the user's $CFLAGS was not set and debugging is
# disabled.
150 151 152 153 154 155 156 157
AC_MSG_CHECKING(if you want to enable debug-code)
CF_ARG_ENABLE(debug,
	[  --enable-debug          compile w/ debugging (if \$CFLAGS is set, add -g there, too)],
	[with_debug=yes],
	[with_debug=no])
AC_MSG_RESULT($with_debug)
if test "$with_debug" = "yes" ; then
	case $host_os in
158
	(ultrix*|osf*)
159
		test -z "$ORIGINAL_CFLAGS" && CF_STRIP_O_OPT(CFLAGS)
160 161 162 163 164 165 166
		if test -z "$GCC" ; then
			CFLAGS="$CFLAGS -g3"
		fi
		;;
	esac
else
	case $host_os in
167
	(osf*)
168
		test -z "$GCC" && CFLAGS="$CFLAGS -std1"
169
		test -z "$ORIGINAL_CFLAGS" && CF_STRIP_G_OPT(CFLAGS)
170
		;;
171
	(*)
172
		test -z "$ORIGINAL_CFLAGS" && CF_STRIP_G_OPT(CFLAGS)
173 174 175 176 177 178 179 180 181 182
		;;
	esac
fi

AC_MSG_CHECKING(if you want to enable lynx trace code *recommended* )
CF_ARG_DISABLE(trace,
	[  --disable-trace         disable logic for trace code],
	[with_trace=$enableval],
	[with_trace=yes])
AC_MSG_RESULT($with_trace)
183
test $with_trace = no && AC_DEFINE(NO_LYNX_TRACE,1,[Define to 1 if you want to enable lynx trace code])
184 185 186 187 188 189 190

AC_MSG_CHECKING(if you want verbose trace code)
CF_ARG_ENABLE(vertrace,
	[  --enable-vertrace       verbose trace code],
	[with_vertrace=yes],
	[with_vertrace=no])
AC_MSG_RESULT($with_vertrace)
191
test $with_vertrace = yes && AC_DEFINE(LY_TRACELINE,__LINE__,[Define to __LINE__ if you want verbose trace code])
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207

if test -n "$GCC"
then
AC_MSG_CHECKING(if you want to turn on gcc warnings)
CF_ARG_ENABLE(warnings,
	[  --enable-warnings       GCC compiler warnings],
	[with_warnings=yes],
	[with_warnings=no])
AC_MSG_RESULT($with_warnings)
if test "$with_warnings" = "yes"
then
	CF_GCC_ATTRIBUTES
	CF_GCC_WARNINGS
fi
fi

208 209
CF_WITH_DBMALLOC
CF_WITH_DMALLOC
210

211 212 213 214 215
dnl --------------------------------------------------------------------------
dnl Checks for compiler & standard-library characteristics
dnl --------------------------------------------------------------------------

dnl If we're able to run this script, this is true!
216
AC_DEFINE(UNIX,1,[Define to 1 if we can run a configure script])
217 218 219 220

dnl Only add to this case statement things that we cannot design tests for.
TRY_CFLAGS=
case $host_os in
221
(aix4*)
222 223 224
	TRY_CFLAGS="$TRY_CFLAGS -DAIX4 -D_BSD=44 -D_AIX"
	LIBS="$LIBS -lbsd"
	;;
225
(aix*)
226
	TRY_CFLAGS="$TRY_CFLAGS -D_ACS_COMPAT_CODE"
227 228
	LIBS="$LIBS -lbsd"
	;;
229
(apollo*)
230 231
	TRY_CFLAGS="$TRY_CFLAGS -D_BUILTINS -W0,-opt,4"
	;;
232
(bsdi*)
233 234
	TRY_CFLAGS="$TRY_CFLAGS -DBSDI"
	;;
235
(clix*)
236 237 238 239 240
	# Tested on CLIX 3.1 (T.Dickey).  The original makefile entry
	# contributed by Alex Matulich (matuli_a@marlin.navsea.navy.mil) also
	# references -lmalloc and -lbsd.
	AC_CHECK_LIB(c_s,strcmp)
	;;
241
(convex*)
242 243
	TRY_CFLAGS="$TRY_CFLAGS -D__STDC__ -Dunix"
	;;
244
(cygwin*)
245
	TRY_CFLAGS="$TRY_CFLAGS -DWIN_EX -D_WINDOWS_NSL"
246 247
	LIBS="$LIBS -luser32"
	;;
248
(dgux*)
249 250
	TRY_CFLAGS="$TRY_CFLAGS -DDGUX"
	;;
251
(hpux*)
252
	TRY_CFLAGS="$TRY_CFLAGS -DSNAKE -D_XOPEN_SOURCE_EXTENDED"
253
	test -z "$GCC" && TRY_CFLAGS="$TRY_CFLAGS -Wp,-H600000 -DSYS_HPUX"
254
	;;
255
(isc*)
256 257 258 259
	# -DPOSIX_JC is necessary, else LYBookmark.c never finds out what a mode_t is.
	TRY_CFLAGS="$TRY_CFLAGS -DISC -DPOSIX_JC"
	LIBS="$LIBS -linet -lnsl_s -lcposix"
	;;
260
(irix6.*)
261 262
	TRY_CFLAGS="$TRY_CFLAGS -DSYS_IRIX64"
	;;
263
(irix*)
264 265 266 267
	# The original makefile used the $CFLAGS option -cckr for some form
	# of K&R compatibility.  However, this causes compilation warnings for
	# varargs on IRIX 5.2, and does not appear to be needed.
	;;
268
(linux*)
269 270
	TRY_CFLAGS="$TRY_CFLAGS -DLINUX"
	;;
271
(mingw*)
272
	# put these directly in CPPFLAGS since they will not work in lynx_cfg.h
273 274 275 276 277 278 279 280 281 282 283 284 285 286
	CF_ADD_CFLAGS(\
		-DWIN32_LEAN_AND_MEAN \
		-DDOSPATH \
		-DNOSIGHUP \
		-DNOUSERS \
		-DWIN_EX \
		-D_CONSOLE \
		-D_MBCS \
		-D_WINDOWS \
		-D_WIN_CC \
		-D__WIN32__ \
	)
	EXTRA_OBJS="$EXTRA_OBJS Xsystem\$o"
	;;
287
(msdosdjgpp*)
288 289 290
	LIBS="$LIBS -lwatt"
	TRY_CFLAGS="$TRY_CFLAGS -DDOSPATH -DNOUSERS"
	;;
291
(next*)
292
	TRY_CFLAGS="$TRY_CFLAGS -DNEXT"
293
	;;
294
(osf4*)
295 296
	# The -Olimit flag (see below) is no longer available with
	# Digital C 5.2, which is bundled with Digital UNIX 4.0.
297
	TRY_CFLAGS="$TRY_CFLAGS -DDSYS5 -DSYS_TRU64"
298
	;;
299
(osf*)
300 301
	# Increase the maximum size of functions that will be optimized.
	test -z "$GCC" && TRY_CFLAGS="$TRY_CFLAGS -O -Olimit 4000"
302
	TRY_CFLAGS="$TRY_CFLAGS -DDSYS5 -DSYS_TRU64"
303
	;;
304
(sco3.2v5*)
305 306
	test $ac_cv_prog_gcc != yes && TRY_CFLAGS="$TRY_CFLAGS -belf"
	;;
307
(sco*)
308 309 310
	LIBS="$LIBS -lmalloc"
	# It's a little late to do much, but try to warn user if he's using
	# SCO's cc (which is reported to have broken const/volatile).
311 312
	case "$CC" in
	(cc|*/cc)
313 314 315 316 317 318
		AC_MSG_WARN(You should consider using gcc or rcc if available)
		unset ac_cv_prog_CC
		AC_CHECK_PROGS(CC,gcc rcc,$CC)
		;;
	esac
	;;
319
(sequent-ptx)
320 321
	TRY_CFLAGS="$TRY_CFLAGS -DSVR4_BSDSELECT -DNO_IOCTL -DUSE_FCNTL"
	;;
322
(sequent-ptx2)
323 324
	TRY_CFLAGS="$TRY_CFLAGS -DSVR4_BSDSELECT"
	;;
325
(sony-newsos*)
326 327 328
	TRY_CFLAGS="$TRY_CFLAGS -I/usr/sony/include"
	AC_CHECK_HEADERS(jcurses.h)
	;;
329
(svr4)
330 331
	TRY_CFLAGS="$TRY_CFLAGS -DSVR4_BSDSELECT -DSVR4"
	;;
332
(sunos3*)
333 334
	TRY_CFLAGS="$TRY_CFLAGS -DSUN"
	;;
335
(sunos4*)
336 337
	TRY_CFLAGS="$TRY_CFLAGS -DSUN -DSUN4"
	;;
338
(ultrix*)
339 340 341 342
	# Increase the maximum size of functions that will be optimized.
	test -z "$GCC" && TRY_CFLAGS="$TRY_CFLAGS -O -Olimit 600 -G 7"
	TRY_CFLAGS="$TRY_CFLAGS -DULTRIX"
	AC_CHECK_HEADERS(cursesX.h,
343
		[AC_DEFINE(HAVE_CURSESX_H,1,[Define to 1 if we have cursesX.h])
344 345 346 347
		 cf_cv_ncurses_header=cursesX.h])
	;;
esac

348
case $host_os in
349
(mingw*)
350 351 352 353
	EXTRA_OBJS="$EXTRA_OBJS LYIcon\$o"
	;;
esac

354
CF_ANSI_CC_REQD
355 356 357 358 359 360 361

dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------

CF_HELP_MESSAGE(
Basic Configuration Options:)

362 363
CF_LARGEFILE

364
dnl --------------------------------------------------------------------------
365
dnl internationalization macros
366 367 368 369 370
dnl --------------------------------------------------------------------------

dnl Set of available languages (based on source distribution)
if test -z "$ALL_LINGUAS" ; then
	ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'`
371 372 373 374 375 376
	AM_PATH_PROG_WITH_TEST(MSGINIT, msginit,
		[$ac_dir/$ac_word --no-translator --version /dev/null >/dev/null 2>&1], :)
	if test "$MSGINIT" != ":" ; then
		CF_VERBOSE(adding en.po)
		ALL_LINGUAS="$ALL_LINGUAS en"
	fi
377 378
fi

379
CF_BUNDLED_INTL(makefile,disable)
380 381 382 383 384 385 386 387 388 389 390 391 392 393

INTLDIR_CPPFLAGS="#"
if test -z "$INTLDIR_MAKE" ; then
	INTLDIR_CPPFLAGS=
fi

AC_SUBST(INTLDIR_CPPFLAGS)

CF_WITH_PATH(nls-datadir,
[  --with-nls-datadir=DIR  NLS data, parent of locale],
NLS_DATADIR,
[PREFIX/DATADIR],
[$prefix/$DATADIRNAME])

394
dnl --------------------------------------------------------------------------
395 396 397 398 399 400
AC_MSG_CHECKING(if you want full utility pathnames)
CF_ARG_DISABLE(full-paths,
	[  --disable-full-paths    control whether full utility pathnames are used],
	[with_full_paths=no],
	[with_full_paths=yes])
AC_MSG_RESULT($with_full_paths)
401
test $with_full_paths = no && AC_DEFINE(USE_EXECVP,1,[Define to 1 if you want full utility pathnames])
402 403 404 405 406 407 408

CF_DEFINE_PROG(system mailer, SYSTEM_MAIL,
	/usr/mmdf/bin/submit \
	/usr/sbin/sendmail \
	/usr/lib/sendmail  \
	)
CF_SYSTEM_MAIL_FLAGS
409 410 411 412 413
if test -n "$SYSTEM_MAIL" ; then
if test $with_full_paths = no ; then
	SYSTEM_MAIL=`basename $SYSTEM_MAIL`
fi
fi
414

415
dnl --------------------------------------------------------------------------
416
CF_XOPEN_SOURCE(500,199506L)
417
CF_SIGWINCH
418 419 420

dnl Collect tests for compiler options into one place
if test -n "$TRY_CFLAGS" ; then
421
	CF_CHECK_CFLAGS($TRY_CFLAGS)
422 423 424 425 426 427 428 429
fi

dnl --------------------------------------------------------------------------
dnl Checks for library configuration (added right-to-left)
dnl --------------------------------------------------------------------------

### Look for network libraries first, since some functions (such as gethostname)
### are used in a lot of places.
430 431 432 433 434 435 436
AC_CACHE_CHECK(if you want NSS compatible SSL libraries,cf_cv_use_libnss_compat,[
AC_ARG_WITH(nss-compat,
	[  --with-nss-compat{=path}       link with nss_compat library if available],
	[cf_cv_use_libnss_compat=$withval],
	[cf_cv_use_libnss_compat=no])
])

437 438
AC_CACHE_CHECK(if you want ssl library,cf_cv_use_libssl,[
AC_ARG_WITH(ssl,
439
	[  --with-ssl{=path}       link with ssl library if available],
440 441 442 443
	[cf_cv_use_libssl=$withval],
	[cf_cv_use_libssl=no])
])

444
AC_CACHE_CHECK(if you want gnutls support,cf_cv_use_libgnutls,[
445
AC_ARG_WITH(gnutls,
446
	[  --with-gnutls{=path}    link with gnutls support],
447 448 449 450
	[cf_cv_use_libgnutls=$withval],
	[cf_cv_use_libgnutls=no])
])

451 452 453
# this option is mainly for comparing with/without Lynx's wrapper for GNUTLS.
AC_CACHE_CHECK(if you want gnutls-openssl compat,cf_cv_gnutls_compat,[
AC_ARG_ENABLE(gnutls-compat,
454
	[  --enable-gnutls-compat  link with gnutls-openssl compat],
455
	[cf_cv_gnutls_compat=$enableval],
456 457 458
	[cf_cv_gnutls_compat=no])
])

459 460
AC_CACHE_CHECK(if you want socks library,cf_cv_use_libsocks,[
AC_ARG_WITH(socks,
461
	[  --with-socks{=path}     link with socks library if available],
462 463 464 465 466 467
	[cf_cv_use_libsocks=$withval],
	[cf_cv_use_libsocks=no])
])

AC_CACHE_CHECK(if you want socks5 library,cf_cv_use_libsocks5,[
AC_ARG_WITH(socks5,
468
	[  --with-socks5{=path}    link with socks5 library if available],
469 470 471 472 473 474 475 476 477 478 479
	[cf_cv_use_libsocks5=$withval],
	[cf_cv_use_libsocks5=no])
])

if test "x$cf_cv_use_libsocks" != xno ; then
	CF_SOCKS($cf_cv_use_libsocks)
elif test "x$cf_cv_use_libsocks5" != xno ; then
	CF_SOCKS5($cf_cv_use_libsocks5)
else
	CF_NETLIBS
fi
480

481
CF_INET_ADDR
482

483 484
CF_PKG_CONFIG

485 486
if test "x$cf_cv_use_libssl"  != xno ; then
	CF_SSL($cf_cv_use_libssl)
487
elif test "x$cf_cv_use_libgnutls" != xno ; then
488 489 490 491 492
    if test "x$cf_cv_gnutls_compat" = xno ; then
        CF_GNUTLS($cf_cv_use_libgnutls,tidy_tls\$o)
    else
        CF_GNUTLS($cf_cv_use_libgnutls)
    fi
493 494
elif test "x$cf_cv_use_libnss_compat"  != xno ; then
	CF_NSS_COMPAT($cf_cv_use_libnss_compat)
495 496
fi

497 498 499 500 501
dnl --------------------------------------------------------------------------
### check for ipv6 support
AC_MSG_CHECKING([whether to enable ipv6])
CF_ARG_ENABLE(ipv6,
[  --enable-ipv6           use ipv6 (with ipv4) support],
502
	[AC_DEFINE(ENABLE_IPV6,1,[Define to 1 if we should enable ipv6])])
503 504 505 506 507 508 509
AC_MSG_RESULT($enableval)
if test "$enableval" = "yes"; then
	CF_CHECK_IPV6
fi
dnl AC_REPLACE_FUNCS(getaddrinfo getnameinfo)

dnl --------------------------------------------------------------------------
510 511 512
dnl This has to be cached, since there's a lot of interdependent tests.
AC_CACHE_CHECK(for screen type, cf_cv_screen,[
AC_ARG_WITH(screen,
513 514
[  --with-screen=XXX       select screen type (XXX is curses (default),
                          ncurses, ncursesw, pdcurses or slang)],
515 516
	[
case $withval in
517
(curses|ncurses*|pdcurses|slang)
518 519
	cf_cv_screen=$withval
	;;
520
(*)	AC_ERROR(Unexpected value $withval)
521 522 523 524 525
	;;
esac],
	[cf_cv_screen=curses])])

case $cf_cv_screen in
526
(curses|ncurses*)
527
	CF_WITH_CURSES_DIR
528 529 530
	;;
esac

531 532
cf_wide_curses=no
dft_color_style=yes
533
case $cf_cv_screen in
534
(curses)
535
	CF_CURSES_CONFIG
536 537 538
	CF_CURS_PERFORMANCE
	CF_CURS_TOUCHLINE
	;;
539
(ncursesw*)
540
	CF_UTF8_LIB
541
	CF_NCURSES_CONFIG($cf_cv_screen)
542
	cf_wide_curses=yes
543
	;;
544 545 546 547
(ncurses*)
	CF_NCURSES_CONFIG($cf_cv_screen)
	;;
(pdcurses)
548
	case $host_os in
549
	(mingw*)
550 551
		cf_cv_ncurses_header=curses.h
		;;
552
	(*)
553 554 555 556
		cf_cv_ncurses_header=xcurses.h
		# do this last, since it changes definition of main: CF_PDCURSES_X11
		;;
	esac
557
	;;
558
(slang)
559
	CF_SLANG_UNIX_DEFS
560
	dft_color_style=no
561 562 563
	;;
esac

564 565
CF_CURSES_CHTYPE

566
AC_MSG_CHECKING(if you want the wide-curses features)
567 568
CF_ARG_ENABLE(widec,
[  --enable-widec          enable wide-curses features],
569 570 571 572
	[use_wide_curses=$enableval],
	[use_wide_curses=$cf_wide_curses])
AC_MSG_RESULT($use_wide_curses)

573 574 575 576 577 578 579
AC_MSG_CHECKING(if color-style code should be used)
CF_ARG_DISABLE(color-style,
[  --disable-color-style   use color style (ncurses/curses)],
	[use_color_style=$enableval],
	[use_color_style=$dft_color_style])

case $use_color_style in
580
(no)
581 582 583
	AC_MSG_RESULT(no)
	INSTALL_LSS=
	;;
584
(*)
585
	AC_DEFINE(USE_COLOR_STYLE,1,[Define to 1 if we should enable color-style])
586 587 588 589 590 591 592 593 594 595 596 597 598 599
	AC_MSG_RESULT(yes)

	AC_MSG_CHECKING(for location of style-sheet file)

CF_WITH_PATH(lss-file,
[  --with-lss-file{=path}  specify the default style-sheet file
                         ],
LYNX_LSS_FILE,
SYSCONFDIR/lynx.lss,
$sysconfdir/lynx.lss)

	AC_MSG_RESULT($LYNX_LSS_FILE)

	test "$LYNX_LSS_FILE" = no && LYNX_LSS_FILE=
600
	AC_DEFINE_UNQUOTED(LYNX_LSS_FILE,"$LYNX_LSS_FILE",[Define to default path for Lynx lss-file])
601 602 603 604 605 606 607 608

	INSTALL_LSS=install-lss
	;;
esac
AC_SUBST(INSTALL_LSS)

dnl --------------------------------------------------------------------------

609 610 611 612 613 614 615 616
AC_MSG_CHECKING(for the default configuration-file)

CF_WITH_PATH(cfg-file,
[  --with-cfg-file{=path}  specify the default configuration file
                         ],
LYNX_CFG_FILE,
SYSCONFDIR/lynx.cfg,
$sysconfdir/lynx.cfg)
617 618 619

AC_MSG_RESULT($LYNX_CFG_FILE)

620
test "$LYNX_CFG_FILE" = no && LYNX_CFG_FILE=
621
AC_DEFINE_UNQUOTED(LYNX_CFG_FILE,"$LYNX_CFG_FILE",[Define to default path for Lynx cfg-file])
622

623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639
dnl --------------------------------------------------------------------------

AC_MSG_CHECKING(for the default configuration-path)

CF_WITH_PATH(cfg-path,
[  --with-cfg-path{=path}  specify the default configuration directories
                         ],
LYNX_CFG_PATH,
SYSCONFDIR,
$sysconfdir)

AC_MSG_RESULT($LYNX_CFG_PATH)

test -z "$LYNX_CFG_PATH" && `echo "$LYNX_CFG_FILE" | sed -e 's%/[[^/]]*$%%'`
test "x$LYNX_CFG_PATH" = xno && LYNX_CFG_PATH=
AC_DEFINE_UNQUOTED(LYNX_CFG_PATH,"$LYNX_CFG_PATH",[Define to default path for Lynx config-files])

640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if htmlized lynx.cfg should be built)
CF_ARG_ENABLE(htmlized-cfg,
[  --enable-htmlized-cfg   build htmlized lynx.cfg],
	[use_htmlized_cfg=$enableval],
	[use_htmlized_cfg=no])
AC_MSG_RESULT($use_htmlized_cfg)

LYNXCFG_MAKE=''
if test $use_htmlized_cfg = no ; then
	LYNXCFG_MAKE='#'
fi
AC_SUBST(LYNXCFG_MAKE)

dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if local doc directory should be linked to help page)
CF_ARG_ENABLE(local-docs,
[  --enable-local-docs     link local doc-directory to help-page],
	[use_local_docs=$enableval],
	[use_local_docs=no])
AC_MSG_RESULT($use_local_docs)

LYNXDOC_MAKE=''
if test $use_local_docs = no ; then
	LYNXDOC_MAKE='#'
fi
AC_SUBST(LYNXDOC_MAKE)

dnl --------------------------------------------------------------------------

AC_MSG_CHECKING(for MIME library directory)
CF_WITH_PATH(mime-libdir,
[  --with-mime-libdir=DIR  MIME data, mime.types and mailcap],
MIME_LIBDIR,
[/etc])
AC_MSG_RESULT($MIME_LIBDIR)
676
MIME_LIBDIR=`echo "$MIME_LIBDIR" | sed -e 's,/$,,' -e 's,$,/,'`
677
AC_DEFINE_UNQUOTED(MIME_LIBDIR,"$MIME_LIBDIR",[Define to default path for MIME library])
678 679 680

dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if locale-charset selection logic should be used)
681
CF_ARG_DISABLE(locale-charset,
682
[  --disable-locale-charset use locale-charset selection logic],
683 684 685
	[use_locale_charset=$enableval],
	[use_locale_charset=yes])
AC_MSG_RESULT($use_locale_charset)
686
test $use_locale_charset != no && AC_DEFINE(USE_LOCALE_CHARSET,1,[Define to 1 if locale-charset selection logic should be used])
687

688 689 690 691 692 693 694 695 696 697 698 699 700 701
dnl --------------------------------------------------------------------------
dnl Check for subsets of compiled-in tables.
dnl --------------------------------------------------------------------------
CHARSET_DEFS=
AC_SUBST(CHARSET_DEFS)

AC_MSG_CHECKING(if you want only a few charsets)
AC_ARG_WITH(charsets,
[  --with-charsets=list    limit charsets to given list of MIME names],
[cf_charsets=$withval],
[cf_charsets=])

if test -n "$cf_charsets" ; then
	AC_MSG_RESULT(yes)
702
	AC_DEFINE(ALL_CHARSETS,0,[Define to 0 if xxx])
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771
	cf_min_charsets=us-ascii,iso-8859-1,utf-8
	if test "$cf_charsets" = "no" ; then
		cf_charsets=minimal
	fi
	if test "$cf_charsets" = "minimal" ; then
		CF_VERBOSE(using minimal list of charsets: $cf_min_charsets)
	fi
	cf_charsets=`echo $cf_charsets | sed -e "s/minimal/$cf_min_charsets/g" -e 's/,/ /g'`
	for cf_charset in $cf_charsets
	do
		cf_def_charset=`echo $cf_charset | sed -e 's/+/_/g' -e 's/-/_/g'`
		cf_use_charset=no
		# check charsets that are defined via .tbl files
		if ( egrep '^M'$cf_charset'$' $srcdir/src/chrtrans/*.tbl 2>/dev/null >/dev/null )
		then
			cf_use_charset=yes
		# check charsets that are "built-in"
		else
			for cf_tst_charset in big5 euc_cn euc_jp euc_kr shift_jis x_transparent
			do
				if test "$cf_tst_charset" = "$cf_def_charset"
				then
					cf_use_charset=yes
					break
				fi
			done
		fi
		if test $cf_use_charset=yes
		then
			CF_VERBOSE(found $cf_charset)
			CHARSET_DEFS="-DNO_CHARSET_${cf_def_charset}=0 $CHARSET_DEFS"
		else
			CF_VERBOSE(not found $cf_charset)
		fi
	done
else
	AC_MSG_RESULT(no)
fi

dnl --------------------------------------------------------------------------
dnl Checks for standard headers
dnl --------------------------------------------------------------------------

AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_DIRENT
dnl Don't check for sys/wait.h here since it is covered by another test.
AC_CHECK_HEADERS( \
	arpa/inet.h \
	fcntl.h \
	limits.h \
	stdlib.h \
	string.h \
	sys/fcntl.h \
	sys/filio.h \
	sys/ioctl.h \
	sys/param.h \
	sys/timeb.h \
	sys/time.h \
	syslog.h \
	termio.h \
	termios.h \
	unistd.h \
	vfork.h \
)
CF_TERMIO_AND_TERMIOS
CF_FUNC_SIGACTION
CF_FUNC_WAIT
AC_TYPE_GETGROUPS
772
AC_TYPE_OFF_T
773 774 775
AC_TYPE_PID_T
AC_TYPE_UID_T
AC_TYPE_MODE_T
776
CF_CHECK_TYPE(ssize_t, int)
777 778 779 780
CF_CHECK_TYPE(socklen_t, int, [
#include <sys/types.h>
#include <sys/socket.h>
])
781
CF_TYPE_LONG_LONG
782 783
CF_TM_GMTOFF

784 785 786 787
CF_CHECK_SIZEOF(int,4)
CF_CHECK_SIZEOF(long,4)
CF_CHECK_SIZEOF(off_t,4)
CF_CHECK_SIZEOF(time_t,4)
788
AC_CHECK_TYPE(intptr_t, long)
789 790 791 792 793

dnl --------------------------------------------------------------------------
dnl Checks for library units
dnl --------------------------------------------------------------------------

794
AC_FUNC_ALLOCA
795 796 797 798 799
AC_FUNC_VFORK
CF_FIONBIO
CF_REMOVE_BROKEN
CF_FUNC_LSTAT
AC_CHECK_FUNCS( \
800
	atoll \
801
	ctermid \
802 803 804 805 806 807 808
	cuserid \
	ftime \
	getcwd \
	getgroups \
	gettimeofday \
	getuid \
	mktemp \
809
	mkdtemp \
810 811 812 813 814 815 816 817
	popen \
	putenv \
	readdir \
	setuid \
	strerror \
	truncate \
	ttyname \
	unsetenv \
818
	sleep usleep \
819 820 821 822 823 824 825 826 827
	vasprintf \
	waitpid \
)
AC_REPLACE_FUNCS( \
	mktime \
	strstr \
)

CF_SRAND(lynx_)
828 829 830 831 832 833 834 835
CF_CHECK_FUNCDECLS([
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
], sleep)
836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853
CF_CHECK_FUNCDECLS([#include <string.h>], strstr)
CF_CHECK_FUNCDECLS([
#include <stdio.h>
#include <grp.h>], getgrgid getgrnam)

dnl --------------------------------------------------------------------------
dnl Checks for external-data
dnl --------------------------------------------------------------------------

CF_BOOL_DEFS
CF_ERRNO
CF_SET_ERRNO
CF_LOCALE
CF_NGROUPS
CF_SYS_ERRLIST
CF_UTMP
CF_CHECK_EXTERN_DATA(h_errno,int)

854 855
AC_SUBST(EXTRA_OBJS)

856 857 858 859 860 861 862
dnl --------------------------------------------------------------------------
dnl Experimental options that don't need to test system features
dnl --------------------------------------------------------------------------

CF_HELP_MESSAGE(
Experimental Options:)

863
dnl --------------------------------------------------------------------------
864 865 866 867 868 869
AC_MSG_CHECKING(if bibp: URLs should be supported)
CF_ARG_DISABLE(bibp-urls,
[  --disable-bibp-urls     disable support for bibp: URLs],
	[use_bibp_urls=$enableval],
	[use_bibp_urls=yes])
AC_MSG_RESULT($use_bibp_urls)
870
test $use_bibp_urls = no && AC_DEFINE(DISABLE_BIBP,1,[Define to 1 if bibp: URLs should be supported])
871

872
dnl --------------------------------------------------------------------------
873 874 875 876 877 878
AC_MSG_CHECKING(if configuration info should be browsable)
CF_ARG_DISABLE(config-info,
[  --disable-config-info   disable browsable configuration-info],
	[use_config_info=$enableval],
	[use_config_info=yes])
AC_MSG_RESULT($use_config_info)
879
test $use_config_info = no && AC_DEFINE(NO_CONFIG_INFO,1,[Define to 1 if configuration info should be browsable])
880

881
dnl --------------------------------------------------------------------------
882 883
AC_MSG_CHECKING(if new-style forms-based options screen should be used)
CF_ARG_DISABLE(forms-options,
884
[  --disable-forms-options disable forms-based options],
885 886 887
	[use_forms_options=$enableval],
	[use_forms_options=yes])
AC_MSG_RESULT($use_forms_options)
888
test $use_forms_options = no && AC_DEFINE(NO_OPTION_FORMS,1,[Define to 1 if new-style forms-based options screen should be used])
889

890
dnl --------------------------------------------------------------------------
891 892 893 894 895 896
AC_MSG_CHECKING(if old-style options menu should be used)
CF_ARG_DISABLE(menu-options,
[  --disable-menu-options  disable old-style option menu],
	[use_menu_options=$enableval],
	[use_menu_options=yes])
AC_MSG_RESULT($use_menu_options)
897
test $use_menu_options = no && AC_DEFINE(NO_OPTION_MENU,1,[Define to 1 if old-style options menu should be used])
898

899 900 901
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if sessions code should be used)
CF_ARG_DISABLE(sessions,
902
[  --disable-sessions      use sessions code],
903 904 905 906
	[use_sessions=$enableval],
	[use_sessions=yes])
AC_MSG_RESULT($use_sessions)
if test $use_sessions != no ; then
907
	AC_DEFINE(USE_SESSIONS,1,[Define to 1 if sessions code should be used])
908 909 910 911 912 913
	EXTRA_OBJS="$EXTRA_OBJS LYSession\$o"
fi

dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if session-caching code should be used)
CF_ARG_DISABLE(session-cache,
914
[  --disable-session-cache use session-caching code],
915 916 917 918
	[use_session_cache=$enableval],
	[use_session_cache=yes])
AC_MSG_RESULT($use_session_cache)
if test $use_session_cache != no ; then
919
    AC_DEFINE(USE_CACHEJAR,1,[Define to 1 if session-caching code should be used])
920 921 922
fi

dnl --------------------------------------------------------------------------
923 924 925
AC_MSG_CHECKING(if address-list page should be used)
CF_ARG_DISABLE(addrlist-page,
[  --disable-addrlist-page disable address-list page],
926
	[use_addrlist_page=$enableval],
927
	[use_addrlist_page=yes])
928
AC_MSG_RESULT($use_addrlist_page)
929
test $use_addrlist_page != no && AC_DEFINE(USE_ADDRLIST_PAGE,1,[Define to 1 if address-list page should be used])
930

931
dnl --------------------------------------------------------------------------
932 933 934 935 936 937
AC_MSG_CHECKING(if experimental CJK logic should be used)
CF_ARG_ENABLE(cjk,
[  --enable-cjk            use experimental CJK logic],
	[use_cjk=$enableval],
	[use_cjk=no])
AC_MSG_RESULT($use_cjk)
938
test $use_cjk != no && AC_DEFINE(CJK_EX,1,[Define to 1 if experimental CJK logic should be used])
939

940
dnl --------------------------------------------------------------------------
941 942 943 944 945 946 947
AC_MSG_CHECKING(if experimental Japanese UTF-8 logic should be used)
CF_ARG_ENABLE(japanese-utf8,
[  --enable-japanese-utf8  use experimental Japanese UTF-8 logic],
	[use_ja_utf8=$enableval],
	[use_ja_utf8=no])
AC_MSG_RESULT($use_ja_utf8)
if test $use_ja_utf8 != no ; then
948
	AC_DEFINE(EXP_JAPANESEUTF8_SUPPORT,1,[Define to 1 if experimental Japanese UTF-8 logic should be used])
949 950 951 952
	AM_ICONV
	if test "$USE_NLS" != yes ; then
	  LIBS="$LIBICONV $LIBS"
	fi
953 954
fi

955
use_dft_colors=no
956
case $cf_cv_screen in
957
(curses|slang|ncurses*)
958 959 960
	use_dft_colors=maybe
	;;
esac
961

962
dnl --------------------------------------------------------------------------
963 964 965 966 967 968 969
if test "$use_dft_colors" != no ; then
AC_MSG_CHECKING(if you want to use default-colors)
CF_ARG_ENABLE(default-colors,
[  --enable-default-colors enable use of default-colors (ncurses/slang)],
	[use_dft_colors=yes],
	[use_dft_colors=no])
AC_MSG_RESULT($use_dft_colors)
970
test $use_dft_colors = "yes" && AC_DEFINE(USE_DEFAULT_COLORS,1,[Define to 1 if you want to use default-colors])
971 972
fi

973
dnl --------------------------------------------------------------------------
974 975 976 977 978 979
AC_MSG_CHECKING(if experimental keyboard-layout logic should be used)
CF_ARG_ENABLE(kbd-layout,
[  --enable-kbd-layout     use experimental keyboard-layout support],
	[use_kbd_layout=$enableval],
	[use_kbd_layout=no])
AC_MSG_RESULT($use_kbd_layout)
980
test $use_kbd_layout != no && AC_DEFINE(EXP_KEYBOARD_LAYOUT,1,[Define to 1 if experimental keyboard-layout logic should be used])
981

982
dnl --------------------------------------------------------------------------
983 984 985 986 987 988
AC_MSG_CHECKING(if experimental nested-table logic should be used)
CF_ARG_ENABLE(nested-tables,
[  --enable-nested-tables  use experimental nested-table support],
	[use_nested_tables=$enableval],
	[use_nested_tables=no])
AC_MSG_RESULT($use_nested_tables)
989
test $use_nested_tables != no && AC_DEFINE(EXP_NESTED_TABLES,1,[Define to 1 if experimental nested-table logic should be used])
990 991 992 993 994 995 996 997

dnl --------------------------------------------------------------------------
dnl Miscellaneous options that don't need to test system features
dnl --------------------------------------------------------------------------

CF_HELP_MESSAGE(
Miscellaneous Options:)

998
dnl --------------------------------------------------------------------------
999
AC_MSG_CHECKING(if alternative line-edit bindings should be used)
1000
CF_ARG_DISABLE(alt-bindings,
1001 1002 1003 1004
[  --disable-alt-bindings  disable alternative line-edit bindings],
	[use_alt_bindings=$enableval],
	[use_alt_bindings=yes])
AC_MSG_RESULT($use_alt_bindings)
1005
test $use_alt_bindings != no && AC_DEFINE(USE_ALT_BINDINGS,1,[Define to 1 if alternative line-edit bindings should be used])
1006

1007 1008 1009
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if ascii case-conversion should be used)
CF_ARG_DISABLE(ascii-ctypes,
1010
[  --disable-ascii-ctypes  disable use of ascii case-conversion],
1011 1012 1013
	[use_ascii_ctypes=$enableval],
	[use_ascii_ctypes=yes])
AC_MSG_RESULT($use_ascii_ctypes)
1014
test $use_ascii_ctypes != no && AC_DEFINE(USE_ASCII_CTYPES,1,[Define to 1 if ascii case-conversion should be used])
1015

1016
dnl --------------------------------------------------------------------------
1017 1018 1019 1020 1021 1022
AC_MSG_CHECKING(if you want to use extended HTML DTD logic)
CF_ARG_DISABLE(extended-dtd,
[  --disable-extended-dtd  disable extended HTML DTD logic],
	[use_ext_htmldtd=no],
	[use_ext_htmldtd=yes])
AC_MSG_RESULT($use_ext_htmldtd)
1023
test $use_ext_htmldtd = "no" && AC_DEFINE(NO_EXTENDED_HTMLDTD,1,[Define to 1 if you want to use extended HTML DTD logic])
1024

1025
dnl --------------------------------------------------------------------------
1026 1027
AC_MSG_CHECKING(if file-upload logic should be used)
CF_ARG_DISABLE(file-upload,
1028
[  --disable-file-upload   disable file-upload support],
1029 1030 1031
	[use_file_upload=$enableval],
	[use_file_upload=yes])
AC_MSG_RESULT($use_file_upload)
1032
test $use_file_upload != no && AC_DEFINE(USE_FILE_UPLOAD,1,[Define to 1 if file-upload logic should be used])
1033

1034 1035 1036
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if IDNA support should be used)
CF_ARG_DISABLE(idna,
1037
[  --disable-idna          disable IDNA support],
1038 1039 1040 1041 1042 1043 1044 1045
	[use_idna=$enableval],
	[use_idna=yes])
AC_MSG_RESULT($use_idna)

if test "$use_idna" = yes ; then
	CF_WITH_IDNA($use_idna)
fi

1046
dnl --------------------------------------------------------------------------
1047 1048
AC_MSG_CHECKING(if element-justification logic should be used)
CF_ARG_DISABLE(justify-elts,
1049
[  --disable-justify-elts  disable element-justification logic],
1050 1051 1052
	[use_justify_elts=$enableval],
	[use_justify_elts=yes])
AC_MSG_RESULT($use_justify_elts)
1053
test $use_justify_elts != no && AC_DEFINE(USE_JUSTIFY_ELTS,1,[Define to 1 if element-justification logic should be used])
1054

1055
dnl --------------------------------------------------------------------------
1056 1057
AC_MSG_CHECKING(if partial-display should be used)
CF_ARG_DISABLE(partial,
1058
[  --disable-partial       disable partial-display logic],
1059 1060 1061
	[use_partial_display=$enableval],
	[use_partial_display=yes])
AC_MSG_RESULT($use_partial_display)
1062
test $use_partial_display != no && AC_DEFINE(DISP_PARTIAL,1,[Define to 1 if partial-display should be used])
1063

1064
dnl --------------------------------------------------------------------------
1065 1066 1067 1068 1069 1070
AC_MSG_CHECKING(if persistent-cookie logic should be used)
CF_ARG_DISABLE(persistent-cookies,
[  --disable-persistent-cookies  disable persistent-cookie support],
	[use_filed_cookies=$enableval],
	[use_filed_cookies=yes])
AC_MSG_RESULT($use_filed_cookies)
1071
test $use_filed_cookies != no && AC_DEFINE(USE_PERSISTENT_COOKIES,1,[Define to 1 if persistent-cookie logic should be used])
1072

1073
dnl --------------------------------------------------------------------------
1074 1075
AC_MSG_CHECKING(if html source should be colorized)
CF_ARG_DISABLE(prettysrc,
1076
[  --disable-prettysrc     disable colorization of HTML source],
1077 1078 1079
	[use_prettysrc=$enableval],
	[use_prettysrc=yes])
AC_MSG_RESULT($use_prettysrc)
1080
test $use_prettysrc != no && AC_DEFINE(USE_PRETTYSRC,1,[Define to 1 if html source should be colorized])
1081

1082 1083 1084
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if progress-bar code should be used)
CF_ARG_DISABLE(progressbar,
1085
[  --disable-progressbar   disable progress-bar],
1086 1087 1088
	[use_progressbar=$enableval],
	[use_progressbar=yes])
AC_MSG_RESULT($use_progressbar)
1089
test $use_progressbar != no && AC_DEFINE(USE_PROGRESSBAR,1,[Define to 1 if progress-bar code should be used])
1090

1091
dnl --------------------------------------------------------------------------
1092 1093
AC_MSG_CHECKING(if read-progress message should show ETA)
CF_ARG_DISABLE(read-eta,
1094
[  --disable-read-eta      disable read-progress message shows ETA],
1095 1096 1097
	[use_read_eta=$enableval],
	[use_read_eta=yes])
AC_MSG_RESULT($use_read_eta)
1098
test $use_read_eta != no && AC_DEFINE(USE_READPROGRESS,1,[Define to 1 if read-progress message should show ETA])
1099

1100
dnl --------------------------------------------------------------------------
1101 1102
AC_MSG_CHECKING(if source caching should be used)
CF_ARG_DISABLE(source-cache,
1103
[  --disable-source-cache  do not cache HTML source for parse mode changes],
1104 1105 1106
	[use_source_cache=$enableval],
	[use_source_cache=yes])
AC_MSG_RESULT($use_source_cache)
1107
test $use_source_cache != no && AC_DEFINE(USE_SOURCE_CACHE,1,[Define to 1 if source caching should be used])
1108

1109 1110 1111
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if scrollbar code should be used)
CF_ARG_DISABLE(scrollbar,
1112
[  --disable-scrollbar     disable scrollbar with mouse],
1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123
	[use_scrollbar=$enableval],
	[use_scrollbar=yes])
AC_MSG_RESULT($use_scrollbar)

dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if charset-selection logic should be used)
CF_ARG_ENABLE(charset-choice,
[  --enable-charset-choice use charset-selection logic],
	[use_charset_choice=$enableval],
	[use_charset_choice=no])
AC_MSG_RESULT($use_charset_choice)
1124
test $use_charset_choice != no && AC_DEFINE(USE_CHARSET_CHOICE,1,[Define to 1 if charset-selection logic should be used])
1125

1126
dnl --------------------------------------------------------------------------
1127 1128 1129 1130 1131 1132 1133
AC_MSG_CHECKING(if you want to use external commands)
CF_ARG_ENABLE(externs,
[  --enable-externs        use external commands],
	[use_externs=yes],
	[use_externs=no])
AC_MSG_RESULT($use_externs)
if test $use_externs != "no" ; then
1134
	AC_DEFINE(USE_EXTERNALS,1,[Define to 1 if you want to use external commands])
1135
	EXTRA_OBJS="$EXTRA_OBJS LYExtern\$o"
1136 1137
fi

1138
dnl --------------------------------------------------------------------------
1139 1140 1141 1142 1143 1144
AC_MSG_CHECKING(if you want to use setfont support)
CF_ARG_ENABLE(font-switch,
[  --enable-font-switch    use Linux setfont for character-translation],
	[use_setfont=yes],
	[use_setfont=no])
AC_MSG_RESULT($use_setfont)
1145 1146
if test $use_setfont = yes ; then
	case $host_os in
1147
	(linux*)
1148 1149
		CF_PATH_PROG(SETFONT, consolechars, setfont)
		;;
1150
	(os2*)
1151 1152 1153
		SETFONT=built-in
		CF_VERBOSE(Assume $host_os has font-switching)
		;;
1154
	(*)
1155
		SETFONT=unknown
1156
		CF_VERBOSE(Assume $host_os has no font-switching)
1157 1158
		;;
	esac
1159
	if test -z "$SETFONT" ; then
1160
		AC_MSG_WARN(Cannot find a font-setting program)
1161
	elif test "$SETFONT" != unknown ; then
1162
		AC_DEFINE(EXP_CHARTRANS_AUTOSWITCH,1,[Define to 1 if you want to use setfont support])
1163 1164
	fi
fi
1165

1166
dnl --------------------------------------------------------------------------
1167 1168 1169
AC_MSG_CHECKING(if you want cgi-link support)
CF_ARG_ENABLE(cgi-links,
[  --enable-cgi-links      support cgi links w/o a http daemon],
1170
	[AC_DEFINE(LYNXCGI_LINKS,1,[Define to 1 if you want cgi-link support])])
1171 1172
AC_MSG_RESULT($enableval)

1173
dnl --------------------------------------------------------------------------
1174 1175 1176 1177 1178 1179
AC_MSG_CHECKING(if you want change-exec support)
CF_ARG_ENABLE(change-exec,
[  --enable-change-exec    allow users to change exec options],
	[use_change_exec=yes],
	[use_change_exec=no])
AC_MSG_RESULT($use_change_exec)
1180
test $use_change_exec = yes && AC_DEFINE(ENABLE_OPTS_CHANGE_EXEC,1,[Define to 1 if you want change-exec support])
1181

1182
dnl --------------------------------------------------------------------------
1183 1184 1185 1186 1187 1188 1189
AC_MSG_CHECKING(if you want exec-links support)
CF_ARG_OPTION(exec-links,
[  --enable-exec-links     allow lynx to execute programs accessed via a link],
	[use_exec_links=$enableval],
	[use_exec_links=$enableval],
	[$use_change_exec])
AC_MSG_RESULT($use_exec_links)
1190
test $use_exec_links = yes && AC_DEFINE(EXEC_LINKS,1,[Define to 1 if you want exec-links support])
1191

1192
dnl --------------------------------------------------------------------------
1193 1194 1195 1196 1197 1198 1199
AC_MSG_CHECKING(if you want exec-scripts support)
CF_ARG_OPTION(exec-scripts,
[  --enable-exec-scripts   allow lynx to execute programs inferred from a link],
	[use_exec_scripts=$enableval],
	[use_exec_scripts=$enableval],
	[$use_change_exec])
AC_MSG_RESULT($use_exec_scripts)
1200
test $use_exec_scripts = yes && AC_DEFINE(EXEC_SCRIPTS,1,[Define to 1 if you want exec-scripts support])
1201

1202
dnl --------------------------------------------------------------------------
1203 1204 1205 1206 1207 1208
AC_MSG_CHECKING(if you want internal-links feature)
CF_ARG_ENABLE(internal-links,
[  --enable-internal-links handle following links to same doc differently],
	[use_internal_links=yes],
	[use_internal_links=no])
AC_MSG_RESULT($use_internal_links)
1209
test $use_internal_links = yes && AC_DEFINE(TRACK_INTERNAL_LINKS,1,[Define to 1 if you want internal-links feature])
1210

1211
dnl --------------------------------------------------------------------------
1212 1213 1214 1215 1216 1217
AC_MSG_CHECKING(if you want to fork NSL requests)
CF_ARG_ENABLE(nsl-fork,
[  --enable-nsl-fork       fork NSL requests, allowing them to be aborted],
	[use_nsl_fork=yes],
	[use_nsl_fork=no])
AC_MSG_RESULT($use_nsl_fork)
1218 1219
if test $use_nsl_fork = yes ; then
	case $host_os in
1220
	(mingw*)
1221
		AC_DEFINE(_WINDOWS_NSL,1,[Define to 1 if we want NSL-fork with Windows])
1222
		;;
1223
	(*)
1224
		AC_DEFINE(NSL_FORK,1,[Define to 1 if we want NSL-fork])
1225 1226 1227
		;;
	esac
fi
1228

1229
dnl --------------------------------------------------------------------------
1230 1231 1232 1233 1234 1235
AC_MSG_CHECKING(if you want to log URL requests via syslog)
CF_ARG_ENABLE(syslog,
[  --enable-syslog         log URL requests via syslog],
	[use_syslog=yes],
	[use_syslog=no])
AC_MSG_RESULT($use_syslog)
1236
test $use_syslog = yes && AC_DEFINE(SYSLOG_REQUESTED_URLS,1,[Define to 1 if you want to log URL requests via syslog])
1237

1238
dnl --------------------------------------------------------------------------
1239 1240 1241 1242 1243 1244
AC_MSG_CHECKING(if you want to underline links)
CF_ARG_ENABLE(underlines,
[  --enable-underlines     underline links rather than using boldface],
	[use_underline=yes],
	[use_underline=no])
AC_MSG_RESULT($use_underline)
1245 1246
test $use_underline = yes && AC_DEFINE(UNDERLINE_LINKS,1,[Define to 1 if xxx])
test $use_underline = no  && AC_DEFINE(UNDERLINE_LINKS,0,[Define to 0 if xxx])
1247

1248
dnl --------------------------------------------------------------------------
1249 1250 1251 1252 1253 1254 1255
AC_MSG_CHECKING(if help files should be gzip'ed)
CF_ARG_ENABLE(gzip-help,
[  --enable-gzip-help      install gzip'ed help files],
	[use_gzip_help=$enableval],
	[use_gzip_help=no])
AC_MSG_RESULT($use_gzip_help)

1256
dnl --------------------------------------------------------------------------
1257 1258 1259 1260 1261 1262 1263 1264
AC_MSG_CHECKING(if you want to use libbz2 for decompression of some bzip2 files)
AC_ARG_WITH(bzlib,
[  --with-bzlib            use libbz2 for decompression of some bzip2 files],
	[use_bzlib=$withval],
	[use_bzlib=no])
AC_MSG_RESULT($use_bzlib)

if test ".$use_bzlib" != ".no" ; then
1265
	CF_WITH_BZLIB($use_bzlib)
1266
	test "x$cf_cv_find_linkage_bz2" = "xyes" && AC_DEFINE(USE_BZLIB,1,[Define to 1 if you want to use libbz2 for decompression of some bzip2 files])
1267 1268
fi

1269
dnl --------------------------------------------------------------------------
1270 1271 1272 1273 1274 1275 1276 1277
AC_MSG_CHECKING(if you want to use zlib for decompression of some gzip files)
AC_ARG_WITH(zlib,
[  --with-zlib             use zlib for decompression of some gzip files],
	[use_zlib=$withval],
	[use_zlib=no])
AC_MSG_RESULT($use_zlib)

if test ".$use_zlib" != ".no" ; then
1278
	CF_WITH_ZLIB($use_zlib)
1279
	test "x$cf_cv_find_linkage_z" = "xyes" && AC_DEFINE(USE_ZLIB,1,[Define to 1 if you want to use zlib for decompression of some gzip files])
1280 1281
fi

1282
dnl --------------------------------------------------------------------------
1283 1284 1285
CF_HELP_MESSAGE(
Other Network Services:)

1286
dnl --------------------------------------------------------------------------
1287 1288 1289 1290 1291 1292
AC_MSG_CHECKING(if you want to exclude FINGER code)
CF_ARG_DISABLE(finger,
[  --disable-finger        disable FINGER logic],
	[use_finger=yes],
	[use_finger=no])
AC_MSG_RESULT($use_finger)
1293
test $use_finger != "no" && AC_DEFINE(DISABLE_FINGER,1,[Define to 1 if you want to exclude FINGER code])
1294

1295
dnl --------------------------------------------------------------------------
1296 1297 1298 1299 1300 1301
AC_MSG_CHECKING(if you want to exclude GOPHER code)
CF_ARG_DISABLE(gopher,
[  --disable-gopher        disable GOPHER logic],
	[use_gopher=yes],
	[use_gopher=no])
AC_MSG_RESULT($use_gopher)
1302
test $use_gopher != "no" && AC_DEFINE(DISABLE_GOPHER,1,[Define to 1 if you want to exclude GOPHER code])
1303

1304
dnl --------------------------------------------------------------------------
1305 1306 1307 1308 1309 1310
AC_MSG_CHECKING(if you want to exclude NEWS code)
CF_ARG_DISABLE(news,
[  --disable-news          disable NEWS logic],
      [use_news=yes],
      [use_news=no])
AC_MSG_RESULT($use_news)
1311
test $use_news != "no" && AC_DEFINE(DISABLE_NEWS,1,[Define to 1 if you want to exclude NEWS code])
1312

1313
dnl --------------------------------------------------------------------------
1314 1315 1316 1317 1318 1319
AC_MSG_CHECKING(if you want to exclude FTP code)
CF_ARG_DISABLE(ftp,
[  --disable-ftp           disable FTP logic],
      [use_ftp=yes],
      [use_ftp=no])
AC_MSG_RESULT($use_ftp)
1320
test $use_ftp != "no" && AC_DEFINE(DISABLE_FTP,1,[Define to 1 if you want to exclude FTP code])
1321

1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if you want to include WAIS code)
CF_ARG_ENABLE(wais,
[  --enable-wais           enable WAIS logic],
      [use_wais=yes],
      [use_wais=no])
AC_MSG_RESULT($use_wais)

MAKE_WAIS="#"
if test $use_wais != "no"
then
	AC_CHECK_LIB(wais,fs_free,[
		CF_MATH_LIB
		CF_ADD_LIB(wais)
		AC_CHECK_HEADERS(wais.h)
		MAKE_WAIS=
		],[AC_MSG_WARN(could not find WAIS library)])
fi
AC_SUBST(MAKE_WAIS)

1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358
dnl --------------------------------------------------------------------------
dnl DirEd (directory-editor) options
dnl --------------------------------------------------------------------------

CF_HELP_MESSAGE(
Directory Editor Options:)

# All DirEd functions that were enabled on compilation can be disabled
# or modified at run time via DIRED_MENU symbols in lynx.cfg.
AC_MSG_CHECKING(if directory-editor code should be used)
CF_ARG_DISABLE(dired,
[  --disable-dired          disable optional directory-editor, DirEd],
	[use_dired=$enableval],
	[use_dired=yes])
AC_MSG_RESULT($use_dired)

if test ".$use_dired" != ".no" ; then
1359
	EXTRA_OBJS="$EXTRA_OBJS LYLocal\$o"
1360
	AC_DEFINE(DIRED_SUPPORT,1,[Define to 1 if we want dired support])
1361 1362 1363

	AC_MSG_CHECKING(if you wish to allow extracting from archives via DirEd)
	CF_ARG_DISABLE(dired-dearchive,
1364
	[  --disable-dired-dearchive disable dearchiving commands],[AC_DEFINE(ARCHIVE_ONLY,1,[Define to 1 if you wish to allow extracting from archives via DirEd])])
1365 1366 1367 1368
	AC_MSG_RESULT($enableval)

	AC_MSG_CHECKING(if DirEd mode should override keys)
	CF_ARG_DISABLE(dired-override,
1369
	[  --disable-dired-override disable DirEd override keymap],,[AC_DEFINE(OK_OVERRIDE,1,[Define to 1 if DirEd mode should override keys])])
1370 1371 1372 1373
	AC_MSG_RESULT($enableval)

	AC_MSG_CHECKING(if you wish to allow permissions commands via DirEd)
	CF_ARG_DISABLE(dired-permit,
1374
	[  --disable-dired-permit  disable chmod/attrib commands],,[AC_DEFINE(OK_PERMIT,1,[Define to 1 if you wish to allow permissions commands via DirEd])])
1375 1376 1377 1378
	AC_MSG_RESULT($enableval)

	AC_MSG_CHECKING(if you wish to allow executable-permission commands via DirEd)
	CF_ARG_DISABLE(dired-xpermit,
1379
	[  --disable-dired-xpermit disable chmod/attrib commands],[AC_DEFINE(NO_CHANGE_EXECUTE_PERMS,1,[Define to 1 if you wish to allow executable-permission commands via DirEd])])
1380 1381 1382 1383
	AC_MSG_RESULT($enableval)

	AC_MSG_CHECKING(if you wish to allow "tar" commands from DirEd)
	CF_ARG_DISABLE(dired-tar,
1384
	[  --disable-dired-tar     disable "tar" command],,[AC_DEFINE(OK_TAR,1,[Define to 1 if if you wish to allow "tar" commands from DirEd])])
1385 1386 1387 1388
	AC_MSG_RESULT($enableval)

	AC_MSG_CHECKING(if you wish to allow "uudecode" commands from DirEd)
	CF_ARG_DISABLE(dired-uudecode,
1389
	[  --disable-dired-uudecode disable "uudecode" command],,[AC_DEFINE(OK_UUDECODE,1,[Define to 1 if you wish to allow "uudecode" commands from DirEd])])
1390 1391 1392 1393
	AC_MSG_RESULT($enableval)

	AC_MSG_CHECKING(if you wish to allow "zip" and "unzip" commands from DirEd)
	CF_ARG_DISABLE(dired-zip,
1394
	[  --disable-dired-zip     disable "zip", "unzip"  commands],,[AC_DEFINE(OK_ZIP,1,[Define to 1 if you wish to allow "zip" and "unzip" commands from DirEd])])
1395 1396 1397 1398
	AC_MSG_RESULT($enableval)

	AC_MSG_CHECKING(if you wish to allow "gzip" and "gunzip" commands from DirEd)
	CF_ARG_DISABLE(dired-gzip,
1399
	[  --disable-dired-gzip    disable "gzip", "gunzip" commands],,[AC_DEFINE(OK_GZIP,1,[Define to 1 if you wish to allow "gzip" and "gunzip" commands from DirEd])])
1400 1401 1402
	AC_MSG_RESULT($enableval)
fi

1403
dnl --------------------------------------------------------------------------
1404 1405 1406
AC_MSG_CHECKING(if you want long-directory listings)
CF_ARG_DISABLE(long-list,
[  --disable-long-list     disable long "ls -l" directory listings],,
1407
	[AC_DEFINE(LONG_LIST,1,[Define to 1 if you want long-directory listings])])
1408 1409
AC_MSG_RESULT($enableval)

1410
dnl --------------------------------------------------------------------------
1411 1412 1413 1414
AC_MSG_CHECKING(if parent-directory references are permitted)
CF_ARG_DISABLE(parent-dir-refs,
[  --disable-parent-dir-refs
                          disable "Up-to" links in directory listings],
1415
	[AC_DEFINE(NO_PARENT_DIR_REFERENCE,1,[Define to 1 if parent-directory references are permitted])])
1416 1417
AC_MSG_RESULT($enableval)

1418
dnl --------------------------------------------------------------------------
1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429
CF_PATH_PROG(TELNET,	telnet)
CF_PATH_PROG(TN3270,	tn3270)
CF_PATH_PROG(RLOGIN,	rlogin)

CF_PATH_PROG(MV,	mv)

CF_PATH_PROG(GZIP,	gzip)
CF_PATH_PROG(UNCOMPRESS,gunzip)
CF_PATH_PROG(UNZIP,	unzip)
CF_PATH_PROG(BZIP2,	bzip2)

1430 1431
CF_PATH_PROG(TAR,	tar, pax gtar gnutar bsdtar star)
CF_TAR_OPTIONS($TAR)
1432 1433 1434 1435
AC_DEFINE_UNQUOTED(TAR_UP_OPTIONS,   "$TAR_UP_OPTIONS",[Define to command for tar'ing up files])
AC_DEFINE_UNQUOTED(TAR_DOWN_OPTIONS, "$TAR_DOWN_OPTIONS",[Define to command for untar'ing files])
AC_DEFINE_UNQUOTED(TAR_FILE_OPTIONS, "$TAR_FILE_OPTIONS",[Define to options for tar to work with files])
AC_DEFINE_UNQUOTED(TAR_PIPE_OPTIONS, "$TAR_PIPE_OPTIONS",[Define to options for tar to work with pipes])
1436

1437 1438 1439
dnl --------------------------------------------------------------------------
dnl Test features that rely on configure-definitions
dnl --------------------------------------------------------------------------
1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450
if test ".$use_dired" != ".no" ; then

CF_PATH_PROG(COMPRESS,	compress)
CF_PATH_PROG(RM,	rm)
CF_PATH_PROG(UUDECODE,	uudecode)
CF_PATH_PROG(ZCAT,	zcat)
CF_PATH_PROG(ZIP,	zip)

dnl 'INSTALL' is a special case, since the configure script has to find a
dnl BSD-compatible one so the build/install works properly.
case "$INSTALL" in
1451
($srcdir*)
1452 1453
	AC_DEFINE_UNQUOTED(INSTALL_PATH,"install")
	;;
1454
(*)
1455 1456 1457 1458 1459 1460 1461 1462 1463 1464
	cf_save_INSTALL="$INSTALL"
	CF_PATH_PROG(INSTALL,	install)
	INSTALL="$cf_save_INSTALL"
	;;
esac
fi

COMPRESS_PROG=
COMPRESS_EXT=
if test $use_gzip_help = yes ; then
1465
	COMPRESS_PROG="$ac_cv_path_GZIP -9 -n"
1466 1467 1468 1469 1470
	COMPRESS_EXT=.gz
fi
AC_SUBST(COMPRESS_PROG)
AC_SUBST(COMPRESS_EXT)

1471 1472
if test $cf_cv_screen = pdcurses ; then
	CF_HELP_MESSAGE(Special Libraries for PDCurses X11:)
1473 1474
	case $host_os in
	(mingw*)
1475 1476
		CF_PDCURSES_W32
		;;
1477
	(*)
1478 1479 1480
		CF_PDCURSES_X11
		;;
	esac
1481 1482 1483 1484
else
	CF_TERMIO_AND_CURSES(LYCurses.h)
fi

1485 1486
### These tests must be run after establishing the curses library.
if test $cf_cv_screen != slang ; then
1487 1488 1489
	if test $cf_cv_screen != pdcurses ; then
		AC_CHECK_HEADERS($cf_cv_screen/term.h term.h)
	fi
1490 1491
	CF_ALT_CHAR_SET
	CF_FANCY_CURSES
1492
	CF_FUNC_CURSES_VERSION
1493 1494 1495 1496
	CF_NCURSES_BROKEN
	CF_COLOR_CURSES
	CF_SIZECHANGE
	CF_TTYTYPE
1497 1498 1499
	if test "$use_wide_curses" = yes ; then
		CF_WIDEC_CURSES
	fi
1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516
	CF_CURSES_FUNCS( \
		assume_default_colors \
		cbreak \
		define_key \
		delscreen \
		getattrs \
		getbegx \
		getbegy \
		keypad \
		napms \
		newpad \
		newterm \
		pnoutrefresh \
		resizeterm \
		touchline \
		touchwin \
		use_default_colors \
1517
		use_legacy_coding \
1518 1519 1520 1521 1522
		wattr_get \
		wborder \
		wredrawln \
		wresize \
		)
1523 1524 1525 1526
	AC_CHECK_FUNCS( \
		_nc_free_and_exit \
		_nc_freeall \
		)
1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541
fi

if test $use_color_style != no ; then
	if test .$cf_cv_color_curses != .yes ; then
		AC_ERROR(Configuration does not support color-styles)
	fi
	if test $cf_cv_screen = slang ; then
		AC_ERROR(Configuration does not support color-styles)
	fi
fi

if test $use_scrollbar != no ; then
	if test .$cf_cv_fancy_curses != .yes ; then
		AC_MSG_WARN(Configuration does not support ACS_xxx definitions)
	else
1542
		AC_DEFINE(USE_SCROLLBAR,1,[Define to 1 if configuration supports ACS_xxx definitions])
1543 1544 1545
	fi
fi

1546 1547 1548
# use rpath for libraries in unusual places
CF_DISABLE_RPATH_HACK

1549
### Finally, build config.h and the makefiles
1550 1551 1552
test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh
AC_SUBST(CONFIG_SHELL)

1553 1554 1555 1556 1557
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
srcdir="$srcdir"
SRCDIR_CLEAN="#"
if test -n "$srcdir" ; then
	echo srcdir is $srcdir
1558 1559 1560
	mkdir -p WWW/Library/Implementation
	mkdir -p src/chrtrans
	test "$USE_INCLUDED_LIBINTL" = yes && mkdir -p intl
1561 1562 1563
	test "$srcdir" != "." && SRCDIR_CLEAN=""
fi

1564 1565 1566 1567
HOMEPAGE_URL="http://lynx.invisible-island.net/"
AC_DEFINE_UNQUOTED(HOMEPAGE_URL,"$HOMEPAGE_URL",[Define to Lynx homepage URL])
AC_SUBST(HOMEPAGE_URL)

1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579
AC_SUBST(SRCDIR_CLEAN)
AC_OUTPUT(
	[makefile \
	WWW/Library/Implementation/makefile \
	src/makefile \
	src/chrtrans/makefile \
	$SUB_MAKEFILE
	],[
	if test "$USE_NLS" = yes ; then
	if test "$use_our_messages" = yes ; then
		echo creating po/makefile
		rm -f	po/temp$$
1580
		sed	-e 's%^.*LYMessages.c%	../LYMessages.c%' \
1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591
			-e '$s/\\//' po/POTFILES >po/temp$$
		sed	-e "/POTFILES =/r po/temp$$" \
			po/makefile.in > po/makefile
		rm -f	po/temp$$
	fi
	fi
	],[
	USE_NLS=$USE_NLS
	use_our_messages=$use_our_messages
	]
)