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