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)
+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(color,
[ --disable-color Disable color and syntax highlighting],
-[if test x$enableval != xno; then
+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
*** libraries that include the regex.h file or call the configure
*** script with --disable-color.])
fi
-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
*** script with --disable-color.])
fi
fi
-])
+)
AC_ARG_ENABLE(multibuffer,
[ --disable-multibuffer Disable multiple file buffers],
echo "--enable-all option no longer needed, ignoring for compatiblity"
fi])
-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])
- AC_TRY_RUN([
-#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;
-}],
- 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 word boundary support when cross-compiling])
-)
-fi
-
-
AC_MSG_CHECKING([whether to enable UTF-8 support])
AC_ARG_ENABLE(utf8,
[ --enable-utf8 Enable UTF-8 support],
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(getopt_long)
-
dnl Checks for libraries.
if eval "test x$CURSES_LIB_NAME = x"; then
fi
fi
+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])
+ AC_TRY_RUN([
+#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;
+}],
+ 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])
+)
+# 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
+
# Check for groff html support
AC_MSG_CHECKING([for HTML support in groff])
groff -t -mandoc -Thtml </dev/null >/dev/null