1dnl $LynxId: configure.in,v 1.302 2018/07/08 15:22:44 tom Exp $
2dnl
3dnl Process this file with autoconf to produce a configure script.
4dnl
5dnl created jan/1997
6dnl by T.E.Dickey <dickey@invisible-island.net>
7dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>
8dnl
9dnl ---------------------------------------------------------------------------
10dnl Copyright 1997-2017,2018 by Thomas E. Dickey
11dnl
12dnl Permission to use, copy, modify, and distribute this software and its
13dnl documentation for any purpose and without fee is hereby granted,
14dnl provided that the above copyright notice appear in all copies and that
15dnl both that copyright notice and this permission notice appear in
16dnl supporting documentation, and that the name of the above listed
17dnl copyright holder(s) not be used in advertising or publicity pertaining
18dnl to distribution of the software without specific, written prior
19dnl permission.
20dnl
21dnl THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
22dnl TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
23dnl AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
24dnl LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
25dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
26dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
27dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
28dnl ---------------------------------------------------------------------------
29dnl
30dnl ask PRCS to plug-in the project-version for the configure-script.
31dnl $Format: "AC_REVISION($ProjectVersion$)"$
32AC_REVISION(2.8.9rel.1)
33
34# Save the original $CFLAGS so we can distinguish whether the user set those
35# in the environment, or whether autoconf added -O and -g options:
36ORIGINAL_CFLAGS="$CFLAGS"
37
38# For autoconf 2.13, make sure we have no cache file at the beginning of this
39# script.  That fixes problems with tests whose cached values change from one
40# run to the next, as well as with tests that are order-dependent.
41rm -f config.cache
42
43AC_PREREQ(2.13.20020210)
44AC_INIT(userdefs.h)
45
46# autoconf 2.5x defaults to no cache file; we need the cache file's information
47# for building the config page.  But start with it empty to avoid confusion by
48# people who don't do a "make distclean" after applying patches.
49cache_file=config.cache
50rm -f config.cache; touch config.cache
51
52CONFIG_H=lynx_cfg.h
53AC_CONFIG_HEADER($CONFIG_H:config.hin)
54AC_SUBST(CONFIG_H)
55
56CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
57AC_ARG_WITH(system-type,
58[  --with-system-type=XXX  test: override derived host system-type],
59[AC_MSG_WARN(overriding system type $host_os to $withval)
60 host_os=$withval])
61
62AC_ARG_PROGRAM
63
64PACKAGE=lynx
65dnl ask PRCS to plug-in the project-version for the packages.
66# $Format: "VERSION=$ProjectVersion$"$
67VERSION=2.8.9pre.1
68
69AC_SUBST(PACKAGE)
70AC_SUBST(VERSION)
71
72AC_MSG_CHECKING(for DESTDIR)
73CF_WITH_PATH(destdir,
74[  --with-destdir=XXX      set DESTDIR destination for install],
75DESTDIR,
76[$DESTDIR],
77[$DESTDIR])
78AC_MSG_RESULT($DESTDIR)
79
80AC_PREFIX_DEFAULT(/usr/local)
81
82dnl --------------------------------------------------------------------------
83dnl Checks for location of programs
84dnl --------------------------------------------------------------------------
85
86dnl Only add to this case statement when a system has a compiler that is not
87dnl detected by AC_PROG_CC.
88case $host_os in
89(openedition)
90	: ${CFLAGS="-D_ALL_SOURCE -Wl,EDIT=NO"}
91	: ${CC=c89}
92	;;
93esac
94
95CF_PROG_CC
96CF_PROG_CPP_COMMENTS
97AC_PROG_LN_S
98case $host_os in
99(mingw*)
100LN_S="cp -p"
101AC_MSG_RESULT(Override: No symbolic links in mingw.)
102	;;
103(*)
104	;;
105esac
106AC_PROG_MAKE_SET
107AC_PROG_INSTALL
108AC_PROG_YACC
109CF_PROG_LINT
110CF_MAKEFLAGS
111CF_MAKE_TAGS
112
113CF_ACVERSION_CHECK(2.52,
114	[AC_PATH_TOOL(WINDRES, windres, none)],
115	[AC_PATH_PROG(WINDRES, windres, none)])
116
117CF_BUILD_CC([#],[])
118
119CF_PROG_RANLIB
120CF_AR_FLAGS
121
122dnl --------------------------------------------------------------------------
123dnl Debug/development/test
124dnl --------------------------------------------------------------------------
125
126CF_HELP_MESSAGE(
127Development Options:)
128
129CF_DISABLE_ECHO
130
131# special case for WWW/*
132if test -n "$ECHO_CC" ; then
133	DONT_ECHO_CC="$SHOW_CC ;"
134else
135	DONT_ECHO_CC=''
136fi
137AC_SUBST(DONT_ECHO_CC)
138
139AC_MSG_CHECKING(if you want to check memory-leaks)
140CF_ARG_ENABLE(find-leaks,
141	[  --enable-find-leaks     logic for testing memory leaks],
142	[with_leak_checks=yes],
143	[with_leak_checks=no])
144AC_MSG_RESULT($with_leak_checks)
145test "$with_leak_checks" = "yes" && AC_DEFINE(LY_FIND_LEAKS,1,[Define to 1 if you want to check memory-leaks])
146
147# The comment about adding -g to $CFLAGS is unclear.  Autoconf tries to add
148# a -g flag; we remove it if the user's $CFLAGS was not set and debugging is
149# disabled.
150AC_MSG_CHECKING(if you want to enable debug-code)
151CF_ARG_ENABLE(debug,
152	[  --enable-debug          compile w/ debugging (if \$CFLAGS is set, add -g there, too)],
153	[with_debug=yes],
154	[with_debug=no])
155AC_MSG_RESULT($with_debug)
156if test "$with_debug" = "yes" ; then
157	case $host_os in
158	(ultrix*|osf*)
159		test -z "$ORIGINAL_CFLAGS" && CF_STRIP_O_OPT(CFLAGS)
160		if test -z "$GCC" ; then
161			CFLAGS="$CFLAGS -g3"
162		fi
163		;;
164	esac
165else
166	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	esac
175fi
176
177AC_MSG_CHECKING(if you want to enable lynx trace code *recommended* )
178CF_ARG_DISABLE(trace,
179	[  --disable-trace         disable logic for trace code],
180	[with_trace=$enableval],
181	[with_trace=yes])
182AC_MSG_RESULT($with_trace)
183test $with_trace = no && AC_DEFINE(NO_LYNX_TRACE,1,[Define to 1 if you want to enable lynx trace code])
184
185AC_MSG_CHECKING(if you want verbose trace code)
186CF_ARG_ENABLE(vertrace,
187	[  --enable-vertrace       verbose trace code],
188	[with_vertrace=yes],
189	[with_vertrace=no])
190AC_MSG_RESULT($with_vertrace)
191test $with_vertrace = yes && AC_DEFINE(LY_TRACELINE,__LINE__,[Define to __LINE__ if you want verbose trace code])
192
193if test -n "$GCC"
194then
195AC_MSG_CHECKING(if you want to turn on gcc warnings)
196CF_ARG_ENABLE(warnings,
197	[  --enable-warnings       GCC compiler warnings],
198	[with_warnings=yes],
199	[with_warnings=no])
200AC_MSG_RESULT($with_warnings)
201if test "$with_warnings" = "yes"
202then
203	CF_GCC_ATTRIBUTES
204	CF_GCC_WARNINGS
205fi
206fi
207
208CF_WITH_DBMALLOC
209CF_WITH_DMALLOC
210
211dnl --------------------------------------------------------------------------
212dnl Checks for compiler & standard-library characteristics
213dnl --------------------------------------------------------------------------
214
215dnl If we're able to run this script, this is true!
216AC_DEFINE(UNIX,1,[Define to 1 if we can run a configure script])
217
218dnl Only add to this case statement things that we cannot design tests for.
219TRY_CFLAGS=
220case $host_os in
221(aix4*)
222	TRY_CFLAGS="$TRY_CFLAGS -DAIX4 -D_BSD=44 -D_AIX"
223	LIBS="$LIBS -lbsd"
224	;;
225(aix*)
226	TRY_CFLAGS="$TRY_CFLAGS -D_ACS_COMPAT_CODE"
227	LIBS="$LIBS -lbsd"
228	;;
229(apollo*)
230	TRY_CFLAGS="$TRY_CFLAGS -D_BUILTINS -W0,-opt,4"
231	;;
232(bsdi*)
233	TRY_CFLAGS="$TRY_CFLAGS -DBSDI"
234	;;
235(clix*)
236	# Tested on CLIX 3.1 (T.Dickey).  The original makefile entry
237	# contributed by Alex Matulich (matuli_a@marlin.navsea.navy.mil) also
238	# references -lmalloc and -lbsd.
239	AC_CHECK_LIB(c_s,strcmp)
240	;;
241(convex*)
242	TRY_CFLAGS="$TRY_CFLAGS -D__STDC__ -Dunix"
243	;;
244(cygwin*)
245	TRY_CFLAGS="$TRY_CFLAGS -DWIN_EX -D_WINDOWS_NSL"
246	LIBS="$LIBS -luser32"
247	;;
248(hpux*)
249	TRY_CFLAGS="$TRY_CFLAGS -D_XOPEN_SOURCE_EXTENDED"
250	test -z "$GCC" && TRY_CFLAGS="$TRY_CFLAGS -Wp,-H600000 -DSYS_HPUX"
251	;;
252(isc*)
253	# -DPOSIX_JC is necessary, else LYBookmark.c never finds out what a mode_t is.
254	TRY_CFLAGS="$TRY_CFLAGS -DISC -DPOSIX_JC"
255	LIBS="$LIBS -linet -lnsl_s -lcposix"
256	;;
257(irix6.*)
258	TRY_CFLAGS="$TRY_CFLAGS -DSYS_IRIX64"
259	;;
260(irix*)
261	# The original makefile used the $CFLAGS option -cckr for some form
262	# of K&R compatibility.  However, this causes compilation warnings for
263	# varargs on IRIX 5.2, and does not appear to be needed.
264	;;
265(linux*)
266	TRY_CFLAGS="$TRY_CFLAGS -DLINUX"
267	;;
268(mingw*)
269	# put these directly in CPPFLAGS since they will not work in lynx_cfg.h
270	CF_ADD_CFLAGS(\
271		-DDOSPATH \
272		-DNOSIGHUP \
273		-DNOUSERS \
274		-DWIN32_LEAN_AND_MEAN \
275		-DWIN_EX \
276		-D_CONSOLE \
277		-D_GNU_SOURCE \
278		-D_MBCS \
279		-D_WINDOWS \
280		-D_WIN_CC \
281		-D__WIN32__ \
282	)
283	EXTRA_OBJS="$EXTRA_OBJS Xsystem\$o"
284	;;
285(msdosdjgpp*)
286	LIBS="$LIBS -lwatt"
287	TRY_CFLAGS="$TRY_CFLAGS -DDOSPATH -DNOUSERS"
288	;;
289(next*)
290	TRY_CFLAGS="$TRY_CFLAGS -DNEXT"
291	;;
292(osf4*)
293	# The -Olimit flag (see below) is no longer available with
294	# Digital C 5.2, which is bundled with Digital UNIX 4.0.
295	TRY_CFLAGS="$TRY_CFLAGS -DDSYS5 -DSYS_TRU64"
296	;;
297(osf*)
298	# Increase the maximum size of functions that will be optimized.
299	test -z "$GCC" && TRY_CFLAGS="$TRY_CFLAGS -O -Olimit 4000"
300	TRY_CFLAGS="$TRY_CFLAGS -DDSYS5 -DSYS_TRU64"
301	;;
302(sco3.2v5*)
303	test $ac_cv_prog_gcc != yes && TRY_CFLAGS="$TRY_CFLAGS -belf"
304	;;
305(sco*)
306	LIBS="$LIBS -lmalloc"
307	# It's a little late to do much, but try to warn user if he's using
308	# SCO's cc (which is reported to have broken const/volatile).
309	case "$CC" in
310	(cc|*/cc)
311		AC_MSG_WARN(You should consider using gcc or rcc if available)
312		unset ac_cv_prog_CC
313		AC_CHECK_PROGS(CC,gcc rcc,$CC)
314		;;
315	esac
316	;;
317(sequent-ptx)
318	TRY_CFLAGS="$TRY_CFLAGS -DSVR4_BSDSELECT -DNO_IOCTL -DUSE_FCNTL"
319	;;
320(sequent-ptx2)
321	TRY_CFLAGS="$TRY_CFLAGS -DSVR4_BSDSELECT"
322	;;
323(sony-newsos*)
324	TRY_CFLAGS="$TRY_CFLAGS -I/usr/sony/include"
325	AC_CHECK_HEADERS(jcurses.h)
326	;;
327(svr4)
328	TRY_CFLAGS="$TRY_CFLAGS -DSVR4_BSDSELECT -DSVR4"
329	;;
330(sunos3*)
331	TRY_CFLAGS="$TRY_CFLAGS -DSUN"
332	;;
333(sunos4*)
334	TRY_CFLAGS="$TRY_CFLAGS -DSUN -DSUN4"
335	;;
336(ultrix*)
337	# Increase the maximum size of functions that will be optimized.
338	test -z "$GCC" && TRY_CFLAGS="$TRY_CFLAGS -O -Olimit 600 -G 7"
339	TRY_CFLAGS="$TRY_CFLAGS -DULTRIX"
340	AC_CHECK_HEADERS(cursesX.h,
341		[AC_DEFINE(HAVE_CURSESX_H,1,[Define to 1 if we have cursesX.h])
342		 cf_cv_ncurses_header=cursesX.h])
343	;;
344esac
345
346case $host_os in
347(mingw*)
348	EXTRA_OBJS="$EXTRA_OBJS LYIcon\$o"
349	;;
350esac
351
352CF_ANSI_CC_REQD
353
354dnl --------------------------------------------------------------------------
355dnl --------------------------------------------------------------------------
356
357CF_HELP_MESSAGE(
358Basic Configuration Options:)
359
360CF_LARGEFILE
361
362dnl --------------------------------------------------------------------------
363dnl internationalization macros
364dnl --------------------------------------------------------------------------
365
366dnl Set of available languages (based on source distribution)
367if test -z "$ALL_LINGUAS" ; then
368	ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'`
369	AM_PATH_PROG_WITH_TEST(MSGINIT, msginit,
370		[$ac_dir/$ac_word --no-translator --version /dev/null >/dev/null 2>&1], :)
371	if test "$MSGINIT" != ":" ; then
372		CF_VERBOSE(adding en.po)
373		ALL_LINGUAS="$ALL_LINGUAS en"
374	fi
375fi
376
377CF_BUNDLED_INTL(makefile,disable)
378
379INTLDIR_CPPFLAGS="#"
380if test -z "$INTLDIR_MAKE" ; then
381	INTLDIR_CPPFLAGS=
382fi
383
384AC_SUBST(INTLDIR_CPPFLAGS)
385
386CF_WITH_PATH(nls-datadir,
387[  --with-nls-datadir=DIR  NLS data, parent of locale],
388NLS_DATADIR,
389[PREFIX/DATADIR],
390[$prefix/$DATADIRNAME])
391
392dnl --------------------------------------------------------------------------
393AC_MSG_CHECKING(if you want full utility pathnames)
394CF_ARG_DISABLE(full-paths,
395	[  --disable-full-paths    control whether full utility pathnames are used],
396	[with_full_paths=no],
397	[with_full_paths=yes])
398AC_MSG_RESULT($with_full_paths)
399test $with_full_paths = no && AC_DEFINE(USE_EXECVP,1,[Define to 1 if you want full utility pathnames])
400
401CF_DEFINE_PROG(system mailer, SYSTEM_MAIL,
402	/usr/mmdf/bin/submit \
403	/usr/sbin/sendmail \
404	/usr/lib/sendmail  \
405	)
406CF_SYSTEM_MAIL_FLAGS
407if test -n "$SYSTEM_MAIL" ; then
408if test $with_full_paths = no ; then
409	SYSTEM_MAIL=`basename $SYSTEM_MAIL`
410fi
411fi
412
413dnl --------------------------------------------------------------------------
414CF_XOPEN_SOURCE(500,199506L)
415CF_SIGWINCH
416
417dnl Collect tests for compiler options into one place
418if test -n "$TRY_CFLAGS" ; then
419	CF_CHECK_CFLAGS($TRY_CFLAGS)
420fi
421
422dnl --------------------------------------------------------------------------
423dnl Checks for library configuration (added right-to-left)
424dnl --------------------------------------------------------------------------
425
426### Look for network libraries first, since some functions (such as gethostname)
427### are used in a lot of places.
428AC_CACHE_CHECK(if you want NSS compatible SSL libraries,cf_cv_use_libnss_compat,[
429AC_ARG_WITH(nss-compat,
430	[  --with-nss-compat{=path}       link with nss_compat library if available],
431	[cf_cv_use_libnss_compat=$withval],
432	[cf_cv_use_libnss_compat=no])
433])
434
435AC_CACHE_CHECK(if you want ssl library,cf_cv_use_libssl,[
436AC_ARG_WITH(ssl,
437	[  --with-ssl{=path}       link with ssl library if available],
438	[cf_cv_use_libssl=$withval],
439	[cf_cv_use_libssl=no])
440])
441
442AC_CACHE_CHECK(if you want gnutls support,cf_cv_use_libgnutls,[
443AC_ARG_WITH(gnutls,
444	[  --with-gnutls{=path}    link with gnutls support],
445	[cf_cv_use_libgnutls=$withval],
446	[cf_cv_use_libgnutls=no])
447])
448
449# this option is mainly for comparing with/without Lynx's wrapper for GNUTLS.
450AC_CACHE_CHECK(if you want gnutls-openssl compat,cf_cv_gnutls_compat,[
451AC_ARG_ENABLE(gnutls-compat,
452	[  --enable-gnutls-compat  link with gnutls-openssl compat],
453	[cf_cv_gnutls_compat=$enableval],
454	[cf_cv_gnutls_compat=no])
455])
456
457AC_CACHE_CHECK(if you want socks library,cf_cv_use_libsocks,[
458AC_ARG_WITH(socks,
459	[  --with-socks{=path}     link with socks library if available],
460	[cf_cv_use_libsocks=$withval],
461	[cf_cv_use_libsocks=no])
462])
463
464AC_CACHE_CHECK(if you want socks5 library,cf_cv_use_libsocks5,[
465AC_ARG_WITH(socks5,
466	[  --with-socks5{=path}    link with socks5 library if available],
467	[cf_cv_use_libsocks5=$withval],
468	[cf_cv_use_libsocks5=no])
469])
470
471if test "x$cf_cv_use_libsocks" != xno ; then
472	CF_SOCKS($cf_cv_use_libsocks)
473elif test "x$cf_cv_use_libsocks5" != xno ; then
474	CF_SOCKS5($cf_cv_use_libsocks5)
475else
476	CF_NETLIBS
477fi
478
479CF_INET_ADDR
480
481CF_PKG_CONFIG
482
483if test "x$cf_cv_use_libssl"  != xno ; then
484	CF_SSL($cf_cv_use_libssl)
485elif test "x$cf_cv_use_libgnutls" != xno ; then
486    if test "x$cf_cv_gnutls_compat" = xno ; then
487        CF_GNUTLS($cf_cv_use_libgnutls,tidy_tls\$o)
488    else
489        CF_GNUTLS($cf_cv_use_libgnutls)
490    fi
491elif test "x$cf_cv_use_libnss_compat"  != xno ; then
492	CF_NSS_COMPAT($cf_cv_use_libnss_compat)
493fi
494
495dnl --------------------------------------------------------------------------
496### check for ipv6 support
497AC_MSG_CHECKING([whether to enable ipv6])
498CF_ARG_ENABLE(ipv6,
499[  --enable-ipv6           use ipv6 (with ipv4) support],
500	[AC_DEFINE(ENABLE_IPV6,1,[Define to 1 if we should enable ipv6])])
501AC_MSG_RESULT($enableval)
502if test "$enableval" = "yes"; then
503	CF_CHECK_IPV6
504fi
505dnl AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
506
507dnl --------------------------------------------------------------------------
508dnl This has to be cached, since there's a lot of interdependent tests.
509AC_CACHE_CHECK(for screen type, cf_cv_screen,[
510AC_ARG_WITH(screen,
511[  --with-screen=XXX       select screen type (XXX is curses (default),
512                          ncurses, ncursesw, pdcurses or slang)],
513	[
514case $withval in
515(curses|ncurses*|pdcurses|slang)
516	cf_cv_screen=$withval
517	;;
518(*)	AC_ERROR(Unexpected value $withval)
519	;;
520esac],
521	[cf_cv_screen=curses])])
522
523case $cf_cv_screen in
524(curses|ncurses*)
525	CF_WITH_CURSES_DIR
526	;;
527esac
528
529cf_wide_curses=no
530dft_color_style=yes
531case $cf_cv_screen in
532(curses)
533	CF_CURSES_CONFIG
534	CF_CURS_PERFORMANCE
535	CF_CURS_TOUCHLINE
536	;;
537(ncursesw*)
538	CF_UTF8_LIB
539	CF_NCURSES_CONFIG($cf_cv_screen)
540	cf_wide_curses=yes
541	;;
542(ncurses*)
543	CF_NCURSES_CONFIG($cf_cv_screen)
544	;;
545(pdcurses)
546	case $host_os in
547	(mingw*)
548		cf_cv_ncurses_header=curses.h
549		;;
550	(*)
551		cf_cv_ncurses_header=xcurses.h
552		# do this last, since it changes definition of main: CF_PDCURSES_X11
553		;;
554	esac
555	;;
556(slang)
557	CF_SLANG_UNIX_DEFS
558	dft_color_style=no
559	;;
560esac
561
562CF_TRY_RPATH
563
564CF_CURSES_CHTYPE
565
566AC_MSG_CHECKING(if you want the wide-curses features)
567CF_ARG_ENABLE(widec,
568[  --enable-widec          enable wide-curses features],
569	[use_wide_curses=$enableval],
570	[use_wide_curses=$cf_wide_curses])
571AC_MSG_RESULT($use_wide_curses)
572
573AC_MSG_CHECKING(if color-style code should be used)
574CF_ARG_DISABLE(color-style,
575[  --disable-color-style   use color style (ncurses/curses)],
576	[use_color_style=$enableval],
577	[use_color_style=$dft_color_style])
578
579case $use_color_style in
580(no)
581	AC_MSG_RESULT(no)
582	INSTALL_LSS=
583	;;
584(*)
585	AC_DEFINE(USE_COLOR_STYLE,1,[Define to 1 if we should enable color-style])
586	AC_MSG_RESULT(yes)
587
588	AC_MSG_CHECKING(for location of style-sheet file)
589
590CF_WITH_PATH(lss-file,
591[  --with-lss-file{=path}  specify the default style-sheet file
592                         ],
593LYNX_LSS_FILE,
594SYSCONFDIR/lynx.lss,
595$sysconfdir/lynx.lss)
596
597	AC_MSG_RESULT($LYNX_LSS_FILE)
598
599	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	INSTALL_LSS=install-lss
603	;;
604esac
605AC_SUBST(INSTALL_LSS)
606
607dnl --------------------------------------------------------------------------
608
609AC_MSG_CHECKING(for the default configuration-file)
610
611CF_WITH_PATH(cfg-file,
612[  --with-cfg-file{=path}  specify the default configuration file
613                         ],
614LYNX_CFG_FILE,
615SYSCONFDIR/lynx.cfg,
616$sysconfdir/lynx.cfg)
617
618AC_MSG_RESULT($LYNX_CFG_FILE)
619
620test "$LYNX_CFG_FILE" = no && LYNX_CFG_FILE=
621AC_DEFINE_UNQUOTED(LYNX_CFG_FILE,"$LYNX_CFG_FILE",[Define to default path for Lynx cfg-file])
622
623dnl --------------------------------------------------------------------------
624
625AC_MSG_CHECKING(for the default configuration-path)
626
627CF_WITH_PATH(cfg-path,
628[  --with-cfg-path{=path}  specify the default configuration directories
629                         ],
630LYNX_CFG_PATH,
631SYSCONFDIR,
632$sysconfdir)
633
634AC_MSG_RESULT($LYNX_CFG_PATH)
635
636test -z "$LYNX_CFG_PATH" && `echo "$LYNX_CFG_FILE" | sed -e 's%/[[^/]]*$%%'`
637test "x$LYNX_CFG_PATH" = xno && LYNX_CFG_PATH=
638AC_DEFINE_UNQUOTED(LYNX_CFG_PATH,"$LYNX_CFG_PATH",[Define to default path for Lynx config-files])
639
640dnl --------------------------------------------------------------------------
641AC_MSG_CHECKING(if htmlized lynx.cfg should be built)
642CF_ARG_ENABLE(htmlized-cfg,
643[  --enable-htmlized-cfg   build htmlized lynx.cfg],
644	[use_htmlized_cfg=$enableval],
645	[use_htmlized_cfg=no])
646AC_MSG_RESULT($use_htmlized_cfg)
647
648LYNXCFG_MAKE=''
649if test $use_htmlized_cfg = no ; then
650	LYNXCFG_MAKE='#'
651fi
652AC_SUBST(LYNXCFG_MAKE)
653
654dnl --------------------------------------------------------------------------
655AC_MSG_CHECKING(if local doc directory should be linked to help page)
656CF_ARG_ENABLE(local-docs,
657[  --enable-local-docs     link local doc-directory to help-page],
658	[use_local_docs=$enableval],
659	[use_local_docs=no])
660AC_MSG_RESULT($use_local_docs)
661
662LYNXDOC_MAKE=''
663if test $use_local_docs = no ; then
664	LYNXDOC_MAKE='#'
665fi
666AC_SUBST(LYNXDOC_MAKE)
667
668dnl --------------------------------------------------------------------------
669
670AC_MSG_CHECKING(for MIME library directory)
671CF_WITH_PATH(mime-libdir,
672[  --with-mime-libdir=DIR  MIME data, mime.types and mailcap],
673MIME_LIBDIR,
674[/etc])
675AC_MSG_RESULT($MIME_LIBDIR)
676MIME_LIBDIR=`echo "$MIME_LIBDIR" | sed -e 's,/$,,' -e 's,$,/,'`
677AC_DEFINE_UNQUOTED(MIME_LIBDIR,"$MIME_LIBDIR",[Define to default path for MIME library])
678
679dnl --------------------------------------------------------------------------
680AC_MSG_CHECKING(if locale-charset selection logic should be used)
681CF_ARG_DISABLE(locale-charset,
682[  --disable-locale-charset use locale-charset selection logic],
683	[use_locale_charset=$enableval],
684	[use_locale_charset=yes])
685AC_MSG_RESULT($use_locale_charset)
686test $use_locale_charset != no && AC_DEFINE(USE_LOCALE_CHARSET,1,[Define to 1 if locale-charset selection logic should be used])
687
688dnl --------------------------------------------------------------------------
689dnl Check for subsets of compiled-in tables.
690dnl --------------------------------------------------------------------------
691CHARSET_DEFS=
692AC_SUBST(CHARSET_DEFS)
693
694AC_MSG_CHECKING(if you want only a few charsets)
695AC_ARG_WITH(charsets,
696[  --with-charsets=list    limit charsets to given list of MIME names],
697[cf_charsets=$withval],
698[cf_charsets=])
699
700if test -n "$cf_charsets" ; then
701	AC_MSG_RESULT(yes)
702	AC_DEFINE(ALL_CHARSETS,0,[Define to 0 if xxx])
703	cf_min_charsets=us-ascii,iso-8859-1,utf-8
704	if test "$cf_charsets" = "no" ; then
705		cf_charsets=minimal
706	fi
707	if test "$cf_charsets" = "minimal" ; then
708		CF_VERBOSE(using minimal list of charsets: $cf_min_charsets)
709	fi
710	cf_charsets=`echo $cf_charsets | sed -e "s/minimal/$cf_min_charsets/g" -e 's/,/ /g'`
711	for cf_charset in $cf_charsets
712	do
713		cf_def_charset=`echo $cf_charset | sed -e 's/+/_/g' -e 's/-/_/g'`
714		cf_use_charset=no
715		# check charsets that are defined via .tbl files
716		if ( egrep '^M'$cf_charset'$' $srcdir/src/chrtrans/*.tbl 2>/dev/null >/dev/null )
717		then
718			cf_use_charset=yes
719		# check charsets that are "built-in"
720		else
721			for cf_tst_charset in big5 euc_cn euc_jp euc_kr shift_jis x_transparent
722			do
723				if test "$cf_tst_charset" = "$cf_def_charset"
724				then
725					cf_use_charset=yes
726					break
727				fi
728			done
729		fi
730		if test $cf_use_charset=yes
731		then
732			CF_VERBOSE(found $cf_charset)
733			CHARSET_DEFS="-DNO_CHARSET_${cf_def_charset}=0 $CHARSET_DEFS"
734		else
735			CF_VERBOSE(not found $cf_charset)
736		fi
737	done
738else
739	AC_MSG_RESULT(no)
740fi
741
742dnl --------------------------------------------------------------------------
743dnl Checks for standard headers
744dnl --------------------------------------------------------------------------
745
746AC_HEADER_STDC
747AC_HEADER_TIME
748AC_HEADER_DIRENT
749dnl Don't check for sys/wait.h here since it is covered by another test.
750AC_CHECK_HEADERS( \
751	arpa/inet.h \
752	fcntl.h \
753	limits.h \
754	stdlib.h \
755	string.h \
756	sys/fcntl.h \
757	sys/filio.h \
758	sys/ioctl.h \
759	sys/param.h \
760	sys/timeb.h \
761	sys/time.h \
762	syslog.h \
763	termio.h \
764	termios.h \
765	unistd.h \
766	vfork.h \
767)
768CF_TERMIO_AND_TERMIOS
769CF_FUNC_SIGACTION
770CF_FUNC_WAIT
771AC_TYPE_GETGROUPS
772AC_TYPE_OFF_T
773AC_TYPE_PID_T
774AC_TYPE_UID_T
775AC_TYPE_MODE_T
776CF_CHECK_TYPE(ssize_t, int)
777CF_CHECK_TYPE(socklen_t, int, [
778#include <sys/types.h>
779#include <sys/socket.h>
780])
781CF_TYPE_LONG_LONG
782CF_TM_GMTOFF
783
784CF_CHECK_SIZEOF(int,4)
785CF_CHECK_SIZEOF(long,4)
786CF_CHECK_SIZEOF(off_t,4)
787CF_CHECK_SIZEOF(time_t,4)
788AC_CHECK_TYPE(intptr_t, long)
789
790dnl --------------------------------------------------------------------------
791dnl Checks for library units
792dnl --------------------------------------------------------------------------
793
794AC_FUNC_ALLOCA
795AC_FUNC_VFORK
796CF_FIONBIO
797CF_REMOVE_BROKEN
798CF_FUNC_LSTAT
799AC_CHECK_FUNCS( \
800	atoll \
801	ctermid \
802	cuserid \
803	ftime \
804	getcwd \
805	getgroups \
806	gettimeofday \
807	getuid \
808	mktemp \
809	mkdtemp \
810	popen \
811	putenv \
812	readdir \
813	setuid \
814	strerror \
815	truncate \
816	ttyname \
817	unsetenv \
818	sleep usleep \
819	vasprintf \
820	waitpid \
821)
822AC_REPLACE_FUNCS( \
823	mktime \
824	strstr \
825)
826
827CF_SRAND(lynx_)
828CF_CHECK_FUNCDECLS([
829#ifdef HAVE_STDLIB_H
830#include <stdlib.h>
831#endif
832#ifdef HAVE_UNISTD_H
833#include <unistd.h>
834#endif
835], sleep)
836CF_CHECK_FUNCDECLS([#include <string.h>], strstr)
837CF_CHECK_FUNCDECLS([
838#include <stdio.h>
839#include <grp.h>], getgrgid getgrnam)
840
841dnl --------------------------------------------------------------------------
842dnl Checks for external-data
843dnl --------------------------------------------------------------------------
844
845CF_BOOL_DEFS
846CF_ERRNO
847CF_SET_ERRNO
848CF_LOCALE
849CF_NGROUPS
850CF_SYS_ERRLIST
851CF_UTMP
852CF_CHECK_EXTERN_DATA(h_errno,int)
853
854AC_SUBST(EXTRA_OBJS)
855
856dnl --------------------------------------------------------------------------
857dnl Experimental options that don't need to test system features
858dnl --------------------------------------------------------------------------
859
860CF_HELP_MESSAGE(
861Experimental Options:)
862
863dnl --------------------------------------------------------------------------
864AC_MSG_CHECKING(if bibp: URLs should be supported)
865CF_ARG_DISABLE(bibp-urls,
866[  --disable-bibp-urls     disable support for bibp: URLs],
867	[use_bibp_urls=$enableval],
868	[use_bibp_urls=yes])
869AC_MSG_RESULT($use_bibp_urls)
870test $use_bibp_urls = no && AC_DEFINE(DISABLE_BIBP,1,[Define to 1 if bibp: URLs should be supported])
871
872dnl --------------------------------------------------------------------------
873AC_MSG_CHECKING(if configuration info should be browsable)
874CF_ARG_DISABLE(config-info,
875[  --disable-config-info   disable browsable configuration-info],
876	[use_config_info=$enableval],
877	[use_config_info=yes])
878AC_MSG_RESULT($use_config_info)
879test $use_config_info = no && AC_DEFINE(NO_CONFIG_INFO,1,[Define to 1 if configuration info should be browsable])
880
881dnl --------------------------------------------------------------------------
882AC_MSG_CHECKING(if new-style forms-based options screen should be used)
883CF_ARG_DISABLE(forms-options,
884[  --disable-forms-options disable forms-based options],
885	[use_forms_options=$enableval],
886	[use_forms_options=yes])
887AC_MSG_RESULT($use_forms_options)
888test $use_forms_options = no && AC_DEFINE(NO_OPTION_FORMS,1,[Define to 1 if new-style forms-based options screen should be used])
889
890dnl --------------------------------------------------------------------------
891AC_MSG_CHECKING(if old-style options menu should be used)
892CF_ARG_DISABLE(menu-options,
893[  --disable-menu-options  disable old-style option menu],
894	[use_menu_options=$enableval],
895	[use_menu_options=yes])
896AC_MSG_RESULT($use_menu_options)
897test $use_menu_options = no && AC_DEFINE(NO_OPTION_MENU,1,[Define to 1 if old-style options menu should be used])
898
899dnl --------------------------------------------------------------------------
900AC_MSG_CHECKING(if sessions code should be used)
901CF_ARG_DISABLE(sessions,
902[  --disable-sessions      use sessions code],
903	[use_sessions=$enableval],
904	[use_sessions=yes])
905AC_MSG_RESULT($use_sessions)
906if test $use_sessions != no ; then
907	AC_DEFINE(USE_SESSIONS,1,[Define to 1 if sessions code should be used])
908	EXTRA_OBJS="$EXTRA_OBJS LYSession\$o"
909fi
910
911dnl --------------------------------------------------------------------------
912AC_MSG_CHECKING(if session-caching code should be used)
913CF_ARG_DISABLE(session-cache,
914[  --disable-session-cache use session-caching code],
915	[use_session_cache=$enableval],
916	[use_session_cache=yes])
917AC_MSG_RESULT($use_session_cache)
918if test $use_session_cache != no ; then
919    AC_DEFINE(USE_CACHEJAR,1,[Define to 1 if session-caching code should be used])
920fi
921
922dnl --------------------------------------------------------------------------
923AC_MSG_CHECKING(if address-list page should be used)
924CF_ARG_DISABLE(addrlist-page,
925[  --disable-addrlist-page disable address-list page],
926	[use_addrlist_page=$enableval],
927	[use_addrlist_page=yes])
928AC_MSG_RESULT($use_addrlist_page)
929test $use_addrlist_page != no && AC_DEFINE(USE_ADDRLIST_PAGE,1,[Define to 1 if address-list page should be used])
930
931dnl --------------------------------------------------------------------------
932AC_MSG_CHECKING(if experimental CJK logic should be used)
933CF_ARG_ENABLE(cjk,
934[  --enable-cjk            use experimental CJK logic],
935	[use_cjk=$enableval],
936	[use_cjk=no])
937AC_MSG_RESULT($use_cjk)
938test $use_cjk != no && AC_DEFINE(CJK_EX,1,[Define to 1 if experimental CJK logic should be used])
939
940dnl --------------------------------------------------------------------------
941AC_MSG_CHECKING(if experimental Japanese UTF-8 logic should be used)
942CF_ARG_ENABLE(japanese-utf8,
943[  --enable-japanese-utf8  use experimental Japanese UTF-8 logic],
944	[use_ja_utf8=$enableval],
945	[use_ja_utf8=no])
946AC_MSG_RESULT($use_ja_utf8)
947if 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	AM_ICONV
950	if test "$USE_NLS" != yes ; then
951	  LIBS="$LIBICONV $LIBS"
952	fi
953fi
954
955use_dft_colors=no
956case $cf_cv_screen in
957(curses|slang|ncurses*)
958	use_dft_colors=maybe
959	;;
960esac
961
962dnl --------------------------------------------------------------------------
963if test "$use_dft_colors" != no ; then
964AC_MSG_CHECKING(if you want to use default-colors)
965CF_ARG_ENABLE(default-colors,
966[  --enable-default-colors enable use of default-colors (ncurses/slang)],
967	[use_dft_colors=yes],
968	[use_dft_colors=no])
969AC_MSG_RESULT($use_dft_colors)
970test $use_dft_colors = "yes" && AC_DEFINE(USE_DEFAULT_COLORS,1,[Define to 1 if you want to use default-colors])
971fi
972
973dnl --------------------------------------------------------------------------
974AC_MSG_CHECKING(if experimental keyboard-layout logic should be used)
975CF_ARG_ENABLE(kbd-layout,
976[  --enable-kbd-layout     use experimental keyboard-layout support],
977	[use_kbd_layout=$enableval],
978	[use_kbd_layout=no])
979AC_MSG_RESULT($use_kbd_layout)
980test $use_kbd_layout != no && AC_DEFINE(EXP_KEYBOARD_LAYOUT,1,[Define to 1 if experimental keyboard-layout logic should be used])
981
982dnl --------------------------------------------------------------------------
983AC_MSG_CHECKING(if experimental nested-table logic should be used)
984CF_ARG_ENABLE(nested-tables,
985[  --enable-nested-tables  use experimental nested-table support],
986	[use_nested_tables=$enableval],
987	[use_nested_tables=no])
988AC_MSG_RESULT($use_nested_tables)
989test $use_nested_tables != no && AC_DEFINE(EXP_NESTED_TABLES,1,[Define to 1 if experimental nested-table logic should be used])
990
991dnl --------------------------------------------------------------------------
992dnl Miscellaneous options that don't need to test system features
993dnl --------------------------------------------------------------------------
994
995CF_HELP_MESSAGE(
996Miscellaneous Options:)
997
998dnl --------------------------------------------------------------------------
999AC_MSG_CHECKING(if alternative line-edit bindings should be used)
1000CF_ARG_DISABLE(alt-bindings,
1001[  --disable-alt-bindings  disable alternative line-edit bindings],
1002	[use_alt_bindings=$enableval],
1003	[use_alt_bindings=yes])
1004AC_MSG_RESULT($use_alt_bindings)
1005test $use_alt_bindings != no && AC_DEFINE(USE_ALT_BINDINGS,1,[Define to 1 if alternative line-edit bindings should be used])
1006
1007dnl --------------------------------------------------------------------------
1008AC_MSG_CHECKING(if ascii case-conversion should be used)
1009CF_ARG_DISABLE(ascii-ctypes,
1010[  --disable-ascii-ctypes  disable use of ascii case-conversion],
1011	[use_ascii_ctypes=$enableval],
1012	[use_ascii_ctypes=yes])
1013AC_MSG_RESULT($use_ascii_ctypes)
1014test $use_ascii_ctypes != no && AC_DEFINE(USE_ASCII_CTYPES,1,[Define to 1 if ascii case-conversion should be used])
1015
1016dnl --------------------------------------------------------------------------
1017AC_MSG_CHECKING(if you want to use extended HTML DTD logic)
1018CF_ARG_DISABLE(extended-dtd,
1019[  --disable-extended-dtd  disable extended HTML DTD logic],
1020	[use_ext_htmldtd=no],
1021	[use_ext_htmldtd=yes])
1022AC_MSG_RESULT($use_ext_htmldtd)
1023test $use_ext_htmldtd = "no" && AC_DEFINE(NO_EXTENDED_HTMLDTD,1,[Define to 1 if you want to use extended HTML DTD logic])
1024
1025dnl --------------------------------------------------------------------------
1026AC_MSG_CHECKING(if file-upload logic should be used)
1027CF_ARG_DISABLE(file-upload,
1028[  --disable-file-upload   disable file-upload support],
1029	[use_file_upload=$enableval],
1030	[use_file_upload=yes])
1031AC_MSG_RESULT($use_file_upload)
1032test $use_file_upload != no && AC_DEFINE(USE_FILE_UPLOAD,1,[Define to 1 if file-upload logic should be used])
1033
1034dnl --------------------------------------------------------------------------
1035AC_MSG_CHECKING(if IDNA support should be used)
1036CF_ARG_DISABLE(idna,
1037[  --disable-idna          disable IDNA support],
1038	[use_idna=$enableval],
1039	[use_idna=yes])
1040AC_MSG_RESULT($use_idna)
1041
1042if test "$use_idna" = yes ; then
1043	CF_WITH_IDNA($use_idna)
1044fi
1045
1046dnl --------------------------------------------------------------------------
1047AC_MSG_CHECKING(if element-justification logic should be used)
1048CF_ARG_DISABLE(justify-elts,
1049[  --disable-justify-elts  disable element-justification logic],
1050	[use_justify_elts=$enableval],
1051	[use_justify_elts=yes])
1052AC_MSG_RESULT($use_justify_elts)
1053test $use_justify_elts != no && AC_DEFINE(USE_JUSTIFY_ELTS,1,[Define to 1 if element-justification logic should be used])
1054
1055dnl --------------------------------------------------------------------------
1056AC_MSG_CHECKING(if partial-display should be used)
1057CF_ARG_DISABLE(partial,
1058[  --disable-partial       disable partial-display logic],
1059	[use_partial_display=$enableval],
1060	[use_partial_display=yes])
1061AC_MSG_RESULT($use_partial_display)
1062test $use_partial_display != no && AC_DEFINE(DISP_PARTIAL,1,[Define to 1 if partial-display should be used])
1063
1064dnl --------------------------------------------------------------------------
1065AC_MSG_CHECKING(if persistent-cookie logic should be used)
1066CF_ARG_DISABLE(persistent-cookies,
1067[  --disable-persistent-cookies  disable persistent-cookie support],
1068	[use_filed_cookies=$enableval],
1069	[use_filed_cookies=yes])
1070AC_MSG_RESULT($use_filed_cookies)
1071test $use_filed_cookies != no && AC_DEFINE(USE_PERSISTENT_COOKIES,1,[Define to 1 if persistent-cookie logic should be used])
1072
1073dnl --------------------------------------------------------------------------
1074AC_MSG_CHECKING(if html source should be colorized)
1075CF_ARG_DISABLE(prettysrc,
1076[  --disable-prettysrc     disable colorization of HTML source],
1077	[use_prettysrc=$enableval],
1078	[use_prettysrc=yes])
1079AC_MSG_RESULT($use_prettysrc)
1080test $use_prettysrc != no && AC_DEFINE(USE_PRETTYSRC,1,[Define to 1 if html source should be colorized])
1081
1082dnl --------------------------------------------------------------------------
1083AC_MSG_CHECKING(if progress-bar code should be used)
1084CF_ARG_DISABLE(progressbar,
1085[  --disable-progressbar   disable progress-bar],
1086	[use_progressbar=$enableval],
1087	[use_progressbar=yes])
1088AC_MSG_RESULT($use_progressbar)
1089test $use_progressbar != no && AC_DEFINE(USE_PROGRESSBAR,1,[Define to 1 if progress-bar code should be used])
1090
1091dnl --------------------------------------------------------------------------
1092AC_MSG_CHECKING(if read-progress message should show ETA)
1093CF_ARG_DISABLE(read-eta,
1094[  --disable-read-eta      disable read-progress message shows ETA],
1095	[use_read_eta=$enableval],
1096	[use_read_eta=yes])
1097AC_MSG_RESULT($use_read_eta)
1098test $use_read_eta != no && AC_DEFINE(USE_READPROGRESS,1,[Define to 1 if read-progress message should show ETA])
1099
1100dnl --------------------------------------------------------------------------
1101AC_MSG_CHECKING(if source caching should be used)
1102CF_ARG_DISABLE(source-cache,
1103[  --disable-source-cache  do not cache HTML source for parse mode changes],
1104	[use_source_cache=$enableval],
1105	[use_source_cache=yes])
1106AC_MSG_RESULT($use_source_cache)
1107test $use_source_cache != no && AC_DEFINE(USE_SOURCE_CACHE,1,[Define to 1 if source caching should be used])
1108
1109dnl --------------------------------------------------------------------------
1110AC_MSG_CHECKING(if scrollbar code should be used)
1111CF_ARG_DISABLE(scrollbar,
1112[  --disable-scrollbar     disable scrollbar with mouse],
1113	[use_scrollbar=$enableval],
1114	[use_scrollbar=yes])
1115AC_MSG_RESULT($use_scrollbar)
1116
1117dnl --------------------------------------------------------------------------
1118AC_MSG_CHECKING(if charset-selection logic should be used)
1119CF_ARG_ENABLE(charset-choice,
1120[  --enable-charset-choice use charset-selection logic],
1121	[use_charset_choice=$enableval],
1122	[use_charset_choice=no])
1123AC_MSG_RESULT($use_charset_choice)
1124test $use_charset_choice != no && AC_DEFINE(USE_CHARSET_CHOICE,1,[Define to 1 if charset-selection logic should be used])
1125
1126dnl --------------------------------------------------------------------------
1127AC_MSG_CHECKING(if you want to use external commands)
1128CF_ARG_ENABLE(externs,
1129[  --enable-externs        use external commands],
1130	[use_externs=yes],
1131	[use_externs=no])
1132AC_MSG_RESULT($use_externs)
1133if 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"
1136fi
1137
1138dnl --------------------------------------------------------------------------
1139AC_MSG_CHECKING(if you want to use setfont support)
1140CF_ARG_ENABLE(font-switch,
1141[  --enable-font-switch    use Linux setfont for character-translation],
1142	[use_setfont=yes],
1143	[use_setfont=no])
1144AC_MSG_RESULT($use_setfont)
1145if test $use_setfont = yes ; then
1146	case $host_os in
1147	(linux*)
1148		CF_PATH_PROG(SETFONT, consolechars, setfont)
1149		;;
1150	(os2*)
1151		SETFONT=built-in
1152		CF_VERBOSE(Assume $host_os has font-switching)
1153		;;
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	fi
1164fi
1165
1166dnl --------------------------------------------------------------------------
1167AC_MSG_CHECKING(if you want cgi-link support)
1168CF_ARG_ENABLE(cgi-links,
1169[  --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])])
1171AC_MSG_RESULT($enableval)
1172
1173dnl --------------------------------------------------------------------------
1174AC_MSG_CHECKING(if you want change-exec support)
1175CF_ARG_ENABLE(change-exec,
1176[  --enable-change-exec    allow users to change exec options],
1177	[use_change_exec=yes],
1178	[use_change_exec=no])
1179AC_MSG_RESULT($use_change_exec)
1180test $use_change_exec = yes && AC_DEFINE(ENABLE_OPTS_CHANGE_EXEC,1,[Define to 1 if you want change-exec support])
1181
1182dnl --------------------------------------------------------------------------
1183AC_MSG_CHECKING(if you want exec-links support)
1184CF_ARG_OPTION(exec-links,
1185[  --enable-exec-links     allow lynx to execute programs accessed via a link],
1186	[use_exec_links=$enableval],
1187	[use_exec_links=$enableval],
1188	[$use_change_exec])
1189AC_MSG_RESULT($use_exec_links)
1190test $use_exec_links = yes && AC_DEFINE(EXEC_LINKS,1,[Define to 1 if you want exec-links support])
1191
1192dnl --------------------------------------------------------------------------
1193AC_MSG_CHECKING(if you want exec-scripts support)
1194CF_ARG_OPTION(exec-scripts,
1195[  --enable-exec-scripts   allow lynx to execute programs inferred from a link],
1196	[use_exec_scripts=$enableval],
1197	[use_exec_scripts=$enableval],
1198	[$use_change_exec])
1199AC_MSG_RESULT($use_exec_scripts)
1200test $use_exec_scripts = yes && AC_DEFINE(EXEC_SCRIPTS,1,[Define to 1 if you want exec-scripts support])
1201
1202dnl --------------------------------------------------------------------------
1203AC_MSG_CHECKING(if you want internal-links feature)
1204CF_ARG_ENABLE(internal-links,
1205[  --enable-internal-links handle following links to same doc differently],
1206	[use_internal_links=yes],
1207	[use_internal_links=no])
1208AC_MSG_RESULT($use_internal_links)
1209test $use_internal_links = yes && AC_DEFINE(TRACK_INTERNAL_LINKS,1,[Define to 1 if you want internal-links feature])
1210
1211dnl --------------------------------------------------------------------------
1212AC_MSG_CHECKING(if you want to fork NSL requests)
1213CF_ARG_ENABLE(nsl-fork,
1214[  --enable-nsl-fork       fork NSL requests, allowing them to be aborted],
1215	[use_nsl_fork=yes],
1216	[use_nsl_fork=no])
1217AC_MSG_RESULT($use_nsl_fork)
1218if test $use_nsl_fork = yes ; then
1219	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	esac
1227fi
1228
1229dnl --------------------------------------------------------------------------
1230AC_MSG_CHECKING(if you want to log URL requests via syslog)
1231CF_ARG_ENABLE(syslog,
1232[  --enable-syslog         log URL requests via syslog],
1233	[use_syslog=yes],
1234	[use_syslog=no])
1235AC_MSG_RESULT($use_syslog)
1236test $use_syslog = yes && AC_DEFINE(SYSLOG_REQUESTED_URLS,1,[Define to 1 if you want to log URL requests via syslog])
1237
1238dnl --------------------------------------------------------------------------
1239AC_MSG_CHECKING(if you want to underline links)
1240CF_ARG_ENABLE(underlines,
1241[  --enable-underlines     underline links rather than using boldface],
1242	[use_underline=yes],
1243	[use_underline=no])
1244AC_MSG_RESULT($use_underline)
1245test $use_underline = yes && AC_DEFINE(UNDERLINE_LINKS,1,[Define to 1 if xxx])
1246test $use_underline = no  && AC_DEFINE(UNDERLINE_LINKS,0,[Define to 0 if xxx])
1247
1248dnl --------------------------------------------------------------------------
1249AC_MSG_CHECKING(if help files should be gzip'ed)
1250CF_ARG_ENABLE(gzip-help,
1251[  --enable-gzip-help      install gzip'ed help files],
1252	[use_gzip_help=$enableval],
1253	[use_gzip_help=no])
1254AC_MSG_RESULT($use_gzip_help)
1255
1256dnl --------------------------------------------------------------------------
1257AC_MSG_CHECKING(if you want to use libbz2 for decompression of some bzip2 files)
1258AC_ARG_WITH(bzlib,
1259[  --with-bzlib            use libbz2 for decompression of some bzip2 files],
1260	[use_bzlib=$withval],
1261	[use_bzlib=no])
1262AC_MSG_RESULT($use_bzlib)
1263
1264if 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])
1267fi
1268
1269dnl --------------------------------------------------------------------------
1270AC_MSG_CHECKING(if you want to use zlib for decompression of some gzip files)
1271AC_ARG_WITH(zlib,
1272[  --with-zlib             use zlib for decompression of some gzip files],
1273	[use_zlib=$withval],
1274	[use_zlib=no])
1275AC_MSG_RESULT($use_zlib)
1276
1277if 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])
1280fi
1281
1282dnl --------------------------------------------------------------------------
1283CF_HELP_MESSAGE(
1284Other Network Services:)
1285
1286dnl --------------------------------------------------------------------------
1287AC_MSG_CHECKING(if you want to exclude FINGER code)
1288CF_ARG_DISABLE(finger,
1289[  --disable-finger        disable FINGER logic],
1290	[use_finger=yes],
1291	[use_finger=no])
1292AC_MSG_RESULT($use_finger)
1293test $use_finger != "no" && AC_DEFINE(DISABLE_FINGER,1,[Define to 1 if you want to exclude FINGER code])
1294
1295dnl --------------------------------------------------------------------------
1296AC_MSG_CHECKING(if you want to exclude GOPHER code)
1297CF_ARG_DISABLE(gopher,
1298[  --disable-gopher        disable GOPHER logic],
1299	[use_gopher=yes],
1300	[use_gopher=no])
1301AC_MSG_RESULT($use_gopher)
1302test $use_gopher != "no" && AC_DEFINE(DISABLE_GOPHER,1,[Define to 1 if you want to exclude GOPHER code])
1303
1304dnl --------------------------------------------------------------------------
1305AC_MSG_CHECKING(if you want to exclude NEWS code)
1306CF_ARG_DISABLE(news,
1307[  --disable-news          disable NEWS logic],
1308      [use_news=yes],
1309      [use_news=no])
1310AC_MSG_RESULT($use_news)
1311test $use_news != "no" && AC_DEFINE(DISABLE_NEWS,1,[Define to 1 if you want to exclude NEWS code])
1312
1313dnl --------------------------------------------------------------------------
1314AC_MSG_CHECKING(if you want to exclude FTP code)
1315CF_ARG_DISABLE(ftp,
1316[  --disable-ftp           disable FTP logic],
1317      [use_ftp=yes],
1318      [use_ftp=no])
1319AC_MSG_RESULT($use_ftp)
1320test $use_ftp != "no" && AC_DEFINE(DISABLE_FTP,1,[Define to 1 if you want to exclude FTP code])
1321
1322dnl --------------------------------------------------------------------------
1323AC_MSG_CHECKING(if you want to include WAIS code)
1324CF_ARG_ENABLE(wais,
1325[  --enable-wais           enable WAIS logic],
1326      [use_wais=yes],
1327      [use_wais=no])
1328AC_MSG_RESULT($use_wais)
1329
1330MAKE_WAIS="#"
1331if test $use_wais != "no"
1332then
1333	AC_CHECK_LIB(wais,fs_free,[
1334		CF_MATH_LIB
1335		CF_ADD_LIB(wais)
1336		AC_CHECK_HEADERS(wais.h)
1337		MAKE_WAIS=
1338		],[AC_MSG_WARN(could not find WAIS library)])
1339fi
1340AC_SUBST(MAKE_WAIS)
1341
1342dnl --------------------------------------------------------------------------
1343dnl DirEd (directory-editor) options
1344dnl --------------------------------------------------------------------------
1345
1346CF_HELP_MESSAGE(
1347Directory Editor Options:)
1348
1349# All DirEd functions that were enabled on compilation can be disabled
1350# or modified at run time via DIRED_MENU symbols in lynx.cfg.
1351AC_MSG_CHECKING(if directory-editor code should be used)
1352CF_ARG_DISABLE(dired,
1353[  --disable-dired          disable optional directory-editor, DirEd],
1354	[use_dired=$enableval],
1355	[use_dired=yes])
1356AC_MSG_RESULT($use_dired)
1357
1358if 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	AC_MSG_CHECKING(if you wish to allow extracting from archives via DirEd)
1363	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	AC_MSG_RESULT($enableval)
1366
1367	AC_MSG_CHECKING(if DirEd mode should override keys)
1368	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	AC_MSG_RESULT($enableval)
1371
1372	AC_MSG_CHECKING(if you wish to allow permissions commands via DirEd)
1373	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	AC_MSG_RESULT($enableval)
1376
1377	AC_MSG_CHECKING(if you wish to allow executable-permission commands via DirEd)
1378	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	AC_MSG_RESULT($enableval)
1381
1382	AC_MSG_CHECKING(if you wish to allow "tar" commands from DirEd)
1383	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	AC_MSG_RESULT($enableval)
1386
1387	AC_MSG_CHECKING(if you wish to allow "uudecode" commands from DirEd)
1388	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	AC_MSG_RESULT($enableval)
1391
1392	AC_MSG_CHECKING(if you wish to allow "zip" and "unzip" commands from DirEd)
1393	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	AC_MSG_RESULT($enableval)
1396
1397	AC_MSG_CHECKING(if you wish to allow "gzip" and "gunzip" commands from DirEd)
1398	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	AC_MSG_RESULT($enableval)
1401fi
1402
1403dnl --------------------------------------------------------------------------
1404AC_MSG_CHECKING(if you want long-directory listings)
1405CF_ARG_DISABLE(long-list,
1406[  --disable-long-list     disable long "ls -l" directory listings],,
1407	[AC_DEFINE(LONG_LIST,1,[Define to 1 if you want long-directory listings])])
1408AC_MSG_RESULT($enableval)
1409
1410dnl --------------------------------------------------------------------------
1411AC_MSG_CHECKING(if parent-directory references are permitted)
1412CF_ARG_DISABLE(parent-dir-refs,
1413[  --disable-parent-dir-refs
1414                          disable "Up-to" links in directory listings],
1415	[AC_DEFINE(NO_PARENT_DIR_REFERENCE,1,[Define to 1 if parent-directory references are permitted])])
1416AC_MSG_RESULT($enableval)
1417
1418dnl --------------------------------------------------------------------------
1419CF_PATH_PROG(TELNET,	telnet)
1420CF_PATH_PROG(TN3270,	tn3270)
1421CF_PATH_PROG(RLOGIN,	rlogin)
1422
1423CF_PATH_PROG(MV,	mv)
1424
1425CF_PATH_PROG(GZIP,	gzip)
1426CF_PATH_PROG(UNCOMPRESS,gunzip)
1427CF_PATH_PROG(UNZIP,	unzip)
1428CF_PATH_PROG(BZIP2,	bzip2)
1429
1430CF_PATH_PROG(TAR,	tar, pax gtar gnutar bsdtar star)
1431CF_TAR_OPTIONS($TAR)
1432AC_DEFINE_UNQUOTED(TAR_UP_OPTIONS,   "$TAR_UP_OPTIONS",[Define to command for tar'ing up files])
1433AC_DEFINE_UNQUOTED(TAR_DOWN_OPTIONS, "$TAR_DOWN_OPTIONS",[Define to command for untar'ing files])
1434AC_DEFINE_UNQUOTED(TAR_FILE_OPTIONS, "$TAR_FILE_OPTIONS",[Define to options for tar to work with files])
1435AC_DEFINE_UNQUOTED(TAR_PIPE_OPTIONS, "$TAR_PIPE_OPTIONS",[Define to options for tar to work with pipes])
1436
1437dnl --------------------------------------------------------------------------
1438dnl Test features that rely on configure-definitions
1439dnl --------------------------------------------------------------------------
1440if test ".$use_dired" != ".no" ; then
1441
1442CF_PATH_PROG(COMPRESS,	compress)
1443CF_PATH_PROG(RM,	rm)
1444CF_PATH_PROG(UUDECODE,	uudecode)
1445CF_PATH_PROG(ZCAT,	zcat)
1446CF_PATH_PROG(ZIP,	zip)
1447
1448dnl 'INSTALL' is a special case, since the configure script has to find a
1449dnl BSD-compatible one so the build/install works properly.
1450case "$INSTALL" in
1451($srcdir*)
1452	AC_DEFINE_UNQUOTED(INSTALL_PATH,"install")
1453	;;
1454(*)
1455	cf_save_INSTALL="$INSTALL"
1456	CF_PATH_PROG(INSTALL,	install)
1457	INSTALL="$cf_save_INSTALL"
1458	;;
1459esac
1460fi
1461
1462COMPRESS_PROG=
1463COMPRESS_EXT=
1464if test $use_gzip_help = yes ; then
1465	COMPRESS_PROG="$ac_cv_path_GZIP -9 -n"
1466	COMPRESS_EXT=.gz
1467fi
1468AC_SUBST(COMPRESS_PROG)
1469AC_SUBST(COMPRESS_EXT)
1470
1471if test $cf_cv_screen = pdcurses ; then
1472	CF_HELP_MESSAGE(Special Libraries for PDCurses X11:)
1473	case $host_os in
1474	(mingw*)
1475		CF_PDCURSES_W32
1476		;;
1477	(*)
1478		CF_PDCURSES_X11
1479		;;
1480	esac
1481else
1482	CF_TERMIO_AND_CURSES(LYCurses.h)
1483fi
1484
1485### These tests must be run after establishing the curses library.
1486if test $cf_cv_screen != slang ; then
1487	if test $cf_cv_screen != pdcurses ; then
1488		AC_CHECK_HEADERS($cf_cv_screen/term.h term.h)
1489	fi
1490	CF_ALT_CHAR_SET
1491	CF_FANCY_CURSES
1492	CF_FUNC_CURSES_VERSION
1493	CF_NCURSES_BROKEN
1494	CF_COLOR_CURSES
1495	CF_SIZECHANGE
1496	CF_TTYTYPE
1497	if test "$use_wide_curses" = yes ; then
1498		CF_WIDEC_CURSES
1499	fi
1500	CF_CURSES_FUNCS( \
1501		assume_default_colors \
1502		cbreak \
1503		define_key \
1504		delscreen \
1505		getattrs \
1506		getbegx \
1507		getbegy \
1508		keypad \
1509		napms \
1510		newpad \
1511		newterm \
1512		pnoutrefresh \
1513		resizeterm \
1514		touchline \
1515		touchwin \
1516		use_default_colors \
1517		use_legacy_coding \
1518		wattr_get \
1519		wborder \
1520		wredrawln \
1521		wresize \
1522		)
1523	AC_CHECK_FUNCS( \
1524		_nc_free_and_exit \
1525		_nc_freeall \
1526		)
1527fi
1528
1529if test $use_color_style != no ; then
1530	if test .$cf_cv_color_curses != .yes ; then
1531		AC_ERROR(Configuration does not support color-styles)
1532	fi
1533	if test $cf_cv_screen = slang ; then
1534		AC_ERROR(Configuration does not support color-styles)
1535	fi
1536fi
1537
1538if test $use_scrollbar != no ; then
1539	if test .$cf_cv_fancy_curses != .yes ; then
1540		AC_MSG_WARN(Configuration does not support ACS_xxx definitions)
1541	else
1542		AC_DEFINE(USE_SCROLLBAR,1,[Define to 1 if configuration supports ACS_xxx definitions])
1543	fi
1544fi
1545
1546# use rpath for libraries in unusual places
1547CF_DISABLE_RPATH_HACK
1548
1549### Finally, build config.h and the makefiles
1550test -z "$CONFIG_SHELL" && CONFIG_SHELL=/bin/sh
1551AC_SUBST(CONFIG_SHELL)
1552
1553CFLAGS="$CFLAGS $EXTRA_CFLAGS"
1554srcdir="$srcdir"
1555SRCDIR_CLEAN="#"
1556if test -n "$srcdir" ; then
1557	echo srcdir is $srcdir
1558	mkdir -p WWW/Library/Implementation
1559	mkdir -p src/chrtrans
1560	test "$USE_INCLUDED_LIBINTL" = yes && mkdir -p intl
1561	test "$srcdir" != "." && SRCDIR_CLEAN=""
1562fi
1563
1564HOMEPAGE_URL="https://lynx.invisible-island.net/"
1565AC_DEFINE_UNQUOTED(HOMEPAGE_URL,"$HOMEPAGE_URL",[Define to Lynx homepage URL])
1566AC_SUBST(HOMEPAGE_URL)
1567
1568AC_SUBST(SRCDIR_CLEAN)
1569AC_OUTPUT(
1570	[makefile \
1571	WWW/Library/Implementation/makefile \
1572	src/makefile \
1573	src/chrtrans/makefile \
1574	$SUB_MAKEFILE
1575	],[
1576	if test "$USE_NLS" = yes ; then
1577	if test "$use_our_messages" = yes ; then
1578		echo creating po/makefile
1579		rm -f	po/temp$$
1580		sed	-e 's%^.*LYMessages.c%	../LYMessages.c%' \
1581			-e '$s/\\//' po/POTFILES >po/temp$$
1582		sed	-e "/POTFILES =/r po/temp$$" \
1583			po/makefile.in > po/makefile
1584		rm -f	po/temp$$
1585	fi
1586	fi
1587	],[
1588	USE_NLS=$USE_NLS
1589	use_our_messages=$use_our_messages
1590	]
1591)
1592