comparison urogue/configure.ac @ 273:51ddbe7b992d

UltraRogue: begin autoconfiscation. Build options can now be set with configure.
author John "Elwin" Edwards
date Mon, 04 Sep 2017 21:08:09 -0400
parents
children aa0eefcd7df6
comparison
equal deleted inserted replaced
272:1db299e868b8 273:51ddbe7b992d
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.56)
5 AC_INIT([UltraRogue],[1.07], [yendor@rogueforge.net])
6 AC_CONFIG_HEADERS([config.h])
7 AC_CONFIG_FILES([Makefile])
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([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
17 # Checks for typedefs, structures, and compiler characteristics.
18 AC_TYPE_UID_T
19 AC_TYPE_SIZE_T
20 AC_STRUCT_TM
21 # Checks for library functions.
22 AC_FUNC_FORK
23 AC_PROG_GCC_TRADITIONAL
24 AC_FUNC_LSTAT
25 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
26 AC_TYPE_SIGNAL
27 AC_FUNC_STAT
28 AC_FUNC_VPRINTF
29 AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid])
30 AC_PROG_INSTALL
31
32 # Programs to process the documentation
33 #AC_CHECK_PROG([NROFF], [nroff], [nroff],)
34 #AC_CHECK_PROG([GROFF], [groff], [groff],)
35 #AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
36 #AC_CHECK_PROG([TBL], [tbl], [tbl],)
37
38 AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="urogue"] )
39 PROGRAM=$progname
40 AC_SUBST(PROGRAM)
41
42 AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
43 AC_MSG_CHECKING([if using setgid execute bit])
44 if test "x$enable_setgid" = "xno" ; then
45 GROUPOWNER=
46 elif test "x$enable_setgid" = "xyes" ; then
47 GROUPOWNER=games
48 elif test "x$enable_setgid" = "x" ; then
49 GROUPOWNER=
50 else
51 GROUPOWNER=$enable_setgid
52 fi
53
54 if test "x$GROUPOWNER" != "x" ; then
55 AC_DEFINE_UNQUOTED([GROUPOWNER],[$GROUPOWNER], [Define to group owner of setgid executable])
56 AC_MSG_RESULT([$GROUPOWNER])
57 else
58 AC_MSG_RESULT([no])
59 fi
60
61 AC_SUBST(GROUPOWNER)
62
63 AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
64 AC_MSG_CHECKING([for scoreboard file])
65 if test "x$enable_scorefile" = "xno" ; then
66 SCOREFILE=
67 elif test "x$enable_scorefile" = "xyes" ; then
68 SCOREFILE=$progname.scr
69 elif test "x$enable_scorefile" = "x" ; then
70 SCOREFILE=$progname.scr
71 else
72 SCOREFILE=$enable_scorefile
73 fi
74
75 if test "x$SCOREFILE" != "x" ; then
76 AC_DEFINE_UNQUOTED([SCOREFILE], ["$SCOREFILE"], [Define to file to use for scoreboard])
77 AC_MSG_RESULT([$SCOREFILE])
78 else
79 AC_MSG_RESULT([disabled])
80 fi
81
82 AC_SUBST(SCOREFILE)
83
84 AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
85 AC_MSG_CHECKING([for log file])
86 if test "x$enable_logfile" = "xno" ; then
87 LOGFILE=
88 elif test "x$enable_logfile" = "xyes" ; then
89 LOGFILE=$progname.log
90 elif test "x$enable_logfile" = "x" ; then
91 LOGFILE=$progname.log
92 else
93 LOGFILE=$enable_logfile
94 fi
95
96 if test "x$LOGFILE" != "x" ; then
97 AC_DEFINE_UNQUOTED([LOGFILE], ["$LOGFILE"], [Define to file to use for log])
98 AC_MSG_RESULT([$LOGFILE])
99 else
100 AC_MSG_RESULT([disabled])
101 fi
102
103 AC_SUBST(LOGFILE)
104
105 AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
106 AC_MSG_CHECKING([for save directory])
107 if test "x$enable_savedir" = "xno" ; then
108 SAVEDIR=
109 elif test "x$enable_savedir" = "xyes" -o "x$enable_savedir" = "x"; then
110 if test "x$GROUPOWNER" != "x"; then
111 SAVEDIR="/var/local/games/roguelike/${progname}save/"
112 else
113 SAVEDIR="$progname/"
114 fi
115 else
116 SAVEDIR="$enable_savedir"
117 fi
118
119 if test "x$SAVEDIR" != "x" ; then
120 AC_DEFINE_UNQUOTED([SAVEDIR], ["$SAVEDIR"], [Define to systemwide directory for storing saved games])
121 AC_MSG_RESULT([$SAVEDIR])
122 else
123 AC_MSG_RESULT([disabled])
124 fi
125
126 AC_SUBST(SAVEDIR)
127
128 AC_ARG_ENABLE([chardir],[AC_HELP_STRING([--enable-chardir=CHARDIR], [enable systemwide location for character files])],[],[enable_chardir="no"])
129 AC_MSG_CHECKING([for character directory])
130 if test "x$enable_chardir" = "xno" ; then
131 CHARDIR=
132 elif test "x$enable_chardir" = "xyes" -o "x$enable_chardir" = "x"; then
133 if test "x$GROUPOWNER" != "x"; then
134 CHARDIR="/var/local/games/roguelike/${progname}char/"
135 else
136 CHARDIR="$progname/"
137 fi
138 else
139 CHARDIR="$enable_chardir"
140 fi
141
142 if test "x$CHARDIR" != "x" ; then
143 AC_DEFINE_UNQUOTED([CHARDIR], ["$CHARDIR"], [Define to systemwide directory for storing character files])
144 AC_MSG_RESULT([$CHARDIR])
145 else
146 AC_MSG_RESULT([disabled])
147 fi
148
149 AC_SUBST(CHARDIR)
150
151 AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
152 AC_MSG_CHECKING([if wizard mode is enabled])
153 if test "x$enable_wizardmode" = "xno" ; then
154 AC_MSG_RESULT([no])
155 elif test "x$enable_wizardmode" = "x" ; then
156 AC_MSG_RESULT([no])
157 else
158 AC_DEFINE([WIZARD], [], [Define to include wizard mode])
159 AC_MSG_RESULT([yes])
160 fi
161
162 AC_MSG_CHECKING([whether to docdir is defined])
163 if test "x$docdir" = "x" ; then
164 AC_MSG_RESULT([docdir undefined])
165 docdir=\${datadir}/doc/\${PACKAGE_TARNAME}
166 AC_SUBST(docdir)
167 else
168 AC_MSG_RESULT([docdir defined])
169 fi
170
171 AC_OUTPUT