From: mdw Date: Sat, 17 Jul 1999 10:27:44 +0000 (+0000) Subject: More useful macros added. X-Git-Tag: 1.2.4~1 X-Git-Url: https://git.distorted.org.uk/~mdw/cfd/commitdiff_plain/aaa993397614d23a868fcbb5b8b50704538644a3 More useful macros added. --- diff --git a/aclocal.glob b/aclocal.glob index 5ae7364..760229c 100644 --- a/aclocal.glob +++ b/aclocal.glob @@ -1,6 +1,6 @@ dnl -*-fundamental-*- *@--GLOB-HEADER--@* dnl -dnl $Id: aclocal.glob,v 1.2 1999/05/13 22:57:23 mdw Exp $ +dnl $Id: aclocal.glob,v 1.3 1999/07/17 10:27:44 mdw Exp $ dnl dnl Common library of autoconf macros dnl @@ -28,6 +28,9 @@ dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. dnl----- Revision history --------------------------------------------------- dnl dnl $Log: aclocal.glob,v $ +dnl Revision 1.3 1999/07/17 10:27:44 mdw +dnl More useful macros added. +dnl dnl Revision 1.2 1999/05/13 22:57:23 mdw dnl Change `-ise' to `-ize' throughout. dnl @@ -37,7 +40,7 @@ dnl dnl----- Common files distribution --------------------------- *@--NOTICE--@* dnl -dnl $Id: aclocal.glob,v 1.2 1999/05/13 22:57:23 mdw Exp $ +dnl $Id: aclocal.glob,v 1.3 1999/07/17 10:27:44 mdw Exp $ dnl --- *@-AC_PROG_CC_STDC-@* --- dnl @@ -1045,6 +1048,88 @@ AC_DEFUN(AM_SYS_POSIX_TERMIOS, dnl----- Macros by Mark Wooding ------------------------------ *@--IGNORE--@* +dnl --- *@-mdw_DECL_ENVIRON-@* --- +dnl +dnl Author: Mark Wooding +dnl +dnl Synopsis: mdw_DECL_ENVIRON +dnl +dnl Arguments: --- +dnl +dnl Use: If the global variable `environ' is declared anywhere +dnl `obvious', then define the preprocessor symbol DECL_ENVIRON. + +AC_DEFUN(mdw_DECL_ENVIRON, +[AC_CHECK_HEADERS([unistd.h]) +AC_CACHE_CHECK([for declaration of \`environ'], sw_cv_environ, +[AC_EGREP_CPP(environ, +[#include +#if HAVE_UNISTD_H +#include +#endif +#if STDC_HEADERS +#include +#include +#endif], [sw_cv_environ=yes], [sw_cv_environ=no])]) +if test $sw_cv_environ = yes; then + AC_DEFINE(DECL_ENVIRON) +fi]) + +dnl --- *@-mdw_CURSES-@* --- +dnl +dnl Author: Mark Wooding +dnl +dnl Synopsis: mdw_CURSES +dnl +dnl Arguments: --- +dnl +dnl Use: Attempts to find an implementation of `curses'. A `curses' +dnl library (`ncurses' by preference) will be added to `LIBS'. +dnl If a library could be found, the preprocessor symbol +dnl HAVE_CURSES is defined, along with one of HAVE_NCURSES_H, +dnl HAVE_NCURSES_NCURSES_H or HAVE_CURSES_H, suggesting which +dnl header to include (in the obvious way). + +AC_DEFUN(mdw_CURSES, +[mdw_CHECK_MANYLIBS(newwin, ncurses curses, AC_DEFINE(HAVE_CURSES)) +if test $mdw_cv_lib_newwin != no; then +AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h curses.h], [break]) +if test "$ac_cv_header_ncurses_h" = "no" && + test "$ac_cv_header_ncurses_ncurses_h" = "no" && + test "$ac_cv_header_curses_h" = "no"; then + AC_MSG_WARN([couldn't find a \`curses' header. Assuming \`curses.h'.]) + AC_DEFINE(HAVE_CURSES_H) +fi +AC_CHECK_FUNCS(wresize) +fi]) + +dnl --- *@-mdw_TYPE_SSIZE_T-@* --- +dnl +dnl Author: Mark Wooding +dnl +dnl Synopsis: mdw_TYPE_SSIZE_T +dnl +dnl Arguments: --- +dnl +dnl Use: Finds an appropriate type for `ssize_t' if there isn't a +dnl sensible one to use already. + +AC_DEFUN(mdw_TYPE_SSIZE_T, +[AC_CACHE_CHECK(for ssize_t, sw_cv_ssize_t, +[AC_EGREP_CPP(ssize_t, +[#include +#if HAVE_UNISTD_H +#include +#endif +#if STDC_HEADERS +#include +#include +#endif], +[sw_cv_ssize_t=yes], [sw_cv_ssize_t=no])]) +if test $sw_cv_ssize_t = no; then + AC_DEFINE(ssize_t, int) +fi]) + dnl --- *@-mdw_REQUIRE-@* --- dnl dnl Author: Mark Wooding