51
|
1 # -*- Autoconf -*-
|
|
2 # Process this file with autoconf to produce a configure script.
|
|
3
|
|
4 AC_PREREQ(2.56)
|
|
5 AC_INIT([Rogue],[5.2.2], [yendor@rogueforge.net])
|
|
6 AC_CONFIG_SRCDIR([armor.c])
|
|
7 AC_CONFIG_HEADERS([config.h])
|
|
8 # May not be needed for the documentation
|
|
9 AC_CONFIG_FILES([Makefile rogue.6 rogue.me])
|
|
10
|
|
11 # Checks for programs.
|
|
12 AC_PROG_CC
|
|
13 # Checks for libraries.
|
|
14 MP_WITH_CURSES
|
|
15 # Checks for header files.
|
|
16 AC_HEADER_STDC
|
|
17 AC_CHECK_HEADERS([arpa/inet.h sys/utsname.h pwd.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmp.h term.h ncurses/term.h process.h])
|
|
18 # WARN: the sources often don't include the headers when needed. That is one
|
|
19 # reason why adding "-Wall" to CFLAGS produces 1246 lines of messages.
|
|
20
|
|
21 # Checks for typedefs, structures, and compiler characteristics.
|
|
22 AC_TYPE_UID_T
|
|
23 AC_TYPE_SIZE_T
|
|
24 AC_STRUCT_TM
|
|
25 # Checks for library functions.
|
|
26 AC_FUNC_FORK
|
|
27 AC_PROG_GCC_TRADITIONAL
|
|
28 AC_FUNC_LSTAT
|
|
29 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
|
|
30 AC_TYPE_SIGNAL
|
|
31 AC_FUNC_STAT
|
|
32 AC_FUNC_VPRINTF
|
|
33 AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid])
|
|
34 AC_PROG_INSTALL
|
|
35
|
|
36 # Programs to process the documentation
|
|
37 AC_CHECK_PROG([NROFF], [nroff], [nroff],)
|
|
38 AC_CHECK_PROG([GROFF], [groff], [groff],)
|
|
39 AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
|
|
40 AC_CHECK_PROG([TBL], [tbl], [tbl],)
|
|
41 AC_CHECK_PROG([SED], [sed], [sed],)
|
|
42
|
|
43 AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue4"] )
|
|
44 PROGRAM=$progname
|
|
45 AC_SUBST(PROGRAM)
|
|
46
|
|
47 AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@])],[],[])
|
|
48 AC_MSG_CHECKING([if using setgid execute bit])
|
|
49 if test "x$enable_setgid" = "xno" ; then
|
|
50 GROUPOWNER=
|
|
51 elif test "x$enable_setgid" = "xyes" ; then
|
|
52 GROUPOWNER=games
|
|
53 elif test "x$enable_setgid" = "x" ; then
|
|
54 GROUPOWNER=
|
|
55 else
|
|
56 GROUPOWNER=$enable_setgid
|
|
57 fi
|
|
58
|
|
59 if test "x$GROUPOWNER" != "x" ; then
|
|
60 AC_DEFINE_UNQUOTED([GROUPOWNER],[$GROUPOWNER], [Define to group owner of setgid executable])
|
|
61 AC_MSG_RESULT([$GROUPOWNER])
|
|
62 else
|
|
63 AC_MSG_RESULT([no])
|
|
64 fi
|
|
65
|
|
66 AC_SUBST(GROUPOWNER)
|
|
67
|
|
68 AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
|
|
69 AC_MSG_CHECKING([for scoreboard file])
|
|
70 if test "x$enable_scorefile" = "xno" ; then
|
|
71 SCOREFILE=
|
|
72 elif test "x$enable_scorefile" = "xyes" ; then
|
|
73 SCOREFILE=$progname.scr
|
|
74 elif test "x$enable_scorefile" = "x" ; then
|
|
75 SCOREFILE=$progname.scr
|
|
76 else
|
|
77 SCOREFILE=$enable_scorefile
|
|
78 fi
|
|
79
|
|
80 if test "x$SCOREFILE" != "x" ; then
|
|
81 AC_DEFINE_UNQUOTED([SCOREFILE], ["$SCOREFILE"], [Define to file to use for scoreboard])
|
|
82 AC_MSG_RESULT([$SCOREFILE])
|
|
83 else
|
|
84 AC_MSG_RESULT([disabled])
|
|
85 fi
|
|
86
|
|
87 AC_SUBST(SCOREFILE)
|
|
88
|
|
89 AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
|
|
90 AC_MSG_CHECKING([for log file])
|
|
91 if test "x$enable_logfile" = "xno" ; then
|
|
92 LOGFILE=
|
|
93 elif test "x$enable_logfile" = "xyes" ; then
|
|
94 LOGFILE=$progname.log
|
|
95 elif test "x$enable_logfile" = "x" ; then
|
|
96 LOGFILE=$progname.log
|
|
97 else
|
|
98 LOGFILE=$enable_logfile
|
|
99 fi
|
|
100
|
|
101 if test "x$LOGFILE" != "x" ; then
|
|
102 AC_DEFINE_UNQUOTED([LOGFILE], ["$LOGFILE"], [Define to file to use for log])
|
|
103 AC_MSG_RESULT([$LOGFILE])
|
|
104 else
|
|
105 AC_MSG_RESULT([disabled])
|
|
106 fi
|
|
107
|
|
108 AC_SUBST(LOGFILE)
|
|
109
|
|
110 AC_ARG_ENABLE([lockfile],[AC_HELP_STRING([--enable-lockfile=LOCKFILE], [enable scoreboard lockfile with given filename])],[],[])
|
|
111 AC_MSG_CHECKING([for scoreboard lockfile file])
|
|
112 if test "x$enable_lockfile" = "xno" ; then
|
|
113 LOCKFILE=
|
|
114 elif test "x$enable_lockfile" = "xyes" ; then
|
|
115 LOCKFILE=$progname.lck
|
|
116 elif test "x$enable_lockfile" = "x" ; then
|
|
117 LOCKFILE=$progname.lck
|
|
118 else
|
|
119 LOCKFILE=$enable_lockfile
|
|
120 fi
|
|
121
|
|
122 if test "x$LOCKFILE" != "x" ; then
|
|
123 AC_DEFINE_UNQUOTED([LOCKFILE], ["$LOCKFILE"], [Define to file to use for scoreboard lockfile])
|
|
124 AC_MSG_RESULT([$LOCKFILE])
|
|
125 else
|
|
126 AC_MSG_RESULT([disabled])
|
|
127 fi
|
|
128
|
|
129 AC_SUBST(LOCKFILE)
|
|
130
|
52
|
131 AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
|
51
|
132 AC_MSG_CHECKING([for save directory])
|
|
133 if test "x$enable_savedir" = "xno" ; then
|
|
134 SAVEDIR=
|
52
|
135 elif test "x$enable_savedir" = "xyes" -o "x$enable_savedir" = "x"; then
|
|
136 if text "x$GROUPOWNER" != "x"; then
|
|
137 SAVEDIR="/var/local/games/roguelike/${progname}save/"
|
|
138 else
|
|
139 SAVEDIR="$progname/"
|
|
140 fi
|
51
|
141 else
|
52
|
142 SAVEDIR="$enable_savedir"
|
51
|
143 fi
|
|
144
|
|
145 if test "x$SAVEDIR" != "x" ; then
|
|
146 AC_DEFINE_UNQUOTED([SAVEDIR], ["$SAVEDIR"], [Define to systemwide directory for storing saved games])
|
|
147 AC_MSG_RESULT([$SAVEDIR])
|
|
148 else
|
|
149 AC_MSG_RESULT([disabled])
|
|
150 fi
|
|
151
|
|
152 AC_SUBST(SAVEDIR)
|
|
153
|
|
154 AC_ARG_ENABLE([destdir],[AC_HELP_STRING([--enable-destdir=DESTDIR], [chroot to install into])],[],[])
|
|
155 AC_MSG_CHECKING([for chrooted install])
|
|
156 if test "x$enable_destdir" = "xno" ; then
|
|
157 DESTDIR=
|
|
158 elif test "x$enable_destdir" = "xyes" ; then
|
|
159 DESTDIR=
|
|
160 elif test "x$enable_destdir" = "x" ; then
|
|
161 DESTDIR=
|
|
162 else
|
|
163 DESTDIR=$enable_destdir
|
|
164 fi
|
|
165
|
|
166 if test "x$DESTDIR" != "x" ; then
|
|
167 AC_MSG_RESULT([$DESTDIR])
|
|
168 else
|
|
169 AC_MSG_RESULT([disabled])
|
|
170 fi
|
|
171
|
|
172 AC_SUBST(DESTDIR)
|
|
173
|
|
174 AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
|
|
175 AC_MSG_CHECKING([if wizard mode is enabled])
|
|
176 if test "x$enable_wizardmode" = "xno" ; then
|
|
177 AC_MSG_RESULT([no])
|
|
178 elif test "x$enable_wizardmode" = "x" ; then
|
|
179 AC_MSG_RESULT([no])
|
|
180 else
|
|
181 AC_DEFINE([WIZARD], [], [Define to include wizard mode])
|
|
182 if test "x$enable_wizardmode" != "xyes" ; then
|
|
183 AC_DEFINE_UNQUOTED([PASSWD],["$enable_wizardmode"], [Define crypt(3) wizard mode password])
|
|
184 fi
|
|
185 AC_MSG_RESULT([yes])
|
|
186 fi
|
|
187
|
|
188 AC_ARG_ENABLE([checktime],[AC_HELP_STRING([--enable-checktime], [enable checktime @<:@default=no@:>@])],[],[])
|
|
189 AC_MSG_CHECKING([if checktime is enabled])
|
|
190 if test "x$enable_checktime" = "xyes" ; then
|
|
191 AC_DEFINE([CHECKTIME], [1], [Define if checktime feature should be enabled])
|
|
192 AC_MSG_RESULT([yes])
|
|
193 else
|
|
194 AC_MSG_RESULT([no])
|
|
195 fi
|
|
196
|
|
197 AC_ARG_ENABLE([maxload],[AC_HELP_STRING([--enable-maxload], [enable maxload @<:@default=no@:>@])],[],[])
|
|
198 AC_MSG_CHECKING([runtime execution limit (maximum system load average)])
|
|
199 if test "x$enable_maxload" = "xyes" ; then
|
|
200 AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled])
|
|
201 AC_MSG_RESULT([100])
|
|
202 elif test "x$enable_maxload" = "x" ; then
|
|
203 AC_MSG_RESULT([unlimited])
|
|
204 elif test "x$enable_maxload" = "xno" ; then
|
|
205 AC_MSG_RESULT([unlimited])
|
|
206 else
|
|
207 AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxload], [Define if maxload feature should be enabled])
|
|
208 AC_MSG_RESULT([$enable_maxload])
|
|
209 fi
|
|
210
|
|
211 AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[])
|
|
212 AC_MSG_CHECKING([runtime execution limit (maximum online system users)])
|
|
213 if test "x$enable_maxusers" = "xyes" ; then
|
|
214 AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled])
|
|
215 AC_MSG_RESULT([100])
|
|
216 elif test "x$enable_maxusers" = "x" ; then
|
|
217 AC_MSG_RESULT([unlimited])
|
|
218 elif test "x$enable_maxload" = "xno" ; then
|
|
219 AC_MSG_RESULT([unlimited])
|
|
220 else
|
|
221 AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxusers], [Define if maxusers feature should be enabled])
|
|
222 AC_MSG_RESULT([$enable_maxusers])
|
|
223 fi
|
|
224
|
|
225 AC_MSG_CHECKING([whether to docdir is defined])
|
|
226 if test "x$docdir" = "x" ; then
|
|
227 AC_MSG_RESULT([docdir undefined])
|
|
228 docdir=\${datadir}/doc/\${PACKAGE_TARNAME}
|
|
229 AC_SUBST(docdir)
|
|
230 else
|
|
231 AC_MSG_RESULT([docdir defined])
|
|
232 fi
|
|
233
|
|
234 AC_OUTPUT
|