freebsd-dev/contrib/dialog/configure.in

280 lines
7.8 KiB
Plaintext
Raw Normal View History

dnl $Id: configure.in,v 1.79 2013/09/02 14:02:57 tom Exp $
2011-01-13 02:21:23 +00:00
dnl Process this file with autoconf to produce a configure script.
2011-04-17 17:00:55 +00:00
dnl ---------------------------------------------------------------------------
2013-06-17 10:00:48 +00:00
dnl Copyright 1999-2011,2012 -- Thomas E. Dickey
2011-01-13 02:21:23 +00:00
dnl
2011-04-17 17:00:55 +00:00
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the
dnl "Software"), to deal in the Software without restriction, including
dnl without limitation the rights to use, copy, modify, merge, publish,
dnl distribute, distribute with modifications, sublicense, and/or sell
dnl copies of the Software, and to permit persons to whom the Software is
dnl furnished to do so, subject to the following conditions:
dnl
dnl The above copyright notice and this permission notice shall be included
dnl in all copies or portions of the Software.
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.
dnl
dnl Except as contained in this notice, the name(s) of the above copyright
dnl holders shall not be used in advertising or otherwise to promote the
dnl sale, use or other dealings in this Software without prior written
dnl authorization.
dnl ---------------------------------------------------------------------------
2013-06-17 10:00:48 +00:00
AC_PREREQ(2.52.20011201)
2011-01-13 02:21:23 +00:00
AC_INIT(dialog.h)
AC_CONFIG_HEADER(dlg_config.h:config.hin)
AC_ARG_PROGRAM
DESTDIR=
AC_SUBST(DESTDIR)
dnl
dnl Checks for programs.
dnl
2013-06-17 10:00:48 +00:00
CF_PROG_CC
2011-01-13 02:21:23 +00:00
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_INSTALL
CF_PROG_LN_S
2012-10-21 18:18:09 +00:00
CF_PROG_LINT
2011-01-13 02:21:23 +00:00
dnl needed for CF_WITH_LIBTOOL
AC_CHECK_TOOL(AR, ar, ar)
CF_MAKEFLAGS
CF_MAKE_TAGS
CF_DISABLE_ECHO
CF_PROG_EXT
CF_PATHSEP
CF_LIB_PREFIX
CF_XOPEN_SOURCE
CF_LARGEFILE
CF_WITH_WARNINGS
CF_PKG_CONFIG
2011-01-13 02:21:23 +00:00
2011-04-17 17:00:55 +00:00
dnl
dnl Allow dialog program and library to be renamed.
AC_MSG_CHECKING(for this package's name)
2011-04-17 17:00:55 +00:00
AC_ARG_WITH(package,
[ --with-package=XXX rename dialog to XXX, library to libXXX.a, etc],
[PACKAGE=$withval],
[PACKAGE=dialog])
AC_MSG_RESULT($PACKAGE)
2011-04-17 17:00:55 +00:00
CF_VERSION_INFO(dialog,$PACKAGE)
CFG_ROOTNAME=$PACKAGE
HDR_ROOTNAME=$PACKAGE
LIB_ROOTNAME=$PACKAGE
AC_SUBST(CFG_ROOTNAME)
AC_SUBST(HDR_ROOTNAME)
AC_SUBST(LIB_ROOTNAME)
2011-04-17 17:00:55 +00:00
dnl
dnl If package is renamed, it is useful to have the dlg_XXX headers in a
dnl subdirectory (using the package name) so that multiple versions of the
dnl headers can coexist.
AC_MSG_CHECKING(if we should install dlg_XXX headers to subdirectory)
2011-04-17 17:00:55 +00:00
AC_ARG_ENABLE(header-subdir,
[ --enable-header-subdir install dlg_XXX headers to subdirectory],
[SUB_INC=$enableval],
[SUB_INC=no])
AC_MSG_RESULT($SUB_INC)
2011-04-17 17:00:55 +00:00
AC_SUBST(SUB_INC)
2011-01-13 02:21:23 +00:00
dnl
dnl Checks for libraries.
dnl
EXTRAOBJS=""
CF_BUNDLED_INTL(makefile,enable)
CF_MATH_LIB(,sqrt(x))
CF_WITH_NO_LEAKS
CF_ARG_MSG_ENABLE([if you want --trace option],
trace,
[ --disable-trace do not support --trace option],
[EXTRAOBJS="$EXTRAOBJS trace\$o"
2013-06-17 10:00:48 +00:00
AC_DEFINE(HAVE_DLG_TRACE,1,[Define to 1 to support --trace option])],,yes)
2011-01-13 02:21:23 +00:00
CF_LD_RPATH_OPT
CF_WITH_SHARED_OR_LIBTOOL(DIALOG,${VERSION_MAJOR}.${VERSION_MINOR},`echo "$VERSION" |sed -e 's/:/./g'`)
2011-01-13 02:21:23 +00:00
2011-04-17 17:00:55 +00:00
CF_WITH_CURSES_DIR
CF_ENABLE_RPATH
2011-01-13 02:21:23 +00:00
use_ncurses=no
AC_ARG_WITH(ncurses,
[ --with-ncurses compile/link with ncurses library],
[use_ncurses=ncurses])
AC_ARG_WITH(ncursesw,
[ --with-ncursesw compile/link with wide-char ncurses library],
[use_ncurses=ncursesw])
if test $use_ncurses != no ; then
cf_wide_curses=yes
if test $use_ncurses = ncursesw ; then
CF_UTF8_LIB
fi
CF_NCURSES_CONFIG($use_ncurses)
else
cf_wide_curses=no
CF_CURSES_CONFIG
fi
cf_all_widgets=yes
CF_ARG_MSG_ENABLE([if you want extra dialogs],
extras,
[ --disable-extras do not include extra dialogs],
[cf_all_widgets=yes],[cf_all_widgets=no],yes)
CF_ARG_MSG_ENABLE([if you want config-file support],
rc-file,
[ --disable-rc-file do not include config-file support],
[EXTRAOBJS="$EXTRAOBJS rc\$o"
2013-06-17 10:00:48 +00:00
AC_DEFINE(HAVE_RC_FILE,1,[Define to 1 to include config-file support])],,$cf_all_widgets)
2011-01-13 02:21:23 +00:00
CF_ARG_MSG_ENABLE([if you want Xdialog-style dialogs],
Xdialog,
2013-06-17 10:00:48 +00:00
[ --disable-Xdialog do not include Xdialog-style dialogs (1.1)],
2011-01-13 02:21:23 +00:00
[EXTRAOBJS="$EXTRAOBJS calendar\$o fselect\$o timebox\$o"
2013-06-17 10:00:48 +00:00
AC_DEFINE(HAVE_XDIALOG,1,[Define to 1 to include Xdialog-style dialogs])],,$cf_all_widgets)
CF_ARG_MSG_ENABLE([if you want extra Xdialog-style dialogs (1.2)],
Xdialog2,
[ --disable-Xdialog2 do not include extra Xdialog-style dialogs (1.2)],
[EXTRAOBJS="$EXTRAOBJS buildlist\$o rangebox\$o treeview\$o"
AC_DEFINE(HAVE_XDIALOG2,1,[Define to 1 to include extra Xdialog-style dialogs])],,$cf_all_widgets)
CF_ARG_MSG_ENABLE([if you want compatibility with whiptail options],
whiptail,
[ --disable-whiptail do not map extra whiptail options],
[AC_DEFINE(HAVE_WHIPTAIL,1,[Define to 1 to include extra whiptail options])],,$cf_all_widgets)
2011-01-13 02:21:23 +00:00
CF_ARG_MSG_ENABLE([if you want the form dialog],
form,
[ --disable-form do not include the form dialog],
[EXTRAOBJS="$EXTRAOBJS formbox\$o"
2013-06-17 10:00:48 +00:00
AC_DEFINE(HAVE_DLG_FORMBOX,1,[Define to 1 to include the form dialog])],,$cf_all_widgets)
2011-01-13 02:21:23 +00:00
CF_ARG_MSG_ENABLE([if you want the gauge dialog],
gauge,
[ --disable-gauge do not include the gauge dialogs],
2011-04-17 17:00:55 +00:00
[EXTRAOBJS="$EXTRAOBJS guage\$o pause\$o prgbox\$o progressbox\$o"
2013-06-17 10:00:48 +00:00
AC_DEFINE(HAVE_DLG_GAUGE,1,[Define to 1 to include the gauge dialogs])],,$cf_all_widgets)
2011-01-13 02:21:23 +00:00
CF_ARG_MSG_ENABLE([if you want the tailbox dialog],
tailbox,
[ --disable-tailbox do not include the tailbox dialog],
[EXTRAOBJS="$EXTRAOBJS tailbox\$o"
2013-06-17 10:00:48 +00:00
AC_DEFINE(HAVE_DLG_TAILBOX,1,[Define to 1 to include the tailbox dialog])],,$cf_all_widgets)
2011-01-13 02:21:23 +00:00
CF_ARG_MSG_ENABLE([if you want the mixedform dialog],
mixedform,
[ --disable-mixedform do not include the mixedform dialog],
[EXTRAOBJS="$EXTRAOBJS mixedform\$o"
2013-06-17 10:00:48 +00:00
AC_DEFINE(HAVE_DLG_MIXEDFORM,1,[Define to 1 to include the mixedform dialog])],,$cf_all_widgets)
2011-01-13 02:21:23 +00:00
CF_ARG_MSG_ENABLE([if you want the mixedgauge dialog],
mixedgauge,
[ --disable-mixedgauge do not include the mixedgauge dialog],
[EXTRAOBJS="$EXTRAOBJS mixedgauge\$o"
2013-06-17 10:00:48 +00:00
AC_DEFINE(HAVE_MIXEDGAUGE,1,[Define to 1 to include the mixedgauge dialog])],,$cf_all_widgets)
2011-01-13 02:21:23 +00:00
CF_ARG_MSG_ENABLE([if you want the wide-curses features],
widec,
[ --enable-widec enable wide-curses features],
2013-06-17 10:00:48 +00:00
[AC_DEFINE(USE_WIDE_CURSES,1,[Define to 1 to enable wide-curses features])],,$cf_wide_curses)
2011-01-13 02:21:23 +00:00
AC_SUBST(EXTRAOBJS)
dnl
dnl Checks for header files.
dnl
AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_DIRENT
AC_CHECK_HEADERS(search.h unctrl.h unistd.h)
CF_CURSES_TERM_H
dnl
dnl Checks for library functions.
dnl
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(\
_nc_free_and_exit \
2011-04-17 17:00:55 +00:00
btowc \
mblen \
mbrlen \
mbrtowc \
mbtowc \
2011-01-13 02:21:23 +00:00
strcasecmp \
strftime \
tsearch \
waitpid \
2011-04-17 17:00:55 +00:00
wcsrtombs \
wcstombs \
wctob \
wctomb \
2011-01-13 02:21:23 +00:00
)
CF_CURSES_FUNCS(\
flushinp \
2011-04-17 17:00:55 +00:00
getattrs \
2011-01-13 02:21:23 +00:00
getbegx \
getbegy \
getbegyx \
getcurx \
getcury \
getmaxx \
getmaxy \
getmaxyx \
getparx \
getpary \
getparyx \
use_default_colors \
wchgat \
2013-06-17 10:00:48 +00:00
wcursyncup \
2011-01-13 02:21:23 +00:00
wget_wch \
2013-06-17 10:00:48 +00:00
wsyncup \
2011-01-13 02:21:23 +00:00
)
2013-06-17 10:00:48 +00:00
AC_CHECK_FUNC(start_color,[AC_DEFINE(HAVE_COLOR,1,[Define to 1 if (n)curses has start_color function])])
2011-01-13 02:21:23 +00:00
CF_CURSES_CHTYPE
2011-04-17 17:00:55 +00:00
CF_CURSES_WACS_SYMBOLS
2012-10-21 18:18:09 +00:00
CF_CURSES_WGETPARENT
2011-01-13 02:21:23 +00:00
CF_FUNC_WAIT
CF_MBSTATE_T
CF_HEADERS_SH(DLG,dlg_config.h)
2013-06-17 10:00:48 +00:00
AC_TRY_LINK([#include <locale.h>],[setlocale(LC_ALL, "")],[AC_DEFINE(HAVE_SETLOCALE,1,[Define to 1 if locale feature can be enabled])])
2011-01-13 02:21:23 +00:00
CF_DISABLE_RPATH_HACK
CF__DEFINE_SHLIB_VARS
AC_OUTPUT(
dialog-config
makefile
$EXTRA_OUTPUT
$SUB_MAKEFILE,[
CF__ADD_SHLIB_RULES(
makefile,
$LIB_MODEL,
[\${LIB_OBJECT}],
[\${LIBS} \${LDFLAGS}])
],[
CF__INIT_SHLIB_RULES
],[sort -u])