From a149549d07fe41b999db1bbadca490402b2c3768 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Sun, 20 Jan 2013 17:57:04 +0000 Subject: [PATCH] * configure.ac: Added --with-wordbounds option to let cross compilers force whether their target system support GNU-style word boundaries or not. Originally reported by dave festing. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4566 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ configure.ac | 29 +++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e3308ad..27962ce5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 2013-01-20 Chris Allegretta * src/text.c (do_histify): Don't allow sigwinch to be received while justifying as that puts us into a wacky state. Fixess crash on justify by Joshua Rogers. + * configure.ac: Added --with-wordbounds option to let cross compilers force + whether their target system support GNU-style word boundaries or not. + Originally reported by dave festing. 2013-01-19 Chris Allegretta * configure.ac: Make ncursesw checking dependent on the presence of ncursesw.h, diff --git a/configure.ac b/configure.ac index c1eb123c..c1489f9c 100644 --- a/configure.ac +++ b/configure.ac @@ -528,7 +528,22 @@ 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([ + + 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([ #ifdef HAVE_SYS_TYPES_H #include #endif @@ -545,11 +560,13 @@ int main(void) 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 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([ -- 2.39.5