about summary refs log tree commit diff stats
path: root/configure.in
blob: e957507b4d9e96db1df7b8c0ca5a8942094fe55d (plain) (blame)
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
dnl Process this file with autoconf to produce a configure script.
dnl written jan/1997
dnl by T.E.Dickey <dickey@clark.net>
dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>

AC_PREREQ(2.12)
AC_INIT(userdefs.h)
AC_CONFIG_HEADER(lynx_cfg.h:config.hin)

AC_PREFIX_DEFAULT(/usr/local)
AC_CANONICAL_HOST

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

AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
AC_PROG_MAKE_SET
CF_MAKE_INCLUDE
AC_PROG_INSTALL

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)

CF_DEFINE_PROG(system mailer, SYSTEM_MAIL,
	/usr/mmdf/bin/submit \
	/usr/sbin/sendmail \
	/usr/lib/sendmail  \
	)
CF_SYSTEM_MAIL_FLAGS

CF_PATH_PROG(CHMOD,	chmod)
CF_PATH_PROG(COMPRESS,	compress)
CF_PATH_PROG(COPY,	cp)
CF_PATH_PROG(GZIP,	gzip)
CF_PATH_PROG(INSTALL,	install)
CF_PATH_PROG(MKDIR,	mkdir)
CF_PATH_PROG(MV,	mv)
CF_PATH_PROG(RM,	rm)
CF_PATH_PROG(TAR,	tar)
CF_PATH_PROG(TOUCH,	touch)
CF_PATH_PROG(UNCOMPRESS,gunzip)
CF_PATH_PROG(UNZIP,	unzip)
CF_PATH_PROG(UUDECODE,	uudecode)
CF_PATH_PROG(ZCAT,	zcat)
CF_PATH_PROG(ZIP,	zip)

dnl --------------------------------------------------------------------------
dnl Checks for compiler & standard-library characteristics
dnl --------------------------------------------------------------------------

dnl If we're able to run this script, this is true!
AC_DEFINE(UNIX)

AC_C_CONST

case $host_os in
aix4*)
	CFLAGS="$CFLAGS -DAIX4 -D_BSD=44" 
	LIBS="$LIBS -lbsd"
	;;
aix*)
	LIBS="$LIBS -lbsd"
	;;
apollo*)
	CFLAGS="$CFLAGS -D_BUILTINS -W0,-opt,4"
	;;
bsdi*)
	CFLAGS="$CFLAGS -DBSDI" 
	;;
convex*)
	CFLAGS="$CFLAGS -D__STDC__ -Dunix"
	;;
dgux*)
	CFLAGS="$CFLAGS -DDGUX" 
	;;
hpux*)
	CFLAGS="$CFLAGS -DSNAKE" 
	;;
isc*)
	# -DPOSIX_JC is necessary, else LYBookmark.c never finds out what a mode_t is.
	CFLAGS="$CFLAGS -DISC -DPOSIX_JC"
	LIBS="$LIBS -linet -lnsl_s -lcposix"
	;;
irix*)
	CFLAGS="$CFLAGS -cckr" 
	;;
linux*)
	CFLAGS="$CFLAGS -DLINUX" 
	;;
next*)
	CFLAGS="$CFLAGS -DNEXT -DXMOSAIC_HACK"
	;;
openbsd*)
	LIBS="$LIBS -lcompat"
	;;
osf*)
	# Increase the maximum size of functions that will be optimized.
	test -z "$GCC" && CFLAGS="$CFLAGS -O -Olimit 4000"
	CFLAGS="$CFLAGS -DDSYS5"
	;;
svr4)
	CFLAGS="$CFLAGS -DSVR4_BSDSELECT -DSVR4"
	;;
sunos3*)
	CFLAGS="$CFLAGS -DSUN"
	;;
sunos4*)
	CFLAGS="$CFLAGS -DSUN -DSUN4"
	;;
ultrix*)
	# Increase the maximum size of functions that will be optimized.
	test -z "$GCC" && CFLAGS="$CFLAGS -O -Olimit 600"
	CFLAGS="$CFLAGS -DULTRIX" 
	;;
esac

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

CF_NETLIBS

AC_MSG_CHECKING(for screen type)
AC_CACHE_VAL(cf_cv_screen,[
AC_ARG_WITH(screen,
[  --with-screen=XXX       select screen type
                          (XXX is curses (default), ncurses or slang)],
	[
case $withval in
curses|ncurses|slang)
	cf_cv_screen=$withval
	;;
*)	AC_ERROR(Unexpected value)
	;;
esac],
	[cf_cv_screen=curses])])
