annotate srogue/acinclude.m4 @ 315:ad2570b5b21f

Advanced Rogue 5, 7: fix some trading post messages. When attempting to buy an unaffordable object, messages were often of the form "You can't afford that a scroll of hold monster !", because the object description (stored in curpurch) was the same text used in inventory displays. This has been worked around by inspecting the contents of curpurch and using different message templates.
author John "Elwin" Edwards
date Sun, 24 Oct 2021 20:26:21 -0400
parents 029c1f5c5588
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
101
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
1 AC_DEFUN([MP_WITH_CURSES],
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
2 [AC_ARG_WITH(ncurses, [ --with-ncurses Force the use of ncurses over curses],,)
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
3 mp_save_LIBS="$LIBS"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
4 CURSES_LIB=""
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
5 if test "$with_ncurses" != yes
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
6 then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
7 AC_CACHE_CHECK([for working curses], mp_cv_curses,
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
8 [LIBS="$LIBS -lcurses"
312
029c1f5c5588 Update the Autoconf files.
John "Elwin" Edwards
parents: 101
diff changeset
9 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])])
101
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
10 if test "$mp_cv_curses" = yes
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
11 then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
12 AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
13 CURSES_LIB="-lcurses"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
14 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
15 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
16 if test ! "$CURSES_LIB"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
17 then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
18 AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
19 [LIBS="$mp_save_LIBS -lncurses"
312
029c1f5c5588 Update the Autoconf files.
John "Elwin" Edwards
parents: 101
diff changeset
20 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])])
101
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
21 if test "$mp_cv_ncurses" = yes
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
22 then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
23 AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
24 CURSES_LIB="-lncurses"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
25 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
26 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
27 if test ! "$CURSES_LIB"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
28 then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
29 AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
30 [LIBS="$mp_save_LIBS -lpdcurses"
312
029c1f5c5588 Update the Autoconf files.
John "Elwin" Edwards
parents: 101
diff changeset
31 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])])
101
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
32 if test "$mp_cv_pdcurses" = yes
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
33 then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
34 AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
35 CURSES_LIB="-lpdcurses"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
36 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
37 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
38 if test ! "$CURSES_LIB"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
39 then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
40 AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
41 [LIBS="$mp_save_LIBS -lpdcur"
312
029c1f5c5588 Update the Autoconf files.
John "Elwin" Edwards
parents: 101
diff changeset
42 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])])
101
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
43 if test "$mp_cv_pdcur" = yes
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
44 then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
45 AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
46 CURSES_LIB="-lpdcur"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
47 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
48 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
49 if test ! "$CURSES_LIB"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
50 then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
51 AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
52 [LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
312
029c1f5c5588 Update the Autoconf files.
John "Elwin" Edwards
parents: 101
diff changeset
53 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])])
101
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
54 if test "$mp_cv_lpdcurses" = yes
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
55 then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
56 AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
57 CURSES_LIB="../pdcurses/pdcurses.a"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
58 RF_ADDTO(CPPFLAGS,"-I../pdcurses")
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
59 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
60 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
61 AC_CACHE_CHECK([for ESCDELAY variable],
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
62 [mc_cv_ncurses_escdelay],
312
029c1f5c5588 Update the Autoconf files.
John "Elwin" Edwards
parents: 101
diff changeset
63 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
101
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
64 extern int ESCDELAY;
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
65 ESCDELAY = 0;
312
029c1f5c5588 Update the Autoconf files.
John "Elwin" Edwards
parents: 101
diff changeset
66 ]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no])
101
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
67 ])
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
68 if test "$mc_cv_ncurses_escdelay" = yes; then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
69 AC_DEFINE(HAVE_ESCDELAY, 1,
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
70 [Define if ncurses has ESCDELAY variable])
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
71 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
72 if test ! "$CURSES_LIB" ; then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
73 LIBS="$mp_save_LIBS"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
74 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
75 ])dnl
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
76
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
77 dnl
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
78 dnl RF_ADDTO(variable, value)
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
79 dnl
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
80 dnl Add value to variable
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
81 dnl
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
82 AC_DEFUN([RF_ADDTO],[
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
83 if test "x$$1" = "x"; then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
84 test "x$silent" != "xyes" && echo " setting $1 to \"$2\""
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
85 $1="$2"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
86 else
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
87 apr_addto_bugger="$2"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
88 for i in $apr_addto_bugger; do
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
89 apr_addto_duplicate="0"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
90 for j in $$1; do
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
91 if test "x$i" = "x$j"; then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
92 apr_addto_duplicate="1"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
93 break
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
94 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
95 done
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
96 if test $apr_addto_duplicate = "0"; then
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
97 test "x$silent" != "xyes" && echo " adding \"$i\" to $1"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
98 $1="$$1 $i"
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
99 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
100 done
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
101 fi
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
102 ])dnl
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
103
15f8229f38c1 srogue: begin porting to autoconf.
John "Elwin" Edwards
parents:
diff changeset
104