From fb040ea36cb8e2158ccd9100600652f94ae90af1 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Mon, 23 Mar 2015 03:49:03 +0000 Subject: Imported from /home/lorry/working-area/delta_nano-tarball/nano-2.4.0.tar.gz. --- configure.ac | 454 +++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 268 insertions(+), 186 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 6388c03..424cf55 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Configuration for GNU nano - a small and user-friendly text editor # -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +# 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. # # GNU nano is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -18,15 +18,17 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, # USA. # -# $Id: configure.ac 4516 2010-08-11 02:42:32Z astyanax $ +# $Id: configure.ac 5127 2015-02-27 17:00:11Z astyanax $ -AC_INIT([GNU nano], [2.2.6], [nano-devel@gnu.org], [nano]) +AC_INIT([GNU nano], [2.4.0], [nano-devel@gnu.org], [nano]) AC_CONFIG_SRCDIR([src/nano.c]) -AC_CANONICAL_TARGET([]) +AC_CANONICAL_HOST AM_INIT_AUTOMAKE AC_CONFIG_HEADERS([config.h]) -AC_PREREQ(2.54) +dnl Make sure the ONCE macros are available. + +AC_PREREQ(2.61) dnl Checks for programs. @@ -35,6 +37,7 @@ AC_PROG_CC AC_PROG_LN_S AC_ISC_POSIX AC_SYS_LARGEFILE +PKG_PROG_PKG_CONFIG dnl Internationalization macros. @@ -49,166 +52,196 @@ AC_DEFINE_DIR([PKGDATADIR], [pkgdatadir], [Where data are placed to.]) dnl Checks for header files. -AC_HEADER_STDC AC_CHECK_HEADERS(getopt.h libintl.h limits.h regex.h sys/param.h wchar.h wctype.h stdarg.h) dnl Checks for options. -AC_ARG_ENABLE(debug, -[ --enable-debug Enable debugging (disabled by default)], -[if test x$enableval = xyes; then - AC_DEFINE(DEBUG, 1, [Define this to enable debug messages and assert warnings.]) debug_support=yes -fi]) - -if test x$debug_support != xyes; then - AC_DEFINE(NDEBUG, 1, [Shut up assert warnings :-)]) -fi - -AC_ARG_ENABLE(tiny, -[ --enable-tiny Disable features for the sake of size], -[if test x$enableval = xyes; then - AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.]) tiny_support=yes +AC_ARG_ENABLE(browser, +AS_HELP_STRING([--disable-browser], [Disable built-in file browser])) +if test "x$enable_browser" = xno; then AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.]) - AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.]) - AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.]) - AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.]) - AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).]) - AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell checker functions.]) - AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion functions for files and search strings.]) - AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.]) -fi]) +fi +AC_ARG_ENABLE(color, +AS_HELP_STRING([--disable-color], [Disable color and syntax highlighting])) +if test "x$enable_nanorc" = xno; then + if test "x$enable_color" = xyes; then + AC_MSG_ERROR([--enable-color cannot work with --disable-nanorc]) + else + # Disabling nanorc silently disables color support. + enable_color=no + fi +fi +if test "x$enable_color" = xno; then + AC_DEFINE(DISABLE_COLOR, 1, [Define this to disable syntax highlighting.]) +else + if test x$ac_cv_header_regex_h != xyes; then + AC_MSG_ERROR([ +*** The header file regex.h was not found. If you wish to have +*** color support, this header file is required. Please either +*** install C libraries that include the regex.h file, or call +*** the configure script with --disable-color.]) + else + color_support=yes + fi +fi AC_ARG_ENABLE(extra, -[ --disable-extra Disable extra features, currently only easter eggs], -[if test x$enableval != xno; then - AC_DEFINE(NANO_EXTRA, 1, [Define this to enable extra stuff.]) extra_support=yes -fi], - [if test x$enable_tiny != xyes; then - AC_DEFINE(NANO_EXTRA, 1, [Define this to enable extra stuff.]) extra_support=yes - fi]) - -AC_ARG_ENABLE(browser, -[ --disable-browser Disable built-in file browser], -[if test x$enableval != xyes; then - AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.]) -fi]) +AS_HELP_STRING([--disable-extra], [Disable extra features, currently only easter eggs])) +if test "x$enable_extra" = xno; then + AC_DEFINE(DISABLE_EXTRA, 1, [Define this to disable extra stuff.]) +fi AC_ARG_ENABLE(help, -[ --disable-help Disable help functions], -[if test x$enableval != xyes; then +AS_HELP_STRING([--disable-help], [Disable help functions])) +if test "x$enable_help" = xno; then AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.]) -fi]) +fi + +AC_ARG_ENABLE(histories, +AS_HELP_STRING([--disable-histories], [Disable search and position histories])) +if test "x$enable_histories" = xno; then + AC_DEFINE(DISABLE_HISTORIES, 1, [Define this to disable search and position histories.]) +fi AC_ARG_ENABLE(justify, -[ --disable-justify Disable justify/unjustify functions], -[if test x$enableval != xyes; then +AS_HELP_STRING([--disable-justify], [Disable justify/unjustify functions])) +if test "x$enable_justify" = xno; then AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.]) -fi]) +fi + +AC_ARG_ENABLE(libmagic, +AS_HELP_STRING([--disable-libmagic], [Disable detection of file types via libmagic])) AC_ARG_ENABLE(mouse, -[ --disable-mouse Disable mouse support (and -m flag)], -[if test x$enableval != xyes; then +AS_HELP_STRING([--disable-mouse], [Disable mouse support (and -m flag)])) +if test "x$enable_mouse" = xno; then AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.]) -fi]) +fi + +AC_ARG_ENABLE(multibuffer, +AS_HELP_STRING([--disable-multibuffer], [Disable multiple file buffers])) +if test "x$enable_multibuffer" = xno; then + AC_DEFINE(DISABLE_MULTIBUFFER, 1, [Define this to disable multiple file buffers.]) +fi + +AC_ARG_ENABLE(nanorc, +AS_HELP_STRING([--disable-nanorc], [Disable use of .nanorc files])) +if test "x$enable_nanorc" = xno; then + AC_DEFINE(DISABLE_NANORC, 1, [Define this to disable the use of .nanorc files.]) +else + nanorc_support=yes +fi AC_ARG_ENABLE(operatingdir, -[ --disable-operatingdir Disable setting of operating directory (chroot of sorts)], -[if test x$enableval != xyes; then +AS_HELP_STRING([--disable-operatingdir], [Disable setting of operating directory (chroot of sorts)])) +if test "x$enable_operatingdir" = xno; then AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).]) -fi]) +fi AC_ARG_ENABLE(speller, -[ --disable-speller Disable spell checker functions], -[if test x$enableval != xyes; then +AS_HELP_STRING([--disable-speller], [Disable spell checker functions])) +if test "x$enable_speller" = xno; then AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell checker functions.]) -fi]) +fi AC_ARG_ENABLE(tabcomp, -[ --disable-tabcomp Disable tab completion functions], -[if test x$enableval != xyes; then - AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion functions for files and search strings.]) -fi]) +AS_HELP_STRING([--disable-tabcomp], [Disable tab completion functions])) +if test "x$enable_tabcomp" = xno; then + AC_DEFINE(DISABLE_TABCOMP, 1, [Define this to disable the tab completion functions for files and search strings.]) +fi AC_ARG_ENABLE(wrapping, -[ --disable-wrapping Disable all wrapping of text (and -w flag)], -[if test x$enableval != xyes; then +AS_HELP_STRING([--disable-wrapping], [Disable all wrapping of text (and -w flag)])) +if test "x$enable_wrapping" = xno; then AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.]) -fi]) +fi AC_ARG_ENABLE(wrapping-as-root, -[ --disable-wrapping-as-root Disable wrapping of text as root by default], -[if test x$enableval != xyes; then +AS_HELP_STRING([--disable-wrapping-as-root], [Disable wrapping of text as root by default])) +if test "x$enable_wrapping_as_root" = xno; then AC_DEFINE(DISABLE_ROOTWRAPPING, 1, [Define this to disable text wrapping as root by default.]) -fi]) +fi -AC_ARG_ENABLE(color, -[ --disable-color Disable color and syntax highlighting], -if test x$enableval != xno; then - if test x$ac_cv_header_regex_h = xyes; then - AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes - AC_DEFINE(ENABLE_COLOR, 1, [Define this to have syntax highlighting, requires regex.h and ENABLE_NANORC too!]) color_support=yes - else - AC_MSG_ERROR([ -*** The header file regex.h was not found. If you wish to use color -*** support this header file is required. Please either install C -*** libraries that include the regex.h file or call the configure -*** script with --disable-color.]) +AC_ARG_ENABLE(debug, +AS_HELP_STRING([--enable-debug], [Enable debugging (disabled by default)])) +if test "x$enable_debug" = xyes; then + AC_DEFINE(DEBUG, 1, [Define this to enable debug messages and assert warnings.]) +else + AC_DEFINE(NDEBUG, 1, [Shut up assert warnings :-)]) +fi + +AC_ARG_ENABLE(tiny, +AS_HELP_STRING([--enable-tiny], [Disable features for the sake of size])) +if test "x$enable_tiny" = xyes; then + AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.]) + if test "x$enable_browser" != xyes; then + AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.]) fi -fi, - if test x$enable_tiny != xyes; then - if test x$ac_cv_header_regex_h = xyes; then - AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes - AC_DEFINE(ENABLE_COLOR, 1, [Define this to have syntax highlighting, requires regex.h and ENABLE_NANORC too!]) color_support=yes - else - AC_MSG_ERROR([ -*** The header file regex.h was not found. If you wish to use color -*** support this header file is required. Please either install C -*** libraries that include the regex.h file or call the configure -*** script with --disable-color.]) + if test "x$enable_color" != xyes; then + AC_DEFINE(DISABLE_COLOR, 1, [Define this to disable syntax highlighting.]) + color_support=no + else + if test "x$enable_nanorc" != xyes; then + AC_MSG_ERROR([--enable-color with --enable-tiny cannot work without --enable-nanorc]) fi fi -) + if test "x$enable_extra" != xyes; then + AC_DEFINE(DISABLE_EXTRA, 1, [Define this to disable extra stuff.]) + fi + if test "x$enable_help" != xyes; then + AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.]) + fi + if test "x$enable_histories" != xyes; then + AC_DEFINE(DISABLE_HISTORIES, 1, [Define this to disable search and position histories.]) + fi + if test "x$enable_justify" != xyes; then + AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.]) + fi + if test "x$enable_libmagic" != xyes; then + enable_libmagic=no + fi + if test "x$enable_mouse" != xyes; then + AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.]) + fi + if test "x$enable_multibuffer" != xyes; then + AC_DEFINE(DISABLE_MULTIBUFFER, 1, [Define this to disable multiple file buffers.]) + fi + if test "x$enable_nanorc" != xyes; then + AC_DEFINE(DISABLE_NANORC, 1, [Define this to disable the use of .nanorc files.]) + fi + if test "x$enable_operatingdir" != xyes; then + AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).]) + fi + if test "x$enable_speller" != xyes; then + AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell checker functions.]) + fi + if test "x$enable_tabcomp" != xyes; then + AC_DEFINE(DISABLE_TABCOMP, 1, [Define this to disable the tab completion functions for files and search strings.]) + fi + if test "x$enable_wrapping" != xyes; then + AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.]) + fi +fi -AC_ARG_ENABLE(multibuffer, -[ --disable-multibuffer Disable multiple file buffers], -[if test x$enableval != xno; then - AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes -fi], - [if test x$enable_tiny != xyes; then - AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes - fi]) +AM_CONDITIONAL(USE_COLOR, test x$color_support = xyes) +AM_CONDITIONAL(USE_NANORC, test x$nanorc_support = xyes) -AC_ARG_ENABLE(nanorc, -[ --disable-nanorc Disable use of .nanorc files], -[if test x$enableval != xno; then - AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes -fi], - [if test x$enable_tiny != xyes; then - AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes - fi]) - -AC_ARG_ENABLE(all, -[ --enable-all Enable ALL extra nano functionality (ignored for compatibility as all options default to on)], -[if test x$enableval = xyes; then - echo "--enable-all option no longer needed, ignoring for compatibility" +AC_MSG_CHECKING([whether to enable UTF-8 support]) +AC_ARG_ENABLE(utf8, AS_HELP_STRING([--enable-utf8], [Enable UTF-8 support])) +AC_MSG_RESULT(${enable_utf8:-auto}) + +AC_ARG_ENABLE(altrcname, +AS_HELP_STRING([--enable-altrcname], [Specify an alternate rcfile name (default: .nanorc)]), +[if test x$enableval != no; then + AC_DEFINE_UNQUOTED(RCFILE_NAME, "$enableval", [Specify an alternate rcfile name (default: .nanorc).]) rcfilename=$enableval fi]) -AC_MSG_CHECKING([whether to enable UTF-8 support]) -AC_ARG_ENABLE(utf8, -[ --enable-utf8 Enable UTF-8 support], -[if test x$enableval = xyes; then - enable_utf8=yes -else - enable_utf8=no -fi], -[enable_utf8=auto]) -AC_MSG_RESULT($enable_utf8) AC_MSG_CHECKING([whether to use slang]) CURSES_LIB_NAME="" AC_ARG_WITH(slang, -[ --with-slang[=DIR] Use the slang library instead of curses], +AS_HELP_STRING([--with-slang[=DIR]], [Use the slang library instead of curses]), [ case "$with_slang" in no) AC_MSG_RESULT(no) @@ -217,12 +250,12 @@ AC_ARG_WITH(slang, AC_MSG_RESULT(yes) if test x$with_slang != xyes; then - # Add additional search path + # Add additional search path. LDFLAGS="-L$with_slang/lib $LDFLAGS" CPPFLAGS="-I$with_slang/include $CPPFLAGS" fi - if test x$enable_utf8 != xno; then + if test "x$enable_utf8" != xno; then AC_CHECK_HEADER(slcurses.h, AC_MSG_CHECKING([for SLutf8_enable in -lslang]) _libs=$LIBS @@ -235,7 +268,7 @@ int main(void) return 0; }], [AC_MSG_RESULT(yes) - AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes + AC_DEFINE(USE_SLANG, 1, [Define this to use the slang wrappers for curses instead of native curses.]) CURSES_LIB_WIDE=yes if test x$with_slang != xyes; then CURSES_LIB="-L${with_slang}/lib -lslang" @@ -245,7 +278,7 @@ int main(void) CURSES_LIB_NAME=slang], [AC_MSG_RESULT(no) - # We might need the term library + # We might need the term library. for termlib in ncurses curses termcap terminfo termlib; do AC_CHECK_LIB([${termlib}], tputs, [tcap="-l$termlib"]) test -n "$tcap" && break @@ -261,7 +294,7 @@ int main(void) return 0; }], [AC_MSG_RESULT(yes) - AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes + AC_DEFINE(USE_SLANG, 1, [Define this to use the slang wrappers for curses instead of native curses.]) CURSES_LIB_WIDE=yes if test x$with_slang != xyes; then CURSES_LIB="-L${with_slang}/lib -lslang $tcap" @@ -271,7 +304,7 @@ int main(void) CURSES_LIB_NAME=slang], [AC_MSG_RESULT(no) - # We might need the math library + # We might need the math library. AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap -lm]) LIBS="$LIBS -lm" AC_TRY_RUN([ @@ -282,7 +315,7 @@ int main(void) return 0; }], [AC_MSG_RESULT(yes) - AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes + AC_DEFINE(USE_SLANG, 1, [Define this to use the slang wrappers for curses instead of native curses.]) CURSES_LIB_WIDE=yes if test x$with_slang != xyes; then CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm" @@ -302,8 +335,8 @@ int main(void) fi if eval "test x$CURSES_LIB_NAME = x"; then - # Reset libs if the above slang tests failed - if test x$enable_utf8 != xno; then + # Reset libs if the above slang tests failed. + if test "x$enable_utf8" != xno; then LIBS=$_libs fi @@ -319,7 +352,7 @@ int main(void) return 0; }], [AC_MSG_RESULT(yes) - AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes + AC_DEFINE(USE_SLANG, 1, [Define this to use the slang wrappers for curses instead of native curses.]) if test x$with_slang != xyes; then CURSES_LIB="-L${with_slang}/lib -lslang" else @@ -328,7 +361,7 @@ int main(void) CURSES_LIB_NAME=slang], [AC_MSG_RESULT(no) - # We might need the term library + # We might need the term library. for termlib in ncurses curses termcap terminfo termlib; do AC_CHECK_LIB([${termlib}], tputs, [tcap="-l$termlib"]) test -n "$tcap" && break @@ -344,7 +377,7 @@ int main(void) return 0; }], [AC_MSG_RESULT(yes) - AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes + AC_DEFINE(USE_SLANG, 1, [Define this to use the slang wrappers for curses instead of native curses.]) if test x$with_slang != xyes; then CURSES_LIB="-L${with_slang}/lib -lslang $tcap" else @@ -353,7 +386,7 @@ int main(void) CURSES_LIB_NAME=slang], [AC_MSG_RESULT(no) - # We might need the math library + # We might need the math library. AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm]) LIBS="$LIBS -lm" AC_TRY_RUN([ @@ -364,7 +397,7 @@ int main(void) return 0; }], [AC_MSG_RESULT(yes) - AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes + AC_DEFINE(USE_SLANG, 1, [Define this to use the slang wrappers for curses instead of native curses.]) if test x$with_slang != xyes; then CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm" else @@ -392,57 +425,79 @@ int main(void) ;; esac], [AC_MSG_RESULT(no)]) -if test x$CURSES_LIB_NAME = xslang; then - AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.]) tiny_support=yes - AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.]) - AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.]) - AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.]) - AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.]) - AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).]) - AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell checker functions.]) - AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion functions for files and search strings.]) - AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.]) -fi - -AM_CONDITIONAL(USE_COLOR, test x$color_support = xyes) -AM_CONDITIONAL(USE_NANORC, test x$nanorc_support = xyes) - -AC_ARG_ENABLE(altrcname, -[ --enable-altrcname Specify alternate rcfile name (default: .nanorc)], -[if test x$enableval != no; then - AC_DEFINE_UNQUOTED(RCFILE_NAME, "$enableval", [Specify alternate rcfile name (default: .nanorc)]) rcfilename=$enableval -fi]) dnl Checks for functions. -AC_CHECK_FUNCS(getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen vsnprintf) +AC_CHECK_FUNCS(getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen snprintf vsnprintf) -if test x$enable_utf8 != xno; then +if test "x$enable_utf8" != xno; then AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace nl_langinfo mblen mbstowcs mbtowc wctomb wcwidth) fi +if test x$ac_cv_func_snprintf = xno; then + AM_PATH_GLIB_2_0(2.0.0,, + AC_MSG_ERROR([ +*** snprintf() not found. GLIB 2.x not found either. +*** You should install the GLIB 2.x library which can +*** be found at http://ftp.gtk.org/.]), + glib) +fi + if test x$ac_cv_func_vsnprintf = xno; then AM_PATH_GLIB_2_0(2.0.0,, AC_MSG_ERROR([ -*** vsnprintf() not found. GLIB 2.x not found either. You should -*** install the GLIB 2.x library which can be found at -*** ftp://ftp.gtk.org/.]), +*** vsnprintf() not found. GLIB 2.x not found either. +*** You should install the GLIB 2.x library which can +*** be found at http://ftp.gtk.org/.]), glib) fi dnl Checks for typedefs, structures, and compiler characteristics. +dnl Checks for available flags. + +AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"], [], []) + dnl Checks for library functions. + AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(getopt_long) + dnl Checks for libraries. +if eval "test x$CURSES_LIB_NAME = x"; then + if test "x$enable_utf8" != xno; then + PKG_CHECK_MODULES([NCURSESW], [ncursesw], [ + CURSES_LIB=$NCURSESW_LIBS + CPPFLAGS="$NCURSESW_CFLAGS $CPPFLAGS" + CURSES_LIB_NAME=ncursesw + CURSES_LIB_WIDE=yes + ], [:]) + else + PKG_CHECK_MODULES([NCURSES], [ncurses], [ + CURSES_LIB=$NCURSES_LIBS + CPPFLAGS="$NCURSES_CFLAGS $CPPFLAGS" + CURSES_LIB_NAME=ncurses + ], [:]) + fi +fi + if eval "test x$CURSES_LIB_NAME = x"; then AC_CHECK_HEADERS(ncurses.h) - if test x$enable_utf8 != xno; then - AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CPPFLAGS="-I/usr/include/ncursesw $CPPFLAGS" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes]) + if test "x$enable_utf8" != xno; then + OLDLIBS="$LIBS" + AC_CHECK_TOOL(NCURSESW_CONFIG, ncursesw5-config, no) + if test "x$NCURSESW_CONFIG" != xno; then + CURSES_LIB=`$NCURSESW_CONFIG --libs` + LIBS="$CURSES_LIB $LIBS" + CPPFLAGS="`$NCURSESW_CONFIG --cflags` $CPPFLAGS" + AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes]) + else + AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes]) + fi + LIBS="$OLDLIBS" fi if eval "test x$CURSES_LIB_NAME = x"; then @@ -453,12 +508,12 @@ fi if eval "test x$CURSES_LIB_NAME = x"; then AC_CHECK_HEADERS(curses.h) - if test x$enable_utf8 != xno; then + if test "x$enable_utf8" != xno; then AC_CHECK_LIB(curses, get_wch, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses CURSES_LIB_WIDE=yes]) fi if eval "test x$CURSES_LIB_NAME = x"; then - AC_CHECK_LIB(curses, initscr, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses]) + AC_CHECK_LIB(curses, initscr, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses]) fi fi @@ -486,7 +541,7 @@ if test "x$GLIB_LIBS" != "x"; then LDFLAGS="$LDFLAGS $GLIB_LIBS" fi -if test x$enable_utf8 != xno && \ +if test "x$enable_utf8" != xno && \ test x$CURSES_LIB_WIDE = xyes && \ test x$ac_cv_func_iswalnum = xyes && \ test x$ac_cv_func_iswpunct = xyes && \ @@ -499,14 +554,14 @@ if test x$enable_utf8 != xno && \ test x$ac_cv_func_wcwidth = xyes; then AC_DEFINE(ENABLE_UTF8, 1, [Define this if your system has sufficient UTF-8 support (a wide curses library, iswalnum(), iswpunct(), iswblank() or iswspace(), nl_langinfo, mblen(), mbstowcs(), mbtowc(), wctomb(), and wcwidth()).]) else - if test x$enable_utf8 = xyes; then + if test "x$enable_utf8" = xyes; then AC_MSG_ERROR([ *** UTF-8 support was requested, but insufficient UTF-8 support was *** detected in your curses and/or C libraries. Please verify that your *** slang was built with UTF-8 support or your curses was built with *** wide character support, and that your C library was built with wide *** character support.]) - elif test x$enable_utf8 != xno; then + elif test "x$enable_utf8" != xno; then AC_MSG_WARN([ *** Insufficient UTF-8 support was detected in your curses and/or C *** libraries. If you want UTF-8 support, please verify that your slang @@ -517,9 +572,24 @@ else fi if test x$color_support = xyes; then - # now check for the end of word boundary support (/< and />) + # Now check for the end-of-word boundary support (/< and />). AC_MSG_CHECKING([for GNU-style word boundary regex support]) - AC_TRY_RUN([ + + AC_ARG_WITH(wordbounds, + AS_HELP_STRING([--with-wordbounds], [Use GNU-style word boundary delimiters]), + [ case "$with_wordbounds" in + no) + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_RESULT(yes) + # We explicitly don't check if the user forced the option, because + # this is needed for cross compilers and we can't test the target. + AC_DEFINE(GNU_WORDBOUNDS, 1, [Define this if the system supports GNU-style word boundaries in regexes.]) gnu_wordbounds=yes, + ;; + esac + ], [ + AC_TRY_RUN([ #ifdef HAVE_SYS_TYPES_H #include #endif @@ -531,16 +601,18 @@ int main(void) regmatch_t pmatch; if (regcomp(&r, "\\\\>", REG_EXTENDED|REG_NOSUB)) - return 1; + return 1; if (regexec(&r, "word boundary", nmatch, &pmatch, 0)) - return 1; + return 1; return 0; }], - AC_MSG_RESULT(yes) - AC_DEFINE(GNU_WORDBOUNDS, 1, [Define if the system supports GNU-style word boundaries in regexes.]) gnu_wordbounds=yes, - AC_MSG_RESULT(no), - AC_MSG_WARN([*** Can't check for GNU-style word boundary support when cross-compiling]) -) + AC_MSG_RESULT(yes) + AC_DEFINE(GNU_WORDBOUNDS, 1, [Define this if the system supports GNU-style word boundaries in regexes.]) gnu_wordbounds=yes, + AC_MSG_RESULT(no), + AC_MSG_WARN([*** Can't check for GNU-style word boundary support when cross-compiling]) + ) +]) + # if test x$CURSES_LIB_NAME = xcurses; then AC_MSG_CHECKING([whether _XOPEN_SOURCE_EXTENDED is needed]) AC_TRY_RUN([ @@ -577,27 +649,37 @@ int main(void) LINES = 80; COLS = 25; return 0; -}], -AC_DEFINE(REDEFINIG_MACROS_OK, 1, [Define this if you know your curses library allows LINES and COLS to be redefined to deal with a resizing bug]) +}], +AC_DEFINE(REDEFINING_MACROS_OK, 1, [Define this if you know your curses library allows LINES and COLS to be redefined to deal with a resizing bug]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no), AC_MSG_WARN([*** Can't check for macro redefinability when cross-compiling])) +AS_IF([test "x$enable_libmagic" != "xno"], [ + AC_CHECK_HEADERS_ONCE([magic.h]) + AC_CHECK_LIB(magic, magic_open) + AC_CHECK_HEADERS_ONCE([zlib.h]) + AC_CHECK_LIB(z, inflate) +]) -# Check for groff html support +# Check for groff html support. AC_MSG_CHECKING([for HTML support in groff]) groff -t -mandoc -Thtml /dev/null -if test $? -ne 0 ; then - echo "no" - echo "*** Will not generate HTML version of man pages ***" - echo "*** Consider installing a newer version of groff with HTML support ***" +if test $? -ne 0 ; then + AC_MSG_RESULT([no]) + AC_MSG_WARN([*** Will not generate HTML version of man pages *** +*** Consider installing a newer version of groff with HTML support ***]) groff_html_support=no else - echo "yes" + AC_MSG_RESULT([yes]) groff_html_support=yes fi AM_CONDITIONAL(GROFF_HTML, test x$groff_html_support = xyes) +# Check for the availability of makeinfo. +AC_CHECK_PROG(haveit, makeinfo, yes, no) +AM_CONDITIONAL(HAVE_MAKEINFO, test x$haveit = xyes) + AC_CONFIG_FILES([ Makefile -- cgit v1.2.1