1dnl $Id: configure.in,v 1.101 2020/11/26 16:21:27 tom Exp $ 2dnl Process this file with autoconf to produce a configure script. 3dnl --------------------------------------------------------------------------- 4dnl Copyright 1999-2019,2020 -- 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.20200802) 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_SCREEN_PDCURSES 67CF_ENABLE_WARNINGS(,yes) 68CF_PKG_CONFIG 69 70dnl 71dnl Allow dialog program and library to be renamed. 72AC_MSG_CHECKING(for this package's name) 73AC_ARG_WITH(package, 74 [ --with-package=XXX rename dialog to XXX, library to libXXX.a, etc], 75 [PACKAGE=$withval], 76 [PACKAGE=dialog]) 77AC_MSG_RESULT($PACKAGE) 78CF_VERSION_INFO(dialog,$PACKAGE) 79 80CFG_ROOTNAME=$PACKAGE 81HDR_ROOTNAME=$PACKAGE 82LIB_ROOTNAME=$PACKAGE 83 84AC_SUBST(CFG_ROOTNAME) 85AC_SUBST(HDR_ROOTNAME) 86AC_SUBST(LIB_ROOTNAME) 87 88dnl 89dnl If package is renamed, it is useful to have the dlg_XXX headers in a 90dnl subdirectory (using the package name) so that multiple versions of the 91dnl headers can coexist. 92AC_MSG_CHECKING(if we should install dlg_XXX headers to subdirectory) 93AC_ARG_ENABLE(header-subdir, 94 [ --enable-header-subdir install dlg_XXX headers to subdirectory], 95 [SUB_INC=$enableval], 96 [SUB_INC=no]) 97AC_MSG_RESULT($SUB_INC) 98AC_SUBST(SUB_INC) 99 100CF_WITH_MAN2HTML 101 102dnl 103dnl Checks for libraries. 104dnl 105EXTRAOBJS="" 106CF_BUNDLED_INTL(makefile,enable) 107CF_MATH_LIB(,sqrt(x)) 108 109CF_WITH_NO_LEAKS 110 111CF_ARG_MSG_ENABLE([if you want --trace option], 112 trace, 113 [ --disable-trace do not support --trace option], 114 [EXTRAOBJS="$EXTRAOBJS trace\$o" 115 AC_DEFINE(HAVE_DLG_TRACE,1,[Define to 1 to support --trace option])],,yes) 116 117CF_ENABLE_RPATH 118CF_LD_RPATH_OPT 119CF_WITH_SHARED_OR_LIBTOOL(DIALOG,${VERSION_MAJOR}.${VERSION_MINOR},`echo "$VERSION" |sed -e 's/:/./g'`) 120 121CF_WITH_CURSES_DIR 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_use_dialogrc=yes 133CF_ARG_MSG_ENABLE([if you want config-file support], 134 rc-file, 135 [ --disable-rc-file do not include config-file support], 136 [EXTRAOBJS="$EXTRAOBJS rc\$o" 137 AC_DEFINE(HAVE_RC_FILE,1,[Define to 1 to include config-file support])],cf_use_dialogrc=no,$cf_all_widgets) 138 139cf_use_dialogrc2=yes 140if test "$cf_use_dialogrc" = yes; then 141CF_ARG_MSG_ENABLE([if you want extra attributes in config-file], 142 rc-file2, 143 [ --disable-rc-file2 do not use extra attributes in config-file], 144 [AC_DEFINE(HAVE_RC_FILE2,1,[Define to 1 to use extra attributes in config-file])],cf_use_dialogrc2=no,$cf_all_widgets) 145fi 146 147CF_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 153CF_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 159CF_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 164CF_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 170CF_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 176CF_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 182CF_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])],,${enable_form:=$cf_all_widgets}) 187 188CF_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 194CF_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_cv_widec_curses) 198 199AC_SUBST(EXTRAOBJS) 200 201dnl 202dnl Checks for header files. 203dnl 204AC_HEADER_STDC 205AC_HEADER_TIME 206AC_HEADER_DIRENT 207AC_CHECK_HEADERS(search.h stdint.h sys/param.h unistd.h) 208CF_CURSES_TERM_H 209 210dnl 211dnl Checks for library functions. 212dnl 213AC_TYPE_SIGNAL 214AC_CHECK_FUNCS(\ 215btowc \ 216mblen \ 217mbrlen \ 218mbrtowc \ 219mbtowc \ 220strcasecmp \ 221strftime \ 222tsearch \ 223waitpid \ 224wcsrtombs \ 225wcstombs \ 226wctob \ 227wctomb \ 228mktime \ 229) 230 231CF_CURSES_FUNCS(\ 232flushinp \ 233getattrs \ 234getbegx \ 235getbegy \ 236getbegyx \ 237getcurx \ 238getcury \ 239getmaxx \ 240getmaxy \ 241getmaxyx \ 242getparx \ 243getpary \ 244getparyx \ 245use_default_colors \ 246wchgat \ 247wcursyncup \ 248wget_wch \ 249wsyncup \ 250) 251 252CF_CURSES_EXIT 253 254AC_CHECK_FUNC(start_color,[AC_DEFINE(HAVE_COLOR,1,[Define to 1 if (n)curses has start_color function])]) 255CF_CURSES_CHTYPE 256CF_CURSES_WACS_SYMBOLS 257CF_CURSES_WGETPARENT 258CF_FUNC_WAIT 259CF_MBSTATE_T 260CF_SIZECHANGE 261 262CF_HEADERS_SH(DLG,dlg_config.h) 263 264AC_TRY_LINK([#include <locale.h>],[setlocale(LC_ALL, "")],[AC_DEFINE(HAVE_SETLOCALE,1,[Define to 1 if locale feature can be enabled])]) 265CF_NL_LANGINFO_1STDAY 266 267CF_MERGE_EXTRA_CFLAGS 268CF_DISABLE_RPATH_HACK 269 270CF__DEFINE_SHLIB_VARS 271CF_LD_SEARCHPATH 272 273AC_OUTPUT( 274 dialog-config 275 makefile 276 $EXTRA_OUTPUT 277 $SUB_MAKEFILE,[ 278CF__ADD_SHLIB_RULES( 279 makefile, 280 $LIB_MODEL, 281 [\${LIB_OBJECT}], 282 [\${LIBS} \${LDFLAGS}]) 283],[ 284CF__INIT_SHLIB_RULES 285],[sort -u]) 286