2003-01-15 20:40:35 +03:00
# Configuration for GNU nano - a small and user-friendly text editor
#
2007-08-01 01:20:08 +04:00
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
# Free Software Foundation, Inc.
2003-01-15 20:40:35 +03:00
#
2005-05-15 23:57:17 +04: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
2007-08-11 09:17:36 +04:00
# Free Software Foundation; either version 3, or (at your option) any
2005-05-15 23:57:17 +04:00
# later version.
2003-01-15 20:40:35 +03:00
#
2005-05-15 23:57:17 +04: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
2003-09-22 20:26:40 +04:00
# along with GNU nano; if not, write to the Free Software
2005-05-15 23:57:17 +04:00
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
# USA.
2003-01-15 20:40:35 +03:00
#
2000-08-09 02:00:30 +04:00
# $Id$
2003-01-15 20:40:35 +03:00
2013-03-24 16:38:51 +04:00
AC_INIT([GNU nano], [2.3.2-svn], [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
2003-01-15 20:40:35 +03:00
AM_INIT_AUTOMAKE
2004-11-18 03:05:14 +03:00
AC_CONFIG_HEADERS([config.h])
2003-01-15 20:40:35 +03:00
2004-05-13 21:19:54 +04:00
AC_PREREQ(2.54)
2000-06-06 09:53:49 +04:00
dnl Checks for programs.
2005-06-21 08:16:12 +04:00
2004-05-13 21:19:54 +04:00
AC_GNU_SOURCE
2000-06-06 09:53:49 +04:00
AC_PROG_CC
2004-08-01 20:09:15 +04:00
AC_PROG_LN_S
2000-06-06 09:53:49 +04:00
AC_ISC_POSIX
2002-02-23 21:23:43 +03:00
AC_SYS_LARGEFILE
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
2003-01-15 20:40:35 +03:00
AM_GNU_GETTEXT_VERSION(0.11.5)
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.])
2000-06-06 09:53:49 +04:00
dnl Checks for header files.
2005-06-21 08:16:12 +04:00
2011-02-13 07:23:10 +03:00
AC_CHECK_HEADERS(getopt.h libintl.h limits.h regex.h sys/param.h wchar.h wctype.h stdarg.h magic.h)
2000-06-06 09:53:49 +04:00
2005-03-26 02:19:04 +03:00
dnl Checks for options.
2007-04-19 07:23:16 +04:00
AC_ARG_ENABLE(debug,
2002-07-19 05:08:59 +04:00
[ --enable-debug Enable debugging (disabled by default)],
2005-03-26 01:25:24 +03:00
[if test x$enableval = xyes; then
2006-11-25 21:26:07 +03:00
AC_DEFINE(DEBUG, 1, [Define this to enable debug messages and assert warnings.]) debug_support=yes
2005-03-26 01:25:24 +03:00
fi])
2002-07-19 05:08:59 +04:00
2005-03-26 01:25:24 +03:00
if test x$debug_support != xyes; then
2006-11-25 21:26:07 +03:00
AC_DEFINE(NDEBUG, 1, [Shut up assert warnings :-)])
2002-07-19 05:08:59 +04:00
fi
2000-06-06 09:53:49 +04:00
AC_ARG_ENABLE(tiny,
2002-12-22 19:30:00 +03:00
[ --enable-tiny Disable features for the sake of size],
2000-06-06 09:53:49 +04:00
[if test x$enableval = xyes; then
2005-11-15 06:17:35 +03:00
AC_DEFINE(NANO_TINY, 1, [Define this to make the nano executable as small as possible.]) tiny_support=yes
2005-11-22 23:24:22 +03:00
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
2006-04-15 00:15:44 +04:00
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.])
2006-11-25 21:26:07 +03:00
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
2007-12-20 20:06:01 +03:00
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.])
2006-11-25 21:26:07 +03:00
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).])
2005-11-22 23:24:22 +03:00
AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell checker functions.])
2006-11-25 21:26:07 +03:00
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.])
2005-03-26 01:25:24 +03:00
fi])
2000-06-06 09:53:49 +04:00
2008-09-30 20:47:57 +04:00
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])
2002-09-07 00:35:28 +04:00
AC_ARG_ENABLE(browser,
2006-11-25 21:26:07 +03:00
[ --disable-browser Disable built-in file browser],
2005-03-26 01:25:24 +03:00
[if test x$enableval != xyes; then
2005-06-03 05:43:56 +04:00
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
2005-03-26 01:25:24 +03:00
fi])
2000-11-24 23:45:14 +03:00
2002-09-07 00:35:28 +04:00
AC_ARG_ENABLE(help,
2006-11-25 21:26:07 +03:00
[ --disable-help Disable help functions],
2005-03-26 01:25:24 +03:00
[if test x$enableval != xyes; then
2006-04-15 00:15:44 +04:00
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help text display.])
2005-03-26 01:25:24 +03:00
fi])
2001-07-11 06:08:33 +04:00
2002-09-07 00:35:28 +04:00
AC_ARG_ENABLE(justify,
2006-11-25 21:26:07 +03:00
[ --disable-justify Disable justify/unjustify functions],
2005-03-26 01:25:24 +03:00
[if test x$enableval != xyes; then
2007-04-19 07:23:16 +04:00
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
2005-03-26 01:25:24 +03:00
fi])
2001-04-13 06:32:06 +04:00
2002-09-07 00:35:28 +04:00
AC_ARG_ENABLE(mouse,
[ --disable-mouse Disable mouse support (and -m flag)],
2005-03-26 01:25:24 +03:00
[if test x$enableval != xyes; then
2006-11-25 21:26:07 +03:00
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.])
2005-03-26 01:25:24 +03:00
fi])
2000-11-24 17:00:16 +03:00
2002-09-07 00:35:28 +04:00
AC_ARG_ENABLE(operatingdir,
[ --disable-operatingdir Disable setting of operating directory (chroot of sorts)],
2005-03-26 01:25:24 +03:00
[if test x$enableval != xyes; then
2006-11-25 21:26:07 +03:00
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).])
2005-03-26 01:25:24 +03:00
fi])
2000-12-01 21:46:01 +03:00
2000-12-06 04:08:10 +03:00
AC_ARG_ENABLE(speller,
2005-11-22 23:24:22 +03:00
[ --disable-speller Disable spell checker functions],
2005-03-26 01:25:24 +03:00
[if test x$enableval != xyes; then
2005-11-22 23:24:22 +03:00
AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell checker functions.])
2005-03-26 01:25:24 +03:00
fi])
2000-12-01 21:46:01 +03:00
2002-09-07 00:35:28 +04:00
AC_ARG_ENABLE(tabcomp,
2006-11-25 21:26:07 +03:00
[ --disable-tabcomp Disable tab completion functions],
2005-03-26 01:25:24 +03:00
[if test x$enableval != xyes; then
2007-04-19 07:23:16 +04:00
AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion functions for files and search strings.])
2005-03-26 01:25:24 +03:00
fi])
2001-01-03 10:11:47 +03:00
2001-04-02 09:36:08 +04:00
AC_ARG_ENABLE(wrapping,
2001-05-02 21:18:17 +04:00
[ --disable-wrapping Disable all wrapping of text (and -w flag)],
2005-03-26 01:25:24 +03:00
[if test x$enableval != xyes; then
2006-11-25 21:26:07 +03:00
AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.])
2005-03-26 01:25:24 +03:00
fi])
2001-04-02 09:36:08 +04:00
2002-10-25 20:08:53 +04:00
AC_ARG_ENABLE(wrapping-as-root,
[ --disable-wrapping-as-root Disable wrapping of text as root by default],
2005-03-26 01:25:24 +03:00
[if test x$enableval != xyes; then
2006-11-25 21:26:07 +03:00
AC_DEFINE(DISABLE_ROOTWRAPPING, 1, [Define this to disable text wrapping as root by default.])
2005-03-26 01:25:24 +03:00
fi])
2002-10-25 20:08:53 +04:00
2002-09-07 00:35:28 +04:00
AC_ARG_ENABLE(color,
2008-09-30 19:30:51 +04:00
[ --disable-color Disable color and syntax highlighting],
2009-03-01 03:50:19 +03:00
if test x$enableval != xno; then
2006-07-12 22:59:29 +04:00
if test x$ac_cv_header_regex_h = xyes; then
2006-11-25 21:26:07 +03:00
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes
2006-07-12 22:59:29 +04:00
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
2008-09-30 19:30:51 +04:00
*** libraries that include the regex.h file or call the configure
*** script with --disable-color.])
2006-07-12 22:59:29 +04:00
fi
2009-03-01 03:50:19 +03:00
fi,
2008-09-30 20:47:57 +04:00
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([
2008-09-30 19:30:51 +04:00
*** 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.])
2008-09-30 20:47:57 +04:00
fi
2008-09-30 19:30:51 +04:00
fi
2009-03-01 03:50:19 +03:00
)
2002-09-07 00:35:28 +04:00
AC_ARG_ENABLE(multibuffer,
2008-09-30 19:30:51 +04:00
[ --disable-multibuffer Disable multiple file buffers],
[if test x$enableval != xno; then
2002-09-07 00:35:28 +04:00
AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes
2008-09-30 19:30:51 +04:00
fi],
2008-09-30 20:47:57 +04:00
[if test x$enable_tiny != xyes; then
AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes
fi])
2001-04-12 18:51:48 +04:00
2002-09-07 00:35:28 +04:00
AC_ARG_ENABLE(nanorc,
2008-09-30 19:30:51 +04:00
[ --disable-nanorc Disable use of .nanorc files],
[if test x$enableval != xno; then
2006-11-25 21:26:07 +03:00
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes
2008-09-30 19:30:51 +04:00
fi],
2008-09-30 20:47:57 +04:00
[if test x$enable_tiny != xyes; then
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) nanorc_support=yes
fi])
2001-09-19 07:19:43 +04:00
2003-01-17 03:17:45 +03:00
AC_ARG_ENABLE(all,
2008-09-30 19:30:51 +04:00
[ --enable-all Enable ALL extra nano functionality (ignored for compatibility as all options default to on)],
2003-01-17 03:17:45 +03:00
[if test x$enableval = xyes; then
2009-11-29 09:24:10 +03:00
echo "--enable-all option no longer needed, ignoring for compatibility"
2003-01-17 03:17:45 +03:00
fi])
2005-03-26 01:25:24 +03:00
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)
2007-12-18 18:55:48 +03:00
AC_MSG_CHECKING([whether to use slang])
CURSES_LIB_NAME=""
AC_ARG_WITH(slang,
[ --with-slang[=DIR] Use the slang library instead of curses],
[ case "$with_slang" in
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
if test x$with_slang != xyes; then
# Add additional search path
LDFLAGS="-L$with_slang/lib $LDFLAGS"
CPPFLAGS="-I$with_slang/include $CPPFLAGS"
fi
if test x$enable_utf8 != xno; then
AC_CHECK_HEADER(slcurses.h,
AC_MSG_CHECKING([for SLutf8_enable in -lslang])
_libs=$LIBS
LIBS="$LIBS -lslang"
AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
SLutf8_enable(1);
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
CURSES_LIB_WIDE=yes
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang"
else
CURSES_LIB="-lslang"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)
# 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
done
AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap])
LIBS="$LIBS $tcap"
AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
SLutf8_enable(1);
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
CURSES_LIB_WIDE=yes
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
else
CURSES_LIB="-lslang $tcap"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)
# We might need the math library
AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap -lm])
LIBS="$LIBS -lm"
AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
SLutf8_enable(1);
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
CURSES_LIB_WIDE=yes
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
else
CURSES_LIB="-lslang $tcap -lm"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)],
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
AC_MSG_WARN([*** Can not use slang when cross-compiling])),
AC_MSG_ERROR([
*** The header file slcurses.h was not found. If you wish to use
*** slang support this header file is required. Please either
*** install a version of slang that includes the slcurses.h file or
*** do not call the configure script with --with-slang.]))
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
LIBS=$_libs
fi
AC_CHECK_HEADER(slcurses.h,
AC_MSG_CHECKING([for SLtt_initialize in -lslang])
_libs=$LIBS
LIBS="$LIBS -lslang"
AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
SLtt_initialize(NULL);
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
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang"
else
CURSES_LIB="-lslang"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)
# 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
done
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap])
LIBS="$LIBS $tcap"
AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
SLtt_initialize(NULL);
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
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
else
CURSES_LIB="-lslang $tcap"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)
# We might need the math library
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm])
LIBS="$LIBS -lm"
AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
SLtt_initialize(NULL);
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
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
else
CURSES_LIB="-lslang $tcap -lm"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)],
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
AC_MSG_WARN([*** Can not use slang when cross-compiling])),
AC_MSG_ERROR([
*** The header file slcurses.h was not found. If you wish to use
*** slang support this header file is required. Please either
*** install a version of slang that includes the slcurses.h file or
*** do not call the configure script with --with-slang.]))
fi
if test "${_libs+set}" = "set"; then
LIBS=$_libs
fi
if test x$with_slang != xyes; then
LDFLAGS=${_ldflags}
fi
;;
esac], [AC_MSG_RESULT(no)])
2007-12-18 19:13:37 +03:00
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.])
2007-12-20 20:06:01 +03:00
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse support.])
2007-12-18 19:13:37 +03:00
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
2007-12-18 18:55:48 +03:00
2006-07-18 22:16:30 +04:00
AM_CONDITIONAL(USE_COLOR, test x$color_support = xyes)
2007-01-06 21:06:02 +03:00
AM_CONDITIONAL(USE_NANORC, test x$nanorc_support = xyes)
2006-06-01 21:23:28 +04:00
2008-08-28 10:13:05 +04:00
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])
2005-03-26 02:19:04 +03:00
dnl Checks for functions.
2005-07-04 08:22:30 +04:00
AC_CHECK_FUNCS(getdelim getline isblank strcasecmp strcasestr strncasecmp strnlen vsnprintf)
2005-03-26 01:25:24 +03:00
2005-03-26 02:19:04 +03:00
if test x$enable_utf8 != xno; then
2007-05-25 18:39:40 +04:00
AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace nl_langinfo mblen mbstowcs mbtowc wctomb wcwidth)
2005-03-26 01:25:24 +03:00
fi
2005-07-04 08:22:30 +04:00
if test x$ac_cv_func_vsnprintf = xno; then
2005-03-26 02:19:04 +03:00
AM_PATH_GLIB_2_0(2.0.0,,
AC_MSG_ERROR([
2005-07-04 08:22:30 +04:00
*** 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/.]),
2005-03-26 02:19:04 +03:00
glib)
2000-06-06 09:53:49 +04:00
fi
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(getopt_long)
dnl Checks for libraries.
2005-03-26 02:19:04 +03:00
if eval "test x$CURSES_LIB_NAME = x"; then
2004-12-12 22:04:56 +03:00
AC_CHECK_HEADERS(ncurses.h)
2005-03-26 01:25:24 +03:00
2005-03-26 02:19:04 +03:00
if test x$enable_utf8 != xno; then
2013-01-21 07:36:18 +04:00
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"
2005-03-26 01:25:24 +03:00
fi
2005-03-26 02:19:04 +03:00
if eval "test x$CURSES_LIB_NAME = x"; then
2005-03-26 01:25:24 +03:00
AC_CHECK_LIB(ncurses, initscr, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses])
2004-12-12 22:04:56 +03:00
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
2004-12-12 22:04:56 +03:00
AC_CHECK_HEADERS(curses.h)
2005-03-26 01:25:24 +03:00
2005-03-26 02:19:04 +03:00
if test x$enable_utf8 != xno; then
2005-06-18 21:06:02 +04:00
AC_CHECK_LIB(curses, get_wch, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses CURSES_LIB_WIDE=yes])
2005-03-26 01:25:24 +03:00
fi
2005-03-26 02:19:04 +03:00
if eval "test x$CURSES_LIB_NAME = x"; then
2004-12-12 22:04:56 +03:00
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
2000-06-06 09:53:49 +04:00
AC_MSG_WARN([
2004-12-12 22:04:56 +03:00
*** No curses lib available. Consider getting the official ncurses
2000-06-06 09:53:49 +04:00
*** distribution from ftp://ftp.gnu.org/pub/gnu/ncurses if you get
*** errors compiling nano.])
else
2004-12-12 22:04:56 +03:00
AC_MSG_RESULT([Using $CURSES_LIB_NAME as the curses library])
2000-06-06 09:53:49 +04:00
fi
2005-07-27 07:11:41 +04:00
AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, [Define this if your curses library has the use_default_colors() command.]))
2001-01-06 21:12:43 +03:00
2004-09-19 02:02:21 +04:00
dnl Parse any configure options.
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)
2005-06-21 19:41:46 +04:00
if test "x$GLIB_CFLAGS" != "x"; then
2005-03-26 02:19:04 +03:00
CFLAGS="$CFLAGS $GLIB_CFLAGS"
2000-06-06 09:53:49 +04:00
fi
2005-06-21 19:41:46 +04:00
if test "x$GLIB_LIBS" != "x"; then
2005-03-26 02:19:04 +03:00
LDFLAGS="$LDFLAGS $GLIB_LIBS"
2000-06-06 09:53:49 +04:00
fi
2005-03-26 01:25:24 +03:00
if test x$enable_utf8 != xno && \
2005-06-21 19:47:39 +04:00
test x$CURSES_LIB_WIDE = xyes && \
test x$ac_cv_func_iswalnum = xyes && \
test x$ac_cv_func_iswpunct = xyes && \
(test x$ac_cv_func_iswblank = xyes || test x$ac_cv_func_iswspace = xyes) && \
2007-05-25 18:39:40 +04:00
test x$ac_cv_func_nl_langinfo = xyes && \
2005-06-21 19:47:39 +04:00
test x$ac_cv_func_mblen = xyes && \
test x$ac_cv_func_mbstowcs = xyes && \
test x$ac_cv_func_mbtowc = xyes && \
test x$ac_cv_func_wctomb = xyes && \
test x$ac_cv_func_wcwidth = xyes; then
2007-05-25 18:39:40 +04:00
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()).])
2004-12-12 22:04:56 +03:00
else
2005-03-26 02:19:04 +03:00
if test x$enable_utf8 = xyes; then
2005-03-26 01:25:24 +03:00
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
2007-12-18 18:55:48 +03:00
*** 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.])
2005-03-26 02:19:04 +03:00
elif test x$enable_utf8 != xno; then
2005-03-26 01:25:24 +03:00
AC_MSG_WARN([
*** Insufficient UTF-8 support was detected in your curses and/or C
2007-12-18 18:55:48 +03:00
*** libraries. If you want UTF-8 support, 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.])
2005-03-26 01:25:24 +03:00
fi
2004-12-12 22:04:56 +03:00
fi
2009-03-01 03:50:19 +03:00
if test x$color_support = xyes; then
# now check for the end of word boundary support (/< and />)
AC_MSG_CHECKING([for GNU-style word boundary regex support])
2013-01-20 21:57:04 +04:00
AC_ARG_WITH(wordbounds,
[ --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 cant test the target
AC_DEFINE(GNU_WORDBOUNDS, 1, [Define if the system supports GNU-style word boundaries in regexes.]) gnu_wordbounds=yes,
;;
esac
], [
AC_TRY_RUN([
2009-03-01 03:50:19 +03:00
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <regex.h>
int main(void)
{
regex_t r;
size_t nmatch;
regmatch_t pmatch;
if (regcomp(&r, "\\\\>", REG_EXTENDED|REG_NOSUB))
return 1;
if (regexec(&r, "word boundary", nmatch, &pmatch, 0))
return 1;
return 0;
}],
2013-01-20 21:57:04 +04:00
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])
)
])
2009-03-01 03:50:19 +03:00
# if test x$CURSES_LIB_NAME = xcurses; then
AC_MSG_CHECKING([whether _XOPEN_SOURCE_EXTENDED is needed])
AC_TRY_RUN([
#include <curses.h>
int main(void)
{
int testcolor = COLOR_WHITE;
return 0;
}], AC_MSG_RESULT(no),
AC_TRY_RUN([
#ifndef _XOPEN_SOURCE_EXTENDED
#define _XOPEN_SOURCE_EXTENDED 1
#endif
#include <curses.h>
int main(void)
{
int testcolor = COLOR_WHITE;
return 0;
}],
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)
AC_MSG_WARN([*** Couldn't successfully compile basic color test with or without _XOPEN_SOURCE_EXTENDED])
AC_MSG_WARN([*** 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]))
fi
#fi
2010-03-07 22:35:46 +03:00
AC_MSG_CHECKING([whether LINES and COLS can be redefined])
AC_TRY_RUN([
#include <curses.h>
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_MSG_RESULT(yes),
AC_MSG_RESULT(no),
AC_MSG_WARN([*** Can't check for macro redefinability when cross-compiling]))
2011-02-13 07:23:10 +03:00
AC_CHECK_LIB(magic, magic_open)
2010-03-07 22:35:46 +03:00
2009-02-15 22:16:18 +03:00
# Check for groff html support
AC_MSG_CHECKING([for HTML support in groff])
groff -t -mandoc -Thtml </dev/null >/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 ***"
groff_html_support=no
else
echo "yes"
groff_html_support=yes
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
2006-06-01 21:23:28 +04:00
doc/nanorc.sample
2003-09-07 04:44:12 +04:00
doc/man/Makefile
doc/man/fr/Makefile
2006-06-01 21:23:28 +04:00
doc/syntax/Makefile
2003-09-07 04:44:12 +04:00
doc/texinfo/Makefile
m4/Makefile
po/Makefile.in
src/Makefile
nano.spec
])
2002-02-23 21:23:43 +03:00
AC_OUTPUT