version 1.1.1.1, 2003/04/13 18:21:21 |
version 1.1.1.2, 2011/09/16 17:47:04 |
|
|
# Process this file with autoconf to produce a configure script. |
# Process this file with autoconf to produce a configure script. |
|
|
# Copyright (C) 1984-2002 Mark Nudelman |
# Copyright (C) 1984-2011 Mark Nudelman |
# |
# |
# You may distribute under the terms of either the GNU General Public |
# You may distribute under the terms of either the GNU General Public |
# License or the Less License, as specified in the README file. |
# License or the Less License, as specified in the README file. |
|
|
AC_SYS_LARGEFILE |
AC_SYS_LARGEFILE |
|
|
# Checks for general libraries. |
# Checks for general libraries. |
|
AC_CHECK_LIB(tinfo, tgoto, [have_tinfo=yes], [have_tinfo=no]) |
AC_CHECK_LIB(xcurses, initscr, [have_xcurses=yes], [have_xcurses=no]) |
AC_CHECK_LIB(xcurses, initscr, [have_xcurses=yes], [have_xcurses=no]) |
|
AC_CHECK_LIB(ncursesw, initscr, [have_ncursesw=yes], [have_ncursesw=no]) |
AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no]) |
AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no]) |
AC_CHECK_LIB(curses, initscr, [have_curses=yes], [have_curses=no]) |
AC_CHECK_LIB(curses, initscr, [have_curses=yes], [have_curses=no]) |
AC_CHECK_LIB(termcap, tgetent, [have_termcap=yes], [have_termcap=no]) |
AC_CHECK_LIB(termcap, tgetent, [have_termcap=yes], [have_termcap=no]) |
|
|
fi |
fi |
|
|
if test $curses_broken = 0; then |
if test $curses_broken = 0; then |
|
|
|
# -- Try tinfo. |
|
if test "x$TERMLIBS" = x; then |
|
if test $have_tinfo = yes; then |
|
TERMLIBS="-ltinfo" |
|
SAVE_LIBS=$LIBS |
|
LIBS="$LIBS $TERMLIBS" |
|
AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);], |
|
[termok=yes], [termok=no]) |
|
LIBS=$SAVE_LIBS |
|
if test $termok = no; then TERMLIBS=""; fi |
|
fi |
|
fi |
|
|
# -- Try xcurses. |
# -- Try xcurses. |
if test "x$TERMLIBS" = x; then |
if test "x$TERMLIBS" = x; then |
if test $have_xcurses = yes; then |
if test $have_xcurses = yes; then |
|
|
fi |
fi |
fi |
fi |
|
|
|
# -- Try ncursesw. |
|
if test "x$TERMLIBS" = x; then |
|
if test $have_ncursesw = yes; then |
|
TERMLIBS="-lncursesw" |
|
SAVE_LIBS=$LIBS |
|
LIBS="$LIBS $TERMLIBS" |
|
AC_TRY_LINK(, [tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);], |
|
[termok=yes], [termok=no]) |
|
LIBS=$SAVE_LIBS |
|
if test $termok = no; then TERMLIBS=""; fi |
|
fi |
|
fi |
|
|
# -- Try ncurses. |
# -- Try ncurses. |
if test "x$TERMLIBS" = x; then |
if test "x$TERMLIBS" = x; then |
if test $have_ncurses = yes; then |
if test $have_ncurses = yes; then |
|
|
|
|
# Checks for header files. |
# Checks for header files. |
AC_HEADER_STDC |
AC_HEADER_STDC |
AC_CHECK_HEADERS([ctype.h errno.h fcntl.h limits.h stdio.h stdlib.h string.h termcap.h termio.h termios.h time.h unistd.h values.h sys/ioctl.h sys/stream.h sys/ptem.h]) |
AC_CHECK_HEADERS([ctype.h errno.h fcntl.h limits.h stdio.h stdlib.h string.h termcap.h termio.h termios.h time.h unistd.h values.h sys/ioctl.h sys/stream.h wctype.h]) |
|
|
# Checks for typedefs, structures, and compiler characteristics. |
# Checks for typedefs, structures, and compiler characteristics. |
AC_HEADER_STAT |
AC_HEADER_STAT |
|
|
[]) |
[]) |
AH_TEMPLATE([HAVE_VOID], |
AH_TEMPLATE([HAVE_VOID], |
[Define HAVE_VOID if your compiler supports the "void" type.]) |
[Define HAVE_VOID if your compiler supports the "void" type.]) |
|
AH_TEMPLATE([HAVE_FLOAT], |
|
[Define HAVE_FLOAT if your compiler supports the "double" type.]) |
AH_TEMPLATE([HAVE_CONST], |
AH_TEMPLATE([HAVE_CONST], |
[Define HAVE_CONST if your compiler supports the "const" modifier.]) |
[Define HAVE_CONST if your compiler supports the "const" modifier.]) |
|
AH_TEMPLATE([HAVE_STAT_INO], |
|
[Define HAVE_STAT_INO if your struct stat has st_ino and st_dev.]) |
AH_TEMPLATE([HAVE_TIME_T], |
AH_TEMPLATE([HAVE_TIME_T], |
[Define HAVE_TIME_T if your system supports the "time_t" type.]) |
[Define HAVE_TIME_T if your system supports the "time_t" type.]) |
AH_TEMPLATE([HAVE_STRERROR], |
AH_TEMPLATE([HAVE_STRERROR], |
|
|
[Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr.]) |
[Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr.]) |
AH_TEMPLATE([HAVE_UPPER_LOWER], |
AH_TEMPLATE([HAVE_UPPER_LOWER], |
[Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower.]) |
[Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower.]) |
|
AH_TEMPLATE([HAVE_WCTYPE], |
|
[Define HAVE_WCTYPE if you have iswupper, iswlower, towupper, towlower.]) |
AH_TEMPLATE([HAVE_SIGSET_T], |
AH_TEMPLATE([HAVE_SIGSET_T], |
[Define HAVE_SIGSET_T you have the sigset_t type.]) |
[Define HAVE_SIGSET_T you have the sigset_t type.]) |
AH_TEMPLATE([HAVE_SIGEMPTYSET], |
AH_TEMPLATE([HAVE_SIGEMPTYSET], |
[Define HAVE_SIGEMPTYSET if you have the sigemptyset macro.]) |
[Define HAVE_SIGEMPTYSET if you have the sigemptyset macro.]) |
AH_TEMPLATE([EDIT_PGM], |
AH_TEMPLATE([EDIT_PGM], |
[Define EDIT_PGM to your editor.]) |
[Define EDIT_PGM to your editor.]) |
|
AH_TEMPLATE([SECURE_COMPILE], |
|
[Define SECURE_COMPILE=1 to build a secure version of less.]) |
|
|
# Checks for identifiers. |
# Checks for identifiers. |
AC_TYPE_OFF_T |
AC_TYPE_OFF_T |
|
|
AC_MSG_CHECKING(for time_t) |
AC_MSG_CHECKING(for time_t) |
AC_TRY_COMPILE([#include <time.h>], [time_t t = 0;], |
AC_TRY_COMPILE([#include <time.h>], [time_t t = 0;], |
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIME_T)], [AC_MSG_RESULT(no)]) |
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIME_T)], [AC_MSG_RESULT(no)]) |
|
AC_MSG_CHECKING(for st_ino in struct stat) |
|
AC_TRY_COMPILE([#include <sys/types.h> |
|
#include <sys/stat.h>], |
|
[struct stat s; dev_t dev = s.st_dev; ino_t ino = s.st_ino;], |
|
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STAT_INO)], [AC_MSG_RESULT(no)]) |
|
|
# Checks for library functions. |
# Checks for library functions. |
AC_TYPE_SIGNAL |
AC_TYPE_SIGNAL |
AC_CHECK_FUNCS([fsync memcpy popen _setjmp sigprocmask sigsetmask stat strchr strstr system]) |
AC_CHECK_FUNCS([fsync popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod]) |
|
|
|
# AC_CHECK_FUNCS may not work for inline functions, so test these separately. |
|
AC_MSG_CHECKING(for memcpy) |
|
AC_TRY_LINK([ |
|
#if HAVE_STRING_H |
|
#include <string.h> |
|
#endif], [memcpy(0,0,0);], |
|
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MEMCPY)], [AC_MSG_RESULT(no)]) |
|
|
|
AC_MSG_CHECKING(for strchr) |
|
AC_TRY_LINK([ |
|
#if HAVE_STRING_H |
|
#include <string.h> |
|
#endif], [strchr("x",'x');], |
|
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRCHR)], [AC_MSG_RESULT(no)]) |
|
|
|
AC_MSG_CHECKING(for strstr) |
|
AC_TRY_LINK([ |
|
#if HAVE_STRING_H |
|
#include <string.h> |
|
#endif], [strstr("x","x");], |
|
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRSTR)], [AC_MSG_RESULT(no)]) |
|
|
# Some systems have termios.h but not the corresponding functions. |
# Some systems have termios.h but not the corresponding functions. |
AC_CHECK_FUNC(tcgetattr, AC_DEFINE(HAVE_TERMIOS_FUNCS)) |
AC_CHECK_FUNC(tcgetattr, AC_DEFINE(HAVE_TERMIOS_FUNCS)) |
|
|
|
|
AC_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;], |
AC_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;], |
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)], [AC_MSG_RESULT(no)]) |
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)], [AC_MSG_RESULT(no)]) |
|
|
AC_MSG_CHECKING(for sigset_t) |
AC_CHECK_TYPES([sigset_t],,,[#include <signal.h>]) |
AC_TRY_LINK([ |
|
#include <signal.h> |
|
], [sigset_t s; s = 0;], |
|
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SIGSET_T)], [AC_MSG_RESULT(no)]) |
|
|
|
AC_MSG_CHECKING(for sigemptyset) |
AC_MSG_CHECKING(for sigemptyset) |
AC_TRY_LINK([ |
AC_TRY_LINK([ |
|
|
|
|
AC_MSG_CHECKING(for locale) |
AC_MSG_CHECKING(for locale) |
AC_TRY_LINK([#include <locale.h> |
AC_TRY_LINK([#include <locale.h> |
#include <ctype.h>], [setlocale(LC_CTYPE,""); isprint(0); iscntrl(0);], |
#include <ctype.h> |
|
#include <langinfo.h>], [setlocale(LC_CTYPE,""); isprint(0); iscntrl(0);], |
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_LOCALE)], [AC_MSG_RESULT(no)]) |
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_LOCALE)], [AC_MSG_RESULT(no)]) |
|
|
AC_MSG_CHECKING(for ctype functions) |
AC_MSG_CHECKING(for ctype functions) |
AC_TRY_LINK([ |
AC_TRY_LINK([ |
#if HAVE_CTYPE_H |
#if HAVE_CTYPE_H |
|
|
#endif], [static int x; x = isupper(x); x = tolower(x); x = toupper(x);], |
#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)]) |
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UPPER_LOWER)], [AC_MSG_RESULT(no)]) |
|
|
|
AC_MSG_CHECKING(for wctype functions) |
|
AC_TRY_LINK([#include <wctype.h>], [iswlower(0); iswupper(0); towlower(0); towupper(0);], |
|
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_WCTYPE)], [AC_MSG_RESULT(no)]) |
|
|
# Checks for external variable ospeed in the termcap library. |
# Checks for external variable ospeed in the termcap library. |
have_ospeed=no |
have_ospeed=no |
AC_MSG_CHECKING(termcap for ospeed) |
AC_MSG_CHECKING(termcap for ospeed) |
|
|
[AC_MSG_RESULT(no)]) |
[AC_MSG_RESULT(no)]) |
fi |
fi |
|
|
|
# Compile in secure mode? |
|
AC_ARG_WITH(secure, |
|
[ --with-secure Compile in secure mode], |
|
AC_DEFINE(SECURE_COMPILE, 1), AC_DEFINE(SECURE_COMPILE, 0)) |
|
|
|
# Should we use floating point? |
|
AC_MSG_CHECKING(for floating point) |
|
AC_ARG_WITH(no-float, |
|
[ --with-no-float Do not use floating point], |
|
WANT_NO_FLOAT=1, WANT_NO_FLOAT=0) |
|
if test $WANT_NO_FLOAT = 0; then |
|
AC_TRY_LINK(, [double f1 = 12.5; double f2 = f1*f1/2.5;], |
|
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT)], [AC_MSG_RESULT(no)]) |
|
else |
|
AC_MSG_RESULT(disabled by user) |
|
fi |
|
|
# Checks for regular expression functions. |
# Checks for regular expression functions. |
have_regex=no |
have_regex=no |
have_posix_regex=unknown |
have_posix_regex=unknown |
AC_MSG_CHECKING(for regcomp) |
AC_MSG_CHECKING(for regcomp) |
|
|
|
# Select a regular expression library. |
WANT_REGEX=auto |
WANT_REGEX=auto |
AC_ARG_WITH(regex, |
AC_ARG_WITH(regex, |
[ --with-regex={auto,pcre,posix,regcmp,re_comp,regcomp,regcomp-local} Select a regular expression library [auto]], |
[ --with-regex={auto,pcre,posix,regcmp,re_comp,regcomp,regcomp-local} Select a regular expression library [auto]], |
|
|
/* |
/* |
* SECURE is 1 if you wish to disable a bunch of features in order to |
* SECURE is 1 if you wish to disable a bunch of features in order to |
* be safe to run by unprivileged users. |
* be safe to run by unprivileged users. |
|
* SECURE_COMPILE is set by the --with-secure configure option. |
*/ |
*/ |
#define SECURE 0 |
#define SECURE SECURE_COMPILE |
|
|
/* |
/* |
* SHELL_ESCAPE is 1 if you wish to allow shell escapes. |
* SHELL_ESCAPE is 1 if you wish to allow shell escapes. |
|
|
* LESSKEYFILE_SYS is the filename of the system-wide lesskey output file. |
* LESSKEYFILE_SYS is the filename of the system-wide lesskey output file. |
* DEF_LESSKEYINFILE is the filename of the default lesskey input |
* DEF_LESSKEYINFILE is the filename of the default lesskey input |
* (in the HOME directory). |
* (in the HOME directory). |
|
* LESSHISTFILE is the filename of the history file |
|
* (in the HOME directory). |
*/ |
*/ |
#define LESSKEYFILE ".less" |
#define LESSKEYFILE ".less" |
#define LESSKEYFILE_SYS SYSDIR "/sysless" |
#define LESSKEYFILE_SYS SYSDIR "/sysless" |
#define DEF_LESSKEYINFILE ".lesskey" |
#define DEF_LESSKEYINFILE ".lesskey" |
|
#define LESSHISTFILE ".lesshst" |
|
|
|
|
/* Settings always true on Unix. */ |
/* Settings always true on Unix. */ |
|
|
#define PATHNAME_SEP "/" |
#define PATHNAME_SEP "/" |
|
|
/* |
/* |
|
* The value returned from tgetent on success. |
|
* Some HP-UX systems return 0 on success. |
|
*/ |
|
#define TGETENT_OK 1 |
|
|
|
/* |
* HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>. |
* HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>. |
*/ |
*/ |
#define HAVE_SYS_TYPES_H 1 |
#define HAVE_SYS_TYPES_H 1 |
|
|
/* |
/* |
* Default shell metacharacters and meta-escape character. |
* Default shell metacharacters and meta-escape character. |
*/ |
*/ |
#define DEF_METACHARS "; *?\t\n'\"()<>|&^`#\\" |
#define DEF_METACHARS "; *?\t\n'\"()<>[]|&^`#\\$%=~" |
#define DEF_METAESCAPE "\\" |
#define DEF_METAESCAPE "\\" |
|
|
/* |
/* |
* HAVE_DUP is 1 if your system has the dup() call. |
* HAVE_DUP is 1 if your system has the dup() call. |
*/ |
*/ |
#define HAVE_DUP 1 |
#define HAVE_DUP 1 |
|
|
|
/* Define to 1 if you have the memcpy() function. */ |
|
#define HAVE_MEMCPY 1 |
|
|
|
/* Define to 1 if you have the strchr() function. */ |
|
#define HAVE_STRCHR 1 |
|
|
|
/* Define to 1 if you have the strstr() function. */ |
|
#define HAVE_STRSTR 1 |
|
|
/* |
/* |
* Sizes of various buffers. |
* Sizes of various buffers. |