Mercurial > hg > early-roguelike
comparison rogue3/configure.ac @ 88:07c4d4883ef2
rogue3: begin porting to autoconf.
Rogue V3 can now be built with './configure && make'. This is
preliminary: 'make install' does not work yet.
| author | John "Elwin" Edwards |
|---|---|
| date | Sat, 24 Aug 2013 13:36:13 -0700 |
| parents | |
| children | e5ddbaf324d4 |
comparison
equal
deleted
inserted
replaced
| 87:f871cb0539d3 | 88:07c4d4883ef2 |
|---|---|
| 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 # May not be needed for the documentation | |
| 8 AC_CONFIG_FILES([Makefile rogue.6 rogue.r]) | |
| 9 | |
| 10 # Checks for programs. | |
| 11 AC_PROG_CC | |
| 12 # Checks for libraries. | |
| 13 MP_WITH_CURSES | |
| 14 # Checks for header files. | |
| 15 AC_HEADER_STDC | |
| 16 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]) | |
| 17 # WARN: the sources often don't include the headers when needed. That is one | |
| 18 # reason why adding "-Wall" to CFLAGS produces 1246 lines of messages. | |
| 19 | |
| 20 # Checks for typedefs, structures, and compiler characteristics. | |
| 21 AC_TYPE_UID_T | |
| 22 AC_TYPE_SIZE_T | |
| 23 AC_STRUCT_TM | |
| 24 # Checks for library functions. | |
| 25 AC_FUNC_FORK | |
| 26 AC_PROG_GCC_TRADITIONAL | |
| 27 AC_FUNC_LSTAT | |
| 28 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK | |
| 29 AC_TYPE_SIGNAL | |
| 30 AC_FUNC_STAT | |
| 31 AC_FUNC_VPRINTF | |
| 32 AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid]) | |
| 33 AC_PROG_INSTALL | |
| 34 | |
| 35 # Programs to process the documentation | |
| 36 AC_CHECK_PROG([NROFF], [nroff], [nroff],) | |
| 37 AC_CHECK_PROG([GROFF], [groff], [groff],) | |
| 38 AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],) | |
| 39 AC_CHECK_PROG([TBL], [tbl], [tbl],) | |
| 40 AC_CHECK_PROG([SED], [sed], [sed],) | |
| 41 | |
| 42 AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue3"] ) | |
| 43 PROGRAM=$progname | |
| 44 AC_SUBST(PROGRAM) | |
| 45 | |
| 46 AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@])],[],[]) | |
| 47 AC_MSG_CHECKING([if using setgid execute bit]) | |
| 48 if test "x$enable_setgid" = "xno" ; then | |
| 49 GROUPOWNER= | |
| 50 elif test "x$enable_setgid" = "xyes" ; then | |
| 51 GROUPOWNER=games | |
| 52 elif test "x$enable_setgid" = "x" ; then | |
| 53 GROUPOWNER= | |
| 54 else | |
| 55 GROUPOWNER=$enable_setgid | |
| 56 fi | |
| 57 | |
| 58 if test "x$GROUPOWNER" != "x" ; then | |
| 59 AC_DEFINE_UNQUOTED([GROUPOWNER],[$GROUPOWNER], [Define to group owner of setgid executable]) | |
| 60 AC_MSG_RESULT([$GROUPOWNER]) | |
| 61 else | |
| 62 AC_MSG_RESULT([no]) | |
| 63 fi | |
| 64 | |
| 65 AC_SUBST(GROUPOWNER) | |
| 66 | |
| 67 AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[]) | |
| 68 AC_MSG_CHECKING([for scoreboard file]) | |
| 69 if test "x$enable_scorefile" = "xno" ; then | |
| 70 SCOREFILE= | |
| 71 elif test "x$enable_scorefile" = "xyes" ; then | |
| 72 SCOREFILE=$progname.scr | |
| 73 elif test "x$enable_scorefile" = "x" ; then | |
| 74 SCOREFILE=$progname.scr | |
| 75 else | |
| 76 SCOREFILE=$enable_scorefile | |
| 77 fi | |
| 78 | |
| 79 if test "x$SCOREFILE" != "x" ; then | |
| 80 AC_DEFINE_UNQUOTED([SCOREFILE], ["$SCOREFILE"], [Define to file to use for scoreboard]) | |
| 81 AC_MSG_RESULT([$SCOREFILE]) | |
| 82 else | |
| 83 AC_MSG_RESULT([disabled]) | |
| 84 fi | |
| 85 | |
| 86 AC_SUBST(SCOREFILE) | |
| 87 | |
| 88 AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[]) | |
| 89 AC_MSG_CHECKING([for log file]) | |
| 90 if test "x$enable_logfile" = "xno" ; then | |
| 91 LOGFILE= | |
| 92 elif test "x$enable_logfile" = "xyes" ; then | |
| 93 LOGFILE=$progname.log | |
| 94 elif test "x$enable_logfile" = "x" ; then | |
| 95 LOGFILE=$progname.log | |
| 96 else | |
| 97 LOGFILE=$enable_logfile | |
| 98 fi | |
| 99 | |
| 100 if test "x$LOGFILE" != "x" ; then | |
| 101 AC_DEFINE_UNQUOTED([LOGFILE], ["$LOGFILE"], [Define to file to use for log]) | |
| 102 AC_MSG_RESULT([$LOGFILE]) | |
| 103 else | |
| 104 AC_MSG_RESULT([disabled]) | |
| 105 fi | |
| 106 | |
| 107 AC_SUBST(LOGFILE) | |
| 108 | |
| 109 AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"]) | |
| 110 AC_MSG_CHECKING([for save directory]) | |
| 111 if test "x$enable_savedir" = "xno" ; then | |
| 112 SAVEDIR= | |
| 113 elif test "x$enable_savedir" = "xyes" -o "x$enable_savedir" = "x"; then | |
| 114 if text "x$GROUPOWNER" != "x"; then | |
| 115 SAVEDIR="/var/local/games/roguelike/${progname}save/" | |
| 116 else | |
| 117 SAVEDIR="$progname/" | |
| 118 fi | |
| 119 else | |
| 120 SAVEDIR="$enable_savedir" | |
| 121 fi | |
| 122 | |
| 123 if test "x$SAVEDIR" != "x" ; then | |
| 124 AC_DEFINE_UNQUOTED([SAVEDIR], ["$SAVEDIR"], [Define to systemwide directory for storing saved games]) | |
| 125 AC_MSG_RESULT([$SAVEDIR]) | |
| 126 else | |
| 127 AC_MSG_RESULT([disabled]) | |
| 128 fi | |
| 129 | |
| 130 AC_SUBST(SAVEDIR) | |
| 131 | |
| 132 AC_ARG_ENABLE([destdir],[AC_HELP_STRING([--enable-destdir=DESTDIR], [chroot to install into])],[],[]) | |
| 133 AC_MSG_CHECKING([for chrooted install]) | |
| 134 if test "x$enable_destdir" = "xno" ; then | |
| 135 DESTDIR= | |
| 136 elif test "x$enable_destdir" = "xyes" ; then | |
| 137 DESTDIR= | |
| 138 elif test "x$enable_destdir" = "x" ; then | |
| 139 DESTDIR= | |
| 140 else | |
| 141 DESTDIR=$enable_destdir | |
| 142 fi | |
| 143 | |
| 144 if test "x$DESTDIR" != "x" ; then | |
| 145 AC_MSG_RESULT([$DESTDIR]) | |
| 146 else | |
| 147 AC_MSG_RESULT([disabled]) | |
| 148 fi | |
| 149 | |
| 150 AC_SUBST(DESTDIR) | |
| 151 | |
| 152 AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[]) | |
| 153 AC_MSG_CHECKING([if wizard mode is enabled]) | |
| 154 if test "x$enable_wizardmode" = "xno" ; then | |
| 155 AC_MSG_RESULT([no]) | |
| 156 elif test "x$enable_wizardmode" = "x" ; then | |
| 157 AC_MSG_RESULT([no]) | |
| 158 else | |
| 159 AC_DEFINE([WIZARD], [], [Define to include wizard mode]) | |
| 160 AC_MSG_RESULT([yes]) | |
| 161 fi | |
| 162 | |
| 163 AC_ARG_ENABLE([maxload],[AC_HELP_STRING([--enable-maxload], [enable maxload @<:@default=no@:>@])],[],[]) | |
| 164 AC_MSG_CHECKING([runtime execution limit (maximum system load average)]) | |
| 165 if test "x$enable_maxload" = "xyes" ; then | |
| 166 AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled]) | |
| 167 AC_MSG_RESULT([100]) | |
| 168 elif test "x$enable_maxload" = "x" ; then | |
| 169 AC_MSG_RESULT([unlimited]) | |
| 170 elif test "x$enable_maxload" = "xno" ; then | |
| 171 AC_MSG_RESULT([unlimited]) | |
| 172 else | |
| 173 AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxload], [Define if maxload feature should be enabled]) | |
| 174 AC_MSG_RESULT([$enable_maxload]) | |
| 175 fi | |
| 176 | |
| 177 AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[]) | |
| 178 AC_MSG_CHECKING([runtime execution limit (maximum online system users)]) | |
| 179 if test "x$enable_maxusers" = "xyes" ; then | |
| 180 AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled]) | |
| 181 AC_MSG_RESULT([100]) | |
| 182 elif test "x$enable_maxusers" = "x" ; then | |
| 183 AC_MSG_RESULT([unlimited]) | |
| 184 elif test "x$enable_maxload" = "xno" ; then | |
| 185 AC_MSG_RESULT([unlimited]) | |
| 186 else | |
| 187 AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxusers], [Define if maxusers feature should be enabled]) | |
| 188 AC_MSG_RESULT([$enable_maxusers]) | |
| 189 fi | |
| 190 | |
| 191 AC_MSG_CHECKING([whether to docdir is defined]) | |
| 192 if test "x$docdir" = "x" ; then | |
| 193 AC_MSG_RESULT([docdir undefined]) | |
| 194 docdir=\${datadir}/doc/\${PACKAGE_TARNAME} | |
| 195 AC_SUBST(docdir) | |
| 196 else | |
| 197 AC_MSG_RESULT([docdir defined]) | |
| 198 fi | |
| 199 | |
| 200 AC_OUTPUT |
