Mercurial > hg > early-roguelike
comparison rogue4/configure.ac @ 51:a1dc75e38e73
rogue4: ported to autoconf.
author | elwin |
---|---|
date | Tue, 11 Oct 2011 15:20:40 +0000 |
parents | |
children | ae4f413fe76c |
comparison
equal
deleted
inserted
replaced
50:c9382913d6df | 51:a1dc75e38e73 |
---|---|
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 | |
131 AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[]) | |
132 AC_MSG_CHECKING([for save directory]) | |
133 if test "x$enable_savedir" = "xno" ; then | |
134 SAVEDIR= | |
135 elif test "x$enable_savedir" = "xyes" ; then | |
136 SAVEDIR=$progname/ | |
137 elif test "x$enable_savedir" = "x" ; then | |
138 SAVEDIR= | |
139 else | |
140 SAVEDIR=$enable_savedir | |
141 fi | |
142 | |
143 if test "x$SAVEDIR" != "x" ; then | |
144 AC_DEFINE_UNQUOTED([SAVEDIR], ["$SAVEDIR"], [Define to systemwide directory for storing saved games]) | |
145 AC_MSG_RESULT([$SAVEDIR]) | |
146 else | |
147 AC_MSG_RESULT([disabled]) | |
148 fi | |
149 | |
150 AC_SUBST(SAVEDIR) | |
151 | |
152 AC_ARG_ENABLE([destdir],[AC_HELP_STRING([--enable-destdir=DESTDIR], [chroot to install into])],[],[]) | |
153 AC_MSG_CHECKING([for chrooted install]) | |
154 if test "x$enable_destdir" = "xno" ; then | |
155 DESTDIR= | |
156 elif test "x$enable_destdir" = "xyes" ; then | |
157 DESTDIR= | |
158 elif test "x$enable_destdir" = "x" ; then | |
159 DESTDIR= | |
160 else | |
161 DESTDIR=$enable_destdir | |
162 fi | |
163 | |
164 if test "x$DESTDIR" != "x" ; then | |
165 AC_MSG_RESULT([$DESTDIR]) | |
166 else | |
167 AC_MSG_RESULT([disabled]) | |
168 fi | |
169 | |
170 AC_SUBST(DESTDIR) | |
171 | |
172 AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[]) | |
173 AC_MSG_CHECKING([if wizard mode is enabled]) | |
174 if test "x$enable_wizardmode" = "xno" ; then | |
175 AC_MSG_RESULT([no]) | |
176 elif test "x$enable_wizardmode" = "x" ; then | |
177 AC_MSG_RESULT([no]) | |
178 else | |
179 AC_DEFINE([WIZARD], [], [Define to include wizard mode]) | |
180 if test "x$enable_wizardmode" != "xyes" ; then | |
181 AC_DEFINE_UNQUOTED([PASSWD],["$enable_wizardmode"], [Define crypt(3) wizard mode password]) | |
182 fi | |
183 AC_MSG_RESULT([yes]) | |
184 fi | |
185 | |
186 AC_ARG_ENABLE([checktime],[AC_HELP_STRING([--enable-checktime], [enable checktime @<:@default=no@:>@])],[],[]) | |
187 AC_MSG_CHECKING([if checktime is enabled]) | |
188 if test "x$enable_checktime" = "xyes" ; then | |
189 AC_DEFINE([CHECKTIME], [1], [Define if checktime feature should be enabled]) | |
190 AC_MSG_RESULT([yes]) | |
191 else | |
192 AC_MSG_RESULT([no]) | |
193 fi | |
194 | |
195 AC_ARG_ENABLE([maxload],[AC_HELP_STRING([--enable-maxload], [enable maxload @<:@default=no@:>@])],[],[]) | |
196 AC_MSG_CHECKING([runtime execution limit (maximum system load average)]) | |
197 if test "x$enable_maxload" = "xyes" ; then | |
198 AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled]) | |
199 AC_MSG_RESULT([100]) | |
200 elif test "x$enable_maxload" = "x" ; then | |
201 AC_MSG_RESULT([unlimited]) | |
202 elif test "x$enable_maxload" = "xno" ; then | |
203 AC_MSG_RESULT([unlimited]) | |
204 else | |
205 AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxload], [Define if maxload feature should be enabled]) | |
206 AC_MSG_RESULT([$enable_maxload]) | |
207 fi | |
208 | |
209 AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[]) | |
210 AC_MSG_CHECKING([runtime execution limit (maximum online system users)]) | |
211 if test "x$enable_maxusers" = "xyes" ; then | |
212 AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled]) | |
213 AC_MSG_RESULT([100]) | |
214 elif test "x$enable_maxusers" = "x" ; then | |
215 AC_MSG_RESULT([unlimited]) | |
216 elif test "x$enable_maxload" = "xno" ; then | |
217 AC_MSG_RESULT([unlimited]) | |
218 else | |
219 AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxusers], [Define if maxusers feature should be enabled]) | |
220 AC_MSG_RESULT([$enable_maxusers]) | |
221 fi | |
222 | |
223 AC_MSG_CHECKING([whether to docdir is defined]) | |
224 if test "x$docdir" = "x" ; then | |
225 AC_MSG_RESULT([docdir undefined]) | |
226 docdir=\${datadir}/doc/\${PACKAGE_TARNAME} | |
227 AC_SUBST(docdir) | |
228 else | |
229 AC_MSG_RESULT([docdir defined]) | |
230 fi | |
231 | |
232 AC_OUTPUT |