]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/dialog/configure.in
Update dialog to 1.2-20130523
[FreeBSD/FreeBSD.git] / contrib / dialog / configure.in
1 dnl $Id: configure.in,v 1.75 2012/12/30 22:38:00 tom Exp $
2 dnl Process this file with autoconf to produce a configure script.
3 dnl ---------------------------------------------------------------------------
4 dnl Copyright 1999-2011,2012 -- Thomas E. Dickey
5 dnl
6 dnl Permission is hereby granted, free of charge, to any person obtaining a
7 dnl copy of this software and associated documentation files (the
8 dnl "Software"), to deal in the Software without restriction, including
9 dnl without limitation the rights to use, copy, modify, merge, publish,
10 dnl distribute, distribute with modifications, sublicense, and/or sell
11 dnl copies of the Software, and to permit persons to whom the Software is
12 dnl furnished to do so, subject to the following conditions:
13 dnl 
14 dnl The above copyright notice and this permission notice shall be included
15 dnl in all copies or portions of the Software.
16 dnl 
17 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21 dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
23 dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 dnl 
25 dnl Except as contained in this notice, the name(s) of the above copyright
26 dnl holders shall not be used in advertising or otherwise to promote the
27 dnl sale, use or other dealings in this Software without prior written
28 dnl authorization.
29 dnl ---------------------------------------------------------------------------
30 AC_PREREQ(2.52.20011201)
31 AC_INIT(dialog.h)
32 AC_CONFIG_HEADER(dlg_config.h:config.hin)
33
34 AC_ARG_PROGRAM
35
36 DESTDIR=
37 AC_SUBST(DESTDIR)
38
39 dnl
40 dnl Checks for programs.
41 dnl
42 CF_PROG_CC
43 AC_PROG_CPP
44 AC_PROG_MAKE_SET
45 AC_PROG_RANLIB
46 AC_PROG_INSTALL
47 CF_PROG_LINT
48
49 dnl needed for CF_WITH_LIBTOOL
50 AC_CHECK_TOOL(AR, ar, ar)
51
52 CF_MAKEFLAGS
53 CF_MAKE_TAGS
54 CF_DISABLE_ECHO
55 CF_PROG_EXT
56 CF_PATHSEP
57 CF_LIB_PREFIX
58 CF_XOPEN_SOURCE
59 CF_LARGEFILE
60
61 CF_WITH_WARNINGS
62
63 dnl
64 dnl Allow dialog program and library to be renamed.
65 AC_ARG_WITH(package,
66         [  --with-package=XXX      rename dialog to XXX, library to libXXX.a, etc],
67         [PACKAGE=$withval],
68         [PACKAGE=dialog])
69 CF_VERSION_INFO(dialog,$PACKAGE)
70
71 dnl
72 dnl If package is renamed, it is useful to have the dlg_XXX headers in a
73 dnl subdirectory (using the package name) so that multiple versions of the
74 dnl headers can coexist.
75 AC_ARG_ENABLE(header-subdir,
76         [  --enable-header-subdir  install dlg_XXX headers to subdirectory],
77         [SUB_INC=$enableval],
78         [SUB_INC=no])
79 AC_SUBST(SUB_INC)
80
81 dnl
82 dnl Checks for libraries.
83 dnl
84 EXTRAOBJS=""
85 CF_BUNDLED_INTL(makefile,enable)
86 CF_MATH_LIB(,sqrt(x))
87
88 CF_WITH_NO_LEAKS
89
90 CF_ARG_MSG_ENABLE([if you want --trace option],
91         trace,
92         [  --disable-trace         do not support --trace option],
93         [EXTRAOBJS="$EXTRAOBJS trace\$o"
94          AC_DEFINE(HAVE_DLG_TRACE,1,[Define to 1 to support --trace option])],,yes)
95
96 LIBTOOL_MAKE="#"
97 CF_WITH_LIBTOOL
98 if test "$with_libtool" = "yes" ; then
99         OBJEXT="lo"
100         LIBTOOL_MAKE=
101         CF_WITH_LIBTOOL_OPTS
102 fi
103 AC_SUBST(LIBTOOL_MAKE)
104
105 CF_WITH_CURSES_DIR
106
107 use_ncurses=no
108 AC_ARG_WITH(ncurses,
109         [  --with-ncurses          compile/link with ncurses library],
110         [use_ncurses=ncurses])
111 AC_ARG_WITH(ncursesw,
112         [  --with-ncursesw         compile/link with wide-char ncurses library],
113         [use_ncurses=ncursesw])
114 if test $use_ncurses != no ; then
115         cf_wide_curses=yes
116         if test $use_ncurses = ncursesw ; then
117                 CF_UTF8_LIB
118         fi
119         CF_NCURSES_CONFIG($use_ncurses)
120 else
121         cf_wide_curses=no
122         CF_CURSES_CONFIG
123 fi
124
125 cf_all_widgets=yes
126 CF_ARG_MSG_ENABLE([if you want extra dialogs],
127         extras,
128         [  --disable-extras        do not include extra dialogs],
129         [cf_all_widgets=yes],[cf_all_widgets=no],yes)
130
131 CF_ARG_MSG_ENABLE([if you want config-file support],
132         rc-file,
133         [  --disable-rc-file       do not include config-file support],
134         [EXTRAOBJS="$EXTRAOBJS rc\$o"
135          AC_DEFINE(HAVE_RC_FILE,1,[Define to 1 to include config-file support])],,$cf_all_widgets)
136
137 CF_ARG_MSG_ENABLE([if you want Xdialog-style dialogs],
138         Xdialog,
139         [  --disable-Xdialog       do not include Xdialog-style dialogs (1.1)],
140         [EXTRAOBJS="$EXTRAOBJS calendar\$o fselect\$o timebox\$o"
141          AC_DEFINE(HAVE_XDIALOG,1,[Define to 1 to include Xdialog-style dialogs])],,$cf_all_widgets)
142
143 CF_ARG_MSG_ENABLE([if you want extra Xdialog-style dialogs (1.2)],
144         Xdialog2,
145         [  --disable-Xdialog2      do not include extra Xdialog-style dialogs (1.2)],
146         [EXTRAOBJS="$EXTRAOBJS buildlist\$o rangebox\$o treeview\$o"
147          AC_DEFINE(HAVE_XDIALOG2,1,[Define to 1 to include extra Xdialog-style dialogs])],,$cf_all_widgets)
148
149 CF_ARG_MSG_ENABLE([if you want compatibility with whiptail options],
150         whiptail,
151         [  --disable-whiptail      do not map extra whiptail options],
152         [AC_DEFINE(HAVE_WHIPTAIL,1,[Define to 1 to include extra whiptail options])],,$cf_all_widgets)
153
154 CF_ARG_MSG_ENABLE([if you want the form dialog],
155         form,
156         [  --disable-form          do not include the form dialog],
157         [EXTRAOBJS="$EXTRAOBJS formbox\$o"
158          AC_DEFINE(HAVE_DLG_FORMBOX,1,[Define to 1 to include the form dialog])],,$cf_all_widgets)
159
160 CF_ARG_MSG_ENABLE([if you want the gauge dialog],
161         gauge,
162         [  --disable-gauge         do not include the gauge dialogs],
163         [EXTRAOBJS="$EXTRAOBJS guage\$o pause\$o prgbox\$o progressbox\$o"
164          AC_DEFINE(HAVE_DLG_GAUGE,1,[Define to 1 to include the gauge dialogs])],,$cf_all_widgets)
165
166 CF_ARG_MSG_ENABLE([if you want the tailbox dialog],
167         tailbox,
168         [  --disable-tailbox       do not include the tailbox dialog],
169         [EXTRAOBJS="$EXTRAOBJS tailbox\$o"
170          AC_DEFINE(HAVE_DLG_TAILBOX,1,[Define to 1 to include the tailbox dialog])],,$cf_all_widgets)
171
172 CF_ARG_MSG_ENABLE([if you want the mixedform dialog],
173         mixedform,
174         [  --disable-mixedform     do not include the mixedform dialog],
175         [EXTRAOBJS="$EXTRAOBJS mixedform\$o"
176          AC_DEFINE(HAVE_DLG_MIXEDFORM,1,[Define to 1 to include the mixedform dialog])],,$cf_all_widgets)
177
178 CF_ARG_MSG_ENABLE([if you want the mixedgauge dialog],
179         mixedgauge,
180         [  --disable-mixedgauge    do not include the mixedgauge dialog],
181         [EXTRAOBJS="$EXTRAOBJS mixedgauge\$o"
182          AC_DEFINE(HAVE_MIXEDGAUGE,1,[Define to 1 to include the mixedgauge dialog])],,$cf_all_widgets)
183
184 CF_ARG_MSG_ENABLE([if you want the wide-curses features],
185         widec,
186         [  --enable-widec          enable wide-curses features],
187         [AC_DEFINE(USE_WIDE_CURSES,1,[Define to 1 to enable wide-curses features])],,$cf_wide_curses)
188
189 AC_SUBST(EXTRAOBJS)
190
191 dnl
192 dnl Checks for header files.
193 dnl
194 AC_HEADER_STDC
195 AC_HEADER_TIME
196 AC_HEADER_DIRENT
197 AC_CHECK_HEADERS(search.h unctrl.h unistd.h)
198 CF_CURSES_TERM_H
199
200 dnl
201 dnl Checks for library functions.
202 dnl
203 AC_TYPE_SIGNAL
204 AC_CHECK_FUNCS(\
205 _nc_free_and_exit \
206 btowc \
207 mblen \
208 mbrlen \
209 mbrtowc \
210 mbtowc \
211 strcasecmp \
212 strftime \
213 tsearch \
214 waitpid \
215 wcsrtombs \
216 wcstombs \
217 wctob \
218 wctomb \
219 )
220
221 CF_CURSES_FUNCS(\
222 flushinp \
223 getattrs \
224 getbegx \
225 getbegy \
226 getbegyx \
227 getcurx \
228 getcury \
229 getmaxx \
230 getmaxy \
231 getmaxyx \
232 getparx \
233 getpary \
234 getparyx \
235 use_default_colors \
236 wchgat \
237 wcursyncup \
238 wget_wch \
239 wsyncup \
240 )
241
242 AC_CHECK_FUNC(start_color,[AC_DEFINE(HAVE_COLOR,1,[Define to 1 if (n)curses has start_color function])])
243 CF_CURSES_CHTYPE
244 CF_CURSES_WACS_SYMBOLS
245 CF_CURSES_WGETPARENT
246 CF_FUNC_WAIT
247 CF_MBSTATE_T
248
249 CF_HEADERS_SH(DLG,dlg_config.h)
250
251 AC_TRY_LINK([#include <locale.h>],[setlocale(LC_ALL, "")],[AC_DEFINE(HAVE_SETLOCALE,1,[Define to 1 if locale feature can be enabled])])
252
253 CF_DISABLE_RPATH_HACK
254
255 AC_OUTPUT(dialog-config makefile $EXTRA_OUTPUT $SUB_MAKEFILE,,,sort -u)