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