2013-09-01 20:50:52 -07:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
2021-05-11 22:30:03 -04:00
|
|
|
AC_PREREQ([2.69])
|
|
|
|
|
AC_INIT([Super-Rogue],[9.0],[elwin@sdf.org],[srogue])
|
2013-09-01 20:50:52 -07:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
2023-09-05 20:05:24 -04:00
|
|
|
AC_CONFIG_AUX_DIR([../build-aux])
|
2013-09-01 20:50:52 -07:00
|
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
|
AC_PROG_CC
|
|
|
|
|
# Checks for libraries.
|
|
|
|
|
MP_WITH_CURSES
|
|
|
|
|
# Checks for header files.
|
2014-04-27 08:29:14 -07:00
|
|
|
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 term.h ncurses/term.h process.h])
|
2013-09-01 20:50:52 -07:00
|
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
2014-04-30 14:46:30 -07:00
|
|
|
AC_TYPE_UID_T
|
2013-09-01 20:50:52 -07:00
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
|
AC_STRUCT_TM
|
|
|
|
|
# Checks for library functions.
|
|
|
|
|
AC_FUNC_FORK
|
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
|
|
|
AC_FUNC_STAT
|
|
|
|
|
AC_FUNC_VPRINTF
|
2014-05-03 10:31:30 -07:00
|
|
|
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid lrand48 random srand48 srandom])
|
2013-09-01 20:50:52 -07:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
|
2016-02-21 20:47:12 -05:00
|
|
|
AC_CHECK_PROG([NROFF], [nroff], [nroff],)
|
|
|
|
|
AC_CHECK_PROG([GROFF], [groff], [groff],)
|
|
|
|
|
AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],)
|
|
|
|
|
AC_CHECK_PROG([TBL], [tbl], [tbl],)
|
|
|
|
|
|
2017-12-30 14:15:52 -05:00
|
|
|
if test "x$GROFF" != "x" ; then
|
|
|
|
|
DOCS_GROFF=
|
|
|
|
|
DOCS_NROFF=.no-nroff
|
|
|
|
|
DOCS_NONE=.none
|
|
|
|
|
elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then
|
|
|
|
|
DOCS_GROFF=.no-groff
|
|
|
|
|
DOCS_NROFF=
|
|
|
|
|
DOCS_NONE=.none
|
|
|
|
|
else
|
|
|
|
|
DOCS_GROFF=.no-groff
|
|
|
|
|
DOCS_NROFF=.no-nroff
|
|
|
|
|
DOCS_NONE=
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AC_SUBST(DOCS_GROFF)
|
|
|
|
|
AC_SUBST(DOCS_NROFF)
|
|
|
|
|
AC_SUBST(DOCS_NONE)
|
|
|
|
|
|
2021-05-11 22:30:03 -04:00
|
|
|
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="srogue"] )
|
2013-09-01 20:50:52 -07:00
|
|
|
PROGRAM=$progname
|
|
|
|
|
AC_SUBST(PROGRAM)
|
|
|
|
|
|
2021-05-11 22:30:03 -04:00
|
|
|
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
|
2013-09-01 20:50:52 -07:00
|
|
|
AC_MSG_CHECKING([if using setgid execute bit])
|
|
|
|
|
if test "x$enable_setgid" = "xno" ; then
|
|
|
|
|
GROUPOWNER=
|
|
|
|
|
elif test "x$enable_setgid" = "xyes" ; then
|
|
|
|
|
GROUPOWNER=games
|
|
|
|
|
elif test "x$enable_setgid" = "x" ; then
|
|
|
|
|
GROUPOWNER=
|
|
|
|
|
else
|
|
|
|
|
GROUPOWNER=$enable_setgid
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test "x$GROUPOWNER" != "x" ; then
|
|
|
|
|
AC_DEFINE_UNQUOTED([GROUPOWNER],[$GROUPOWNER], [Define to group owner of setgid executable])
|
|
|
|
|
AC_MSG_RESULT([$GROUPOWNER])
|
|
|
|
|
else
|
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AC_SUBST(GROUPOWNER)
|
|
|
|
|
|
2021-05-11 22:30:03 -04:00
|
|
|
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[])
|
2013-09-01 20:50:52 -07:00
|
|
|
AC_MSG_CHECKING([for scoreboard file])
|
|
|
|
|
if test "x$enable_scorefile" = "xno" ; then
|
|
|
|
|
SCOREFILE=
|
|
|
|
|
elif test "x$enable_scorefile" = "xyes" ; then
|
|
|
|
|
SCOREFILE=$progname.scr
|
|
|
|
|
elif test "x$enable_scorefile" = "x" ; then
|
|
|
|
|
SCOREFILE=$progname.scr
|
|
|
|
|
else
|
|
|
|
|
SCOREFILE=$enable_scorefile
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test "x$SCOREFILE" != "x" ; then
|
|
|
|
|
AC_DEFINE_UNQUOTED([SCOREFILE], ["$SCOREFILE"], [Define to file to use for scoreboard])
|
|
|
|
|
AC_MSG_RESULT([$SCOREFILE])
|
|
|
|
|
else
|
|
|
|
|
AC_MSG_RESULT([disabled])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AC_SUBST(SCOREFILE)
|
|
|
|
|
|
2021-05-11 22:30:03 -04:00
|
|
|
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[])
|
2013-09-01 20:50:52 -07:00
|
|
|
AC_MSG_CHECKING([for log file])
|
|
|
|
|
if test "x$enable_logfile" = "xno" ; then
|
|
|
|
|
LOGFILE=
|
|
|
|
|
elif test "x$enable_logfile" = "xyes" ; then
|
|
|
|
|
LOGFILE=$progname.log
|
|
|
|
|
elif test "x$enable_logfile" = "x" ; then
|
|
|
|
|
LOGFILE=$progname.log
|
|
|
|
|
else
|
|
|
|
|
LOGFILE=$enable_logfile
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test "x$LOGFILE" != "x" ; then
|
|
|
|
|
AC_DEFINE_UNQUOTED([LOGFILE], ["$LOGFILE"], [Define to file to use for log])
|
|
|
|
|
AC_MSG_RESULT([$LOGFILE])
|
|
|
|
|
else
|
|
|
|
|
AC_MSG_RESULT([disabled])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AC_SUBST(LOGFILE)
|
|
|
|
|
|
2021-05-11 22:30:03 -04:00
|
|
|
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"])
|
2013-09-01 20:50:52 -07:00
|
|
|
AC_MSG_CHECKING([for save directory])
|
|
|
|
|
if test "x$enable_savedir" = "xno" ; then
|
|
|
|
|
SAVEDIR=
|
|
|
|
|
elif test "x$enable_savedir" = "xyes" -o "x$enable_savedir" = "x"; then
|
2015-06-04 14:48:25 -04:00
|
|
|
if test "x$GROUPOWNER" != "x"; then
|
2013-09-01 20:50:52 -07:00
|
|
|
SAVEDIR="/var/local/games/roguelike/${progname}save/"
|
|
|
|
|
else
|
|
|
|
|
SAVEDIR="$progname/"
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
SAVEDIR="$enable_savedir"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test "x$SAVEDIR" != "x" ; then
|
|
|
|
|
AC_DEFINE_UNQUOTED([SAVEDIR], ["$SAVEDIR"], [Define to systemwide directory for storing saved games])
|
|
|
|
|
AC_MSG_RESULT([$SAVEDIR])
|
|
|
|
|
else
|
|
|
|
|
AC_MSG_RESULT([disabled])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AC_SUBST(SAVEDIR)
|
|
|
|
|
|
2021-05-11 22:30:03 -04:00
|
|
|
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[])
|
2013-09-01 20:50:52 -07:00
|
|
|
AC_MSG_CHECKING([if wizard mode is enabled])
|
|
|
|
|
if test "x$enable_wizardmode" = "xno" ; then
|
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
|
elif test "x$enable_wizardmode" = "x" ; then
|
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
|
else
|
|
|
|
|
AC_DEFINE([WIZARD], [], [Define to include wizard mode])
|
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AC_OUTPUT
|