]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/dialog/configure.in
MFC r368207,368607:
[FreeBSD/stable/10.git] / contrib / dialog / configure.in
1 dnl $Id: configure.in,v 1.79 2013/09/02 14:02:57 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_LN_S
48 CF_PROG_LINT
49
50 dnl needed for CF_WITH_LIBTOOL
51 AC_CHECK_TOOL(AR, ar, ar)
52
53 CF_MAKEFLAGS
54 CF_MAKE_TAGS
55 CF_DISABLE_ECHO
56 CF_PROG_EXT
57 CF_PATHSEP
58 CF_LIB_PREFIX
59 CF_XOPEN_SOURCE
60 CF_LARGEFILE
61
62 CF_WITH_WARNINGS
63 CF_PKG_CONFIG
64
65 dnl
66 dnl Allow dialog program and library to be renamed.
67 AC_MSG_CHECKING(for this package's name)
68 AC_ARG_WITH(package,
69         [  --with-package=XXX      rename dialog to XXX, library to libXXX.a, etc],
70         [PACKAGE=$withval],
71         [PACKAGE=dialog])
72 AC_MSG_RESULT($PACKAGE)
73 CF_VERSION_INFO(dialog,$PACKAGE)
74
75 CFG_ROOTNAME=$PACKAGE
76 HDR_ROOTNAME=$PACKAGE
77 LIB_ROOTNAME=$PACKAGE
78
79 AC_SUBST(CFG_ROOTNAME)
80 AC_SUBST(HDR_ROOTNAME)
81 AC_SUBST(LIB_ROOTNAME)
82
83 dnl
84 dnl If package is renamed, it is useful to have the dlg_XXX headers in a
85 dnl subdirectory (using the package name) so that multiple versions of the
86 dnl headers can coexist.
87 AC_MSG_CHECKING(if we should install dlg_XXX headers to subdirectory)
88 AC_ARG_ENABLE(header-subdir,
89         [  --enable-header-subdir  install dlg_XXX headers to subdirectory],
90         [SUB_INC=$enableval],
91         [SUB_INC=no])
92 AC_MSG_RESULT($SUB_INC)
93 AC_SUBST(SUB_INC)
94
95 dnl
96 dnl Checks for libraries.
97 dnl
98 EXTRAOBJS=""
99 CF_BUNDLED_INTL(makefile,enable)
100 CF_MATH_LIB(,sqrt(x))
101
102 CF_WITH_NO_LEAKS
103
104 CF_ARG_MSG_ENABLE([if you want --trace option],
105         trace,
106         [  --disable-trace         do not support --trace option],
107         [EXTRAOBJS="$EXTRAOBJS trace\$o"
108          AC_DEFINE(HAVE_DLG_TRACE,1,[Define to 1 to support --trace option])],,yes)
109
110 CF_LD_RPATH_OPT
111 CF_WITH_SHARED_OR_LIBTOOL(DIALOG,${VERSION_MAJOR}.${VERSION_MINOR},`echo "$VERSION" |sed -e 's/:/./g'`)
112
113 CF_WITH_CURSES_DIR
114
115 CF_ENABLE_RPATH
116
117 use_ncurses=no
118 AC_ARG_WITH(ncurses,
119         [  --with-ncurses          compile/link with ncurses library],
120         [use_ncurses=ncurses])
121 AC_ARG_WITH(ncursesw,
122         [  --with-ncursesw         compile/link with wide-char ncurses library],
123         [use_ncurses=ncursesw])
124 if test $use_ncurses != no ; then
125         cf_wide_curses=yes
126         if test $use_ncurses = ncursesw ; then
127                 CF_UTF8_LIB
128         fi
129         CF_NCURSES_CONFIG($use_ncurses)
130 else
131         cf_wide_curses=no
132         CF_CURSES_CONFIG
133 fi
134
135 cf_all_widgets=yes
136 CF_ARG_MSG_ENABLE([if you want extra dialogs],
137         extras,
138         [  --disable-extras        do not include extra dialogs],
139         [cf_all_widgets=yes],[cf_all_widgets=no],yes)
140
141 CF_ARG_MSG_ENABLE([if you want config-file support],
142         rc-file,
143         [  --disable-rc-file       do not include config-file support],
144         [EXTRAOBJS="$EXTRAOBJS rc\$o"
145          AC_DEFINE(HAVE_RC_FILE,1,[Define to 1 to include config-file support])],,$cf_all_widgets)
146
147 CF_ARG_MSG_ENABLE([if you want Xdialog-style dialogs],
148         Xdialog,
149         [  --disable-Xdialog       do not include Xdialog-style dialogs (1.1)],
150         [EXTRAOBJS="$EXTRAOBJS calendar\$o fselect\$o timebox\$o"
151          AC_DEFINE(HAVE_XDIALOG,1,[Define to 1 to include Xdialog-style dialogs])],,$cf_all_widgets)
152
153 CF_ARG_MSG_ENABLE([if you want extra Xdialog-style dialogs (1.2)],
154         Xdialog2,
155         [  --disable-Xdialog2      do not include extra Xdialog-style dialogs (1.2)],
156         [EXTRAOBJS="$EXTRAOBJS buildlist\$o rangebox\$o treeview\$o"
157          AC_DEFINE(HAVE_XDIALOG2,1,[Define to 1 to include extra Xdialog-style dialogs])],,$cf_all_widgets)
158
159 CF_ARG_MSG_ENABLE([if you want compatibility with whiptail options],
160         whiptail,
161         [  --disable-whiptail      do not map extra whiptail options],
162         [AC_DEFINE(HAVE_WHIPTAIL,1,[Define to 1 to include extra whiptail options])],,$cf_all_widgets)
163
164 CF_ARG_MSG_ENABLE([if you want the form dialog],
165         form,
166         [  --disable-form          do not include the form dialog],
167         [EXTRAOBJS="$EXTRAOBJS formbox\$o"
168          AC_DEFINE(HAVE_DLG_FORMBOX,1,[Define to 1 to include the form dialog])],,$cf_all_widgets)
169
170 CF_ARG_MSG_ENABLE([if you want the gauge dialog],
171         gauge,
172         [  --disable-gauge         do not include the gauge dialogs],
173         [EXTRAOBJS="$EXTRAOBJS guage\$o pause\$o prgbox\$o progressbox\$o"
174          AC_DEFINE(HAVE_DLG_GAUGE,1,[Define to 1 to include the gauge dialogs])],,$cf_all_widgets)
175
176 CF_ARG_MSG_ENABLE([if you want the tailbox dialog],
177         tailbox,
178         [  --disable-tailbox       do not include the tailbox dialog],
179         [EXTRAOBJS="$EXTRAOBJS tailbox\$o"
180          AC_DEFINE(HAVE_DLG_TAILBOX,1,[Define to 1 to include the tailbox dialog])],,$cf_all_widgets)
181
182 CF_ARG_MSG_ENABLE([if you want the mixedform dialog],
183         mixedform,
184         [  --disable-mixedform     do not include the mixedform dialog],
185         [EXTRAOBJS="$EXTRAOBJS mixedform\$o"
186          AC_DEFINE(HAVE_DLG_MIXEDFORM,1,[Define to 1 to include the mixedform dialog])],,$cf_all_widgets)
187
188 CF_ARG_MSG_ENABLE([if you want the mixedgauge dialog],
189         mixedgauge,
190         [  --disable-mixedgauge    do not include the mixedgauge dialog],
191         [EXTRAOBJS="$EXTRAOBJS mixedgauge\$o"
192          AC_DEFINE(HAVE_MIXEDGAUGE,1,[Define to 1 to include the mixedgauge dialog])],,$cf_all_widgets)
193
194 CF_ARG_MSG_ENABLE([if you want the wide-curses features],
195         widec,
196         [  --enable-widec          enable wide-curses features],
197         [AC_DEFINE(USE_WIDE_CURSES,1,[Define to 1 to enable wide-curses features])],,$cf_wide_curses)
198
199 AC_SUBST(EXTRAOBJS)
200
201 dnl
202 dnl Checks for header files.
203 dnl
204 AC_HEADER_STDC
205 AC_HEADER_TIME
206 AC_HEADER_DIRENT
207 AC_CHECK_HEADERS(search.h unctrl.h unistd.h)
208 CF_CURSES_TERM_H
209
210 dnl
211 dnl Checks for library functions.
212 dnl
213 AC_TYPE_SIGNAL
214 AC_CHECK_FUNCS(\
215 _nc_free_and_exit \
216 btowc \
217 mblen \
218 mbrlen \
219 mbrtowc \
220 mbtowc \
221 strcasecmp \
222 strftime \
223 tsearch \
224 waitpid \
225 wcsrtombs \
226 wcstombs \
227 wctob \
228 wctomb \
229 )
230
231 CF_CURSES_FUNCS(\
232 flushinp \
233 getattrs \
234 getbegx \
235 getbegy \
236 getbegyx \
237 getcurx \
238 getcury \
239 getmaxx \
240 getmaxy \
241 getmaxyx \
242 getparx \
243 getpary \
244 getparyx \
245 use_default_colors \
246 wchgat \
247 wcursyncup \
248 wget_wch \
249 wsyncup \
250 )
251
252 AC_CHECK_FUNC(start_color,[AC_DEFINE(HAVE_COLOR,1,[Define to 1 if (n)curses has start_color function])])
253 CF_CURSES_CHTYPE
254 CF_CURSES_WACS_SYMBOLS
255 CF_CURSES_WGETPARENT
256 CF_FUNC_WAIT
257 CF_MBSTATE_T
258
259 CF_HEADERS_SH(DLG,dlg_config.h)
260
261 AC_TRY_LINK([#include <locale.h>],[setlocale(LC_ALL, "")],[AC_DEFINE(HAVE_SETLOCALE,1,[Define to 1 if locale feature can be enabled])])
262
263 CF_DISABLE_RPATH_HACK
264
265 CF__DEFINE_SHLIB_VARS
266
267 AC_OUTPUT(
268         dialog-config
269         makefile
270         $EXTRA_OUTPUT
271         $SUB_MAKEFILE,[
272 CF__ADD_SHLIB_RULES(
273         makefile,
274         $LIB_MODEL,
275         [\${LIB_OBJECT}],
276         [\${LIBS} \${LDFLAGS}])
277 ],[
278 CF__INIT_SHLIB_RULES
279 ],[sort -u])