diff options
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | Makefile.in | 11 | ||||
-rw-r--r-- | aclocal.m4 | 83 | ||||
-rwxr-xr-x | configure | 425 | ||||
-rwxr-xr-x | configure.in | 12 | ||||
-rw-r--r-- | src/devices/grolbp/lbp.cc | 4 | ||||
-rw-r--r-- | src/devices/grolbp/lbp.h | 6 | ||||
-rw-r--r-- | src/include/lib.h | 8 | ||||
-rw-r--r-- | src/preproc/grn/hgraph.cc | 4 | ||||
-rw-r--r-- | src/preproc/pic/pic.h | 4 | ||||
-rw-r--r-- | src/roff/groff/groff.cc | 4 |
11 files changed, 380 insertions, 198 deletions
@@ -1,3 +1,20 @@ +2000-06-10 Gael Queri <gqueri@mail.dotcom.fr> + + 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. + +2000-06-07 Paco Andres Verdu <pandres@dragonet.es> + + * src/devides/grolbp/lbp.h: Removed unused variables. + 2000-05-31 Keith Thompson <kst@sdsc.edu> * src/devices/grolbp/lbp.cc (set_papersizes): Add declaration of diff --git a/Makefile.in b/Makefile.in index 43bbb3be..65a6729e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -170,14 +170,17 @@ man7dir=$(manroot)/man$(man7ext) # -DHAVE_STRDUP if you have strdup() # -DHAVE_STRSEP if you have strsep() # -DHAVE_STRCASECMP if you have strcasecmp() -# -DSTDLIB_H_DECLARES_PUTENV if your C++ <stdlib.h> declares putenv() -# -DSTDIO_H_DECLARES_POPEN if your C++ <stdio.h> declares popen() -# -DSTDIO_H_DECLARES_PCLOSE if your C++ <stdio.h> declares pclose() +# -DNEED_DECLARATION_HYPOT if your C++ <math.h> doesn't declare hypot() +# -DNEED_DECLARATION_PUTENV if your C++ <stdlib.h> doesn't declare putenv() +# -DNEED_DECLARATION_POPEN if your C++ <stdio.h> doesn't declare popen() +# -DNEED_DECLARATION_PCLOSE if your C++ <stdio.h> doesn't declare pclose() +# -DNEED_DECLARATION_STRNCASECMP +# if your C++ <string.h> doesn't declare +# strncasecmp() # -DRET_TYPE_SRAND_IS_VOID if your srand() returns void or int # -DHAVE_SYS_NERR if you have sysnerr in <errno.h> or <stdio.h> # -DHAVE_SYS_ERRLIST if you have sys_errlist in <errno.h> or # <stdio.h> -# -DMATH_H_DECLARES_HYPOT if you have hypot() in <math.h> # -DTRADITIONAL_CPP if your C++ compiler uses a traditional # (Reiser) preprocessor # -DLONG_FOR_TIME_T if localtime() takes a long * not a time_t * @@ -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 @@ -1473,21 +1473,22 @@ else fi echo "$ac_t""$CPP" 1>&6 -for ac_hdr in unistd.h dirent.h limits.h sys/dir.h stdlib.h strings.h +for ac_hdr in stdlib.h unistd.h dirent.h limits.h sys/dir.h \ + string.h strings.h math.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1481: checking for $ac_hdr" >&5 +echo "configure:1482: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1486 "configure" +#line 1487 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1514,7 +1515,7 @@ fi done echo $ac_n "checking for ISC 3.x or 4.x""... $ac_c" 1>&6 -echo "configure:1518: checking for ISC 3.x or 4.x" >&5 +echo "configure:1519: checking for ISC 3.x or 4.x" >&5 if grep '[34]\.' /usr/options/cb.name >/dev/null 2>&1 then echo "$ac_t""yes" 1>&6 @@ -1526,7 +1527,7 @@ else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking whether -D_POSIX_SOURCE is necessary""... $ac_c" 1>&6 -echo "configure:1530: checking whether -D_POSIX_SOURCE is necessary" >&5 +echo "configure:1531: checking whether -D_POSIX_SOURCE is necessary" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1536,7 +1537,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <<EOF -#line 1540 "configure" +#line 1541 "configure" #include "confdefs.h" #include <stdio.h> extern "C" { void fileno(int); } @@ -1544,7 +1545,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define _POSIX_SOURCE 1 @@ -1572,28 +1573,28 @@ ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking declaration of putenv""... $ac_c" 1>&6 -echo "configure:1577: checking declaration of putenv" >&5 +echo $ac_n "checking for return type of srand""... $ac_c" 1>&6 +echo "configure:1578: checking for return type of srand" >&5 cat > conftest.$ac_ext <<EOF -#line 1579 "configure" +#line 1580 "configure" #include "confdefs.h" #include <stdlib.h> -extern "C" { void putenv(int); } +extern "C" { void srand(unsigned int); } int main() { ; return 0; } EOF -if { (eval echo configure:1587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - echo "$ac_t""no" 1>&6 + echo "$ac_t""void" 1>&6;cat >> confdefs.h <<\EOF +#define RET_TYPE_SRAND_IS_VOID 1 +EOF + else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF -#define STDLIB_H_DECLARES_PUTENV 1 -EOF - + echo "$ac_t""int" 1>&6 fi rm -f conftest* ac_ext=c @@ -1603,6 +1604,8 @@ ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross +echo $ac_n "checking whether hypot must be declared""... $ac_c" 1>&6 +echo "configure:1609: checking whether hypot must be declared" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1611,30 +1614,53 @@ ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking declaration of popen""... $ac_c" 1>&6 -echo "configure:1616: checking declaration of popen" >&5 -cat > conftest.$ac_ext <<EOF -#line 1618 "configure" +if eval "test \"`echo '$''{'groff_cv_decl_needed_hypot'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1622 "configure" #include "confdefs.h" + #include <stdio.h> -extern "C" { void popen(int); } +#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 int main() { - +char *(*pfn) = (char *(*)) hypot ; return 0; } EOF -if { (eval echo configure:1626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - echo "$ac_t""no" 1>&6 + groff_cv_decl_needed_hypot=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF -#define STDIO_H_DECLARES_POPEN 1 + groff_cv_decl_needed_hypot=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$groff_cv_decl_needed_hypot" 1>&6 +if test $groff_cv_decl_needed_hypot = yes; then + cat >> confdefs.h <<\EOF +#define NEED_DECLARATION_HYPOT 1 EOF fi -rm -f conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' @@ -1642,6 +1668,8 @@ ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross +echo $ac_n "checking whether popen must be declared""... $ac_c" 1>&6 +echo "configure:1673: checking whether popen must be declared" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1650,30 +1678,53 @@ ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking declaration of pclose""... $ac_c" 1>&6 -echo "configure:1655: checking declaration of pclose" >&5 -cat > conftest.$ac_ext <<EOF -#line 1657 "configure" +if eval "test \"`echo '$''{'groff_cv_decl_needed_popen'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1686 "configure" #include "confdefs.h" + #include <stdio.h> -extern "C" { void pclose(int); } +#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 int main() { - +char *(*pfn) = (char *(*)) popen ; return 0; } EOF -if { (eval echo configure:1665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - echo "$ac_t""no" 1>&6 + groff_cv_decl_needed_popen=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF -#define STDIO_H_DECLARES_PCLOSE 1 + groff_cv_decl_needed_popen=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$groff_cv_decl_needed_popen" 1>&6 +if test $groff_cv_decl_needed_popen = yes; then + cat >> confdefs.h <<\EOF +#define NEED_DECLARATION_POPEN 1 EOF fi -rm -f conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' @@ -1681,6 +1732,8 @@ ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross +echo $ac_n "checking whether pclose must be declared""... $ac_c" 1>&6 +echo "configure:1737: checking whether pclose must be declared" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1689,30 +1742,53 @@ ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking for return type of srand""... $ac_c" 1>&6 -echo "configure:1694: checking for return type of srand" >&5 -cat > conftest.$ac_ext <<EOF -#line 1696 "configure" +if eval "test \"`echo '$''{'groff_cv_decl_needed_pclose'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1750 "configure" #include "confdefs.h" + +#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> -extern "C" { void srand(unsigned int); } +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef HAVE_MATH_H +#include <math.h> +#endif int main() { - +char *(*pfn) = (char *(*)) pclose ; return 0; } EOF -if { (eval echo configure:1704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - echo "$ac_t""void" 1>&6;cat >> confdefs.h <<\EOF -#define RET_TYPE_SRAND_IS_VOID 1 -EOF - + groff_cv_decl_needed_pclose=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""int" 1>&6 + groff_cv_decl_needed_pclose=yes fi rm -f conftest* +fi + +echo "$ac_t""$groff_cv_decl_needed_pclose" 1>&6 +if test $groff_cv_decl_needed_pclose = yes; then + cat >> confdefs.h <<\EOF +#define NEED_DECLARATION_PCLOSE 1 +EOF + +fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' @@ -1720,6 +1796,8 @@ ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross +echo $ac_n "checking whether putenv must be declared""... $ac_c" 1>&6 +echo "configure:1801: checking whether putenv must be declared" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1728,30 +1806,117 @@ ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking for sys_nerr in <errno.h> or <stdio.h>""... $ac_c" 1>&6 -echo "configure:1733: checking for sys_nerr in <errno.h> or <stdio.h>" >&5 -cat > conftest.$ac_ext <<EOF -#line 1735 "configure" +if eval "test \"`echo '$''{'groff_cv_decl_needed_putenv'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1814 "configure" #include "confdefs.h" -#include <errno.h> + #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 int main() { -int k; k = sys_nerr; +char *(*pfn) = (char *(*)) putenv ; return 0; } EOF -if { (eval echo configure:1743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF -#define HAVE_SYS_NERR 1 + groff_cv_decl_needed_putenv=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + groff_cv_decl_needed_putenv=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$groff_cv_decl_needed_putenv" 1>&6 +if test $groff_cv_decl_needed_putenv = yes; then + cat >> confdefs.h <<\EOF +#define NEED_DECLARATION_PUTENV 1 EOF +fi +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether strncasecmp must be declared""... $ac_c" 1>&6 +echo "configure:1865: checking whether strncasecmp must be declared" >&5 + +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + +if eval "test \"`echo '$''{'groff_cv_decl_needed_strncasecmp'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1878 "configure" +#include "confdefs.h" + +#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 +int main() { +char *(*pfn) = (char *(*)) strncasecmp +; return 0; } +EOF +if { (eval echo configure:1902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + groff_cv_decl_needed_strncasecmp=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""no" 1>&6 + groff_cv_decl_needed_strncasecmp=yes fi rm -f conftest* +fi + +echo "$ac_t""$groff_cv_decl_needed_strncasecmp" 1>&6 +if test $groff_cv_decl_needed_strncasecmp = yes; then + cat >> confdefs.h <<\EOF +#define NEED_DECLARATION_STRNCASECMP 1 +EOF + +fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' @@ -1767,21 +1932,21 @@ ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking for sys_errlist in <errno.h> or <stdio.h>""... $ac_c" 1>&6 -echo "configure:1772: checking for sys_errlist in <errno.h> or <stdio.h>" >&5 +echo $ac_n "checking for sys_nerr in <errno.h> or <stdio.h>""... $ac_c" 1>&6 +echo "configure:1937: checking for sys_nerr in <errno.h> or <stdio.h>" >&5 cat > conftest.$ac_ext <<EOF -#line 1774 "configure" +#line 1939 "configure" #include "confdefs.h" #include <errno.h> #include <stdio.h> int main() { -int k; k = (int)sys_errlist[0]; +int k; k = sys_nerr; ; return 0; } EOF -if { (eval echo configure:1782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF -#define HAVE_SYS_ERRLIST 1 +#define HAVE_SYS_NERR 1 EOF else @@ -1806,28 +1971,28 @@ ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross -echo $ac_n "checking declaration of hypot""... $ac_c" 1>&6 -echo "configure:1811: checking declaration of hypot" >&5 +echo $ac_n "checking for sys_errlist in <errno.h> or <stdio.h>""... $ac_c" 1>&6 +echo "configure:1976: checking for sys_errlist in <errno.h> or <stdio.h>" >&5 cat > conftest.$ac_ext <<EOF -#line 1813 "configure" +#line 1978 "configure" #include "confdefs.h" -#include <math.h> -extern "C" { double hypot(double,double); } +#include <errno.h> +#include <stdio.h> int main() { - +int k; k = (int)sys_errlist[0]; ; return 0; } EOF -if { (eval echo configure:1821: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - echo "$ac_t""no" 1>&6 + echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF +#define HAVE_SYS_ERRLIST 1 +EOF + else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF -#define MATH_H_DECLARES_HYPOT 1 -EOF - + echo "$ac_t""no" 1>&6 fi rm -f conftest* ac_ext=c @@ -1846,16 +2011,16 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking C++ <osfcn.h>""... $ac_c" 1>&6 -echo "configure:1850: checking C++ <osfcn.h>" >&5 +echo "configure:2015: checking C++ <osfcn.h>" >&5 cat > conftest.$ac_ext <<EOF -#line 1852 "configure" +#line 2017 "configure" #include "confdefs.h" #include <osfcn.h> int main() { read(0, 0, 0); open(0, 0); ; return 0; } EOF -if { (eval echo configure:1859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define HAVE_CC_OSFCN_H 1 @@ -1884,16 +2049,16 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking C++ <limits.h>""... $ac_c" 1>&6 -echo "configure:1888: checking C++ <limits.h>" >&5 +echo "configure:2053: checking C++ <limits.h>" >&5 cat > conftest.$ac_ext <<EOF -#line 1890 "configure" +#line 2055 "configure" #include "confdefs.h" #include <limits.h> int main() { int x = INT_MIN; int y = INT_MAX; int z = UCHAR_MAX; ; return 0; } EOF -if { (eval echo configure:1897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define HAVE_CC_LIMITS_H 1 @@ -1922,16 +2087,16 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking for declaration of time_t""... $ac_c" 1>&6 -echo "configure:1926: checking for declaration of time_t" >&5 +echo "configure:2091: checking for declaration of time_t" >&5 cat > conftest.$ac_ext <<EOF -#line 1928 "configure" +#line 2093 "configure" #include "confdefs.h" #include <time.h> int main() { time_t t = time(0); struct tm *p = localtime(&t); ; return 0; } EOF -if { (eval echo configure:1935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -1952,12 +2117,12 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1956: checking return type of signal handlers" >&5 +echo "configure:2121: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1961 "configure" +#line 2126 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -1974,7 +2139,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2143: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1993,16 +2158,16 @@ EOF echo $ac_n "checking struct exception""... $ac_c" 1>&6 -echo "configure:1997: checking struct exception" >&5 +echo "configure:2162: checking struct exception" >&5 cat > conftest.$ac_ext <<EOF -#line 1999 "configure" +#line 2164 "configure" #include "confdefs.h" #include <math.h> int main() { struct exception e; ; return 0; } EOF -if { (eval echo configure:2006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define HAVE_STRUCT_EXCEPTION 1 @@ -2016,7 +2181,7 @@ else fi rm -f conftest* echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:2020: checking for sin in -lm" >&5 +echo "configure:2185: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2024,7 +2189,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <<EOF -#line 2028 "configure" +#line 2193 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2035,7 +2200,7 @@ int main() { sin() ; return 0; } EOF -if { (eval echo configure:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2060,17 +2225,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2064: checking for $ac_hdr" >&5 +echo "configure:2229: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2069 "configure" +#line 2234 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2099,12 +2264,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2103: checking for $ac_func" >&5 +echo "configure:2268: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2108 "configure" +#line 2273 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2127,7 +2292,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2152,7 +2317,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2156: checking for working mmap" >&5 +echo "configure:2321: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2160,7 +2325,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 2164 "configure" +#line 2329 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -2300,7 +2465,7 @@ main() } EOF -if { (eval echo configure:2304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2327,12 +2492,12 @@ LIBS="$LIBS -lc $LIBM" for ac_func in fmod strtol getcwd strerror putenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2331: checking for $ac_func" >&5 +echo "configure:2496: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2336 "configure" +#line 2501 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2355,7 +2520,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2385,12 +2550,12 @@ LIBS="$saved_libs" for ac_func in rename mkstemp strcasecmp strncasecmp strsep strdup do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2389: checking for $ac_func" >&5 +echo "configure:2554: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2394 "configure" +#line 2559 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2413,7 +2578,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2438,12 +2603,12 @@ fi done echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:2442: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +echo "configure:2607: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2447 "configure" +#line 2612 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -2455,7 +2620,7 @@ int main() { char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:2459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -2484,16 +2649,16 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether ANSI array delete syntax supported""... $ac_c" 1>&6 -echo "configure:2488: checking whether ANSI array delete syntax supported" >&5 +echo "configure:2653: checking whether ANSI array delete syntax supported" >&5 cat > conftest.$ac_ext <<EOF -#line 2490 "configure" +#line 2655 "configure" #include "confdefs.h" int main() { char *p = new char[5]; delete [] p; ; return 0; } EOF -if { (eval echo configure:2497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2522,16 +2687,16 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking traditional preprocessor""... $ac_c" 1>&6 -echo "configure:2526: checking traditional preprocessor" >&5 +echo "configure:2691: checking traditional preprocessor" >&5 cat > conftest.$ac_ext <<EOF -#line 2528 "configure" +#line 2693 "configure" #include "confdefs.h" #define name2(a,b) a/**/b int main() { int name2(foo,bar); ; return 0; } EOF -if { (eval echo configure:2535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define TRADITIONAL_CPP 1 @@ -2552,12 +2717,12 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking w_coredump""... $ac_c" 1>&6 -echo "configure:2556: checking w_coredump" >&5 +echo "configure:2721: checking w_coredump" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""no" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2561 "configure" +#line 2726 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/wait.h> @@ -2572,7 +2737,7 @@ main() #endif } EOF -if { (eval echo configure:2576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define WCOREFLAG 0200 @@ -2588,12 +2753,12 @@ rm -fr conftest* fi echo $ac_n "checking default value for grops -b option""... $ac_c" 1>&6 -echo "configure:2592: checking default value for grops -b option" >&5 +echo "configure:2757: checking default value for grops -b option" >&5 test -n "${BROKEN_SPOOLER_FLAGS}" || BROKEN_SPOOLER_FLAGS=7 echo "$ac_t""$BROKEN_SPOOLER_FLAGS" 1>&6 echo $ac_n "checking default paper size""... $ac_c" 1>&6 -echo "configure:2597: checking default paper size" >&5 +echo "configure:2762: checking default paper size" >&5 if test -z "$PAGE"; then descfile= if test -r $prefix/share/groff/font/devps/DESC; then @@ -2628,7 +2793,7 @@ test -n "$PAGE" || PAGE=letter echo "$ac_t""$PAGE" 1>&6 echo $ac_n "checking for existing troff installation""... $ac_c" 1>&6 -echo "configure:2632: checking for existing troff installation" >&5 +echo "configure:2797: checking for existing troff installation" >&5 if test "x`(echo .tm '|n(.g' | tr '|' '\\\\' | troff -z -i 2>&1) 2>/dev/null`" = x0; then echo "$ac_t""yes" 1>&6 g=g @@ -2638,7 +2803,7 @@ else fi echo $ac_n "checking for prefix of system macro packages""... $ac_c" 1>&6 -echo "configure:2642: checking for prefix of system macro packages" >&5 +echo "configure:2807: checking for prefix of system macro packages" >&5 sys_tmac_prefix= sys_tmac_file_prefix= for d in /usr/share/lib/tmac /usr/lib/tmac; do @@ -2658,7 +2823,7 @@ echo "$ac_t""$sys_tmac_prefix" 1>&6 tmac_wrap= echo $ac_n "checking which system macro packages should be made available""... $ac_c" 1>&6 -echo "configure:2662: checking which system macro packages should be made available" >&5 +echo "configure:2827: checking which system macro packages should be made available" >&5 if test "x$sys_tmac_file_prefix" = "xtmac."; then for f in $sys_tmac_prefix*; do suff=`echo $f | sed -e "s;$sys_tmac_prefix;;"` diff --git a/configure.in b/configure.in index 6d12d542..081df0e6 100755 --- a/configure.in +++ b/configure.in @@ -18,16 +18,18 @@ AC_PROG_LN_S GROFF_CSH_HACK(SH_SCRIPT_SED_CMD='1s/.*/:/', SH_SCRIPT_SED_CMD='') AC_SUBST(SH_SCRIPT_SED_CMD) dnl checks for headers -AC_CHECK_HEADERS(unistd.h dirent.h limits.h sys/dir.h stdlib.h strings.h) +AC_CHECK_HEADERS(stdlib.h unistd.h dirent.h limits.h sys/dir.h \ + string.h strings.h math.h) GROFF_ISC_SYSV3 GROFF_POSIX -GROFF_PUTENV -GROFF_POPEN -GROFF_PCLOSE GROFF_SRAND +GROFF_NEED_DECLARATION(hypot) +GROFF_NEED_DECLARATION(popen) +GROFF_NEED_DECLARATION(pclose) +GROFF_NEED_DECLARATION(putenv) +GROFF_NEED_DECLARATION(strncasecmp) GROFF_SYS_NERR GROFF_SYS_ERRLIST -GROFF_HYPOT GROFF_OSFCN_H GROFF_LIMITS_H dnl checks for typedefs diff --git a/src/devices/grolbp/lbp.cc b/src/devices/grolbp/lbp.cc index db64a9b0..48564647 100644 --- a/src/devices/grolbp/lbp.cc +++ b/src/devices/grolbp/lbp.cc @@ -32,11 +32,13 @@ TODO #include "charset.h" #ifdef HAVE_STRNCASECMP +#ifdef NEED_DECLARATION_STRNCASECMP extern "C" { // SunOS's string.h fails to declare this. int strncasecmp(const char *, const char *, int); } -#endif +#endif /* NEED_DECLARATION_STRNCASECMP */ +#endif /* HAVE_STRNCASECMP */ static short int papersize = -1, // papersize orientation = -1 , // orientation diff --git a/src/devices/grolbp/lbp.h b/src/devices/grolbp/lbp.h index 332d0a43..04e6cecb 100644 --- a/src/devices/grolbp/lbp.h +++ b/src/devices/grolbp/lbp.h @@ -350,7 +350,7 @@ splinerel(double px,double py,int flush) { static int lx = 0 ,ly = 0; static float pend = 0.0; - static int dx = 0,dy = 0, despx = 0, despy = 0, sigpend = 0; + static int dy = 0, despx = 0, despy = 0, sigpend = 0; int dxnew ,dynew, sg; char xcoord[4],ycoord[4]; float npend ; @@ -389,7 +389,7 @@ splinerel(double px,double py,int flush) /*if ((despx != 0) || (despy != 0)) fprintf(stderr,"2 *%d,%d\n",despx,despy);*/ if (flush) { - dx = dxnew = dy = despx = despy = 0; + dxnew = dy = despx = despy = 0; return; }; /* if (flush) */ dxnew -= despx; @@ -400,7 +400,7 @@ splinerel(double px,double py,int flush) /* if ((dxnew != 0) || (dynew != 0)) fprintf(stderr,"3 * %d,%d\n",dxnew,dynew);*/ lx = (int)px; ly = (int)py; - dx = dxnew = dy = despx = despy = 0; + dxnew = dy = despx = despy = 0; }; /* splinerel */ diff --git a/src/include/lib.h b/src/include/lib.h index bfc57c35..2af894ac 100644 --- a/src/include/lib.h +++ b/src/include/lib.h @@ -36,17 +36,17 @@ int is_prime(unsigned); FILE *xtmpfile(char **namep=0, char *postfix=0, int do_unlink=1); char *xtmptemplate(char *extension=0); -#ifndef STDIO_H_DECLARES_POPEN +#ifdef NEED_DECLARATION_POPEN extern "C" { FILE *popen(const char *, const char *); } -#endif /* not STDIO_H_DECLARES_POPEN */ +#endif /* NEED_DECLARATION_POPEN */ -#ifndef STDIO_H_DECLARES_PCLOSE +#ifdef NEED_DECLARATION_PCLOSE extern "C" { int pclose (FILE *); } -#endif /* not STDIO_H_DECLARES_PCLOSE */ +#endif /* NEED_DECLARATION_PCLOSE */ int interpret_lf_args(const char *p); diff --git a/src/preproc/grn/hgraph.cc b/src/preproc/grn/hgraph.cc index ec0a7dcb..db3bfefa 100644 --- a/src/preproc/grn/hgraph.cc +++ b/src/preproc/grn/hgraph.cc @@ -6,11 +6,11 @@ #include "gprint.h" -#ifndef MATH_H_DECLARES_HYPOT +#ifdef NEED_DECLARATION_HYPOT extern "C" { double hypot(double, double); } -#endif +#endif /* NEED_DECLARATION_HYPOT */ #define MAXVECT 40 #define MAXPOINTS 200 diff --git a/src/preproc/pic/pic.h b/src/preproc/pic/pic.h index 77e59c7e..72485a39 100644 --- a/src/preproc/pic/pic.h +++ b/src/preproc/pic/pic.h @@ -24,11 +24,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdlib.h> #include <errno.h> -#ifndef MATH_H_DECLARES_HYPOT +#ifdef NEED_DECLARATION_HYPOT extern "C" { double hypot(double, double); } -#endif +#endif /* NEED_DECLARATION_HYPOT */ #include "assert.h" #include "cset.h" diff --git a/src/roff/groff/groff.cc b/src/roff/groff/groff.cc index d301e207..6b7625e2 100644 --- a/src/roff/groff/groff.cc +++ b/src/roff/groff/groff.cc @@ -44,11 +44,11 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // specified #define XREG ".X" -#ifndef STDLIB_H_DECLARES_PUTENV +#ifdef NEED_DECLARATION_PUTENV extern "C" { int putenv(const char *); } -#endif /* not STDLIB_H_DECLARES_PUTENV */ +#endif /* NEED_DECLARATION_PUTENV */ const int SOELIM_INDEX = 0; const int REFER_INDEX = SOELIM_INDEX + 1; |