2016-08-14 22:18:00 +03:00
|
|
|
# Configuration for GNU nano - a small and user-friendly text editor
|
2003-01-15 20:40:35 +03:00
|
|
|
#
|
2024-01-10 13:24:28 +03:00
|
|
|
# Copyright (C) 1999-2011, 2013-2024 Free Software Foundation, Inc.
|
2017-04-09 13:09:23 +03:00
|
|
|
# Copyright (C) 2014, 2017 Mike Frysinger
|
2003-01-15 20:40:35 +03:00
|
|
|
#
|
2016-08-29 18:10:49 +03:00
|
|
|
# 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 Free Software Foundation, either version 3 of the License,
|
|
|
|
# or (at your option) any later version.
|
2003-01-15 20:40:35 +03:00
|
|
|
#
|
2016-08-29 18:10:49 +03:00
|
|
|
# GNU nano is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
|
|
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the GNU General Public License for more details.
|
2003-01-15 20:40:35 +03:00
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2018-11-11 14:28:40 +03:00
|
|
|
# along with this program. If not, see https://www.gnu.org/licenses/.
|
2003-01-15 20:40:35 +03:00
|
|
|
|
2024-05-01 11:01:44 +03:00
|
|
|
AC_INIT([GNU nano], [8.0], [nano-devel@gnu.org], [nano])
|
2003-09-07 04:44:12 +04:00
|
|
|
AC_CONFIG_SRCDIR([src/nano.c])
|
2013-01-03 07:47:26 +04:00
|
|
|
AC_CANONICAL_HOST
|
2017-02-22 01:04:33 +03:00
|
|
|
AM_INIT_AUTOMAKE([1.14])
|
2022-03-07 19:22:49 +03:00
|
|
|
AM_MAINTAINER_MODE([enable])
|
2004-11-18 03:05:14 +03:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2003-01-15 20:40:35 +03:00
|
|
|
|
2014-04-03 01:03:32 +04:00
|
|
|
dnl Make sure the ONCE macros are available.
|
|
|
|
|
2017-02-22 01:04:33 +03:00
|
|
|
AC_PREREQ([2.69])
|
2000-06-06 09:53:49 +04:00
|
|
|
|
2017-02-22 01:04:35 +03:00
|
|
|
dnl Lie about gnulib features we don't use to speed up & shrink down.
|
|
|
|
|
2017-02-22 01:04:41 +03:00
|
|
|
gl_cv_func_printf_directive_n=yes
|
2017-02-22 01:04:35 +03:00
|
|
|
gl_cv_func_printf_infinite_long_double=yes
|
2017-02-22 01:04:41 +03:00
|
|
|
gl_cv_func_printf_long_double=yes
|
|
|
|
gl_cv_func_snprintf_directive_n=yes
|
2017-03-14 23:06:05 +03:00
|
|
|
gl_cv_glob_lists_symlinks=yes
|
2017-02-22 01:04:35 +03:00
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
dnl Checks for programs.
|
2005-06-21 08:16:12 +04:00
|
|
|
|
2020-09-17 17:28:05 +03:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
2000-06-06 09:53:49 +04:00
|
|
|
AC_PROG_CC
|
2017-02-22 01:04:35 +03:00
|
|
|
gl_EARLY
|
|
|
|
gl_INIT
|
2004-08-01 20:09:15 +04:00
|
|
|
AC_PROG_LN_S
|
2020-09-17 17:28:05 +03:00
|
|
|
AC_SEARCH_LIBS([strerror], [cposix])
|
2002-02-23 21:23:43 +03:00
|
|
|
AC_SYS_LARGEFILE
|
2014-03-24 17:42:58 +04:00
|
|
|
PKG_PROG_PKG_CONFIG
|
2000-06-06 09:53:49 +04:00
|
|
|
|
2003-01-15 20:40:35 +03:00
|
|
|
dnl Internationalization macros.
|
2005-06-21 08:16:12 +04:00
|
|
|
|
2017-02-22 01:04:34 +03:00
|
|
|
AM_GNU_GETTEXT_VERSION([0.18.3])
|
2003-01-15 20:40:35 +03:00
|
|
|
AM_GNU_GETTEXT([external], [need-ngettext])
|
2006-07-18 22:16:30 +04:00
|
|
|
AM_CONDITIONAL(USE_NLS, test x$USE_NLS = xyes)
|
2003-01-15 20:40:35 +03:00
|
|
|
|
2006-06-01 21:23:28 +04:00
|
|
|
dnl Data location.
|
|
|
|
|
|
|
|
pkgdatadir=${datadir}/${PACKAGE}
|
|
|
|
AC_DEFINE_DIR([PKGDATADIR], [pkgdatadir], [Where data are placed to.])
|
|
|
|
|
2018-11-29 21:36:51 +03:00
|
|
|
dnl Whether this is a git repository.
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether building from git])
|
2021-02-02 13:51:22 +03:00
|
|
|
if test -f "$srcdir/roll-a-release.sh" ; then
|
2018-11-29 21:36:51 +03:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
from_git=yes
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
from_git=no
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(BUILDING_FROM_GIT, test x$from_git = xyes)
|
|
|
|
|
2018-11-28 19:38:05 +03:00
|
|
|
dnl Checks for pkg-config and gettext when building from git.
|
2018-11-29 21:36:51 +03:00
|
|
|
|
|
|
|
if test x$from_git = xyes; then
|
2018-11-28 19:38:05 +03:00
|
|
|
if test ! -f $(aclocal --print-ac-dir)/pkg.m4; then
|
|
|
|
AC_MSG_ERROR([
|
2020-09-17 10:49:35 +03:00
|
|
|
*** The pkg.m4 macros are missing.
|
|
|
|
*** The pkg-config package needs to be installed when building from git.
|
|
|
|
*** After fixing this problem, rerun ./autogen.sh.])
|
2018-11-28 19:38:05 +03:00
|
|
|
fi
|
2018-11-29 21:36:51 +03:00
|
|
|
if test "$ac_cv_path_MSGFMT" = ":"; then
|
|
|
|
AC_MSG_ERROR([
|
2020-09-17 10:49:35 +03:00
|
|
|
*** The msgfmt program is missing.
|
|
|
|
*** The gettext package needs to be installed when building from git.])
|
2018-11-29 21:36:51 +03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
dnl Checks for header files.
|
2005-06-21 08:16:12 +04:00
|
|
|
|
2017-02-22 01:04:48 +03:00
|
|
|
AC_CHECK_HEADERS(libintl.h limits.h pwd.h termios.h sys/param.h)
|
2000-06-06 09:53:49 +04:00
|
|
|
|
2005-03-26 02:19:04 +03:00
|
|
|
dnl Checks for options.
|
|
|
|
|
2014-04-03 23:50:12 +04:00
|
|
|
AC_ARG_ENABLE(browser,
|
2017-04-26 14:37:32 +03:00
|
|
|
AS_HELP_STRING([--disable-browser], [Disable the built-in file browser]))
|
2017-05-08 20:08:23 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_browser" != xyes; then
|
|
|
|
enable_browser=no
|
|
|
|
fi
|
2017-05-08 20:08:23 +03:00
|
|
|
fi
|
2017-05-19 12:43:04 +03:00
|
|
|
if test "x$enable_browser" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_BROWSER, 1, [Define this to enable the built-in file browser.])
|
2017-05-19 12:43:04 +03:00
|
|
|
fi
|
2014-04-03 23:50:12 +04:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(color,
|
|
|
|
AS_HELP_STRING([--disable-color], [Disable color and syntax highlighting]))
|
2017-11-01 21:45:33 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_color" = xyes; then
|
|
|
|
if test "x$enable_nanorc" != xyes; then
|
2020-09-17 10:49:35 +03:00
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** --enable-color needs --enable-nanorc to work])
|
2017-12-29 21:27:33 +03:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
enable_color=no
|
2017-11-01 21:45:33 +03:00
|
|
|
fi
|
|
|
|
fi
|
2014-04-03 23:50:12 +04:00
|
|
|
if test "x$enable_nanorc" = xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_color" = xyes; then
|
2020-09-17 10:49:35 +03:00
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** --enable-color cannot work with --disable-nanorc])
|
2017-12-29 21:27:33 +03:00
|
|
|
else
|
|
|
|
# Disabling nanorc silently disables color support.
|
|
|
|
enable_color=no
|
|
|
|
fi
|
2014-04-03 23:50:12 +04:00
|
|
|
fi
|
2017-11-01 21:45:33 +03:00
|
|
|
if test "x$enable_color" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_COLOR, 1, [Define this to have syntax highlighting.])
|
|
|
|
color_support=yes
|
2014-04-03 23:50:12 +04:00
|
|
|
fi
|
2008-09-30 20:47:57 +04:00
|
|
|
|
2016-05-25 23:13:50 +03:00
|
|
|
AC_ARG_ENABLE(comment,
|
2017-04-26 14:37:32 +03:00
|
|
|
AS_HELP_STRING([--disable-comment], [Disable the comment/uncomment function]))
|
2016-05-25 23:13:50 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_comment" = xyes; then
|
2020-09-17 10:49:35 +03:00
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** --enable-comment cannot work with --enable-tiny])
|
2017-12-29 21:27:33 +03:00
|
|
|
else
|
|
|
|
enable_comment=no
|
|
|
|
fi
|
2016-05-25 23:13:50 +03:00
|
|
|
fi
|
2017-05-19 12:43:04 +03:00
|
|
|
if test "x$enable_comment" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_COMMENT, 1, [Define this to enable the comment/uncomment function.])
|
2017-05-19 12:43:04 +03:00
|
|
|
fi
|
2016-05-25 23:13:50 +03:00
|
|
|
|
2008-09-30 20:47:57 +04:00
|
|
|
AC_ARG_ENABLE(extra,
|
2017-04-26 14:37:32 +03:00
|
|
|
AS_HELP_STRING([--disable-extra], [Disable the Easter egg]))
|
2017-11-01 22:33:14 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_extra" != xyes; then
|
|
|
|
enable_extra=no
|
|
|
|
fi
|
2017-11-01 22:33:14 +03:00
|
|
|
fi
|
|
|
|
if test "x$enable_extra" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_EXTRA, 1, [Define this to have an Easter egg.])
|
2014-03-26 13:35:52 +04:00
|
|
|
fi
|
2008-09-30 20:47:57 +04:00
|
|
|
|
2022-08-28 17:31:04 +03:00
|
|
|
AC_ARG_ENABLE(formatter,
|
|
|
|
AS_HELP_STRING([--disable-formatter], [Disable the formatting tool]))
|
|
|
|
if test "x$enable_tiny" = xyes; then
|
|
|
|
if test "x$enable_formatter" = xyes; then
|
|
|
|
if test "x$enable_color" != xyes; then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** --enable-formatter needs both --enable-color and --enable-nanorc to work])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
enable_formatter=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test "x$enable_color" = xno; then
|
|
|
|
if test "x$enable_formatter" = xyes; then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** --enable-formatter cannot work with --disable-color nor --disable-nanorc])
|
|
|
|
else
|
|
|
|
enable_formatter=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test "x$enable_formatter" != xno; then
|
|
|
|
AC_DEFINE(ENABLE_FORMATTER, 1, [Define this to have access to a formatter.])
|
|
|
|
fi
|
|
|
|
|
2002-09-07 00:35:28 +04:00
|
|
|
AC_ARG_ENABLE(help,
|
2017-04-26 14:37:32 +03:00
|
|
|
AS_HELP_STRING([--disable-help], [Disable the built-in help texts]))
|
2017-04-25 18:51:45 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_help" = xyes; then
|
|
|
|
if test "x$enable_multibuffer" != xyes; then
|
2020-09-17 10:49:35 +03:00
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** --enable-help needs --enable-multibuffer to work])
|
2017-12-29 21:27:33 +03:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
enable_help=no
|
2017-04-25 18:51:45 +03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test "x$enable_multibuffer" = xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_help" = xyes; then
|
2020-09-17 10:49:35 +03:00
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** --enable-help cannot work with --disable-multibuffer])
|
2017-12-29 21:27:33 +03:00
|
|
|
else
|
|
|
|
# Disabling multibuffer silently disables the help texts.
|
|
|
|
enable_help=no
|
|
|
|
fi
|
2017-04-25 18:51:45 +03:00
|
|
|
fi
|
2017-05-19 12:43:04 +03:00
|
|
|
if test "x$enable_help" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_HELP, 1, [Define this to enable the Ctrl+G help texts.])
|
2017-05-19 12:43:04 +03:00
|
|
|
fi
|
2001-07-11 06:08:33 +04:00
|
|
|
|
2014-06-19 21:39:26 +04:00
|
|
|
AC_ARG_ENABLE(histories,
|
|
|
|
AS_HELP_STRING([--disable-histories], [Disable search and position histories]))
|
2017-10-29 21:42:12 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_histories" != xyes; then
|
|
|
|
enable_histories=no
|
|
|
|
fi
|
2017-10-29 21:42:12 +03:00
|
|
|
fi
|
|
|
|
if test "x$enable_histories" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_HISTORIES, 1, [Define this to have search and position histories.])
|
2014-06-19 21:39:26 +04:00
|
|
|
fi
|
|
|
|
|
2002-09-07 00:35:28 +04:00
|
|
|
AC_ARG_ENABLE(justify,
|
2017-04-26 14:37:32 +03:00
|
|
|
AS_HELP_STRING([--disable-justify], [Disable the justify/unjustify functions]))
|
2017-10-31 19:34:07 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_justify" != xyes; then
|
|
|
|
enable_justify=no
|
|
|
|
fi
|
2017-10-31 19:34:07 +03:00
|
|
|
fi
|
|
|
|
if test "x$enable_justify" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_JUSTIFY, 1, [Define this to have the routines for justifying.])
|
2014-03-26 13:35:52 +04:00
|
|
|
fi
|
2001-04-13 06:32:06 +04:00
|
|
|
|
2014-04-03 23:50:12 +04:00
|
|
|
AC_ARG_ENABLE(libmagic,
|
|
|
|
AS_HELP_STRING([--disable-libmagic], [Disable detection of file types via libmagic]))
|
2020-09-16 13:03:11 +03:00
|
|
|
if test "x$enable_libmagic" = xyes; then
|
|
|
|
if test "x$enable_tiny" = xyes; then
|
|
|
|
if test "x$enable_color" != xyes; then
|
2020-09-17 10:49:35 +03:00
|
|
|
AC_MSG_ERROR([
|
2022-08-28 17:31:04 +03:00
|
|
|
*** --enable-libmagic needs both --enable-color and --enable-nanorc to work])
|
2020-09-16 13:03:11 +03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test "x$enable_color" = xno; then
|
2020-09-17 10:49:35 +03:00
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** --enable-libmagic cannot work with --disable-color nor --disable-nanorc])
|
2020-09-16 13:03:11 +03:00
|
|
|
fi
|
|
|
|
fi
|
2014-04-03 23:50:12 +04:00
|
|
|
|
2022-08-28 17:31:04 +03:00
|
|
|
AC_ARG_ENABLE(linter,
|
|
|
|
AS_HELP_STRING([--disable-linter], [Disable the linting tool]))
|
|
|
|
if test "x$enable_tiny" = xyes; then
|
|
|
|
if test "x$enable_linter" = xyes; then
|
|
|
|
if test "x$enable_color" != xyes; then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** --enable-linter needs both --enable-color and --enable-nanorc to work])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
enable_linter=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test "x$enable_color" = xno; then
|
|
|
|
if test "x$enable_linter" = xyes; then
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** --enable-linter cannot work with --disable-color nor --disable-nanorc])
|
|
|
|
else
|
|
|
|
enable_linter=no
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test "x$enable_linter" != xno; then
|
|
|
|
AC_DEFINE(ENABLE_LINTER, 1, [Define this to have access to a linter.])
|
|
|
|
fi
|
|
|
|
|
2016-10-20 11:44:29 +03:00
|
|
|
AC_ARG_ENABLE(linenumbers,
|
|
|
|
AS_HELP_STRING([--disable-linenumbers], [Disable line numbering]))
|
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_linenumbers" != xyes; then
|
|
|
|
enable_linenumbers=no
|
|
|
|
fi
|
2016-10-20 11:44:29 +03:00
|
|
|
fi
|
2017-05-19 12:43:04 +03:00
|
|
|
if test "x$enable_linenumbers" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_LINENUMBERS, 1, [Define this to enable line numbering.])
|
2017-05-19 12:43:04 +03:00
|
|
|
fi
|
2016-10-20 11:44:29 +03:00
|
|
|
|
2002-09-07 00:35:28 +04:00
|
|
|
AC_ARG_ENABLE(mouse,
|
2017-04-26 14:37:32 +03:00
|
|
|
AS_HELP_STRING([--disable-mouse], [Disable mouse support]))
|
2017-05-01 21:45:07 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_mouse" != xyes; then
|
|
|
|
enable_mouse=no
|
|
|
|
fi
|
2017-05-01 21:45:07 +03:00
|
|
|
fi
|
2017-05-19 12:43:04 +03:00
|
|
|
if test "x$enable_mouse" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_MOUSE, 1, [Define this to enable mouse support.])
|
2017-05-19 12:43:04 +03:00
|
|
|
fi
|
2000-11-24 17:00:16 +03:00
|
|
|
|
2014-04-03 23:50:12 +04:00
|
|
|
AC_ARG_ENABLE(multibuffer,
|
|
|
|
AS_HELP_STRING([--disable-multibuffer], [Disable multiple file buffers]))
|
2017-05-01 21:20:34 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_multibuffer" != xyes; then
|
|
|
|
enable_multibuffer=no
|
|
|
|
fi
|
2017-05-01 21:20:34 +03:00
|
|
|
fi
|
2017-05-19 12:43:04 +03:00
|
|
|
if test "x$enable_multibuffer" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.])
|
2017-05-19 12:43:04 +03:00
|
|
|
fi
|
2014-04-03 23:50:12 +04:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(nanorc,
|
2017-04-26 14:37:32 +03:00
|
|
|
AS_HELP_STRING([--disable-nanorc], [Disable the use of .nanorc files]))
|
2017-05-08 20:42:44 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_nanorc" != xyes; then
|
|
|
|
enable_nanorc=no
|
|
|
|
fi
|
2017-05-08 20:42:44 +03:00
|
|
|
fi
|
2017-05-19 12:43:04 +03:00
|
|
|
if test "x$enable_nanorc" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_NANORC, 1, [Define this to enable the use of .nanorc files.])
|
|
|
|
nanorc_support=yes
|
2017-05-19 12:43:04 +03:00
|
|
|
fi
|
2014-04-03 23:50:12 +04:00
|
|
|
|
2002-09-07 00:35:28 +04:00
|
|
|
AC_ARG_ENABLE(operatingdir,
|
2017-04-26 14:37:32 +03:00
|
|
|
AS_HELP_STRING([--disable-operatingdir], [Disable the setting of an operating directory]))
|
2017-10-29 23:08:07 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_operatingdir" != xyes; then
|
|
|
|
enable_operatingdir=no
|
|
|
|
fi
|
2017-10-29 23:08:07 +03:00
|
|
|
fi
|
|
|
|
if test "x$enable_operatingdir" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_OPERATINGDIR, 1, [Define this to allow setting an operating directory (a chroot of sorts).])
|
2014-03-26 13:35:52 +04:00
|
|
|
fi
|
2000-12-01 21:46:01 +03:00
|
|
|
|
2000-12-06 04:08:10 +03:00
|
|
|
AC_ARG_ENABLE(speller,
|
2022-08-28 17:31:04 +03:00
|
|
|
AS_HELP_STRING([--disable-speller], [Disable the spell-checking tool]))
|
2017-10-31 21:32:42 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_speller" != xyes; then
|
|
|
|
enable_speller=no
|
|
|
|
fi
|
2017-10-31 21:32:42 +03:00
|
|
|
fi
|
|
|
|
if test "x$enable_speller" != xno; then
|
2022-08-28 17:31:04 +03:00
|
|
|
AC_DEFINE(ENABLE_SPELLER, 1, [Define this to have access to a spell checker.])
|
2014-03-26 13:35:52 +04:00
|
|
|
fi
|
2000-12-01 21:46:01 +03:00
|
|
|
|
2002-09-07 00:35:28 +04:00
|
|
|
AC_ARG_ENABLE(tabcomp,
|
2017-04-26 14:37:32 +03:00
|
|
|
AS_HELP_STRING([--disable-tabcomp], [Disable the tab-completion functions]))
|
2017-05-08 20:15:51 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_tabcomp" != xyes; then
|
|
|
|
enable_tabcomp=no
|
|
|
|
fi
|
2017-05-08 20:15:51 +03:00
|
|
|
fi
|
2017-05-19 12:43:04 +03:00
|
|
|
if test "x$enable_tabcomp" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_TABCOMP, 1, [Define this to have tab completion for filenames and search strings.])
|
2017-05-19 12:43:04 +03:00
|
|
|
fi
|
2001-01-03 10:11:47 +03:00
|
|
|
|
2016-12-07 15:10:40 +03:00
|
|
|
AC_ARG_ENABLE(wordcomp,
|
2017-04-26 14:37:32 +03:00
|
|
|
AS_HELP_STRING([--disable-wordcomp], [Disable the word-completion function]))
|
2016-12-07 15:10:40 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_wordcomp" = xyes; then
|
2020-09-17 10:49:35 +03:00
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** --enable-wordcomp cannot work with --enable-tiny])
|
2017-12-29 21:27:33 +03:00
|
|
|
else
|
|
|
|
enable_wordcomp=no
|
|
|
|
fi
|
2016-12-07 15:10:40 +03:00
|
|
|
fi
|
2017-05-19 12:43:04 +03:00
|
|
|
if test "x$enable_wordcomp" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_WORDCOMPLETION, 1, [Define this to enable the word-completion function.])
|
2017-05-19 12:43:04 +03:00
|
|
|
fi
|
2016-12-07 15:10:40 +03:00
|
|
|
|
2001-04-02 09:36:08 +04:00
|
|
|
AC_ARG_ENABLE(wrapping,
|
2017-04-26 14:37:32 +03:00
|
|
|
AS_HELP_STRING([--disable-wrapping], [Disable all hard-wrapping of text]))
|
2017-10-29 23:00:09 +03:00
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_wrapping" != xyes; then
|
|
|
|
enable_wrapping=no
|
|
|
|
fi
|
2017-10-29 23:00:09 +03:00
|
|
|
fi
|
|
|
|
if test "x$enable_wrapping" != xno; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(ENABLE_WRAPPING, 1, [Define this to have hard text wrapping.])
|
2014-03-26 13:35:52 +04:00
|
|
|
fi
|
2001-04-02 09:36:08 +04:00
|
|
|
|
2014-04-04 17:12:07 +04:00
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
AS_HELP_STRING([--enable-debug], [Enable debugging (disabled by default)]))
|
|
|
|
if test "x$enable_debug" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(DEBUG, 1, [Define this to enable debug messages and abortion on failing asserts.])
|
2014-04-04 17:12:07 +04:00
|
|
|
else
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(NDEBUG, 1, [Shut up assert warnings :-)])
|
2014-04-04 17:12:07 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(tiny,
|
|
|
|
AS_HELP_STRING([--enable-tiny], [Disable features for the sake of size]))
|
|
|
|
if test "x$enable_tiny" = xyes; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.])
|
|
|
|
if test "x$enable_libmagic" != xyes; then
|
|
|
|
enable_libmagic=no
|
|
|
|
fi
|
2014-04-04 17:12:07 +04:00
|
|
|
fi
|
|
|
|
|
2014-04-03 23:50:12 +04:00
|
|
|
AM_CONDITIONAL(USE_COLOR, test x$color_support = xyes)
|
|
|
|
AM_CONDITIONAL(USE_NANORC, test x$nanorc_support = xyes)
|
2003-01-17 03:17:45 +03:00
|
|
|
|
2005-03-26 01:25:24 +03:00
|
|
|
AC_MSG_CHECKING([whether to enable UTF-8 support])
|
2014-03-26 13:35:52 +04:00
|
|
|
AC_ARG_ENABLE(utf8, AS_HELP_STRING([--enable-utf8], [Enable UTF-8 support]))
|
2014-03-27 14:28:19 +04:00
|
|
|
AC_MSG_RESULT(${enable_utf8:-auto})
|
2005-03-26 01:25:24 +03:00
|
|
|
|
2014-04-03 23:50:12 +04:00
|
|
|
AC_ARG_ENABLE(altrcname,
|
|
|
|
AS_HELP_STRING([--enable-altrcname], [Specify an alternate rcfile name (default: .nanorc)]),
|
|
|
|
[if test x$enableval != no; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_DEFINE_UNQUOTED(RCFILE_NAME, "$enableval", [Specify an alternate rcfile name (default: .nanorc).]) rcfilename=$enableval
|
2014-04-03 23:50:12 +04:00
|
|
|
fi])
|
|
|
|
|
2005-03-26 02:19:04 +03:00
|
|
|
dnl Checks for functions.
|
|
|
|
|
2014-03-26 13:35:52 +04:00
|
|
|
if test "x$enable_utf8" != xno; then
|
2021-04-25 12:41:36 +03:00
|
|
|
AC_CHECK_FUNCS(iswalpha iswalnum iswpunct mbstowcs wctomb)
|
2005-03-26 01:25:24 +03:00
|
|
|
fi
|
2000-06-06 09:53:49 +04:00
|
|
|
|
2022-02-26 10:15:46 +03:00
|
|
|
AC_CHECK_FUNCS_ONCE(chmod chown fchmod fchown flockfile funlockfile
|
|
|
|
fork fsync geteuid pipe wait waitpid)
|
|
|
|
|
2014-03-24 17:31:37 +04:00
|
|
|
dnl Checks for available flags.
|
2014-04-03 01:03:32 +04:00
|
|
|
|
2014-03-24 17:31:37 +04:00
|
|
|
AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"], [], [])
|
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
dnl Checks for libraries.
|
2005-03-26 02:19:04 +03:00
|
|
|
|
2014-03-24 17:42:58 +04:00
|
|
|
if eval "test x$CURSES_LIB_NAME = x"; then
|
2017-12-29 21:27:33 +03:00
|
|
|
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
|
2014-03-24 17:42:58 +04:00
|
|
|
fi
|
|
|
|
|
2005-03-26 02:19:04 +03:00
|
|
|
if eval "test x$CURSES_LIB_NAME = x"; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_CHECK_HEADERS(ncurses.h)
|
|
|
|
|
|
|
|
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"
|
2020-09-03 20:25:05 +03:00
|
|
|
AC_CHECK_LIB(ncursesw, wget_wch, [CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
|
2017-12-29 21:27:33 +03:00
|
|
|
else
|
2020-09-03 20:25:05 +03:00
|
|
|
AC_CHECK_LIB(ncursesw, wget_wch, [CURSES_LIB="-lncursesw" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
|
2017-12-29 21:27:33 +03:00
|
|
|
fi
|
|
|
|
LIBS="$OLDLIBS"
|
2013-01-21 07:36:18 +04:00
|
|
|
fi
|
2005-03-26 01:25:24 +03:00
|
|
|
|
2017-12-29 21:27:33 +03:00
|
|
|
if eval "test x$CURSES_LIB_NAME = x"; then
|
|
|
|
AC_CHECK_LIB(ncurses, initscr, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses])
|
|
|
|
fi
|
2000-06-06 09:53:49 +04:00
|
|
|
fi
|
|
|
|
|
2005-03-26 02:19:04 +03:00
|
|
|
if eval "test x$CURSES_LIB_NAME = x"; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_CHECK_HEADERS(curses.h)
|
2005-03-26 01:25:24 +03:00
|
|
|
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_utf8" != xno; then
|
2020-09-03 20:25:05 +03:00
|
|
|
AC_CHECK_LIB(curses, wget_wch, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses CURSES_LIB_WIDE=yes])
|
2017-12-29 21:27:33 +03:00
|
|
|
fi
|
2005-03-26 01:25:24 +03:00
|
|
|
|
2017-12-29 21:27:33 +03:00
|
|
|
if eval "test x$CURSES_LIB_NAME = x"; then
|
|
|
|
AC_CHECK_LIB(curses, initscr, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses])
|
|
|
|
fi
|
2000-06-06 09:53:49 +04:00
|
|
|
fi
|
|
|
|
|
2005-03-26 02:19:04 +03:00
|
|
|
if eval "test x$CURSES_LIB_NAME = x"; then
|
2018-01-19 13:11:12 +03:00
|
|
|
AC_MSG_ERROR([
|
2018-12-16 15:35:48 +03:00
|
|
|
*** No curses lib was found. Please install the curses header files
|
2020-10-11 17:29:40 +03:00
|
|
|
*** from libncurses-dev (Debian), ncurses-devel (Fedora), or similar.
|
2018-12-16 15:35:48 +03:00
|
|
|
*** (Or install ncurses from https://ftp.gnu.org/gnu/ncurses/.)])
|
2000-06-06 09:53:49 +04:00
|
|
|
else
|
2020-04-19 20:09:32 +03:00
|
|
|
AC_MSG_RESULT([ The curses library to be used is: $CURSES_LIB_NAME])
|
2000-06-06 09:53:49 +04:00
|
|
|
fi
|
|
|
|
|
2016-11-23 22:26:03 +03:00
|
|
|
AC_CHECK_LIB([$CURSES_LIB_NAME], [use_default_colors],
|
2017-12-29 21:27:33 +03:00
|
|
|
[AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, [Define this if your curses library has the use_default_colors() function.])],
|
|
|
|
[], [$CURSES_LIB])
|
2017-02-22 01:04:45 +03:00
|
|
|
AC_CHECK_LIB([$CURSES_LIB_NAME], [set_escdelay],
|
2017-12-29 21:27:33 +03:00
|
|
|
[AC_DEFINE(HAVE_SET_ESCDELAY, 1, [Define this if your curses library has the set_escdelay() function.])],
|
|
|
|
[], [$CURSES_LIB])
|
2016-11-23 22:26:03 +03:00
|
|
|
AC_CHECK_LIB([$CURSES_LIB_NAME], [key_defined],
|
2017-12-29 21:27:33 +03:00
|
|
|
[AC_DEFINE(HAVE_KEY_DEFINED, 1, [Define this if your curses library has the key_defined() function.])],
|
|
|
|
[], [$CURSES_LIB])
|
2001-01-06 21:12:43 +03:00
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
LIBS="$LIBS $CURSES_LIB"
|
2000-06-20 03:19:07 +04:00
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
AC_SUBST(CURSES_LIB)
|
|
|
|
|
2014-03-26 13:35:52 +04:00
|
|
|
if test "x$enable_utf8" != xno && \
|
2017-12-29 21:27:33 +03:00
|
|
|
test x$CURSES_LIB_WIDE = xyes && \
|
2021-04-25 12:41:36 +03:00
|
|
|
test x$ac_cv_func_iswalpha = xyes && \
|
2017-12-29 21:27:33 +03:00
|
|
|
test x$ac_cv_func_iswalnum = xyes && \
|
|
|
|
test x$ac_cv_func_iswpunct = xyes && \
|
|
|
|
test x$ac_cv_func_mbstowcs = xyes && \
|
|
|
|
test x$ac_cv_func_wctomb = xyes; then
|
|
|
|
AC_DEFINE(ENABLE_UTF8, 1, [Define this if your system has sufficient UTF-8 support.])
|
2004-12-12 22:04:56 +03:00
|
|
|
else
|
2017-12-29 21:27:33 +03:00
|
|
|
if test "x$enable_utf8" = xyes; then
|
|
|
|
AC_MSG_ERROR([
|
2020-08-23 10:05:47 +03:00
|
|
|
*** UTF-8 support was requested, but insufficient support was
|
|
|
|
*** detected in your curses and/or C libraries. Please verify
|
|
|
|
*** that both your curses library and your C library were built
|
2018-12-16 15:35:48 +03:00
|
|
|
*** with wide-character support.])
|
2017-12-29 21:27:33 +03:00
|
|
|
elif test "x$enable_utf8" != xno; then
|
|
|
|
AC_MSG_WARN([
|
2020-08-23 10:05:47 +03:00
|
|
|
*** Insufficient UTF-8 support was detected in your curses
|
|
|
|
*** and/or C libraries. If you want UTF-8 support, please
|
|
|
|
*** verify that both your curses library and your C library
|
|
|
|
*** were built with wide-character support.])
|
2017-12-29 21:27:33 +03:00
|
|
|
fi
|
2004-12-12 22:04:56 +03:00
|
|
|
fi
|
|
|
|
|
2017-04-04 19:42:23 +03:00
|
|
|
AC_CACHE_CHECK([for enhanced regular expression flag], nano_cv_flag_reg_enhanced,
|
2017-12-29 21:27:33 +03:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <regex.h>]],
|
|
|
|
[[
|
|
|
|
#ifndef REG_ENHANCED
|
|
|
|
error: No REG_ENHANCED support!
|
|
|
|
#endif
|
|
|
|
]])],
|
|
|
|
[nano_cv_flag_reg_enhanced=yes],
|
|
|
|
[nano_cv_flag_reg_enhanced=no])])
|
2017-04-04 19:42:23 +03:00
|
|
|
dnl The bundled gnulib regex module doesn't support REG_ENHANCED.
|
|
|
|
if test "$ac_use_included_regex" = "yes"; then
|
2017-12-29 21:27:33 +03:00
|
|
|
nano_cv_flag_reg_enhanced="no"
|
2017-04-04 19:42:23 +03:00
|
|
|
fi
|
|
|
|
if test "$nano_cv_flag_reg_enhanced" = "yes"; then
|
2017-12-29 21:27:33 +03:00
|
|
|
nano_reg_extended="REG_EXTENDED | REG_ENHANCED"
|
2017-04-04 19:42:23 +03:00
|
|
|
else
|
2017-12-29 21:27:33 +03:00
|
|
|
nano_reg_extended="REG_EXTENDED"
|
2017-04-04 19:42:23 +03:00
|
|
|
fi
|
2016-03-22 13:42:28 +03:00
|
|
|
|
2017-04-04 19:42:23 +03:00
|
|
|
AC_DEFINE_UNQUOTED(NANO_REG_EXTENDED, $nano_reg_extended,
|
2017-12-29 21:27:33 +03:00
|
|
|
[Flag(s) to use to get the full range of extended regular expressions])
|
2016-03-22 13:42:28 +03:00
|
|
|
|
2017-01-09 16:28:33 +03:00
|
|
|
if test x$color_support = xyes; then
|
2020-09-16 11:44:48 +03:00
|
|
|
AC_MSG_CHECKING([whether _XOPEN_SOURCE_EXTENDED is needed])
|
2020-09-17 14:26:24 +03:00
|
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
2009-03-01 03:50:19 +03:00
|
|
|
#include <curses.h>
|
|
|
|
int main(void)
|
|
|
|
{
|
2017-12-29 21:27:33 +03:00
|
|
|
int testcolor = COLOR_WHITE;
|
|
|
|
return 0;
|
2020-09-17 14:26:24 +03:00
|
|
|
}]])],
|
|
|
|
AC_MSG_RESULT(no),
|
2020-09-17 14:17:52 +03:00
|
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
2009-03-01 03:50:19 +03:00
|
|
|
#ifndef _XOPEN_SOURCE_EXTENDED
|
|
|
|
#define _XOPEN_SOURCE_EXTENDED 1
|
|
|
|
#endif
|
|
|
|
#include <curses.h>
|
|
|
|
int main(void)
|
|
|
|
{
|
2017-12-29 21:27:33 +03:00
|
|
|
int testcolor = COLOR_WHITE;
|
|
|
|
return 0;
|
2020-09-17 14:17:52 +03:00
|
|
|
}]])],
|
2020-09-16 11:44:48 +03:00
|
|
|
AC_DEFINE(NEED_XOPEN_SOURCE_EXTENDED, 1, [Define this if you need the _XOPEN_SOURCE_EXTENDED macro for color support.])
|
|
|
|
AC_MSG_RESULT(yes),
|
|
|
|
AC_MSG_RESULT(not sure)
|
2020-09-17 10:49:35 +03:00
|
|
|
AC_MSG_WARN([
|
|
|
|
*** Couldn't successfully compile basic color test with or without
|
|
|
|
*** _XOPEN_SOURCE_EXTENDED. This build may not compile. Consider
|
|
|
|
*** configuring with --disable-color or installing ncurses.])),
|
|
|
|
AC_MSG_WARN([
|
|
|
|
*** Can't check need for _XOPEN_SOURCE_EXTENDED when cross-compiling.]))
|
2016-03-22 13:42:28 +03:00
|
|
|
fi
|
2009-03-01 03:50:19 +03:00
|
|
|
|
2014-03-24 17:47:37 +04:00
|
|
|
AS_IF([test "x$enable_libmagic" != "xno"], [
|
2020-09-17 17:28:05 +03:00
|
|
|
AC_CHECK_HEADERS([magic.h])
|
|
|
|
AC_CHECK_LIB(magic, magic_open)
|
|
|
|
AC_CHECK_HEADERS([zlib.h])
|
|
|
|
AC_CHECK_LIB(z, inflate)
|
2014-03-24 17:47:37 +04:00
|
|
|
])
|
2010-03-07 22:35:46 +03:00
|
|
|
|
2014-04-03 00:37:30 +04:00
|
|
|
# Check for groff html support.
|
2009-02-15 22:16:18 +03:00
|
|
|
AC_MSG_CHECKING([for HTML support in groff])
|
|
|
|
groff -t -mandoc -Thtml </dev/null >/dev/null
|
2014-03-26 13:35:52 +04:00
|
|
|
if test $? -ne 0 ; then
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_MSG_RESULT([no])
|
2018-12-16 15:35:48 +03:00
|
|
|
AC_MSG_WARN([
|
2020-09-17 10:49:35 +03:00
|
|
|
*** Will not generate HTML version of man pages. Consider
|
|
|
|
*** installing a newer version of groff with HTML support.])
|
2017-12-29 21:27:33 +03:00
|
|
|
groff_html_support=no
|
2009-02-15 22:16:18 +03:00
|
|
|
else
|
2017-12-29 21:27:33 +03:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
groff_html_support=yes
|
2009-02-15 22:16:18 +03:00
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(GROFF_HTML, test x$groff_html_support = xyes)
|
|
|
|
|
2003-09-07 04:44:12 +04:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
|
|
|
doc/Makefile
|
2016-12-24 19:49:14 +03:00
|
|
|
doc/sample.nanorc
|
2017-02-22 01:04:35 +03:00
|
|
|
lib/Makefile
|
2003-09-07 04:44:12 +04:00
|
|
|
m4/Makefile
|
|
|
|
po/Makefile.in
|
|
|
|
src/Makefile
|
2016-12-24 19:25:06 +03:00
|
|
|
syntax/Makefile
|
2003-09-07 04:44:12 +04:00
|
|
|
])
|
|
|
|
|
2002-02-23 21:23:43 +03:00
|
|
|
AC_OUTPUT
|
2020-04-19 20:09:32 +03:00
|
|
|
|
|
|
|
make showinfo
|