summaryrefslogtreecommitdiff
path: root/Build/source/utils/dialog/dialog-1.1-20110302/configure.in
blob: 5ecd8fbaa33c310992a5738f74276fd54e5b0130 (plain)
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
dnl $Id: configure.in,v 1.64 2011/03/01 00:59:50 tom Exp $
dnl Process this file with autoconf to produce a configure script.
dnl ---------------------------------------------------------------------------
dnl Copyright 1999-2010,2011 -- Thomas E. Dickey
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the
dnl "Software"), to deal in the Software without restriction, including
dnl without limitation the rights to use, copy, modify, merge, publish,
dnl distribute, distribute with modifications, sublicense, and/or sell
dnl copies of the Software, and to permit persons to whom the Software is
dnl furnished to do so, subject to the following conditions:
dnl 
dnl The above copyright notice and this permission notice shall be included
dnl in all copies or portions of the Software.
dnl 
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.
dnl 
dnl Except as contained in this notice, the name(s) of the above copyright
dnl holders shall not be used in advertising or otherwise to promote the
dnl sale, use or other dealings in this Software without prior written
dnl authorization.
dnl ---------------------------------------------------------------------------
AC_PREREQ(2.13.20020210)
AC_INIT(dialog.h)
AC_CONFIG_HEADER(dlg_config.h:config.hin)

AC_ARG_PROGRAM

DESTDIR=
AC_SUBST(DESTDIR)

dnl
dnl Checks for programs.
dnl
AC_PROG_CC
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_INSTALL

dnl needed for CF_WITH_LIBTOOL
AC_CHECK_TOOL(AR, ar, ar)

AC_ISC_POSIX
AC_C_CONST

CF_MAKEFLAGS
CF_MAKE_TAGS
CF_DISABLE_ECHO
CF_PROG_EXT
CF_PATHSEP
CF_LIB_PREFIX
CF_XOPEN_SOURCE
CF_LARGEFILE

CF_WITH_WARNINGS

dnl
dnl Allow dialog program and library to be renamed.
AC_ARG_WITH(package,
	[  --with-package=XXX      rename dialog to XXX, library to libXXX.a, etc],
	[PACKAGE=$withval],
	[PACKAGE=dialog])
CF_VERSION_INFO(dialog,$PACKAGE)

dnl
dnl If package is renamed, it is useful to have the dlg_XXX headers in a
dnl subdirectory (using the package name) so that multiple versions of the
dnl headers can coexist.
AC_ARG_ENABLE(header-subdir,
	[  --enable-header-subdir  install dlg_XXX headers to subdirectory],
	[SUB_INC=$enableval],
	[SUB_INC=no])
AC_SUBST(SUB_INC)

dnl
dnl Checks for libraries.
dnl
EXTRAOBJS=""
CF_BUNDLED_INTL(makefile,enable)
CF_MATH_LIB(,sqrt(x))

CF_WITH_NO_LEAKS

CF_ARG_MSG_ENABLE([if you want --trace option],
	trace,
	[  --disable-trace         do not support --trace option],
	[EXTRAOBJS="$EXTRAOBJS trace\$o"
	 AC_DEFINE(HAVE_DLG_TRACE)],,yes)

LIBTOOL_MAKE="#"
CF_WITH_LIBTOOL
if test "$with_libtool" = "yes" ; then
	OBJEXT="lo"
	LIBTOOL_MAKE=
	CF_WITH_LIBTOOL_OPTS
fi
AC_SUBST(LIBTOOL_MAKE)

CF_WITH_CURSES_DIR

use_ncurses=no
AC_ARG_WITH(ncurses,
	[  --with-ncurses          compile/link with ncurses library],
	[use_ncurses=ncurses])
AC_ARG_WITH(ncursesw,
	[  --with-ncursesw         compile/link with wide-char ncurses library],
	[use_ncurses=ncursesw])
if test $use_ncurses != no ; then
	cf_wide_curses=yes
	if test $use_ncurses = ncursesw ; then
		CF_UTF8_LIB
	fi
	CF_NCURSES_CONFIG($use_ncurses)
else
	cf_wide_curses=no
	CF_CURSES_CONFIG
fi

