3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
6 --- less-381/./configure.ac~configure
7 +++ less-381/./configure.ac
9 # contact the author, see the README file.
11 # Autoconf initialization.
14 AC_CONFIG_SRCDIR([forwback.c])
15 AC_CONFIG_HEADER([defines.h])
20 LIBS="$LIBS $TERMLIBS"
21 - AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
22 - [termok=yes], [termok=no])
23 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);]])],[termok=yes],[termok=no])
25 if test $termok = no; then TERMLIBS=""; fi
30 LIBS="$LIBS $TERMLIBS"
31 - AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
32 - [termok=yes], [termok=no])
33 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);]])],[termok=yes],[termok=no])
35 if test $termok = no; then TERMLIBS=""; fi
40 LIBS="$LIBS $TERMLIBS"
41 - AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
42 - [termok=yes], [termok=no])
43 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);]])],[termok=yes],[termok=no])
45 if test $termok = no; then TERMLIBS=""; fi
48 TERMLIBS="-lcurses -ltermcap"
50 LIBS="$LIBS $TERMLIBS"
51 - AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
52 - [termok=yes], [termok=no])
53 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);]])],[termok=yes],[termok=no])
55 if test $termok = no; then TERMLIBS=""; fi
60 LIBS="$LIBS $TERMLIBS"
61 - AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
62 - [termok=yes], [termok=no])
63 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);]])],[termok=yes],[termok=no])
65 if test $termok = no; then TERMLIBS=""; fi
68 TERMLIBS="-lcurses -ltermlib"
70 LIBS="$LIBS $TERMLIBS"
71 - AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);],
72 - [termok=yes], [termok=no])
73 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);]])],[termok=yes],[termok=no])
75 if test $termok = no; then TERMLIBS=""; fi
78 # Checks for identifiers.
80 AC_MSG_CHECKING(for void)
81 -AC_TRY_COMPILE(, [void *foo = 0;],
82 - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_VOID)], [AC_MSG_RESULT(no)])
83 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[void *foo = 0;]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_VOID)],[AC_MSG_RESULT(no)])
84 AC_MSG_CHECKING(for const)
85 -AC_TRY_COMPILE(, [const int foo = 0;],
86 - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_CONST)], [AC_MSG_RESULT(no)])
87 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[const int foo = 0;]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_CONST)],[AC_MSG_RESULT(no)])
88 AC_MSG_CHECKING(for time_t)
89 -AC_TRY_COMPILE([#include <time.h>], [time_t t = 0;],
90 - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIME_T)], [AC_MSG_RESULT(no)])
91 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[time_t t = 0;]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIME_T)],[AC_MSG_RESULT(no)])
93 # Checks for library functions.
96 AC_CHECK_FUNC(tcgetattr, AC_DEFINE(HAVE_TERMIOS_FUNCS))
98 AC_MSG_CHECKING(for fileno)
100 +AC_LINK_IFELSE([AC_LANG_PROGRAM([[
103 -#endif], [static int x; x = fileno(stdin);],
104 - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FILENO)], [AC_MSG_RESULT(no)])
105 +#endif]], [[static int x; x = fileno(stdin);]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FILENO)],[AC_MSG_RESULT(no)])
107 AC_MSG_CHECKING(for strerror)
109 +AC_LINK_IFELSE([AC_LANG_PROGRAM([[
113 @@ -233,68 +223,56 @@
117 -#endif], [static char *x; x = strerror(0);],
118 - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)], [AC_MSG_RESULT(no)])
119 +#endif]], [[static char *x; x = strerror(0);]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)],[AC_MSG_RESULT(no)])
121 AC_MSG_CHECKING(for sys_errlist)
122 -AC_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;],
123 - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)], [AC_MSG_RESULT(no)])
124 +AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[extern char *sys_errlist[]; static char **x; x = sys_errlist;]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)],[AC_MSG_RESULT(no)])
126 AC_MSG_CHECKING(for sigset_t)
128 +AC_LINK_IFELSE([AC_LANG_PROGRAM([[
130 -], [sigset_t s; s = 0;],
131 - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SIGSET_T)], [AC_MSG_RESULT(no)])
132 +]], [[sigset_t s; s = 0;]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SIGSET_T)],[AC_MSG_RESULT(no)])
134 AC_MSG_CHECKING(for sigemptyset)
136 +AC_LINK_IFELSE([AC_LANG_PROGRAM([[
138 -], [sigset_t s; sigemptyset(&s);],
139 - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SIGEMPTYSET)], [AC_MSG_RESULT(no)])
140 +]], [[sigset_t s; sigemptyset(&s);]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SIGEMPTYSET)],[AC_MSG_RESULT(no)])
143 AC_MSG_CHECKING(for errno)
145 +AC_LINK_IFELSE([AC_LANG_PROGRAM([[
148 -#endif], [static int x; x = errno;],
149 - [AC_MSG_RESULT(yes - in errno.h); AC_DEFINE(HAVE_ERRNO) have_errno=yes])
150 +#endif]], [[static int x; x = errno;]])],[AC_MSG_RESULT(yes - in errno.h); AC_DEFINE(HAVE_ERRNO) have_errno=yes],[])
151 if test $have_errno = no; then
153 +AC_LINK_IFELSE([AC_LANG_PROGRAM([[
156 -#endif], [extern int errno; static int x; x = errno;],
157 - [AC_MSG_RESULT(yes - must define); AC_DEFINE(HAVE_ERRNO) AC_DEFINE(MUST_DEFINE_ERRNO)],
158 - [AC_MSG_RESULT(no)])
159 +#endif]], [[extern int errno; static int x; x = errno;]])],[AC_MSG_RESULT(yes - must define); AC_DEFINE(HAVE_ERRNO) AC_DEFINE(MUST_DEFINE_ERRNO)],[AC_MSG_RESULT(no)])
162 AC_MSG_CHECKING(for locale)
163 -AC_TRY_LINK([#include <locale.h>
164 -#include <ctype.h>], [setlocale(LC_CTYPE,""); isprint(0); iscntrl(0);],
165 - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_LOCALE)], [AC_MSG_RESULT(no)])
166 +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <locale.h>
167 +#include <ctype.h>]], [[setlocale(LC_CTYPE,""); isprint(0); iscntrl(0);]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_LOCALE)],[AC_MSG_RESULT(no)])
168 AC_MSG_CHECKING(for ctype functions)
170 +AC_LINK_IFELSE([AC_LANG_PROGRAM([[
173 -#endif], [static int x; x = isupper(x); x = tolower(x); x = toupper(x);],
174 - [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UPPER_LOWER)], [AC_MSG_RESULT(no)])
175 +#endif]], [[static int x; x = isupper(x); x = tolower(x); x = toupper(x);]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UPPER_LOWER)],[AC_MSG_RESULT(no)])
177 # Checks for external variable ospeed in the termcap library.
179 AC_MSG_CHECKING(termcap for ospeed)
181 +AC_LINK_IFELSE([AC_LANG_PROGRAM([[
182 #include <sys/types.h>
188 -#endif], [ospeed = 0;],
189 -[AC_MSG_RESULT(yes - in termcap.h); AC_DEFINE(HAVE_OSPEED) have_ospeed=yes])
190 +#endif]], [[ospeed = 0;]])],[AC_MSG_RESULT(yes - in termcap.h); AC_DEFINE(HAVE_OSPEED) have_ospeed=yes],[])
191 if test $have_ospeed = no; then
192 -AC_TRY_LINK(, [extern short ospeed; ospeed = 0;],
193 - [AC_MSG_RESULT(yes - must define); AC_DEFINE(HAVE_OSPEED) AC_DEFINE(MUST_DEFINE_OSPEED)],
194 - [AC_MSG_RESULT(no)])
195 +AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[extern short ospeed; ospeed = 0;]])],[AC_MSG_RESULT(yes - must define); AC_DEFINE(HAVE_OSPEED) AC_DEFINE(MUST_DEFINE_OSPEED)],[AC_MSG_RESULT(no)])
198 # Checks for regular expression functions.
200 if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then
201 # Some versions of Solaris have a regcomp() function, but it doesn't work!
202 # So we run a test program. If we're cross-compiling, do it the old way.
204 +AC_RUN_IFELSE([AC_LANG_SOURCE([[
205 #include <sys/types.h>
207 main() { regex_t r; regmatch_t rm; char *text = "xabcy";
208 @@ -322,19 +300,16 @@
210 if (rm.rm_sp != text + 1) exit(1); /* check for correct offset */
213 - have_posix_regex=yes, have_posix_regex=no, have_posix_regex=unknown)
214 +exit(0); }]])],[have_posix_regex=yes],[have_posix_regex=no],[have_posix_regex=unknown])
215 if test $have_posix_regex = yes; then
216 AC_MSG_RESULT(using POSIX regcomp)
217 AC_DEFINE(HAVE_POSIX_REGCOMP)
219 elif test $have_posix_regex = unknown; then
221 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
222 #include <sys/types.h>
223 -#include <regex.h>],
224 - [regex_t *r; regfree(r);],
225 - AC_MSG_RESULT(using POSIX regcomp)
226 - AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes)
227 +#include <regex.h>]], [[regex_t *r; regfree(r);]])],[AC_MSG_RESULT(using POSIX regcomp)
228 + AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes],[])
234 if test $have_regex = no; then
235 if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then
237 -#include "regexp.h"], [regcomp("");],
238 -AC_MSG_RESULT(using V8 regcomp); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes)
239 +AC_LINK_IFELSE([AC_LANG_PROGRAM([[
240 +#include "regexp.h"]], [[regcomp("");]])],[AC_MSG_RESULT(using V8 regcomp); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes],[])