1dnl	UNNETHACK autoconf template
2AC_INIT(UNNETHACK, 3.5.1, bhaak@gmx.net)
3dnl Avoid AC_REVISION() because we check configure into CVS
4dnl and it will cause confusing revision numbers to be included
5dnl in configure if developers forget to check in configure.ac
6dnl before running bootstrap.sh and checking in configure.
7
8AC_CONFIG_SRCDIR(Files)
9AC_SUBST(SRCDIR,[../$srcdir/src])
10AC_CONFIG_AUX_DIR(sys/autoconf)
11
12dnl  ----- Precious variables
13AC_ARG_VAR(CC, [C compiler])
14AC_ARG_VAR(CHGRP, [sets GAMEUID (set this to true as a no op)])
15AC_ARG_VAR(CHOWN, [sets GAMEGRP (set this to true as a no op)])
16AC_ARG_VAR(CHMOD, [sets file modes (set this to true as a no op)])
17AC_ARG_VAR(ZLIB_CFLAGS, [Compiler flags to find zlib header files])
18AC_ARG_VAR(ZLIB_LIBS, [Linker flags to find zlib library files])
19
20AC_PROG_LN_S
21AC_PROG_AWK
22
23dnl  ----- Check options
24dnl  ----- Window systems
25
26# NETHACK_WIN_ENABLE(proxy, auto)
27nethack_default_win=""
28# Note: Order is important: The last listed enabled port will be the default.
29NETHACK_WIN_ENABLE(dummy, no, [dummy graphics for unit tests])
30NETHACK_WIN_ENABLE(dummy, no, [dummy graphics for unit tests])
31NETHACK_WIN_ENABLE(curses, no, [use curses interface])
32NETHACK_WIN_ENABLE(tty, auto)
33#NETHACK_WIN_ENABLE(x11, no)
34#NETHACK_WIN_ENABLE(mswin, no, [use Microsoft Window's native graphics])
35dnl deactivate X11 and Win32 tiles version
36enable_x11_graphics="no"
37enable_mswin_graphics="no"
38
39dnl  ----- Figure out a C compiler to use; set @CC@
40AC_PROG_CC
41AC_SUBST(LFLAGS)
42
43dnl  ----- Check OS
44AC_CANONICAL_HOST
45
46dnl  ----- Early checks for libraries, as needed
47
48dnl PKG_PROG_PKG_CONFIG([])
49if test "$enable_x11_graphics" != "no"; then
50    # We have to check for libXaw before we define SYSV,
51    # since the X11 include files change their behaviour
52    # depending on whether the compiler defines it or not.
53    NETHACK_CHECK_LIBXAW([LIBXAW], have_libXaw=yes, have_libXaw=no)
54fi
55
56dnl  ------ Main OS types
57case $host_os in
58     mingw32 )		AC_DEFINE(WIN32,[],[An MS-Windows system])
59			AC_SUBST(HOST_MSWIN,[])
60			AC_SUBST(HOST_UNIX,[#])
61			SYSTEM="Syswinnt"
62			SYSSRC="\${SYSMSWINSRC}"
63			SYSOBJ="\${SYSMSWINOBJ}"
64			;;
65     *bsd* )		AC_DEFINE(BSD,[],[A BSD like system])
66			AC_SUBST(HOST_MSWIN,[#])
67			AC_SUBST(HOST_UNIX,[])
68			SYSTEM="Sysunix"
69			SYSSRC="\${SYSUNIXSRC}"
70			SYSOBJ="\${SYSUNIXOBJ}"
71			;;
72     * )		AC_DEFINE(SYSV,[],[A System V like system])
73			AC_SUBST(HOST_MSWIN,[#])
74			AC_SUBST(HOST_UNIX,[])
75			SYSTEM="Sysunix"
76			SYSSRC="\${SYSUNIXSRC}"
77			SYSOBJ="\${SYSUNIXOBJ}"
78			;;
79esac
80AC_SUBST(SYSTEM)
81AC_SUBST(SYSSRC)
82AC_SUBST(SYSOBJ)
83
84if test $host_os = mingw32; then
85    CFLAGS="$CFLAGS -mno-cygwin -isystem /usr/include/mingw"
86    LFLAGS="$LDFLAGS -mno-cygwin -L/usr/lib/mingw"
87
88    AC_MSG_CHECKING([for how to build UnNetHack key dynamic libraries])
89    if test "$GCC" = yes; then
90	AC_MSG_RESULT([gcc])
91	AC_SUBST(NHKEYDLL_GCC,[])
92    else
93	AC_MSG_RESULT([unknown])
94	if test "$enable_tty_graphics" = yes; then
95	    AC_MSG_ERROR([Don't know how to build UnNetHack key DLLs with $CC])
96	else
97	    AC_MSG_WARN([Can't enable tty graphics (key dynamic libraries)])
98	    NETHACK_AUTO_WIN_DISABLE(tty)
99	fi
100    fi
101fi
102
103
104dnl Disable GCC warning: "format not a string literal and no format arguments"
105if test "$GCC" = "yes"; then
106	AX_CHECK_COMPILER_FLAGS(-Wno-format-security, CFLAGS="$CFLAGS -Wno-format-security")
107fi
108
109dnl ------ Common subtypes
110case $host_os in
111     *cygwin* )		AC_DEFINE(CYGWIN32,[],[Unix on win32]);;
112     *linux* )		AC_DEFINE(LINUX,[],[GNU Linux]);;
113esac
114
115
116dnl  ----- Check for programs
117AC_PROG_LEX
118if test "$LEX" == ":"; then
119	AC_MSG_ERROR([cannot find flex or lex])
120fi
121AC_CHECK_PROGS(YACC, ['bison -y' byacc yacc])
122if test -z "$YACC"; then
123	AC_MSG_ERROR([cannot find bison, byacc or yacc])
124fi
125AC_CHECK_TOOLS(CHOWN,[chown true])
126AC_CHECK_TOOLS(CHGRP,[chgrp true])
127AC_CHECK_TOOLS(CHMOD,[chmod true])
128AC_CHECK_TOOL(WINDRES,windres,no)
129NETHACK_PROG_COMPRESS
130
131dnl  ----- Check for libraries
132
133dnl NETHACK_CHECK_LIBPNG(NETHACK_LIBPNG, have_libpng=yes, have_libpng=no)
134
135dnl  ----- Select window systems
136
137WINSRC=
138WINOBJ=
139WINLIB=
140CNF_SHARE_DATND=
141
142OPTIONS_FILE=
143OPTIONS_FILES=
144
145WINTTYLIB=
146if test "$enable_tty_graphics" != "no"; then
147    if test $host_os = mingw32; then
148	AC_SUBST(EXTRA_UNSHARE,["nhdefkey.dll nh340key.dll nhraykey.dll"])
149	CFLAGS="$CFLAGS -DWIN32CON"
150	WINTTYLIB=""
151	WINSRC="${WINSRC} \$(WINTTYSRC)"
152	WINOBJ="${WINOBJ} \$(WINTTYOBJ)"
153	WINLIB="${WINLIB} \$(WINTTYLIB)"
154	AC_DEFINE(TTY_GRAPHICS, [], [Console output])
155    else
156	# For TTY, determine the termlib
157	# Check for termlib before termcap because Solaris termcap needs libucb.
158	TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo"
159	for termlib in ${TERMLIB_VARIANTS}; do
160	    AC_CHECK_LIB(${termlib}, tgetent,
161	      [WINTTYLIB="-l${termlib}"
162	      WINSRC="${WINSRC} \$(WINTTYSRC)"
163	      WINOBJ="${WINOBJ} \$(WINTTYOBJ)"
164	      WINLIB="${WINLIB} \$(WINTTYLIB)"
165	      AC_DEFINE(TTY_GRAPHICS, [], [Console output])
166	      break])
167	done
168	if test -z "$termlib"; then
169	    if test "$enable_tty_graphics" = yes; then
170		AC_MSG_ERROR([Can't find tgetent (needed for tty graphics)])
171	    else
172		AC_MSG_WARN([Can't enable tty graphics (no tgetent)])
173		NETHACK_AUTO_WIN_DISABLE(tty)
174	    fi
175	fi
176	dnl  ----- Check for tparm in curses
177	AC_CHECK_HEADERS(curses.h termcap.h)
178	AC_CHECK_LIB(curses, tparm, AC_DEFINE(HAVE_TPARM, 1, [Define this if you have the tparm function in an included lib.]),)
179
180    fi
181
182    OPTIONS_FILE="options"
183    OPTIONS_FILES="options"
184fi
185if test "$enable_tty_graphics" = "no" -a $host_os = mingw32; then
186    LFLAGS="$LFLAGS -mwindows"
187fi
188AC_SUBST(WINTTYLIB)
189
190
191WINCURSESLIB=
192if test "$enable_curses_graphics" != "no"; then
193	# For curses, determine the curses lib
194	CURSES_VARIANTS="ncurses curses"
195	for curseslib in ${CURSES_VARIANTS}; do
196	    AC_CHECK_LIB(${curseslib}, tgetent,
197	      [WINCURSESLIB="-l${curseslib}"
198	      WINSRC="${WINSRC} \$(WINCURSESSRC)"
199	      WINOBJ="${WINOBJ} \$(WINCURSESOBJ)"
200	      WINLIB="${WINLIB} \$(WINCURSESLIB)"
201	      AC_DEFINE(CURSES_GRAPHICS, [], [Curses interface])
202	      break])
203	done
204	if test -z "$curseslib"; then
205	    if test "$enable_curses_graphics" = yes; then
206		AC_MSG_ERROR([Can't find tgetent (needed for curses graphics)])
207	    else
208		AC_MSG_WARN([Can't enable curses graphics (no tgetent)])
209		NETHACK_AUTO_WIN_DISABLE(curses)
210	    fi
211	fi
212
213	OPTIONS_FILE="options"
214	OPTIONS_FILES="options"
215fi
216AC_SUBST(WINCURSESLIB)
217
218dnl if test "$enable_proxy_graphics" != "no"; then
219dnl     if test "$have_libpng" = "no"; then
220dnl 	if test "$enable_proxy_graphics" = "yes"; then
221dnl 	    AC_MSG_ERROR([Need libpng for proxy graphics])
222dnl 	else
223dnl 	    AC_MSG_WARN([Can't enable proxy graphics (no useable libpng)])
224dnl 	fi
225dnl     else
226dnl 	if test "$enable_proxy_graphics" = "yes"; then
227dnl 	    PKG_CHECK_MODULES(NETHACK_PROXY, nhproxy >= 0.9.0)
228dnl 	else
229dnl 	    PKG_CHECK_MODULES(NETHACK_PROXY, nhproxy >= 0.9.0, :, :)
230dnl 	fi
231dnl 	if test -n "$NETHACK_PROXY_LIBS"; then
232dnl 	    CFLAGS="${CFLAGS} ${NETHACK_LIBPNG_CFLAGS}"
233dnl 	    LFLAGS="${LFLAGS} ${NETHACK_LIBPNG_LFLAGS}"
234dnl 	    WINSRC="${WINSRC} \$(WINPROXYSRC)"
235dnl 	    WINOBJ="${WINOBJ} \$(WINPROXYOBJ)"
236dnl 	    WINLIB="${WINLIB} ${NETHACK_PROXY_LIBS}"
237dnl 	    CNF_SHARE_DATND="${CNF_SHARE_DATND} \$(CNF_SHARE_PROXYND)"
238dnl 	    AC_DEFINE(PROXY_GRAPHICS, [], [proxy graphics])
239dnl 	fi
240dnl     fi
241dnl fi
242dnl AC_SUBST(NETHACK_PROXY_CFLAGS)
243
244if test "$enable_x11_graphics" != "no"; then
245    if test $have_libXaw != yes; then
246      AC_MSG_ERROR([Need X Athena Widgets Library for X11 graphics])
247    fi
248    CFLAGS="${CFLAGS} ${LIBXAW_CFLAGS}"
249    WINSRC="${WINSRC} \$(WINX11SRC)"
250    WINOBJ="${WINOBJ} \$(WINX11OBJ)"
251    WINLIB="${WINLIB} ${LIBXAW_LIBS}"
252    CNF_SHARE_DATND="${CNF_SHARE_DATND} \$(CNF_SHARE_X11ND)"
253    AC_DEFINE(X11_GRAPHICS, [], [X11 graphics])
254
255    OPTIONS_FILE="options"
256    OPTIONS_FILES="options"
257fi
258
259if test "$enable_dummy_graphics" != "no"; then
260    WINSRC="${WINSRC} \$(WINDUMMYSRC)"
261    WINOBJ="${WINOBJ} \$(WINDUMMYOBJ)"
262    AC_DEFINE(DUMMY_GRAPHICS, [], [Dummy graphics])
263
264    OPTIONS_FILE="options"
265    OPTIONS_FILES="options"
266fi
267
268if test "$enable_mswin_graphics" != "no"; then
269    AC_MINGW32
270
271    if test "$WINDRES" = "no"; then
272	AC_MSG_ERROR([Need windres for Microsoft Window's native graphics])
273    fi
274    WINSRC="${WINSRC} \$(WINMSSRC)"
275    WINOBJ="${WINOBJ} \$(WINMSOBJ)"
276    WINLIB="${WINLIB} \$(WINMSLIB)"
277    CNF_SHARE_DATND="${CNF_SHARE_DATND} \$(CNF_SHARE_MSND)"
278    AC_DEFINE(MSWIN_GRAPHICS, [], [Microsoft Window's native graphics])
279
280    OPTIONS_FILE="guioptions"
281    OPTIONS_FILES="$OPTIONS_FILES guioptions"
282fi
283
284AC_SUBST(WINSRC)
285AC_SUBST(WINOBJ)
286AC_SUBST(WINLIB)
287AC_SUBST(CNF_SHARE_DATND)
288AC_SUBST(OPTIONS_FILE)
289AC_SUBST(OPTIONS_FILES)
290
291AC_MSG_CHECKING(for valid window system configuration)
292if test -n "$nethack_wins"; then
293    AC_MSG_RESULT([yes])
294    for win in $nethack_wins; do
295	AC_DEFINE_UNQUOTED(DEFAULT_WINDOW_SYS,["$win"],
296	  [The default windowing system])
297	break
298    done
299else
300    AC_MSG_RESULT([no])
301    AC_MSG_ERROR([need to enable at least one window system])
302fi
303
304
305dnl  ----- Check for header files
306AC_HEADER_STDC
307# Due to what may be a bug in autoconf, we have to call AC_CHECK_HEADERS()
308# to get the various HAVE_xxx_H preprocessor variables detected by
309# AC_HEADER_STDC active. These are needed for AC_CHECK_DECLS(), below.
310AC_CHECK_HEADERS([string.h utime.h])
311AC_CHECK_HEADER(regex.h, [have_regex_h=yes],[have_regex_h=no],/* TEST_REGEX */)
312
313dnl ------ Check for data types
314dnl -- Regex-Check for MENU_COLOR
315if test "$have_regex_h" = "yes"; then
316  AC_CHECK_TYPE(struct re_pattern_buffer,
317    [AC_DEFINE(MENU_COLOR_REGEX, [], [Use regular expressions])
318     AC_DEFINE(MENU_COLOR_REGEX_GNU, [], [GNU regex is available])
319    ],
320    [AC_CHECK_TYPE(regex_t,
321      [AC_DEFINE(MENU_COLOR_REGEX, [], [Use regular expressions])
322	AC_DEFINE(MENU_COLOR_REGEX_POSIX, [], [Posix regex is available])
323      ],,
324      [AC_INCLUDES_DEFAULT([])
325	#include <regex.h>
326      ])
327    ],[AC_INCLUDES_DEFAULT([])
328	#include <regex.h>
329      ])
330fi
331AC_CHECK_TYPE(void,,AC_DEFINE(NOVOID, [], [No void type available]))
332
333
334dnl  ----- Check for library functions
335AC_CHECK_DECLS([strncmpi, strnicmp], AC_DEFINE(STRNCMPI, [], [Use strncmpi]))
336
337dnl ------ Check needed functions for TIMED_DELAY
338AC_CHECK_FUNC(msleep, cf_result=yes, cf_result=no)
339if test "$cf_result" = no; then
340	AC_CHECK_FUNC(usleep, AC_DEFINE(TIMED_DELAY, [], [Using usleep]), [])
341else
342	AC_DEFINE(TIMED_DELAY, [], [Using msleep])
343fi
344
345dnl ------ Check fcntl for USE_FCNTL
346AC_CHECK_FUNCS(fcntl)
347
348dnl  ----- Check for program needed to build Guidebook
349AC_CHECK_PROG(HAVE_NROFF, nroff, "yes", "no")
350AC_CHECK_PROG(HAVE_TBL, tbl, "yes", "no")
351if test "$HAVE_NROFF" != "no" ; then
352if test "$HAVE_TBL" != "no" ; then
353	AC_SUBST(GUIDEBOOK,[Guidebook])
354	AC_SUBST(GUIDEBOOK_TXT,[Guidebook.txt])
355fi
356fi
357
358if test $host_os != mingw32; then
359  dnl searching for non blocking random device
360  AC_MSG_CHECKING(for pseudo random number device)
361  if test -r "/dev/urandom"; then
362	AC_DEFINE(DEV_RANDOM, ["/dev/urandom"], [Pseudo random number device])
363	AC_MSG_RESULT(/dev/urandom)
364  elif test -r "/dev/random"; then
365	AC_DEFINE(DEV_RANDOM, ["/dev/random"], [Pseudo random number device])
366	AC_MSG_RESULT(/dev/random)
367  else
368	AC_MSG_RESULT(not found);
369  fi
370
371  dnl check for GNU Scientific Library for Mersenne Twister RNG
372  dnl http://www.gnu.org/software/gsl/manual/html_node/Autoconf-Macros.html
373  AC_CHECK_LIB([gsl],[gsl_blas_dgemm],
374		[LFLAGS="$LDFLAGS -lgsl";
375		 AC_DEFINE(USE_MERSENNE_TWISTER, [], [Using Mersenne Twister as RNG])])
376fi
377
378dnl  ----- Check for compile-time options
379# We use auto for data librarian to avoid breaking the rule that autoconf
380# should use the same defaults as the manual configuration, but all platforms
381# that support autoconf also support DLB, so the automatic choice is always yes.
382NETHACK_ARG(data-librarian,[Data librarian],DLB,auto,
383  [enable_data_librarian=yes])
384NETHACK_ARG(sinks,[Kitchen sinks],SINKS,yes)
385# NETHACK_ARG(light-src-spell,[Spells are light sources],LIGHT_SRC_SPELL,yes)
386NETHACK_ARG(wallified-maze,[Fancy mazes],WALLIFIED_MAZE,yes)
387NETHACK_ARG(reincarnation,[Special Rogue-like levels],REINCARNATION,yes)
388NETHACK_ARG(blackmarket,[Blackmarket],BLACKMARKET,yes)
389NETHACK_ARG(kops,[Keystone Kops],KOPS,yes)
390NETHACK_ARG(seduce,[Succubi/incubi seduction],SEDUCE,yes)
391# NETHACK_ARG(invisible-objects,[Invisible objects],INVISIBLE_OBJECTS,yes)
392# NETHACK_ARG(unpolypile,[Object unpolymorphing],UNPOLYPILE,yes)
393# NETHACK_ARG(wallet-o-p,[Perseus' Wallet],WALLET_O_P,yes)
394# NETHACK_ARG(lightsabers,[Lightsabers],LIGHTSABERS,yes)
395# NETHACK_ARG(d-saber,[Dimsabers],LIGHTSABERS,yes)
396# NETHACK_ARG(p-spoon,[Spoon],P_SPOON,yes)
397# NETHACK_ARG(firearms,[Guns and Bullets],FIREARMS,yes)
398# NETHACK_ARG(eaten-memory,[Remember which monsters have been eaten],
399#  EATEN_MEMORY,yes)
400NETHACK_ARG(randomized-planes,[Shuffling order of Elemental Planes],RANDOMIZED_PLANES,yes)
401NETHACK_ARG(steed,[Ability to ride monsters],STEED,yes)
402# NETHACK_ARG(dwarf,[Dwarf race],DWARF,yes)
403NETHACK_ARG(tourist,[Tourist class],TOURIST,yes)
404# NETHACK_ARG(yeoman,[Yeoman class],YEOMAN,yes)
405# NETHACK_ARG(zouthern,[Zoutherner class],ZOUTHERN,no)
406NETHACK_ARG(redo,[Redo last command],REDO,yes)
407NETHACK_ARG(clipping,[Allow smaller screens],CLIPPING,yes)
408NETHACK_ARG(menu-color,[TTY graphics menu color],MENU_COLOR,yes)
409if test "$enable_tty_graphics" != "no"; then
410NETHACK_ARG(status-color,[TTY graphics status color],STATUS_COLORS,yes)
411fi
412NETHACK_ARG(auto-open,[Open doors by walking into them],AUTO_OPEN,yes)
413NETHACK_ARG(elbereth,[Engraving the E-word repels monsters],ELBERETH,yes)
414# NETHACK_ARG(noartifactwish,[Prevent wishing for special artifacts],
415#  NOARTIFACTWISH,no)
416# NETHACK_ARG(no-bones,[Disable loading and saving bones levels],NO_BONES,no)
417NETHACK_ARG(user-sounds,
418  [Allow user-defined mapping from messages to sounds)],
419  USER_SOUNDS,no)
420NETHACK_ARG(exp-on-botl,[Show experience on bottom line],EXP_ON_BOTL,yes)
421NETHACK_ARG(score-on-botl,[Show score on bottom line],SCORE_ON_BOTL,no)
422NETHACK_ARG(realtime-on-botl,[Show elapsed time on bottom line],REALTIME_ON_BOTL,no)
423NETHACK_ARG(high-score-comparison-by-uid,[Compare High Score entries by user id instead of user name],PERS_IS_UID,no)
424#NETHACK_ARG(borg,[Borg player (only under DOS)],BORG,no)
425# NETHACK_ARG(keep-save,[Keep save files after restore],KEEP_SAVE,no)
426# NETHACK_ARG(charon,[Charon's boat, enables Cerebus (not implemented)],CHARON,no)
427# NETHACK_ARG(show-dmg,[Display damage reports],SHOW_DMG,yes)
428# NETHACK_ARG(show-weight,[Display object weight],SHOW_WEIGHT,yes)
429# NETHACK_ARG(other-services,[Shopkeeper services],OTHER_SERVICES,yes)
430NETHACK_ARG(paranoid,[Require some questions to be answered with 'yes' instead of 'y'],PARANOID,yes)
431NETHACK_ARG(show-born,[Display number of created monsters at the end of game],SHOW_BORN,yes)
432NETHACK_ARG(show-extinct,[Display extinct monsters at the end of game],SHOW_EXTINCT,yes)
433NETHACK_ARG(dungeon-growth,[Dungeon growth],DUNGEON_GROWTH,yes)
434#NETHACK_ARG(shout,[Shouting and pet commands (not implemented)],SHOUT,no)
435# NETHACK_ARG(display-layers,[Support transparent tilesets],DISPLAY_LAYERS,yes)
436NETHACK_ARG(goldobj,[Gold is kept on object chains (experimental)],GOLDOBJ,no)
437NETHACK_ARG(autopickup-exceptions,[Exceptions to autopickup (experimental)],
438  AUTOPICKUP_EXCEPTIONS,no)
439NETHACK_ARG(qwertz,[QWERTZ keyboard layout support],QWERTZ,yes)
440NETHACK_ARG(simple-mail,[simple mail dgamelaunch support],SIMPLE_MAIL,no)
441
442NETHACK_ARG_WITH_PARAM(xlogfile,[More verbose logfile],XLOGFILE,yes,FILE,[xlogfile])
443
444NETHACK_ARG_WITH_PARAM(livelog,[Live game progress logfile],LIVELOGFILE,no,FILE,[livelog])
445if test "$enable_livelog" != "no" ; then
446	NETHACK_ARG(livelog-shout,[Shoutting into the live game logfile],LIVELOG_SHOUT,no)
447	NETHACK_ARG(livelog-killing,[Reporting killing of uniques and ghosts of former players],LIVELOG_BONES_KILLER,no)
448fi
449
450NETHACK_ARG(dump,[Dumping character stats],DUMP_LOG,yes)
451if test "$enable_dump" != "no" ; then
452	NETHACK_ARG_WITH_PARAM(dump-file,[Name of character dump file],DUMP_FN,no,FILE,"/tmp/%n.nh")
453	NETHACK_ARG_WITH_PARAM(dump-messages,[Number of dumped messages],DUMPMSGS,yes,NUMBER,20)
454	NETHACK_ARG(dump-text,[Dump a text file],DUMP_TEXT_LOG,yes)
455	NETHACK_ARG(dump-html,[Dump an HTML file],DUMP_HTML_LOG,no)
456	if test "$enable_dump_html" != "no" ; then
457		NETHACK_ARG_WITH_PARAM(dump-html-css-file,[Path to the css dump file],DUMP_HTML_CSS_FILE,yes,FILE,"unnethack_dump.css")
458		NETHACK_ARG(dump-html-css-embedded,[CSS file should be included in the HTML dump],DUMP_HTML_CSS_EMBEDDED,no)
459	fi
460fi
461
462NETHACK_ARG_WITH_PARAM(whereis-file,[Log information about running games],WHEREIS_FILE,no,FILE,[%n.whereis])
463
464NETHACK_ARG_WITH_PARAM(wizmode,[enable wizard mode for the specified user],WIZARD,yes,USER,[wizard])
465
466if test "$CHOWN" != "true"; then
467    AC_MSG_CHECKING([for owner of installed files])
468    AC_ARG_WITH([owner], [AS_HELP_STRING([--with-owner=USER],
469	    [Set the owner of installed files (default=games)])],
470	    [], [with_owner=games])
471    if test "$with_owner" != "no" ; then
472	NETHACK_COMMAND_IFELSE(
473		[find . -user "$with_owner" -prune -print > /dev/null],
474		[AC_MSG_RESULT([$with_owner])
475		 AC_SUBST(OWNER,[$with_owner])],
476		[AC_MSG_FAILURE([test for user $with_owner failed])])
477    else
478	CHOWN=true
479	AC_MSG_RESULT([not set])
480    fi
481fi
482
483if test "$CHGRP" != "true"; then
484    AC_MSG_CHECKING([for group of installed files])
485    AC_ARG_WITH([group], [AS_HELP_STRING([--with-group=GROUP],
486	    [Set the group of installed files (default=bin)])],
487	    [], [with_group=bin])
488    if test "$with_group" != "no" ; then
489	NETHACK_COMMAND_IFELSE(
490		[find . -group "$with_group" -prune -print > /dev/null],
491		[AC_MSG_RESULT([$with_group])
492		 AC_SUBST(GROUP,[$with_group])],
493		[AC_MSG_FAILURE([test for group $with_group failed])])
494    else
495	CHGRP=true
496	AC_MSG_RESULT([not set])
497    fi
498fi
499
500NETHACK_LINKS=
501NETHACK_LINKS_ADD([dat/data.base])
502NETHACK_LINKS_ADD([dat/rumors.tru])
503NETHACK_LINKS_ADD([dat/rumors.fal])
504NETHACK_LINKS_ADD([dat/quest.txt])
505NETHACK_LINKS_ADD([dat/oracles.txt])
506NETHACK_LINKS_ADD([dat/dungeon.def])
507NETHACK_LINKS_ADD([dat/help])
508NETHACK_LINKS_ADD([dat/hh])
509NETHACK_LINKS_ADD([dat/cmdhelp])
510NETHACK_LINKS_ADD([dat/history])
511NETHACK_LINKS_ADD([dat/opthelp])
512NETHACK_LINKS_ADD([dat/wizhelp])
513NETHACK_LINKS_ADD([include/win32api.h:sys/winnt/win32api.h])
514
515AC_CONFIG_LINKS(${NETHACK_LINKS})
516
517dnl  ----- Process the Makefiles
518AC_CONFIG_FILES([Makefile:sys/autoconf/Makefile.top]
519	[src/Makefile:sys/autoconf/Makefile.src]
520	[doc/Makefile:sys/autoconf/Makefile.doc]
521	[dat/Makefile:sys/autoconf/Makefile.dat]
522	[util/Makefile:sys/autoconf/Makefile.utl]
523	[sys/autoconf/depend.awk:sys/autoconf/depend.in])
524
525AH_TOP([#ifndef AUTOCONF_H
526#define AUTOCONF_H])
527AH_BOTTOM([#endif /* AUTOCONF_H */])
528
529NETHACK_CONFIG_HEADER([include/autoconf.h:sys/autoconf/autoconf.hin])
530
531AC_OUTPUT
532