1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
# Process this file with autoconf to produce a configure script.
AC_INIT(powwow, 1.2.23)
AM_INIT_AUTOMAKE
AC_CANONICAL_HOST
AC_ARG_ENABLE(vt100,
AC_HELP_STRING([--enable-vt100],
[Hard code VT100 escape sequences; use if you have no termcap [[default=no]]]),
,
[enable_vt100="no"]
)
AS_IF([ test "${enable_vt100}" = yes ],
[ AC_DEFINE(USE_VT100) ])
AC_ARG_ENABLE(regex,
AS_HELP_STRING([--enable-regex],
[Enable regular expressions [[default=yes]]])
[]
[yes - find first available: pcreposix, libc]
[pcreposix - use pcreposix]
[libc - use libc]
,,
[enable_regex="yes"]
)
AC_ARG_ENABLE(prove,
AC_HELP_STRING([--enable-prove],
[Enable prove option [[default=no]]]),
[AC_DEFINE(ENABLE_PROVE)]
)
AC_ARG_ENABLE(sort,
AC_HELP_STRING([--enable-sort],
[Sort aliases and actions [[default=no]]]),
,
[enable_sort="no"]
)
AS_IF([ test "${enable_sort}" = yes ],
[ AC_DEFINE(DO_SORT) ])
AC_ARG_ENABLE(noshell,
AC_HELP_STRING([--enable-noshell],
[Disables the "#!" command [[default=no]]]),
,
[enable_noshell="no"]
)
AS_IF([ test "${enable_noshell}" = yes ],
[ AC_DEFINE(NO_SHELL) ])
AC_ARG_ENABLE(ansibug,
AC_HELP_STRING([--enable-ansibug],
[Enables fixes for "#mark" ansi bugs on some terminals [[default=no]]]),
,
[enable_ansibug="no"]
)
AS_IF([ test "${enable_ansibug}" = yes ],
[ AC_DEFINE(BUG_ANSI) ])
AC_ARG_ENABLE(bsd,
AC_HELP_STRING([--enable-bsd],
[Needed for BSD systems, in powwow this was USE_SGTTY and BSD_LIKE. Default on Darwin (OS X) systems.]))
AS_IF([ test -z "${enable_bsd}" ],
[ case "${host_os}" in
darwin*) enable_bsd=yes ;;
*) enable_bsd=no ;;
esac])
AS_IF([ test "${enable_bsd}" = yes ],
[ AC_DEFINE(USE_SGTTY)
AC_DEFINE(BSD_LIKE) ])
AC_MSG_CHECKING([man page encoding])
if test -z "${MAN_PAGE_ENCODING}"; then
case "${host_os}" in
darwin*) MAN_PAGE_ENCODING=ISO-8859-1 ;;
*) MAN_PAGE_ENCODING=UTF-8 ;;
esac
fi
AC_SUBST([MAN_PAGE_ENCODING])
AC_MSG_RESULT([${MAN_PAGE_ENCODING}])
if test "${MAN_PAGE_ENCODING}" != UTF-8; then
AC_CHECK_PROG([ICONV], [iconv], [iconv], [])
if test -z "${ICONV}" -a "${MAN_PAGE_ENCODING}" != UTF-8; then
AC_MSG_WARN([Forcing man page encoding to UTF-8])
MAN_PAGE_ENCODING=UTF-8
fi
fi
AM_CONDITIONAL([MAN_PAGE_ENCODING_IS_UTF_8],
[test "${MAN_PAGE_ENCODING}" = UTF-8 ])
# Checks for programs.
AC_PROG_CC_C89
AC_PROG_LN_S
# Checks for libraries.
AC_CHECK_FUNC(lrand48,,AC_DEFINE(USE_RANDOM))
if test "x${enable_vt100}" != "xyes"; then
AC_SEARCH_LIBS(initscr,[ncurses curses], [], [
if test "x${enable_vt100}" = "xno" ; then
AC_MSG_ERROR([*** curses libraries not found])
fi])
fi
# Dynamic modules
AC_SEARCH_LIBS(dlopen,[dl],[
AC_DEFINE(HAVE_LIBDL)
dl_ldflags="-rdynamic"])
AC_SUBST(dl_ldflags)
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h unistd.h])
AC_CHECK_HEADER([locale.h],
[AC_CHECK_FUNC([putwc],[AC_DEFINE(USE_LOCALE)])])
if test "x${enable_regex}" = "xno"; then
AC_MSG_RESULT([Regex support disabled])
enable_regex_using="disabled"
else
enable_regex_using="not_found"
if test "x${enable_regex}" = "xyes"; then
AC_CHECK_HEADER("pcreposix.h",[
enable_regex_using="pcreposix"
], [
AC_CHECK_HEADER("regex.h",[
enable_regex_using="libc"
])
])
else
# Use the options defined
enable_regex_using="${enable_regex}"
fi
if test "x${enable_regex_using}" = "xnot_found"; then
# no regex
enable_regex=no
AC_MSG_RESULT([*** Unable to enable regex support])
else
AC_DEFINE(USE_REGEXP)
if test "x${enable_regex_using}" = "xpcreposix"; then
AC_MSG_RESULT([Using pcreposix regcomp])
AC_DEFINE(USE_REGEXP_PCREPOSIX)
AC_CHECK_LIB(pcreposix,regcomp,,
AC_MSG_ERROR([*** pcreposix library not found])
)
elif test "x${enable_regex_using}" = "xlibc"; then
AC_MSG_RESULT([Using libc regcomp])
AC_CHECK_FUNC(regcomp,,
AC_MSG_ERROR([*** regcomp not found in libc])
)
else
AC_MSG_ERROR([*** unknown regex option: $enable_regex_using])
fi
fi
fi
AC_ARG_WITH([plugindir],
AC_HELP_STRING([--with-plugindir=DIR],
[Plugin installation directory [[default=LIBDIR/powwow]]])],
[plugindir="${withval}"],
[plugindir="\${libdir}/powwow"])
AC_SUBST(plugindir)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
AC_FUNC_MALLOC
AC_OUTPUT(Makefile src/Makefile doc/powwow.doc doc/Makefile man/powwow.6.utf-8 man/Makefile)
cat <<EOF
Powwow has been configured with the following options:
Version: ${VERSION}
User binaries: $(eval eval eval echo "${bindir}")
Data directory: $(eval eval eval echo "${datadir}/${PACKAGE}")
Plugin directory: $(eval eval eval echo "${plugindir}")
enable-vt100: ${enable_vt100}
enable-regex: ${enable_regex} (${enable_regex_using})
enable-sort: ${enable_sort}
enable-noshell: ${enable_noshell}
enable-ansibug: ${enable_ansibug}
enable-bsd: ${enable_bsd}
Man page encoding: ${MAN_PAGE_ENCODING}
Host: ${host}
Compiler: ${CC}
Preprocessor flags: ${CPPFLAGS}
Compiler flags: ${CFLAGS}
Linker flags: ${LDFLAGS}
Libraries: ${LIBS}
EOF
|