1dnl $Id: configure.in,v 1.57 2010/04/28 20:33:01 tom Exp $ 2dnl Process this file with autoconf to produce a configure script. 3dnl 4AC_PREREQ(2.13.20020210) 5AC_INIT(dialog.h) 6AC_CONFIG_HEADER(dlg_config.h:config.hin) 7 8CF_VERSION_INFO(dialog) 9AC_ARG_PROGRAM 10 11DESTDIR= 12AC_SUBST(DESTDIR) 13 14dnl 15dnl Checks for programs. 16dnl 17AC_PROG_CC 18AC_PROG_CPP 19AC_PROG_GCC_TRADITIONAL 20AC_PROG_MAKE_SET 21AC_PROG_RANLIB 22AC_PROG_INSTALL 23 24dnl needed for CF_WITH_LIBTOOL 25AC_CHECK_TOOL(AR, ar, ar) 26 27AC_ISC_POSIX 28AC_C_CONST 29 30CF_MAKEFLAGS 31CF_MAKE_TAGS 32CF_DISABLE_ECHO 33CF_PROG_EXT 34CF_PATHSEP 35CF_LIB_PREFIX 36CF_XOPEN_SOURCE 37CF_LARGEFILE 38 39CF_WITH_WARNINGS 40 41dnl 42dnl Checks for libraries. 43dnl 44EXTRAOBJS="" 45CF_BUNDLED_INTL(makefile,enable) 46CF_MATH_LIB(,sqrt(x)) 47 48CF_WITH_NO_LEAKS 49 50CF_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 56LIBTOOL_MAKE="#" 57CF_WITH_LIBTOOL 58if test "$with_libtool" = "yes" ; then 59 OBJEXT="lo" 60 LIBTOOL_MAKE= 61 CF_WITH_LIBTOOL_OPTS 62fi 63AC_SUBST(LIBTOOL_MAKE) 64 65use_ncurses=no 66AC_ARG_WITH(ncurses, 67 [ --with-ncurses compile/link with ncurses library], 68 [use_ncurses=ncurses]) 69AC_ARG_WITH(ncursesw, 70 [ --with-ncursesw compile/link with wide-char ncurses library], 71 [use_ncurses=ncursesw]) 72if 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) 78else 79 cf_wide_curses=no 80 CF_CURSES_CONFIG 81fi 82 83cf_all_widgets=yes 84CF_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 89CF_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 95CF_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 101CF_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 107CF_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 113CF_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 119CF_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 125CF_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 131CF_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 136AC_SUBST(EXTRAOBJS) 137 138dnl 139dnl Checks for header files. 140dnl 141AC_HEADER_STDC 142AC_HEADER_TIME 143AC_HEADER_DIRENT 144AC_CHECK_HEADERS(search.h unctrl.h unistd.h) 145CF_CURSES_TERM_H 146 147dnl 148dnl Checks for library functions. 149dnl 150AC_TYPE_SIGNAL 151AC_CHECK_FUNCS(\ 152_nc_free_and_exit \ 153strcasecmp \ 154strftime \ 155tsearch \ 156waitpid \ 157) 158 159CF_CURSES_FUNCS(\ 160flushinp \ 161getbegx \ 162getbegy \ 163getbegyx \ 164getcurx \ 165getcury \ 166getmaxx \ 167getmaxy \ 168getmaxyx \ 169getparx \ 170getpary \ 171getparyx \ 172use_default_colors \ 173wget_wch \ 174) 175 176AC_CHECK_FUNC(start_color,[AC_DEFINE(HAVE_COLOR)]) 177CF_CURSES_CHTYPE 178CF_FUNC_WAIT 179CF_MBSTATE_T 180 181CF_HEADERS_SH(DLG,dlg_config.h) 182 183AC_TRY_LINK([#include <locale.h>],[setlocale(LC_ALL, "")],[AC_DEFINE(HAVE_SETLOCALE)]) 184 185CF_DISABLE_RPATH_HACK 186 187AC_OUTPUT(dialog-config makefile $EXTRA_OUTPUT $SUB_MAKEFILE samples/install/makefile,,,sort -u) 188