cf_all_widgets=yes
CF_ARG_MSG_ENABLE([if you want extra dialogs],
	extras,
	[  --disable-extras        do not include extra dialogs],
	[cf_all_widgets=yes],[cf_all_widgets=no],yes)

CF_ARG_MSG_ENABLE([if you want config-file support],
	rc-file,
	[  --disable-rc-file       do not include config-file support],
	[EXTRAOBJS="$EXTRAOBJS rc\$o"
	 AC_DEFINE(HAVE_RC_FILE)],,$cf_all_widgets)

CF_ARG_MSG_ENABLE([if you want Xdialog-style dialogs],
	Xdialog,
	[  --disable-Xdialog       do not include Xdialog-style dialogs],
	[EXTRAOBJS="$EXTRAOBJS calendar\$o fselect\$o timebox\$o"
	 AC_DEFINE(HAVE_XDIALOG)],,$cf_all_widgets)

CF_ARG_MSG_ENABLE([if you want the form dialog],
	form,
	[  --disable-form          do not include the form dialog],
	[EXTRAOBJS="$EXTRAOBJS formbox\$o"
	 AC_DEFINE(HAVE_DLG_FORMBOX)],,$cf_all_widgets)

CF_ARG_MSG_ENABLE([if you want the gauge dialog],
	gauge,
	[  --disable-gauge         do not include the gauge dialogs],
	[EXTRAOBJS="$EXTRAOBJS guage\$o pause\$o prgbox\$o progressbox\$o"
	 AC_DEFINE(HAVE_DLG_GAUGE)],,$cf_all_widgets)

CF_ARG_MSG_ENABLE([if you want the tailbox dialog],
	tailbox,
	[  --disable-tailbox       do not include the tailbox dialog],
	[EXTRAOBJS="$EXTRAOBJS tailbox\$o"
	 AC_DEFINE(HAVE_DLG_TAILBOX)],,$cf_all_widgets)

CF_ARG_MSG_ENABLE([if you want the mixedform dialog],
	mixedform,
	[  --disable-mixedform     do not include the mixedform dialog],
	[EXTRAOBJS="$EXTRAOBJS mixedform\$o"
	 AC_DEFINE(HAVE_DLG_MIXEDFORM)],,$cf_all_widgets)

CF_ARG_MSG_ENABLE([if you want the mixedgauge dialog],
	mixedgauge,
	[  --disable-mixedgauge    do not include the mixedgauge dialog],
	[EXTRAOBJS="$EXTRAOBJS mixedgauge\$o"
	 AC_DEFINE(HAVE_MIXEDGAUGE)],,$cf_all_widgets)

CF_ARG_MSG_ENABLE([if you want the wide-curses features],
	widec,
	[  --enable-widec          enable wide-curses features],
	[AC_DEFINE(USE_WIDE_CURSES)],,$cf_wide_curses)

AC_SUBST(EXTRAOBJS)

dnl
dnl Checks for header files.
dnl
AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_DIRENT
AC_CHECK_HEADERS(search.h unctrl.h unistd.h)
CF_CURSES_TERM_H

dnl
dnl Checks for library functions.
dnl
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(\
_nc_free_and_exit \
btowc \
mblen \
mbrlen \
mbrtowc \
mbtowc \
strcasecmp \
strftime \
tsearch \
waitpid \
wcsrtombs \
wcstombs \
wctob \
wctomb \
)

CF_CURSES_FUNCS(\
flushinp \
getattrs \
getbegx \
getbegy \
getbegyx \
getcurx \
getcury \
getmaxx \
getmaxy \
getmaxyx \
getparx \
getpary \
getparyx \
use_default_colors \
wget_wch \
)

AC_CHECK_FUNC(start_color,[AC_DEFINE(HAVE_COLOR)])
CF_CURSES_CHTYPE
CF_CURSES_WACS_SYMBOLS
CF_FUNC_WAIT
CF_MBSTATE_T

CF_HEADERS_SH(DLG,dlg_config.h)

AC_TRY_LINK([#include <locale.h>],[setlocale(LC_ALL, "")],[AC_DEFINE(HAVE_SETLOCALE)])

CF_DISABLE_RPATH_HACK

AC_OUTPUT(dialog-config makefile $EXTRA_OUTPUT $SUB_MAKEFILE samples/install/makefile,,,sort -u)