nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

configure.ac (18124B)


      1 # Configuration for GNU nano - a small and user-friendly text editor
      2 #
      3 # Copyright (C) 1999-2011, 2013-2025 Free Software Foundation, Inc.
      4 # Copyright (C) 2014, 2017 Mike Frysinger
      5 #
      6 # GNU nano is free software: you can redistribute it and/or modify
      7 # it under the terms of the GNU General Public License as published
      8 # by the Free Software Foundation, either version 3 of the License,
      9 # or (at your option) any later version.
     10 #
     11 # GNU nano is distributed in the hope that it will be useful,
     12 # but WITHOUT ANY WARRANTY; without even the implied warranty
     13 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     14 # See the GNU General Public License for more details.
     15 #
     16 # You should have received a copy of the GNU General Public License
     17 # along with this program.  If not, see https://www.gnu.org/licenses/.
     18 
     19 AC_INIT([GNU nano], [8.5], [nano-devel@gnu.org], [nano])
     20 AC_CONFIG_SRCDIR([src/nano.c])
     21 AC_CANONICAL_HOST
     22 AM_INIT_AUTOMAKE([1.14])
     23 AM_MAINTAINER_MODE([enable])
     24 AC_CONFIG_HEADERS([config.h])
     25 
     26 dnl Make sure the ONCE macros are available.
     27 
     28 AC_PREREQ([2.69])
     29 
     30 dnl Lie about gnulib features we don't use to speed up & shrink down.
     31 
     32 gl_cv_func_printf_directive_n=yes
     33 gl_cv_func_printf_infinite_long_double=yes
     34 gl_cv_func_printf_long_double=yes
     35 gl_cv_func_snprintf_directive_n=yes
     36 gl_cv_glob_lists_symlinks=yes
     37 
     38 dnl Checks for programs.
     39 
     40 AC_USE_SYSTEM_EXTENSIONS
     41 AC_PROG_CC
     42 gl_EARLY
     43 gl_INIT
     44 AC_PROG_LN_S
     45 AC_SEARCH_LIBS([strerror], [cposix])
     46 AC_SYS_LARGEFILE
     47 PKG_PROG_PKG_CONFIG
     48 
     49 dnl Internationalization macros.
     50 
     51 AM_GNU_GETTEXT_VERSION([0.20])
     52 AM_GNU_GETTEXT([external], [need-ngettext])
     53 AM_CONDITIONAL(USE_NLS, test x$USE_NLS = xyes)
     54 
     55 dnl Data location.
     56 
     57 pkgdatadir=${datadir}/${PACKAGE}
     58 AC_DEFINE_DIR([PKGDATADIR], [pkgdatadir], [Where data are placed to.])
     59 
     60 dnl Whether this is a git repository.
     61 
     62 AC_MSG_CHECKING([whether building from git])
     63 if test -f "$srcdir/roll-a-release.sh" ; then
     64 	AC_MSG_RESULT([yes])
     65 	from_git=yes
     66 else
     67 	AC_MSG_RESULT([no])
     68 	from_git=no
     69 fi
     70 AM_CONDITIONAL(BUILDING_FROM_GIT, test x$from_git = xyes)
     71 
     72 dnl Checks for pkg-config and gettext when building from git.
     73 
     74 if test x$from_git = xyes; then
     75 	if test ! -f $(aclocal --print-ac-dir)/pkg.m4; then
     76 		AC_MSG_ERROR([
     77   *** The pkg.m4 macros are missing.
     78   *** The pkg-config package needs to be installed when building from git.
     79   *** After fixing this problem, rerun ./autogen.sh.])
     80 	fi
     81 	if test "$ac_cv_path_MSGFMT" = ":"; then
     82 		AC_MSG_ERROR([
     83   *** The msgfmt program is missing.
     84   *** The gettext package needs to be installed when building from git.])
     85 	fi
     86 fi
     87 
     88 dnl Checks for header files.
     89 
     90 AC_CHECK_HEADERS(libintl.h limits.h pwd.h termios.h sys/param.h)
     91 
     92 dnl Checks for options.
     93 
     94 AC_ARG_ENABLE(browser,
     95 AS_HELP_STRING([--disable-browser], [Disable the built-in file browser]))
     96 if test "x$enable_tiny" = xyes; then
     97 	if test "x$enable_browser" != xyes; then
     98 		enable_browser=no
     99 	fi
    100 fi
    101 if test "x$enable_browser" != xno; then
    102 	AC_DEFINE(ENABLE_BROWSER, 1, [Define this to enable the built-in file browser.])
    103 fi
    104 
    105 AC_ARG_ENABLE(color,
    106 AS_HELP_STRING([--disable-color], [Disable color and syntax highlighting]))
    107 if test "x$enable_tiny" = xyes; then
    108 	if test "x$enable_color" = xyes; then
    109 		if test "x$enable_nanorc" != xyes; then
    110 			AC_MSG_ERROR([
    111   ***  --enable-color needs --enable-nanorc to work])
    112 		fi
    113 	else
    114 		enable_color=no
    115 	fi
    116 fi
    117 if test "x$enable_nanorc" = xno; then
    118 	if test "x$enable_color" = xyes; then
    119 		AC_MSG_ERROR([
    120   ***  --enable-color cannot work with --disable-nanorc])
    121 	else
    122 		# Disabling nanorc silently disables color support.
    123 		enable_color=no
    124 	fi
    125 fi
    126 if test "x$enable_color" != xno; then
    127 	AC_DEFINE(ENABLE_COLOR, 1, [Define this to have syntax highlighting.])
    128 	color_support=yes
    129 fi
    130 
    131 AC_ARG_ENABLE(comment,
    132 AS_HELP_STRING([--disable-comment], [Disable the comment/uncomment function]))
    133 if test "x$enable_tiny" = xyes; then
    134 	if test "x$enable_comment" = xyes; then
    135 		AC_MSG_ERROR([
    136   ***  --enable-comment cannot work with --enable-tiny])
    137 	else
    138 		enable_comment=no
    139 	fi
    140 fi
    141 if test "x$enable_comment" != xno; then
    142 	AC_DEFINE(ENABLE_COMMENT, 1, [Define this to enable the comment/uncomment function.])
    143 fi
    144 
    145 AC_ARG_ENABLE(extra,
    146 AS_HELP_STRING([--disable-extra], [Disable the Easter egg]))
    147 if test "x$enable_tiny" = xyes; then
    148 	if test "x$enable_extra" != xyes; then
    149 		enable_extra=no
    150 	fi
    151 fi
    152 if test "x$enable_extra" != xno; then
    153 	AC_DEFINE(ENABLE_EXTRA, 1, [Define this to have an Easter egg.])
    154 fi
    155 
    156 AC_ARG_ENABLE(formatter,
    157 AS_HELP_STRING([--disable-formatter], [Disable the formatting tool]))
    158 if test "x$enable_tiny" = xyes; then
    159 	if test "x$enable_formatter" = xyes; then
    160 		if test "x$enable_color" != xyes; then
    161 			AC_MSG_ERROR([
    162   ***  --enable-formatter needs both --enable-color and --enable-nanorc to work])
    163 		fi
    164 	else
    165 		enable_formatter=no
    166 	fi
    167 fi
    168 if test "x$enable_color" = xno; then
    169 	if test "x$enable_formatter" = xyes; then
    170 		AC_MSG_ERROR([
    171   ***  --enable-formatter cannot work with --disable-color nor --disable-nanorc])
    172 	else
    173 		enable_formatter=no
    174 	fi
    175 fi
    176 if test "x$enable_formatter" != xno; then
    177 	AC_DEFINE(ENABLE_FORMATTER, 1, [Define this to have access to a formatter.])
    178 fi
    179 
    180 AC_ARG_ENABLE(help,
    181 AS_HELP_STRING([--disable-help], [Disable the built-in help texts]))
    182 if test "x$enable_tiny" = xyes; then
    183 	if test "x$enable_help" = xyes; then
    184 		if test "x$enable_multibuffer" != xyes; then
    185 			AC_MSG_ERROR([
    186   ***  --enable-help needs --enable-multibuffer to work])
    187 		fi
    188 	else
    189 		enable_help=no
    190 	fi
    191 fi
    192 if test "x$enable_multibuffer" = xno; then
    193 	if test "x$enable_help" = xyes; then
    194 		AC_MSG_ERROR([
    195   ***  --enable-help cannot work with --disable-multibuffer])
    196 	else
    197 		# Disabling multibuffer silently disables the help texts.
    198 		enable_help=no
    199 	fi
    200 fi
    201 if test "x$enable_help" != xno; then
    202 	AC_DEFINE(ENABLE_HELP, 1, [Define this to enable the Ctrl+G help texts.])
    203 fi
    204 
    205 AC_ARG_ENABLE(histories,
    206 AS_HELP_STRING([--disable-histories], [Disable search and position histories]))
    207 if test "x$enable_tiny" = xyes; then
    208 	if test "x$enable_histories" != xyes; then
    209 		enable_histories=no
    210 	fi
    211 fi
    212 if test "x$enable_histories" != xno; then
    213 	AC_DEFINE(ENABLE_HISTORIES, 1, [Define this to have search and position histories.])
    214 fi
    215 
    216 AC_ARG_ENABLE(justify,
    217 AS_HELP_STRING([--disable-justify], [Disable the justify/unjustify functions]))
    218 if test "x$enable_tiny" = xyes; then
    219 	if test "x$enable_justify" != xyes; then
    220 		enable_justify=no
    221 	fi
    222 fi
    223 if test "x$enable_justify" != xno; then
    224 	AC_DEFINE(ENABLE_JUSTIFY, 1, [Define this to have the routines for justifying.])
    225 fi
    226 
    227 AC_ARG_ENABLE(libmagic,
    228 AS_HELP_STRING([--disable-libmagic], [Disable detection of file types via libmagic]))
    229 if test "x$enable_libmagic" = xyes; then
    230 	if test "x$enable_tiny" = xyes; then
    231 		if test "x$enable_color" != xyes; then
    232 			AC_MSG_ERROR([
    233   ***  --enable-libmagic needs both --enable-color and --enable-nanorc to work])
    234 		fi
    235 	fi
    236 	if test "x$enable_color" = xno; then
    237 		AC_MSG_ERROR([
    238   ***  --enable-libmagic cannot work with --disable-color nor --disable-nanorc])
    239 	fi
    240 fi
    241 
    242 AC_ARG_ENABLE(linter,
    243 AS_HELP_STRING([--disable-linter], [Disable the linting tool]))
    244 if test "x$enable_tiny" = xyes; then
    245 	if test "x$enable_linter" = xyes; then
    246 		if test "x$enable_color" != xyes; then
    247 			AC_MSG_ERROR([
    248   ***  --enable-linter needs both --enable-color and --enable-nanorc to work])
    249 		fi
    250 	else
    251 		enable_linter=no
    252 	fi
    253 fi
    254 if test "x$enable_color" = xno; then
    255 	if test "x$enable_linter" = xyes; then
    256 		AC_MSG_ERROR([
    257   ***  --enable-linter cannot work with --disable-color nor --disable-nanorc])
    258 	else
    259 		enable_linter=no
    260 	fi
    261 fi
    262 if test "x$enable_linter" != xno; then
    263 	AC_DEFINE(ENABLE_LINTER, 1, [Define this to have access to a linter.])
    264 fi
    265 
    266 AC_ARG_ENABLE(linenumbers,
    267 AS_HELP_STRING([--disable-linenumbers], [Disable line numbering]))
    268 if test "x$enable_tiny" = xyes; then
    269 	if test "x$enable_linenumbers" != xyes; then
    270 		enable_linenumbers=no
    271 	fi
    272 fi
    273 if test "x$enable_linenumbers" != xno; then
    274 	AC_DEFINE(ENABLE_LINENUMBERS, 1, [Define this to enable line numbering.])
    275 fi
    276 
    277 AC_ARG_ENABLE(mouse,
    278 AS_HELP_STRING([--disable-mouse], [Disable mouse support]))
    279 if test "x$enable_tiny" = xyes; then
    280 	if test "x$enable_mouse" != xyes; then
    281 		enable_mouse=no
    282 	fi
    283 fi
    284 if test "x$enable_mouse" != xno; then
    285 	AC_DEFINE(ENABLE_MOUSE, 1, [Define this to enable mouse support.])
    286 fi
    287 
    288 AC_ARG_ENABLE(multibuffer,
    289 AS_HELP_STRING([--disable-multibuffer], [Disable multiple file buffers]))
    290 if test "x$enable_tiny" = xyes; then
    291 	if test "x$enable_multibuffer" != xyes; then
    292 		enable_multibuffer=no
    293 	fi
    294 fi
    295 if test "x$enable_multibuffer" != xno; then
    296 	AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.])
    297 fi
    298 
    299 AC_ARG_ENABLE(nanorc,
    300 AS_HELP_STRING([--disable-nanorc], [Disable the use of .nanorc files]))
    301 if test "x$enable_tiny" = xyes; then
    302 	if test "x$enable_nanorc" != xyes; then
    303 		enable_nanorc=no
    304 	fi
    305 fi
    306 if test "x$enable_nanorc" != xno; then
    307 	AC_DEFINE(ENABLE_NANORC, 1, [Define this to enable the use of .nanorc files.])
    308 	nanorc_support=yes
    309 fi
    310 
    311 AC_ARG_ENABLE(operatingdir,
    312 AS_HELP_STRING([--disable-operatingdir], [Disable the setting of an operating directory]))
    313 if test "x$enable_tiny" = xyes; then
    314 	if test "x$enable_operatingdir" != xyes; then
    315 		enable_operatingdir=no
    316 	fi
    317 fi
    318 if test "x$enable_operatingdir" != xno; then
    319 	AC_DEFINE(ENABLE_OPERATINGDIR, 1, [Define this to allow setting an operating directory (a chroot of sorts).])
    320 fi
    321 
    322 AC_ARG_ENABLE(speller,
    323 AS_HELP_STRING([--disable-speller], [Disable the spell-checking tool]))
    324 if test "x$enable_tiny" = xyes; then
    325 	if test "x$enable_speller" != xyes; then
    326 		enable_speller=no
    327 	fi
    328 fi
    329 if test "x$enable_speller" != xno; then
    330 	AC_DEFINE(ENABLE_SPELLER, 1, [Define this to have access to a spell checker.])
    331 fi
    332 
    333 AC_ARG_ENABLE(tabcomp,
    334 AS_HELP_STRING([--disable-tabcomp], [Disable the tab-completion functions]))
    335 if test "x$enable_tiny" = xyes; then
    336 	if test "x$enable_tabcomp" != xyes; then
    337 		enable_tabcomp=no
    338 	fi
    339 fi
    340 if test "x$enable_tabcomp" != xno; then
    341 	AC_DEFINE(ENABLE_TABCOMP, 1, [Define this to have tab completion for filenames and search strings.])
    342 fi
    343 
    344 AC_ARG_ENABLE(wordcomp,
    345 AS_HELP_STRING([--disable-wordcomp], [Disable the word-completion function]))
    346 if test "x$enable_tiny" = xyes; then
    347 	if test "x$enable_wordcomp" = xyes; then
    348 		AC_MSG_ERROR([
    349   ***  --enable-wordcomp cannot work with --enable-tiny])
    350 	else
    351 		enable_wordcomp=no
    352 	fi
    353 fi
    354 if test "x$enable_wordcomp" != xno; then
    355 	AC_DEFINE(ENABLE_WORDCOMPLETION, 1, [Define this to enable the word-completion function.])
    356 fi
    357 
    358 AC_ARG_ENABLE(wrapping,
    359 AS_HELP_STRING([--disable-wrapping], [Disable all hard-wrapping of text]))
    360 if test "x$enable_tiny" = xyes; then
    361 	if test "x$enable_wrapping" != xyes; then
    362 		enable_wrapping=no
    363 	fi
    364 fi
    365 if test "x$enable_wrapping" != xno; then
    366 	AC_DEFINE(ENABLE_WRAPPING, 1, [Define this to have hard text wrapping.])
    367 fi
    368 
    369 AC_ARG_ENABLE(debug,
    370 AS_HELP_STRING([--enable-debug], [Enable debugging (disabled by default)]))
    371 if test "x$enable_debug" = xyes; then
    372 	AC_DEFINE(DEBUG, 1, [Define this to enable debug messages and abortion on failing asserts.])
    373 else
    374 	AC_DEFINE(NDEBUG, 1, [Shut up assert warnings :-)])
    375 fi
    376 
    377 AC_ARG_ENABLE(tiny,
    378 AS_HELP_STRING([--enable-tiny], [Disable features for the sake of size]))
    379 if test "x$enable_tiny" = xyes; then
    380 	AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.])
    381 	if test "x$enable_libmagic" != xyes; then
    382 		enable_libmagic=no
    383 	fi
    384 fi
    385 
    386 AM_CONDITIONAL(USE_COLOR, test x$color_support = xyes)
    387 AM_CONDITIONAL(USE_NANORC, test x$nanorc_support = xyes)
    388 
    389 AC_MSG_CHECKING([whether to enable UTF-8 support])
    390 AC_ARG_ENABLE(utf8, AS_HELP_STRING([--enable-utf8], [Enable UTF-8 support]))
    391 AC_MSG_RESULT(${enable_utf8:-auto})
    392 
    393 AC_ARG_ENABLE(altrcname,
    394 AS_HELP_STRING([--enable-altrcname], [Specify an alternate rcfile name (default: .nanorc)]),
    395 [if test x$enableval != no; then
    396 	AC_DEFINE_UNQUOTED(RCFILE_NAME, "$enableval", [Specify an alternate rcfile name (default: .nanorc).]) rcfilename=$enableval
    397 fi])
    398 
    399 dnl Checks for functions.
    400 
    401 if test "x$enable_utf8" != xno; then
    402 	AC_CHECK_FUNCS(iswalpha iswalnum iswpunct mbstowcs wctomb)
    403 fi
    404 
    405 AC_CHECK_FUNCS_ONCE(chmod chown fchmod fchown flockfile funlockfile
    406                     fork fsync geteuid pipe wait waitpid)
    407 
    408 dnl Checks for available flags.
    409 
    410 AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"], [], [])
    411 
    412 dnl Checks for libraries.
    413 
    414 if eval "test x$CURSES_LIB_NAME = x"; then
    415 	if test "x$enable_utf8" != xno; then
    416 		PKG_CHECK_MODULES([NCURSESW], [ncursesw], [
    417 			CURSES_LIB=$NCURSESW_LIBS
    418 			CPPFLAGS="$NCURSESW_CFLAGS $CPPFLAGS"
    419 			CURSES_LIB_NAME=ncursesw
    420 			CURSES_LIB_WIDE=yes
    421 		], [:])
    422 	else
    423 		PKG_CHECK_MODULES([NCURSES], [ncurses], [
    424 			CURSES_LIB=$NCURSES_LIBS
    425 			CPPFLAGS="$NCURSES_CFLAGS $CPPFLAGS"
    426 			CURSES_LIB_NAME=ncurses
    427 		], [:])
    428 	fi
    429 fi
    430 
    431 if eval "test x$CURSES_LIB_NAME = x"; then
    432 	AC_CHECK_HEADERS(ncurses.h)
    433 
    434 	if test "x$enable_utf8" != xno; then
    435 		OLDLIBS="$LIBS"
    436 		AC_CHECK_TOOL(NCURSESW_CONFIG, ncursesw5-config, no)
    437 		if test "x$NCURSESW_CONFIG" != xno; then
    438 			CURSES_LIB=`$NCURSESW_CONFIG --libs`
    439 			LIBS="$CURSES_LIB $LIBS"
    440 			CPPFLAGS="`$NCURSESW_CONFIG --cflags` $CPPFLAGS"
    441 			AC_CHECK_LIB(ncursesw, wget_wch, [CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
    442 		else
    443 			AC_CHECK_LIB(ncursesw, wget_wch, [CURSES_LIB="-lncursesw" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
    444 		fi
    445 		LIBS="$OLDLIBS"
    446 	fi
    447 
    448 	if eval "test x$CURSES_LIB_NAME = x"; then
    449 		AC_CHECK_LIB(ncurses, initscr, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses])
    450 	fi
    451 fi
    452 
    453 if eval "test x$CURSES_LIB_NAME = x"; then
    454 	AC_CHECK_HEADERS(curses.h)
    455 
    456 	if test "x$enable_utf8" != xno; then
    457 		AC_CHECK_LIB(curses, wget_wch, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses CURSES_LIB_WIDE=yes])
    458 	fi
    459 
    460 	if eval "test x$CURSES_LIB_NAME = x"; then
    461 		AC_CHECK_LIB(curses, initscr, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses])
    462 	fi
    463 fi
    464 
    465 if eval "test x$CURSES_LIB_NAME = x"; then
    466 	AC_MSG_ERROR([
    467   *** No curses lib was found.  Please install the curses header files
    468   *** from libncurses-dev (Debian), ncurses-devel (Fedora), or similar.
    469   *** (Or install ncurses from https://ftp.gnu.org/gnu/ncurses/.)])
    470 else
    471 	AC_MSG_RESULT([  The curses library to be used is: $CURSES_LIB_NAME])
    472 fi
    473 
    474 AC_CHECK_LIB([$CURSES_LIB_NAME], [use_default_colors],
    475 			 [AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, [Define this if your curses library has the use_default_colors() function.])],
    476 			 [], [$CURSES_LIB])
    477 AC_CHECK_LIB([$CURSES_LIB_NAME], [set_escdelay],
    478 			 [AC_DEFINE(HAVE_SET_ESCDELAY, 1, [Define this if your curses library has the set_escdelay() function.])],
    479 			 [], [$CURSES_LIB])
    480 AC_CHECK_LIB([$CURSES_LIB_NAME], [key_defined],
    481 			 [AC_DEFINE(HAVE_KEY_DEFINED, 1, [Define this if your curses library has the key_defined() function.])],
    482 			 [], [$CURSES_LIB])
    483 
    484 LIBS="$LIBS $CURSES_LIB"
    485 
    486 AC_SUBST(CURSES_LIB)
    487 
    488 if test "x$enable_utf8" != xno && \
    489 	test x$CURSES_LIB_WIDE = xyes && \
    490 	test x$ac_cv_func_iswalpha = xyes && \
    491 	test x$ac_cv_func_iswalnum = xyes && \
    492 	test x$ac_cv_func_iswpunct = xyes && \
    493 	test x$ac_cv_func_mbstowcs = xyes && \
    494 	test x$ac_cv_func_wctomb = xyes; then
    495 		AC_DEFINE(ENABLE_UTF8, 1, [Define this if your system has sufficient UTF-8 support.])
    496 else
    497 	if test "x$enable_utf8" = xyes; then
    498 		AC_MSG_ERROR([
    499   *** UTF-8 support was requested, but insufficient support was
    500   *** detected in your curses and/or C libraries.  Please verify
    501   *** that both your curses library and your C library were built
    502   *** with wide-character support.])
    503 	elif test "x$enable_utf8" != xno; then
    504 		AC_MSG_WARN([
    505   *** Insufficient UTF-8 support was detected in your curses
    506   *** and/or C libraries.  If you want UTF-8 support, please
    507   *** verify that both your curses library and your C library
    508   *** were built with wide-character support.])
    509 	fi
    510 fi
    511 
    512 AC_CACHE_CHECK([for enhanced regular expression flag], nano_cv_flag_reg_enhanced,
    513 			   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <regex.h>]],
    514 												   [[
    515 													 #ifndef REG_ENHANCED
    516 													 error: No REG_ENHANCED support!
    517 													 #endif
    518 												   ]])],
    519 								  [nano_cv_flag_reg_enhanced=yes],
    520 								  [nano_cv_flag_reg_enhanced=no])])
    521 dnl The bundled gnulib regex module doesn't support REG_ENHANCED.
    522 if test "$ac_use_included_regex" = "yes"; then
    523 	nano_cv_flag_reg_enhanced="no"
    524 fi
    525 if test "$nano_cv_flag_reg_enhanced" = "yes"; then
    526 	nano_reg_extended="REG_EXTENDED | REG_ENHANCED"
    527 else
    528 	nano_reg_extended="REG_EXTENDED"
    529 fi
    530 
    531 AC_DEFINE_UNQUOTED(NANO_REG_EXTENDED, $nano_reg_extended,
    532 				   [Flag(s) to use to get the full range of extended regular expressions])
    533 
    534 if test x$color_support = xyes; then
    535 	AC_MSG_CHECKING([whether _XOPEN_SOURCE_EXTENDED is needed])
    536 	AC_RUN_IFELSE([AC_LANG_SOURCE([[
    537 #include <curses.h>
    538 int main(void)
    539 {
    540 	int testcolor = COLOR_WHITE;
    541 	return 0;
    542 }]])],
    543 	AC_MSG_RESULT(no),
    544 	AC_RUN_IFELSE([AC_LANG_SOURCE([[
    545 #ifndef _XOPEN_SOURCE_EXTENDED
    546 #define _XOPEN_SOURCE_EXTENDED 1
    547 #endif
    548 #include <curses.h>
    549 int main(void)
    550 {
    551 	int testcolor = COLOR_WHITE;
    552 	return 0;
    553 }]])],
    554 	AC_DEFINE(NEED_XOPEN_SOURCE_EXTENDED, 1, [Define this if you need the _XOPEN_SOURCE_EXTENDED macro for color support.])
    555 	AC_MSG_RESULT(yes),
    556 	AC_MSG_RESULT(not sure)
    557 	AC_MSG_WARN([
    558   *** Couldn't successfully compile basic color test with or without
    559   *** _XOPEN_SOURCE_EXTENDED.  This build may not compile.  Consider
    560   *** configuring with --disable-color or installing ncurses.])),
    561 	AC_MSG_WARN([
    562   *** Can't check need for _XOPEN_SOURCE_EXTENDED when cross-compiling.]))
    563 fi
    564 
    565 AS_IF([test "x$enable_libmagic" != "xno"], [
    566 	AC_CHECK_HEADERS([magic.h])
    567 	AC_CHECK_LIB(magic, magic_open)
    568 	AC_CHECK_HEADERS([zlib.h])
    569 	AC_CHECK_LIB(z, inflate)
    570 ])
    571 
    572 # Check for groff html support.
    573 AC_MSG_CHECKING([for HTML support in groff])
    574 groff -t -mandoc -Thtml </dev/null >/dev/null
    575 if test $? -ne 0 ; then
    576 	AC_MSG_RESULT([no])
    577 	AC_MSG_WARN([
    578   *** Will not generate HTML version of man pages.  Consider
    579   *** installing a newer version of groff with HTML support.])
    580 	groff_html_support=no
    581 else
    582 	AC_MSG_RESULT([yes])
    583 	groff_html_support=yes
    584 fi
    585 AM_CONDITIONAL(GROFF_HTML, test x$groff_html_support = xyes)
    586 
    587 AC_CONFIG_FILES([
    588 Makefile
    589 doc/Makefile
    590 doc/sample.nanorc
    591 lib/Makefile
    592 m4/Makefile
    593 po/Makefile.in
    594 src/Makefile
    595 syntax/Makefile
    596 ])
    597 
    598 AC_OUTPUT
    599 
    600 make showinfo