dnl dnl vii - buffer and display output dnl Copyright (C) 1995, 1999, 2003, 2005 Peter Miller dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. dnl dnl MANIFEST: how to configure cook, input to the GNU autoconf program dnl AC_INIT(common/patchlevel.h) AC_CONFIG_HEADER(common/config.h) AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_YACC AC_PROG_RANLIB AC_AIX AC_MINIX AC_ISC_POSIX AC_C_CROSS AC_CHECK_LIB(curses, main, , AC_CHECK_LIB(ncurses, main)) AC_CHECK_LIB(termcap, main) dnl dnl Test to see where TIOCGWINSZ is defined. dnl AC_MSG_CHECKING([for TIOCGWINSZ]) AC_TRY_RUN([ #include int main(argc, argv)int argc; char **argv;{ #ifdef TIOCGWINSZ struct winsize ws; ws.ws_col = 0; exit(ws.ws_col); #else exit(1); #endif }] , AC_DEFINE(HAVE_winsize_SYS_IOCTL_H,1, [Define this symbol if your system as AND it defines TIOCGWINSZ and struct winsize.]) AC_MSG_RESULT([sys/ioctl.h]), AC_MSG_RESULT([not found]), AC_MSG_RESULT(cross)) dnl dnl Test to see where struct winsize is defined. dnl AC_MSG_CHECKING([for struct winsize]) AC_TRY_RUN([ #include int main(argc, argv)int argc; char **argv;{ #ifdef TIOCGWINSZ struct winsize ws; ws.ws_col = 0; exit(ws.ws_col); #else exit(1); #endif }] , AC_DEFINE(HAVE_winsize_TERMIOS_H,1, [Define this symbol if your system as AND it defines TIOCGWINSZ and struct winsize.]) AC_MSG_RESULT([termios.h]), AC_MSG_RESULT([not found]), AC_MSG_RESULT(cross)) dnl dnl Test to see if stdarg.h is available *and* works. dnl AC_MSG_CHECKING([for working stdarg.h]) AC_TRY_RUN([ #include char *foo = "test"; #if defined(__STDC__) && __STDC__ int test(char*,...); #endif int test(fmt)char*fmt;{va_list ap;char*a;int x; va_start(ap,fmt);a=va_arg(ap,char*);x=(a!=foo);va_end(ap);return x;} int main(argc,argv)int argc;char**argv;{ exit(test("",foo));}] , AC_DEFINE(HAVE_STDARG_H,1, [Define this symbol of your system has AND it works.]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no), AC_MSG_RESULT(cross)) AC_CHECK_HEADERS(stddef.h stdlib.h limits.h poll.h string.h memory.h unistd.h) AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_HEADER_TIME AC_C_CONST AC_SYS_LONG_FILE_NAMES AC_CHECK_FUNCS(_endwin getpgrp isendwin poll psignal sigsetmask strerror \ tcgetpgrp) dnl dnl Test to see if getpgrp() or getpgrp(0) should be used to dnl discover the process group of the current process. dnl AC_MSG_CHECKING([for appropriate getpgrp argument]) AC_TRY_RUN([ int main(argc, argv) int argc; char **argv; { #ifdef HAVE_GETPGRP if (getpgrp(32767) == getpgrp(0)) exit(2); #endif exit(0); }] , AC_DEFINE(CONF_getpgrp_arg, 0, [Set this to a suitable argument for the getpgrp function to discover the process group of the current process.]) AC_MSG_RESULT(zero), AC_DEFINE(CONF_getpgrp_arg, []) AC_MSG_RESULT(empty), AC_MSG_RESULT(cross)) dnl dnl Test to find a Bourne shell which understands functions dnl AC_MSG_CHECKING([for a Bourne shell which understands functions]) if test "z$SH" = "z"; then if test -f /bin/sh5; then SH=/bin/sh5 else SH=/bin/sh fi fi AC_SUBST(SH) AC_DEFINE_UNQUOTED(CONF_SHELL, ["$SH"], [Set this to be the absolute path of a Bourne shell which understands functions.]) AC_MSG_RESULT($SH) AC_OUTPUT(Makefile etc/Howto.conf) AH_TOP([/* * vii - buffer and display output * Copyright (C) 1995, 1999, 2003, 2005 Peter Miller * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * MANIFEST: template common/config.h file * * @configure_input@ */ #ifndef COMMON_CONFIG_H #define COMMON_CONFIG_H ]) AH_BOTTOM([ #include #endif /* COMMON_CONFIG_H */ ])