1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(gofish.h)
3AM_INIT_AUTOMAKE(gofish, 1.0)
4AM_CONFIG_HEADER(config.h:config.h.in)
5
6AC_CANONICAL_HOST
7
8dnl Extra configure arguments
9gopherroot=$localstatedir/gopher
10AC_ARG_WITH(gopherroot,
11	[  --with-gopherroot=ROOT   Use ROOT for Gopher documents],
12	[gopherroot=$withval])
13AC_SUBST(gopherroot)
14
15dnl Checks for programs.
16AC_PROG_CC
17AC_PROG_INSTALL
18
19dnl Checks for Sun libraries.
20AC_CHECK_LIB(socket, socket)
21AC_CHECK_LIB(nsl, gethostbyname)
22
23dnl Checks for header files.
24AC_HEADER_DIRENT
25AC_HEADER_STDC
26AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h syslog.h unistd.h)
27
28dnl Checks for typedefs, structures, and compiler characteristics.
29AC_C_CONST
30AC_TYPE_UID_T
31AC_C_INLINE
32AC_TYPE_OFF_T
33AC_TYPE_PID_T
34AC_TYPE_SIZE_T
35AC_STRUCT_TM
36
37dnl Checks for library functions.
38
39dnl We cannot use this special function since it fails under FreeBSD
40dnl AC_FUNC_MMAP
41AC_CHECK_FUNCS(mmap)
42AC_TYPE_SIGNAL
43AC_FUNC_STRFTIME
44AC_CHECK_FUNCS(gethostname select socket strdup strerror strstr strtol uname)
45AC_CHECK_FUNCS(writev daemon)
46
47dnl Interix does not have initgroups
48AC_CHECK_FUNCS(initgroups)
49
50dnl poll does not work on the arm
51dnl if this goes, AC_CANONICAL_HOST and the files
52dnl config.sub and config.guess can go
53case $host in
54  armv4l-*) ;;
55  *) AC_CHECK_FUNCS(poll) ;;
56esac
57
58dnl Add -Wall option for gcc
59if test "$GCC" = "yes"; then
60  CFLAGS="$CFLAGS -Wall"
61fi
62
63AC_MSG_CHECKING([mmap_cache])
64AC_ARG_ENABLE(mmap-cache,
65  [  --enable-mmap-cache    Enable mmap caching. EXPERIMENTAL],
66  [])
67if test "$enable_mmap_cache" = "yes"; then
68  AC_DEFINE(MMAP_CACHE, 1, [Define this to enable mmap cache])
69else
70  enable_mmap_cache=no
71fi
72AC_MSG_RESULT([$enable_mmap_cache])
73
74AC_MSG_CHECKING([CGI])
75AC_ARG_ENABLE(cgi,
76  [  --enable-cgi    Enable CGI in http server. EXPERIMENTAL],
77  [])
78if test "$enable_cgi" = "yes"; then
79  AC_DEFINE(CGI, 1, [Define this to enable CGI in the http server])
80else
81  enable_cgi=no
82fi
83AC_MSG_RESULT([$enable_cgi])
84
85dnl Check for gopher user override.
86AC_MSG_CHECKING([gopheruser])
87gopheruser="gopher"
88AC_ARG_WITH(gopheruser,
89	[  --with-gopheruser=USER  Use USER as non-privileged user],
90	[gopheruser=$withval])
91AC_DEFINE_UNQUOTED(GOPHER_USER, "$gopheruser", [The non-privileged user])
92AC_MSG_RESULT([$gopheruser])
93
94AC_OUTPUT(Makefile)
95