From 36ea47893878bfe5f7e047b07d8f3e916fa7b5c7 Mon Sep 17 00:00:00 2001 From: wlemb Date: Sun, 11 Jun 2000 06:27:26 +0000 Subject: Replaced specific checks for function declarations with a generic routine taken from GNU bfd. * aclocal.m4 (GROFF_NEED_DECLARATION): New function. GROFF_PUTENV, GROFF_POPEN, GROFF_PCLOSE, GROFF_HYPOT: Removed. * configure.in: Use it. * src/devices/grolbp/lbp.cc, src/include/lib.h, src/preproc/grn/hgraph.cc, src/preproc/pic/pic.h, src/roff/groff/groff.cc: Use it. * Makefile.in, configure: Updated. * src/devides/grolbp/lbp.h: Removed unused variables. --- aclocal.m4 | 83 ++++++++++++++++++++++++++++---------------------------------- 1 file changed, 38 insertions(+), 45 deletions(-) (limited to 'aclocal.m4') diff --git a/aclocal.m4 b/aclocal.m4 index 8bc06f50..1cd92ce2 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -103,39 +103,6 @@ AC_MSG_RESULT(no)) AC_LANG_RESTORE])dnl dnl dnl -AC_DEFUN(GROFF_PUTENV, -[AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_MSG_CHECKING([declaration of putenv]) -AC_TRY_COMPILE([#include -extern "C" { void putenv(int); }],, -AC_MSG_RESULT(no), -AC_MSG_RESULT(yes);AC_DEFINE(STDLIB_H_DECLARES_PUTENV)) -AC_LANG_RESTORE])dnl -dnl -dnl -AC_DEFUN(GROFF_POPEN, -[AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_MSG_CHECKING([declaration of popen]) -AC_TRY_COMPILE([#include -extern "C" { void popen(int); }],, -AC_MSG_RESULT(no), -AC_MSG_RESULT(yes);AC_DEFINE(STDIO_H_DECLARES_POPEN)) -AC_LANG_RESTORE])dnl -dnl -dnl -AC_DEFUN(GROFF_PCLOSE, -[AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_MSG_CHECKING([declaration of pclose]) -AC_TRY_COMPILE([#include -extern "C" { void pclose(int); }],, -AC_MSG_RESULT(no), -AC_MSG_RESULT(yes);AC_DEFINE(STDIO_H_DECLARES_PCLOSE)) -AC_LANG_RESTORE])dnl -dnl -dnl dnl srand() of SunOS 4.1.3 has return type int instead of void dnl AC_DEFUN(GROFF_SRAND, @@ -173,17 +140,6 @@ AC_MSG_RESULT(no)) AC_LANG_RESTORE])dnl dnl dnl -AC_DEFUN(GROFF_HYPOT, -[AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_MSG_CHECKING([declaration of hypot]) -AC_TRY_COMPILE([#include -extern "C" { double hypot(double,double); }],, -AC_MSG_RESULT(no), -AC_MSG_RESULT(yes);AC_DEFINE(MATH_H_DECLARES_HYPOT)) -AC_LANG_RESTORE])dnl -dnl -dnl AC_DEFUN(GROFF_OSFCN_H, [AC_LANG_SAVE AC_LANG_CPLUSPLUS @@ -516,4 +472,41 @@ else DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` fi rm -f conftest.defs -]) +])dnl +dnl +dnl +dnl Check whether we need a declaration for a function. +dnl +dnl Stolen from GNU bfd. +dnl +AC_DEFUN(GROFF_NEED_DECLARATION, +[AC_MSG_CHECKING([whether $1 must be declared]) +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_CACHE_VAL(groff_cv_decl_needed_$1, +[AC_TRY_COMPILE([ +#include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_MATH_H +#include +#endif], +[char *(*pfn) = (char *(*)) $1], +groff_cv_decl_needed_$1=no, +groff_cv_decl_needed_$1=yes)]) +AC_MSG_RESULT($groff_cv_decl_needed_$1) +if test $groff_cv_decl_needed_$1 = yes; then + AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z])) +fi +AC_LANG_RESTORE])dnl -- cgit v1.2.1