diff options
author | wlemb <wlemb> | 2000-06-11 06:27:26 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2000-06-11 06:27:26 +0000 |
commit | 36ea47893878bfe5f7e047b07d8f3e916fa7b5c7 (patch) | |
tree | e57dd0627e5adf7b3004685929667bc37b38f58d /aclocal.m4 | |
parent | ff6307d03bc5dd13673dcf03cfe5d494c6a2c0d6 (diff) | |
download | groff-36ea47893878bfe5f7e047b07d8f3e916fa7b5c7.tar.gz |
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.
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 83 |
1 files changed, 38 insertions, 45 deletions
@@ -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 <stdlib.h> -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 <stdio.h> -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 <stdio.h> -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 <math.h> -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 <stdio.h> +#ifdef HAVE_STRING_H +#include <string.h> +#else +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef HAVE_MATH_H +#include <math.h> +#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 |