AC_MSG_RESULT($cf_cv_screen)

case $cf_cv_screen in
curses)
	CF_CURSES_LIBS
	CF_CURS_PERFORMANCE
	;;
ncurses)
	CF_NCURSES_CPPFLAGS
	CF_NCURSES_LIBS
	;;
slang)
	CF_TERMCAP_LIBS
	CF_SLANG_CPPFLAGS
	CF_SLANG_LIBS
	;;
esac

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

AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_DIRENT
AC_CHECK_HEADERS( \
	fcntl.h \
	limits.h \
	string.h \
	sys/fcntl.h \
	sys/filio.h \
	sys/ioctl.h \
	sys/param.h \
	sys/time.h \
	termio.h \
	termios.h \
	unistd.h \
)
CF_TERMIO_AND_TERMIOS

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

AC_FUNC_VFORK
CF_REMOVE_BROKEN
AC_CHECK_FUNCS( \
	cuserid \
	getcwd \
	putenv \
)

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

CF_BOOL_DEFS
CF_ERRNO
CF_LOCALE
CF_NGROUPS
CF_SYS_ERRLIST
CF_UTMP

### These tests must be run after establishing the curses library.
if test $cf_cv_screen != slang ; then
	CF_ALT_CHAR_SET
	CF_FANCY_CURSES
	CF_NCURSES_VERSION
	CF_NCURSES_BROKEN
	CF_COLOR_CURSES
	CF_SIZECHANGE
	CF_TTYTYPE
	AC_CHECK_FUNCS( \
		cbreak \
		keypad \
	)
fi

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

AC_MSG_CHECKING(if color-style code should be used)
AC_CACHE_VAL(cf_cv_color_style,[
AC_ARG_WITH(color-style,
[  --with-color-style=XXX  enable color style (types are ncurses, slang)],
	[cf_cv_color_style=$withval],
	[cf_cv_color_style=no])])

if test $cf_cv_color_style != no ; then
	if test .$cf_cv_color_curses != .yes ; then
		AC_ERROR(Configuration does not support color-styles)
	fi
	AC_DEFINE(USEHASH)
	AC_DEFINE(UNPAINT_CACHE)
	AC_DEFINE(LINKEDSTYLES)
fi

case $cf_cv_color_style in
no)
	AC_MSG_RESULT(no)
	;;
slang)
	AC_DEFINE(SLCS)
	AC_MSG_RESULT(slang-style)
	;;
*)
	AC_DEFINE(USE_COLOR_STYLE)
	AC_MSG_RESULT(curses-style)
	;;
esac

AC_MSG_CHECKING(if parent-directory references are permitted)
AC_CACHE_VAL(cf_cv_parent_dir,[
cf_cv_parent_dir=yes
AC_ARG_ENABLE(parent-dir-refs,
[  --disable-parent-dir-refs
                          disable \"Up-to\" parent-links in directory listings],
	[test "$enableval" = no && cf_cv_parent_dir=no])
])
AC_MSG_RESULT($cf_cv_parent_dir)
test $cf_cv_parent_dir = no && AC_DEFINE(NO_PARENT_DIR_REFERENCE)

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

AC_MSG_CHECKING(if you want to see long compiling messages)
CF_ARG_DISABLE(echo,
	[  --disable-echo          develop: display \"compiling\" commands],
	[SHOW_CC='	@echo compiling $@'
    ECHO_CC='@'],
	[SHOW_CC='# compiling'
    ECHO_CC=''])
AC_MSG_RESULT($enableval)
AC_SUBST(SHOW_CC)
AC_SUBST(ECHO_CC)

AC_MSG_CHECKING(if you want to check memory-leaks)
CF_ARG_ENABLE(find-leaks,
	[  --enable-find-leaks     develop: 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)

AC_MSG_CHECKING(if you want to enable debug-code)
CF_ARG_ENABLE(debug,
	[  --enable-debug          develop: logic for testing memory leaks],
	[with_debug=yes],
	[with_debug=no])
AC_MSG_RESULT($with_debug)
test "$with_debug" = "yes" && AC_DEFINE(DEBUG)

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

### Finally, build config.h and the makefiles
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
AC_OUTPUT(
	makefile \
	WWW/Library/unix/makefile \
	src/makefile \
	src/chrtrans/makefile \
	)