156
|
1 # -*- Autoconf -*-
|
|
2 # Process this file with autoconf to produce a configure script.
|
|
3
|
312
|
4 AC_PREREQ([2.69])
|
|
5 AC_INIT([XRogue],[8.0.3],[elwin@sdf.org],[xrogue])
|
156
|
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
|
284
|
15 AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h term.h ncurses/term.h process.h arpa/inet.h])
|
156
|
16
|
|
17 # Checks for typedefs, structures, and compiler characteristics.
|
|
18 AC_TYPE_SIZE_T
|
|
19 AC_STRUCT_TM
|
|
20 # Checks for library functions.
|
|
21 AC_FUNC_FORK
|
|
22 AC_PROG_GCC_TRADITIONAL
|
|
23 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
|
|
24 AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr _spawnl spawnl getpwuid loadav strerror setgid setuid getuid getgid])
|
|
25 AC_PROG_INSTALL
|
|
26
|
312
|
27 AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="xrogue"] )
|
156
|
28 PROGRAM=$progname
|
|
29 AC_SUBST(PROGRAM)
|
|
30
|
312
|
31 AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
|
156
|
32 AC_MSG_CHECKING([if using setgid execute bit])
|
|
33 if test "x$enable_setgid" = "xno" ; then
|
|
34 GROUPOWNER=
|
|
35 elif test "x$enable_setgid" = "xyes" ; then
|
|
36 GROUPOWNER=games
|
|
37 elif test "x$enable_setgid" = "x" ; then
|
|
38 GROUPOWNER=
|
|
39 else
|
|
40 GROUPOWNER=$enable_setgid
|
|
41 fi
|
|
42
|
|
43 if test "x$GROUPOWNER" != "x" ; then
|
|
44 AC_DEFINE_UNQUOTED([GROUPOWNER],[$GROUPOWNER], [Define to group owner of setgid executable])
|
|
45 AC_MSG_RESULT([$GROUPOWNER])
|
|
46 else
|
|
47 AC_MSG_RESULT([no])
|
|
48 fi
|
|
49
|
|
50 AC_SUBST(GROUPOWNER)
|
|
51
|
312
|
52 AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[])
|
156
|
53 AC_MSG_CHECKING([for scoreboard file])
|
|
54 if test "x$enable_scorefile" = "xno" ; then
|
|
55 SCOREFILE=
|
|
56 elif test "x$enable_scorefile" = "xyes" ; then
|
|
57 SCOREFILE=$progname.scr
|
|
58 elif test "x$enable_scorefile" = "x" ; then
|
|
59 SCOREFILE=$progname.scr
|
|
60 else
|
|
61 SCOREFILE=$enable_scorefile
|
|
62 fi
|
|
63
|
|
64 if test "x$SCOREFILE" != "x" ; then
|
|
65 AC_DEFINE_UNQUOTED([SCOREFILE], ["$SCOREFILE"], [Define to file to use for scoreboard])
|
|
66 AC_MSG_RESULT([$SCOREFILE])
|
|
67 else
|
|
68 AC_MSG_RESULT([disabled])
|
|
69 fi
|
|
70
|
|
71 AC_SUBST(SCOREFILE)
|
|
72
|
312
|
73 AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[])
|
156
|
74 AC_MSG_CHECKING([for log file])
|
|
75 if test "x$enable_logfile" = "xno" ; then
|
|
76 LOGFILE=
|
|
77 elif test "x$enable_logfile" = "xyes" ; then
|
|
78 LOGFILE=$progname.log
|
|
79 elif test "x$enable_logfile" = "x" ; then
|
|
80 LOGFILE=$progname.log
|
|
81 else
|
|
82 LOGFILE=$enable_logfile
|
|
83 fi
|
|
84
|
|
85 if test "x$LOGFILE" != "x" ; then
|
|
86 AC_DEFINE_UNQUOTED([LOGFILE], ["$LOGFILE"], [Define to file to use for log])
|
|
87 AC_MSG_RESULT([$LOGFILE])
|
|
88 else
|
|
89 AC_MSG_RESULT([disabled])
|
|
90 fi
|
|
91
|
|
92 AC_SUBST(LOGFILE)
|
|
93
|
312
|
94 AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"])
|
156
|
95 AC_MSG_CHECKING([for save directory])
|
|
96 if test "x$enable_savedir" = "xno" ; then
|
|
97 SAVEDIR=
|
|
98 elif test "x$enable_savedir" = "xyes" -o "x$enable_savedir" = "x"; then
|
157
|
99 if test "x$GROUPOWNER" != "x"; then
|
156
|
100 SAVEDIR="/var/local/games/roguelike/${progname}save/"
|
|
101 else
|
|
102 SAVEDIR="$progname/"
|
|
103 fi
|
|
104 else
|
|
105 SAVEDIR="$enable_savedir"
|
|
106 fi
|
|
107
|
|
108 if test "x$SAVEDIR" != "x" ; then
|
|
109 AC_DEFINE_UNQUOTED([SAVEDIR], ["$SAVEDIR"], [Define to systemwide directory for storing saved games])
|
|
110 AC_MSG_RESULT([$SAVEDIR])
|
|
111 else
|
|
112 AC_MSG_RESULT([disabled])
|
|
113 fi
|
|
114
|
|
115 AC_SUBST(SAVEDIR)
|
|
116
|
312
|
117 AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[])
|
156
|
118 AC_MSG_CHECKING([if wizard mode is enabled])
|
|
119 if test "x$enable_wizardmode" = "xno" ; then
|
|
120 AC_MSG_RESULT([no])
|
|
121 elif test "x$enable_wizardmode" = "x" ; then
|
|
122 AC_MSG_RESULT([no])
|
|
123 else
|
|
124 AC_DEFINE([WIZARD], [], [Define to include wizard mode])
|
|
125 AC_MSG_RESULT([yes])
|
|
126 fi
|
|
127
|
312
|
128 AC_ARG_ENABLE([limitscore],[AS_HELP_STRING([--enable-limitscore],[limit scores to one per class per uid @<:@default=no@:>@])],[],[])
|
156
|
129 AC_MSG_CHECKING([if limiting scores])
|
|
130 if test "x$enable_limitscore" = "xno" ; then
|
|
131 AC_MSG_RESULT([no])
|
|
132 elif test "x$enable_limitscore" = "x" ; then
|
|
133 AC_MSG_RESULT([no])
|
|
134 else
|
|
135 AC_DEFINE([LIMITSCORE], [], [Define to limit scores to one per class per uid])
|
|
136 AC_MSG_RESULT([yes])
|
|
137 fi
|
|
138
|
|
139 AC_OUTPUT
|