forked from ThomasDickey/lynx-snapshots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
1659 lines (1464 loc) · 52.5 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
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
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
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
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl $LynxId: configure.in,v 1.383 2024/09/15 20:17:44 tom Exp $
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
dnl created jan/1997
dnl by T.E.Dickey <[email protected]>
dnl and Jim Spath <[email protected]>
dnl
dnl ---------------------------------------------------------------------------
dnl Copyright 1997-2023,2024 by Thomas E. Dickey
dnl
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.
dnl
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 ---------------------------------------------------------------------------
dnl
AC_REVISION($Revision: 1.383 $)
AC_PREREQ(2.52.20231210)
AC_INIT(lynx,2.9.2g,[email protected])
AC_CONFIG_SRCDIR(userdefs.h)
echo "Configuring $PACKAGE_NAME version $PACKAGE_VERSION"
# 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.
rm -f config.cache
# 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
CONFIG_H=lynx_cfg.h
AC_CONFIG_HEADER($CONFIG_H:config.hin)
AC_SUBST(CONFIG_H)
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])
AC_ARG_PROGRAM
PACKAGE=$PACKAGE_NAME
VERSION=$PACKAGE_VERSION
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
NO_DOTS_VERSION=`echo "$PACKAGE_VERSION" | sed -e 's,\.,-,g'`
AC_SUBST(NO_DOTS_VERSION)
AC_MSG_CHECKING(for DESTDIR)
CF_WITH_PATH(destdir,
[ --with-destdir=XXX set DESTDIR destination for install],
DESTDIR,
[$DESTDIR],
[$DESTDIR])
AC_MSG_RESULT($DESTDIR)
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
dnl detected by AC_PROG_CC.
case "$host_os" in
(openedition)
: ${CFLAGS="-D_ALL_SOURCE -Wl,EDIT=NO"}
: ${CC=c89}
;;
esac
CF_PROG_CC
AC_C_INLINE
CF_PROG_CPP_COMMENTS
AC_PROG_LN_S
case "$host_os" in
(mingw*)
LN_S="cp -p"
AC_MSG_RESULT(Override: No symbolic links in mingw.)
;;
(*)
;;
esac
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_YACC
AC_PROG_EGREP
CF_PROG_LINT
CF_MAKEFLAGS
CF_MAKE_PHONY
CF_MAKE_TAGS
CF_ACVERSION_CHECK(2.52,
[AC_PATH_TOOL(WINDRES, windres, none)],
[AC_PATH_PROG(WINDRES, windres, none)])
CF_BUILD_CC([#],[])
CF_PROG_RANLIB
CF_AR_FLAGS
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)
test "$with_leak_checks" = "yes" && AC_DEFINE(LY_FIND_LEAKS,1,[Define to 1 if you want to check memory-leaks])
# 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.
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
(ultrix*|osf*)
test -z "$ORIGINAL_CFLAGS" && CF_STRIP_O_OPT(CFLAGS)
if test -z "$GCC" ; then
CFLAGS="$CFLAGS -g3"
fi
;;
esac
else
case "$host_os" in
(osf*)
test -z "$GCC" && CFLAGS="$CFLAGS -std1"
test -z "$ORIGINAL_CFLAGS" && CF_STRIP_G_OPT(CFLAGS)
;;
(*)
test -z "$ORIGINAL_CFLAGS" && CF_STRIP_G_OPT(CFLAGS)
;;
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)
test "$with_trace" = no && AC_DEFINE(NO_LYNX_TRACE,1,[Define to 1 if you want to enable lynx trace code])
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)
test "$with_vertrace" = yes && AC_DEFINE(LY_TRACELINE,__LINE__,[Define to __LINE__ if you want verbose trace code])
CF_WITH_SCREEN_PDCURSES
CF_ENABLE_WARNINGS
CF_WITH_DBMALLOC
CF_WITH_DMALLOC
dnl --------------------------------------------------------------------------
dnl Checks for compiler & standard-library characteristics
dnl --------------------------------------------------------------------------
dnl If we're able to run this script, this is true!
AC_DEFINE(UNIX,1,[Define to 1 if we can run a configure script])
dnl Only add to this case statement things that we cannot design tests for.
TRY_CFLAGS=
case "$host_os" in
(aix4*)
TRY_CFLAGS="$TRY_CFLAGS -DAIX4 -D_BSD=44 -D_AIX"
LIBS="$LIBS -lbsd"
;;
(aix*)
TRY_CFLAGS="$TRY_CFLAGS -D_ACS_COMPAT_CODE"
LIBS="$LIBS -lbsd"
;;
(apollo*)
TRY_CFLAGS="$TRY_CFLAGS -D_BUILTINS -W0,-opt,4"
;;
(bsdi*)
TRY_CFLAGS="$TRY_CFLAGS -DBSDI"
;;
(clix*)
# Tested on CLIX 3.1 (T.Dickey). The original makefile entry
# contributed by Alex Matulich ([email protected]) also
# references -lmalloc and -lbsd.
AC_CHECK_LIB(c_s,strcmp)
;;
(convex*)
TRY_CFLAGS="$TRY_CFLAGS -D__STDC__ -Dunix"
;;
(cygwin*)
TRY_CFLAGS="$TRY_CFLAGS -DWIN_EX -D_WINDOWS_NSL"
LIBS="$LIBS -luser32"
;;
(hpux*)
TRY_CFLAGS="$TRY_CFLAGS -D_XOPEN_SOURCE_EXTENDED"
test -z "$GCC" && TRY_CFLAGS="$TRY_CFLAGS -Wp,-H600000 -DSYS_HPUX"
;;
(isc*)
# -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"
;;
(irix6.*)
TRY_CFLAGS="$TRY_CFLAGS -DSYS_IRIX64"
;;
(irix*)
# 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.
;;
(linux*)
TRY_CFLAGS="$TRY_CFLAGS -DLINUX"
;;
(mingw*)
# put these directly in CPPFLAGS since they will not work in lynx_cfg.h
CF_ADD_CFLAGS(\
-DDOSPATH \
-DNOSIGHUP \
-DNOUSERS \
-DWIN32_LEAN_AND_MEAN \
-DWIN_EX \
-D_CONSOLE \
-D_GNU_SOURCE \
-D_MBCS \
-D_WINDOWS \
-D_WIN_CC \
-D__WIN32__ \
)
EXTRA_OBJS="$EXTRA_OBJS Xsystem\$o"
AC_CHECK_LIB(ssp,__chk_fail)
;;
(msdosdjgpp*)
LIBS="$LIBS -lwatt"
TRY_CFLAGS="$TRY_CFLAGS -DDOSPATH -DNOUSERS"
;;
(next*)
TRY_CFLAGS="$TRY_CFLAGS -DNEXT"
;;
(osf4*)
# The -Olimit flag (see below) is no longer available with
# Digital C 5.2, which is bundled with Digital UNIX 4.0.
TRY_CFLAGS="$TRY_CFLAGS -DDSYS5 -DSYS_TRU64"
;;
(osf*)
# Increase the maximum size of functions that will be optimized.
test -z "$GCC" && TRY_CFLAGS="$TRY_CFLAGS -O -Olimit 4000"
TRY_CFLAGS="$TRY_CFLAGS -DDSYS5 -DSYS_TRU64"
;;
(sco3.2v5*)
test "$ac_cv_prog_gcc" != yes && TRY_CFLAGS="$TRY_CFLAGS -belf"
;;
(sco*)
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).
case "$CC" in
(cc|*/cc)
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
;;
(sequent-ptx)
TRY_CFLAGS="$TRY_CFLAGS -DSVR4_BSDSELECT -DNO_IOCTL -DUSE_FCNTL"
;;
(sequent-ptx2)
TRY_CFLAGS="$TRY_CFLAGS -DSVR4_BSDSELECT"
;;
(sony-newsos*)
TRY_CFLAGS="$TRY_CFLAGS -I/usr/sony/include"
AC_CHECK_HEADERS(jcurses.h)
;;
(svr4)
TRY_CFLAGS="$TRY_CFLAGS -DSVR4_BSDSELECT -DSVR4"
;;
(sunos3*)
TRY_CFLAGS="$TRY_CFLAGS -DSUN"
;;
(sunos4*)
TRY_CFLAGS="$TRY_CFLAGS -DSUN -DSUN4"
;;
(ultrix*)
# 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,
[AC_DEFINE(HAVE_CURSESX_H,1,[Define to 1 if we have cursesX.h])
cf_cv_ncurses_header=cursesX.h])
;;
esac
case "$host_os" in
(mingw*)
EXTRA_OBJS="$EXTRA_OBJS LYIcon\$o"
;;
esac
CF_ANSI_CC_REQD
CF_XOPEN_SOURCE(500,199506L)
CF_LARGEFILE
AC_CHECK_DECL(exit)
dnl --------------------------------------------------------------------------
dnl --------------------------------------------------------------------------
CF_HELP_MESSAGE(
Basic Configuration Options:)
dnl --------------------------------------------------------------------------
dnl internationalization macros
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/*//'`
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
fi
CF_BUNDLED_INTL(makefile,disable)
CF_WITH_PATH(nls-datadir,
[ --with-nls-datadir=DIR NLS data, parent of locale],
NLS_DATADIR,
[PREFIX/DATADIR],
[$prefix/$DATADIRNAME])
dnl --------------------------------------------------------------------------
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)
test "$with_full_paths" = no && AC_DEFINE(USE_EXECVP,1,[Define to 1 if you want full utility pathnames])
CF_DEFINE_PROG(system mailer, SYSTEM_MAIL,
/usr/mmdf/bin/submit \
/usr/sbin/sendmail \
/usr/lib/sendmail \
)
CF_SYSTEM_MAIL_FLAGS
if test -n "$SYSTEM_MAIL" ; then
if test "$with_full_paths" = no ; then
SYSTEM_MAIL=`basename "$SYSTEM_MAIL"`
fi
fi
dnl --------------------------------------------------------------------------
CF_SIGWINCH
CF_PKG_CONFIG
dnl Collect tests for compiler options into one place
if test -n "$TRY_CFLAGS" ; then
CF_CHECK_CFLAGS($TRY_CFLAGS)
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.
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])
])
AC_CACHE_CHECK(if you want ssl library,cf_cv_use_libssl,[
AC_ARG_WITH(ssl,
[ --with-ssl{=path} link with ssl library if available],
[cf_cv_use_libssl=$withval],
[cf_cv_use_libssl=no])
])
AC_CACHE_CHECK(if you want gnutls support,cf_cv_use_libgnutls,[
AC_ARG_WITH(gnutls,
[ --with-gnutls{=path} link with gnutls support],
[cf_cv_use_libgnutls=$withval],
[cf_cv_use_libgnutls=no])
])
# 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,
[ --enable-gnutls-compat link with gnutls-openssl compat],
[cf_cv_gnutls_compat=$enableval],
[cf_cv_gnutls_compat=no])
])
AC_CACHE_CHECK(if you want socks library,cf_cv_use_libsocks,[
AC_ARG_WITH(socks,
[ --with-socks{=path} link with socks library if available],
[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,
[ --with-socks5{=path} link with socks5 library if available],
[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_cv_socks_lib=no
CF_NETLIBS
fi
# dante(socks5) interferes with configure-checks
if test "x$cf_cv_socks_lib" != xno ; then
LIBS=`echo "x$LIBS" | sed -e "s,x-l$cf_cv_socks_lib[ ][ ]*,,"`
fi
CF_INET_ADDR
if test "x$cf_cv_use_libssl" != xno ; then
CF_SSL($cf_cv_use_libssl)
elif test "x$cf_cv_use_libgnutls" != xno ; then
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
elif test "x$cf_cv_use_libnss_compat" != xno ; then
CF_NSS_COMPAT($cf_cv_use_libnss_compat)
fi
dnl --------------------------------------------------------------------------
### check for ipv6 support
AC_MSG_CHECKING([whether to enable ipv6])
CF_ARG_ENABLE(ipv6,
[ --enable-ipv6 use ipv6 (with ipv4) support],
[AC_DEFINE(ENABLE_IPV6,1,[Define to 1 if we should enable ipv6])])
AC_MSG_RESULT($enableval)
if test "$enableval" = "yes"; then
CF_CHECK_IPV6
fi
dnl AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
dnl --------------------------------------------------------------------------
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,
[ --with-screen=XXX select screen type (XXX is curses (default),
ncurses, ncursesw, pdcurses or slang)],
[
case "$withval" in
(curses|ncurses*|pdcurses|slang)
cf_cv_screen=$withval
;;
(*) AC_ERROR(Unexpected value $withval)
;;
esac],
[cf_cv_screen=curses])])
case "$cf_cv_screen" in
(curses|ncurses*)
CF_WITH_CURSES_DIR
;;
esac
cf_wide_curses=no
dft_color_style=yes
case "$cf_cv_screen" in
(curses)
CF_CURSES_CONFIG
CF_CURS_PERFORMANCE
CF_CURS_TOUCHLINE
;;
(ncursesw*)
CF_UTF8_LIB
CF_NCURSES_CONFIG($cf_cv_screen)
cf_wide_curses=yes
;;
(ncurses*)
CF_NCURSES_CONFIG($cf_cv_screen)
;;
(pdcurses)
case "$host_os" in
(mingw*)
cf_cv_ncurses_header=curses.h
;;
(*)
cf_cv_ncurses_header=xcurses.h
# do this last, since it changes definition of main: CF_PDCURSES_X11
;;
esac
;;
(slang)
CF_SLANG_UNIX_DEFS
dft_color_style=no
;;
esac
CF_TRY_RPATH
CF_CURSES_CHTYPE
AC_MSG_CHECKING(if you want the wide-curses features)
CF_ARG_ENABLE(widec,
[ --enable-widec enable wide-curses features],
[use_wide_curses=$enableval],
[use_wide_curses=$cf_wide_curses])
AC_MSG_RESULT($use_wide_curses)
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
(no)
AC_MSG_RESULT(no)
INSTALL_LSS=
;;
(*)
AC_DEFINE(USE_COLOR_STYLE,1,[Define to 1 if we should enable color-style])
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=
AC_DEFINE_UNQUOTED(LYNX_LSS_FILE,"$LYNX_LSS_FILE",[Define to default path for Lynx lss-file])
INSTALL_LSS=install-lss
;;
esac
AC_SUBST(INSTALL_LSS)
dnl --------------------------------------------------------------------------
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)
AC_MSG_RESULT($LYNX_CFG_FILE)
test "$LYNX_CFG_FILE" = no && LYNX_CFG_FILE=
AC_DEFINE_UNQUOTED(LYNX_CFG_FILE,"$LYNX_CFG_FILE",[Define to default path for Lynx cfg-file])
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" && 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])
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=''
LYNXCFG_NO_MAKE=''
if test "$use_htmlized_cfg" = no ; then
LYNXCFG_MAKE='#'
else
LYNXCFG_NO_MAKE='#'
fi
AC_SUBST(LYNXCFG_MAKE)
AC_SUBST(LYNXCFG_NO_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)
MIME_LIBDIR=`echo "$MIME_LIBDIR" | sed -e 's,/$,,' -e 's,$,/,'`
AC_DEFINE_UNQUOTED(MIME_LIBDIR,"$MIME_LIBDIR",[Define to default path for MIME library])
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if locale-charset selection logic should be used)
CF_ARG_DISABLE(locale-charset,
[ --disable-locale-charset use locale-charset selection logic],
[use_locale_charset=$enableval],
[use_locale_charset=yes])
AC_MSG_RESULT($use_locale_charset)
test "$use_locale_charset" != no && AC_DEFINE(USE_LOCALE_CHARSET,1,[Define to 1 if locale-charset selection logic should be used])
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)
AC_DEFINE(ALL_CHARSETS,0,[Define to 0 if xxx])
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-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_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 \
sys/fcntl.h \
sys/filio.h \
sys/ioctl.h \
sys/param.h \
sys/timeb.h \
sys/time.h \
syslog.h \
termio.h \
termios.h \
vfork.h \
wchar.h \
)
CF_TERMIO_AND_TERMIOS
CF_FUNC_SIGACTION
CF_FUNC_WAIT
AC_TYPE_GETGROUPS
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_UID_T
AC_TYPE_MODE_T
CF_CHECK_TYPE(ssize_t, int)
CF_CHECK_TYPE(socklen_t, int, [
#include <sys/types.h>
#include <sys/socket.h>
])
CF_TYPE_LONG_LONG
CF_TM_GMTOFF
CF_CHECK_SIZEOF(int,4)
CF_CHECK_SIZEOF(long,4)
CF_CHECK_SIZEOF(off_t,4)
CF_CHECK_SIZEOF(size_t,4)
CF_CHECK_SIZEOF(time_t,4)
AC_CHECK_TYPE(intptr_t, long)
dnl --------------------------------------------------------------------------
dnl Checks for library units
dnl --------------------------------------------------------------------------
AC_FUNC_ALLOCA
AC_FUNC_VFORK
CF_FIONBIO
CF_REMOVE_BROKEN
CF_FUNC_LSTAT
CF_FUNC_GETPWUID
CF_PW_GECOS
CF_FUNC_VASPRINTF
AC_CHECK_FUNCS( \
atoll \
ctermid \
cuserid \
ftime \
getcwd \
getgroups \
gettimeofday \
getuid \
popen \
putenv \
readdir \
setuid \
truncate \
ttyname \
unsetenv \
sleep \
usleep \
waitpid \
)
AC_CHECK_FUNCS( \
mkdtemp,,[AC_CHECK_FUNCS(mktemp)]
)
AC_REPLACE_FUNCS( \
mktime \
strstr \
wcwidth \
)
CF_SRAND(lynx_)
CF_CHECK_FUNCDECLS([
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
], sleep)
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
AC_CHECK_FUNCS(strerror,,[CF_SYS_ERRLIST])
CF_UTMP
CF_CHECK_EXTERN_DATA(h_errno,int)
AC_SUBST(EXTRA_OBJS)
dnl --------------------------------------------------------------------------
dnl Experimental options that don't need to test system features
dnl --------------------------------------------------------------------------
CF_HELP_MESSAGE(
Experimental Options:)
dnl --------------------------------------------------------------------------
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)
test "$use_bibp_urls" = no && AC_DEFINE(DISABLE_BIBP,1,[Define to 1 if bibp: URLs should be supported])
dnl --------------------------------------------------------------------------
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)
test "$use_config_info" = no && AC_DEFINE(NO_CONFIG_INFO,1,[Define to 1 if configuration info should be browsable])
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if new-style forms-based options screen should be used)
CF_ARG_DISABLE(forms-options,
[ --disable-forms-options disable forms-based options],
[use_forms_options=$enableval],
[use_forms_options=yes])
AC_MSG_RESULT($use_forms_options)
test "$use_forms_options" = no && AC_DEFINE(NO_OPTION_FORMS,1,[Define to 1 if new-style forms-based options screen should be used])
dnl --------------------------------------------------------------------------
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)
test "$use_menu_options" = no && AC_DEFINE(NO_OPTION_MENU,1,[Define to 1 if old-style options menu should be used])
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if sessions code should be used)
CF_ARG_DISABLE(sessions,
[ --disable-sessions use sessions code],
[use_sessions=$enableval],
[use_sessions=yes])
AC_MSG_RESULT($use_sessions)
if test "$use_sessions" != no ; then
AC_DEFINE(USE_SESSIONS,1,[Define to 1 if sessions code should be used])
EXTRA_OBJS="$EXTRA_OBJS LYSession\$o"
fi
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if session-caching code should be used)
CF_ARG_DISABLE(session-cache,
[ --disable-session-cache use session-caching code],
[use_session_cache=$enableval],
[use_session_cache=yes])
AC_MSG_RESULT($use_session_cache)
if test "$use_session_cache" != no ; then
AC_DEFINE(USE_CACHEJAR,1,[Define to 1 if session-caching code should be used])
fi
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if address-list page should be used)
CF_ARG_DISABLE(addrlist-page,
[ --disable-addrlist-page disable address-list page],
[use_addrlist_page=$enableval],
[use_addrlist_page=yes])
AC_MSG_RESULT($use_addrlist_page)
test "$use_addrlist_page" != no && AC_DEFINE(USE_ADDRLIST_PAGE,1,[Define to 1 if address-list page should be used])
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if support for CJK should be used)
CF_ARG_DISABLE(cjk,
[ --disable-cjk do not use CJK logic],
[use_cjk=$enableval],
[use_cjk=yes])
AC_MSG_RESULT($use_cjk)
test "$use_cjk" != no && AC_DEFINE(CJK_EX,1,[Define to 1 if CJK logic should be used])
use_cjk_utf8=no
AM_ICONV
if test "x$am_cv_func_iconv" = "xyes"
then
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if experimental support for Chinese UTF-8 should be used)
CF_ARG_ENABLE(chinese-utf8,
[ --enable-chinese-utf8 use Chinese UTF-8 logic],
[use_cn_utf8=$enableval],
[use_cn_utf8=yes])
AC_MSG_RESULT($use_cn_utf8)
if test "$use_cn_utf8" != no ; then
AC_DEFINE(EXP_CHINESEUTF8_SUPPORT,1,[Define to 1 if Chinese UTF-8 logic should be used])
use_cjk_utf8=yes
fi
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if support for Japanese UTF-8 should be used)
CF_ARG_DISABLE(japanese-utf8,
[ --disable-japanese-utf8 do not use Japanese UTF-8 logic],
[use_ja_utf8=$enableval],
[use_ja_utf8=yes])
AC_MSG_RESULT($use_ja_utf8)
if test "$use_ja_utf8" != no ; then
AC_DEFINE(USE_JAPANESEUTF8_SUPPORT,1,[Define to 1 if Japanese UTF-8 logic should be used])
use_cjk_utf8=yes
fi
dnl --------------------------------------------------------------------------
if test $use_cjk_utf8 = yes
then
if test "$USE_NLS" != yes ; then
LIBS="$LIBICONV $LIBS"
fi
fi
else
CF_VERBOSE(skipping CJK features which depend on iconv)
fi
dnl --------------------------------------------------------------------------
AC_MSG_CHECKING(if experimental wcwidth/UTF-8 logic should be used)
CF_ARG_ENABLE(wcwidth-support,
[ --enable-wcwidth-support use experimental wcwidth/UTF-8 logic],
[use_wcwidth=$enableval],
[use_wcwidth=no])
AC_MSG_RESULT($use_wcwidth)
test "$use_wcwidth" != no && AC_DEFINE(EXP_WCWIDTH_SUPPORT,1,[Define to 1 if experimental wcwidth/UTF-8 logic should be used])
dnl --------------------------------------------------------------------------
use_dft_colors=no
case "$cf_cv_screen" in
(curses|slang|ncurses*)
use_dft_colors=maybe
;;
esac
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)],