]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/dialog/configure.in
Merge gdtoa-20110304.
[FreeBSD/FreeBSD.git] / contrib / dialog / configure.in
1 dnl $Id: configure.in,v 1.57 2010/04/28 20:33:01 tom Exp $
2 dnl Process this file with autoconf to produce a configure script.
3 dnl
4 AC_PREREQ(2.13.20020210)
5 AC_INIT(dialog.h)
6 AC_CONFIG_HEADER(dlg_config.h:config.hin)
7
8 CF_VERSION_INFO(dialog)
9 AC_ARG_PROGRAM
10
11 DESTDIR=
12 AC_SUBST(DESTDIR)
13
14 dnl
15 dnl Checks for programs.
16 dnl
17 AC_PROG_CC
18 AC_PROG_CPP
19 AC_PROG_GCC_TRADITIONAL
20 AC_PROG_MAKE_SET
21 AC_PROG_RANLIB
22 AC_PROG_INSTALL
23
24 dnl needed for CF_WITH_LIBTOOL
25 AC_CHECK_TOOL(AR, ar, ar)
26
27 AC_ISC_POSIX
28 AC_C_CONST
29
30 CF_MAKEFLAGS
31 CF_MAKE_TAGS
32 CF_DISABLE_ECHO
33 CF_PROG_EXT
34 CF_PATHSEP
35 CF_LIB_PREFIX
36 CF_XOPEN_SOURCE
37 CF_LARGEFILE
38
39 CF_WITH_WARNINGS
40
41 dnl
42 dnl Checks for libraries.
43 dnl
44 EXTRAOBJS=""
45 CF_BUNDLED_INTL(makefile,enable)
46 CF_MATH_LIB(,sqrt(x))
47
48 CF_WITH_NO_LEAKS
49
50 CF_ARG_MSG_ENABLE([if you want --trace option],
51         trace,
52         [  --disable-trace         do not support --trace option],
53         [EXTRAOBJS="$EXTRAOBJS trace\$o"
54          AC_DEFINE(HAVE_DLG_TRACE)],,yes)
55
56 LIBTOOL_MAKE="#"
57 CF_WITH_LIBTOOL
58 if test "$with_libtool" = "yes" ; then
59         OBJEXT="lo"
60         LIBTOOL_MAKE=
61         CF_WITH_LIBTOOL_OPTS
62 fi
63 AC_SUBST(LIBTOOL_MAKE)
64
65 use_ncurses=no
66 AC_ARG_WITH(ncurses,
67         [  --with-ncurses          compile/link with ncurses library],
68         [use_ncurses=ncurses])
69 AC_ARG_WITH(ncursesw,
70         [  --with-ncursesw         compile/link with wide-char ncurses library],
71         [use_ncurses=ncursesw])
72 if test $use_ncurses != no ; then
73         cf_wide_curses=yes
74         if test $use_ncurses = ncursesw ; then
75                 CF_UTF8_LIB
76         fi
77         CF_NCURSES_CONFIG($use_ncurses)
78 else
79         cf_wide_curses=no
80         CF_CURSES_CONFIG
81 fi
82
83 cf_all_widgets=yes
84 CF_ARG_MSG_ENABLE([if you want extra dialogs],
85         extras,
86         [  --disable-extras        do not include extra dialogs],
87         [cf_all_widgets=yes],[cf_all_widgets=no],yes)
88
89 CF_ARG_MSG_ENABLE([if you want config-file support],
90         rc-file,
91         [  --disable-rc-file       do not include config-file support],
92         [EXTRAOBJS="$EXTRAOBJS rc\$o"
93          AC_DEFINE(HAVE_RC_FILE)],,$cf_all_widgets)
94
95 CF_ARG_MSG_ENABLE([if you want Xdialog-style dialogs],
96         Xdialog,
97         [  --disable-Xdialog       do not include Xdialog-style dialogs],
98         [EXTRAOBJS="$EXTRAOBJS calendar\$o fselect\$o timebox\$o"
99          AC_DEFINE(HAVE_XDIALOG)],,$cf_all_widgets)
100
101 CF_ARG_MSG_ENABLE([if you want the form dialog],
102         form,
103         [  --disable-form          do not include the form dialog],
104         [EXTRAOBJS="$EXTRAOBJS formbox\$o"
105          AC_DEFINE(HAVE_DLG_FORMBOX)],,$cf_all_widgets)
106
107 CF_ARG_MSG_ENABLE([if you want the gauge dialog],
108         gauge,
109         [  --disable-gauge         do not include the gauge dialogs],
110         [EXTRAOBJS="$EXTRAOBJS guage\$o pause\$o progressbox\$o"
111          AC_DEFINE(HAVE_DLG_GAUGE)],,$cf_all_widgets)
112
113 CF_ARG_MSG_ENABLE([if you want the tailbox dialog],
114         tailbox,
115         [  --disable-tailbox       do not include the tailbox dialog],
116         [EXTRAOBJS="$EXTRAOBJS tailbox\$o"
117          AC_DEFINE(HAVE_DLG_TAILBOX)],,$cf_all_widgets)
118
119 CF_ARG_MSG_ENABLE([if you want the mixedform dialog],
120         mixedform,
121         [  --disable-mixedform     do not include the mixedform dialog],
122         [EXTRAOBJS="$EXTRAOBJS mixedform\$o"
123          AC_DEFINE(HAVE_DLG_MIXEDFORM)],,$cf_all_widgets)
124
125 CF_ARG_MSG_ENABLE([if you want the mixedgauge dialog],
126         mixedgauge,
127         [  --disable-mixedgauge    do not include the mixedgauge dialog],
128         [EXTRAOBJS="$EXTRAOBJS mixedgauge\$o"
129          AC_DEFINE(HAVE_MIXEDGAUGE)],,$cf_all_widgets)
130
131 CF_ARG_MSG_ENABLE([if you want the wide-curses features],
132         widec,
133         [  --enable-widec          enable wide-curses features],
134         [AC_DEFINE(USE_WIDE_CURSES)],,$cf_wide_curses)
135
136 AC_SUBST(EXTRAOBJS)
137
138 dnl
139 dnl Checks for header files.
140 dnl
141 AC_HEADER_STDC
142 AC_HEADER_TIME
143 AC_HEADER_DIRENT
144 AC_CHECK_HEADERS(search.h unctrl.h unistd.h)
145 CF_CURSES_TERM_H
146
147 dnl
148 dnl Checks for library functions.
149 dnl
150 AC_TYPE_SIGNAL
151 AC_CHECK_FUNCS(\
152 _nc_free_and_exit \
153 strcasecmp \
154 strftime \
155 tsearch \
156 waitpid \
157 )
158
159 CF_CURSES_FUNCS(\
160 flushinp \
161 getbegx \
162 getbegy \
163 getbegyx \
164 getcurx \
165 getcury \
166 getmaxx \
167 getmaxy \
168 getmaxyx \
169 getparx \
170 getpary \
171 getparyx \
172 use_default_colors \
173 wget_wch \
174 )
175
176 AC_CHECK_FUNC(start_color,[AC_DEFINE(HAVE_COLOR)])
177 CF_CURSES_CHTYPE
178 CF_FUNC_WAIT
179 CF_MBSTATE_T
180
181 CF_HEADERS_SH(DLG,dlg_config.h)
182
183 AC_TRY_LINK([#include <locale.h>],[setlocale(LC_ALL, "")],[AC_DEFINE(HAVE_SETLOCALE)])
184
185 CF_DISABLE_RPATH_HACK
186
187 AC_OUTPUT(dialog-config makefile $EXTRA_OUTPUT $SUB_MAKEFILE samples/install/makefile,,,sort -u)