diff -ur motor-3.4.0.orig/configure.in motor-3.4.0/configure.in --- motor-3.4.0.orig/configure.in 2005-02-12 17:00:30.000000000 +0200 +++ motor-3.4.0/configure.in 2009-08-09 21:06:54.000000000 +0300 @@ -1,6 +1,9 @@ AC_INIT(aclocal.m4) AM_INIT_AUTOMAKE(motor, "3.4.0") +### AC_SYSTEM_EXTENSIONS +AC_GNU_SOURCE + AM_CONFIG_HEADER(config.h) AC_PROG_CC @@ -59,6 +62,8 @@ AC_MSG_RESULT($gnu_make) AC_DEFINE_UNQUOTED(GNUMAKE, "$gnu_make", [gnu make program name]) +AC_CHECK_FUNCS([strndup]) + AC_CHECK_LIB(ncurses, main,, [AC_CHECK_LIB(curses, main,, AC_MSG_ERROR(The ncurses terminal library is required in order to build the program))]) diff -ur motor-3.4.0.orig/parser/include/strfn.h motor-3.4.0/parser/include/strfn.h --- motor-3.4.0.orig/parser/include/strfn.h 2001-08-22 09:52:40.000000000 +0300 +++ motor-3.4.0/parser/include/strfn.h 2009-08-09 20:56:51.000000000 +0300 @@ -32,6 +32,9 @@ #ifndef _STRFN_H #define _STRFN_H + +#include "config.h" + /*****************************************************************************/ /* Functions for manipulate strings */ /*****************************************************************************/ @@ -48,7 +51,10 @@ * Return value: * char * - new string */ + +#ifndef HAVE_STRNDUP char *strndup(const char *src, int size); +#endif /* * strappend - Append source string to destination. diff -ur motor-3.4.0.orig/parser/src/strfn.c motor-3.4.0/parser/src/strfn.c --- motor-3.4.0.orig/parser/src/strfn.c 2001-08-22 09:52:39.000000000 +0300 +++ motor-3.4.0/parser/src/strfn.c 2009-08-09 20:57:40.000000000 +0300 @@ -20,6 +20,9 @@ * */ + +#include "config.h" + #include #include #include @@ -44,6 +47,7 @@ return z; } +#ifndef HAVE_STRNDUP /* string function */ char *strndup(const char *src, int size) { int s; @@ -56,6 +60,7 @@ return r; } +#endif char *strappend(char *dst, const char *src) { int dlen;