summaryrefslogtreecommitdiffstats
path: root/contrib/groff/aclocal.m4
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/groff/aclocal.m4')
-rw-r--r--contrib/groff/aclocal.m4102
1 files changed, 36 insertions, 66 deletions
diff --git a/contrib/groff/aclocal.m4 b/contrib/groff/aclocal.m4
index 34ee4f1..83a6839 100644
--- a/contrib/groff/aclocal.m4
+++ b/contrib/groff/aclocal.m4
@@ -94,38 +94,35 @@ dnl
dnl
AC_DEFUN(GROFF_POSIX,
[AC_MSG_CHECKING([whether -D_POSIX_SOURCE is necessary])
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
+AC_LANG_PUSH(C++)
AC_TRY_COMPILE([#include <stdio.h>
extern "C" { void fileno(int); }],,
AC_MSG_RESULT(yes);AC_DEFINE(_POSIX_SOURCE),
AC_MSG_RESULT(no))
-AC_LANG_RESTORE])dnl
+AC_LANG_POP(C++)])dnl
dnl
dnl
dnl srand() of SunOS 4.1.3 has return type int instead of void
dnl
AC_DEFUN(GROFF_SRAND,
-[AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
+[AC_LANG_PUSH(C++)
AC_MSG_CHECKING([for return type of srand])
AC_TRY_COMPILE([#include <stdlib.h>
extern "C" { void srand(unsigned int); }],,
AC_MSG_RESULT(void);AC_DEFINE(RET_TYPE_SRAND_IS_VOID),
AC_MSG_RESULT(int))
-AC_LANG_RESTORE])dnl
+AC_LANG_POP(C++)])dnl
dnl
dnl
AC_DEFUN(GROFF_SYS_NERR,
-[AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
+[AC_LANG_PUSH(C++)
AC_MSG_CHECKING([for sys_nerr in <errno.h> or <stdio.h>])
AC_TRY_COMPILE([#include <errno.h>
#include <stdio.h>],
[int k; k = sys_nerr;],
AC_MSG_RESULT(yes);AC_DEFINE(HAVE_SYS_NERR),
AC_MSG_RESULT(no))
-AC_LANG_RESTORE])dnl
+AC_LANG_POP(C++)])dnl
dnl
dnl
AC_DEFUN(GROFF_SYS_ERRLIST,
@@ -138,36 +135,33 @@ AC_MSG_RESULT(no))])dnl
dnl
dnl
AC_DEFUN(GROFF_OSFCN_H,
-[AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
+[AC_LANG_PUSH(C++)
AC_MSG_CHECKING([C++ <osfcn.h>])
AC_TRY_COMPILE([#include <osfcn.h>],
[read(0, 0, 0); open(0, 0);],
AC_MSG_RESULT(yes);AC_DEFINE(HAVE_CC_OSFCN_H),
AC_MSG_RESULT(no))
-AC_LANG_RESTORE])dnl
+AC_LANG_POP(C++)])dnl
dnl
dnl
AC_DEFUN(GROFF_LIMITS_H,
-[AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
+[AC_LANG_PUSH(C++)
AC_MSG_CHECKING([C++ <limits.h>])
AC_TRY_COMPILE([#include <limits.h>],
[int x = INT_MIN; int y = INT_MAX; int z = UCHAR_MAX;],
AC_MSG_RESULT(yes);AC_DEFINE(HAVE_CC_LIMITS_H),
AC_MSG_RESULT(no))
-AC_LANG_RESTORE])dnl
+AC_LANG_POP(C++)])dnl
dnl
dnl
AC_DEFUN(GROFF_TIME_T,
-[AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
+[AC_LANG_PUSH(C++)
AC_MSG_CHECKING([for declaration of time_t])
AC_TRY_COMPILE([#include <time.h>],
[time_t t = time(0); struct tm *p = localtime(&t);],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no);AC_DEFINE(LONG_FOR_TIME_T))
-AC_LANG_RESTORE])dnl
+AC_LANG_POP(C++)])dnl
dnl
dnl
AC_DEFUN(GROFF_STRUCT_EXCEPTION,
@@ -179,26 +173,24 @@ AC_MSG_RESULT(no))])dnl
dnl
dnl
AC_DEFUN(GROFF_ARRAY_DELETE,
-[AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
+[AC_LANG_PUSH(C++)
AC_MSG_CHECKING([whether ANSI array delete syntax supported])
AC_TRY_COMPILE(,
changequote(,)dnl
char *p = new char[5]; delete [] p;changequote([,]),
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no);AC_DEFINE(ARRAY_DELETE_NEEDS_SIZE))
-AC_LANG_RESTORE])dnl
+AC_LANG_POP(C++)])dnl
dnl
dnl
dnl
AC_DEFUN(GROFF_TRADITIONAL_CPP,
-[AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
+[AC_LANG_PUSH(C++)
AC_MSG_CHECKING([traditional preprocessor])
AC_TRY_COMPILE([#define name2(a,b) a/**/b],[int name2(foo,bar);],
AC_MSG_RESULT(yes);AC_DEFINE(TRADITIONAL_CPP),
AC_MSG_RESULT(no))
-AC_LANG_RESTORE])dnl
+AC_LANG_POP(C++)])dnl
dnl
dnl
AC_DEFUN(GROFF_WCOREFLAG,
@@ -246,8 +238,6 @@ if test -z "$PAGE"; then
if test -n "$descfile" \
&& grep "^paperlength 841890" $descfile >/dev/null 2>&1; then
PAGE=A4
- else
- PAGE=letter
fi
fi
if test -z "$PAGE"; then
@@ -255,7 +245,8 @@ if test -z "$PAGE"; then
/etc/resolv.conf 2>/dev/null`
if test -z "$dom"; then
dom=`(domainname) 2>/dev/null | tr -d '+'`
- if test -z "$dom"; then
+ if test -z "$dom" \
+ || test "$dom" = '(none)'; then
dom=`(hostname) 2>/dev/null | grep '\.'`
fi
fi
@@ -275,8 +266,7 @@ dnl
dnl
AC_DEFUN(GROFF_CXX_CHECK,
[AC_REQUIRE([AC_PROG_CXX])
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
+AC_LANG_PUSH(C++)
if test "$cross_compiling" = no; then
AC_MSG_CHECKING([that C++ compiler can compile simple program])
fi
@@ -308,7 +298,7 @@ AC_TRY_LINK([#include <stdio.h>],
[fopen(0, 0);],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no);AC_MSG_ERROR([header files do not support C++ (if you are using a version of gcc/g++ earlier than 2.5, you should install libg++)]))
-AC_LANG_RESTORE])dnl
+AC_LANG_POP(C++)])dnl
dnl
dnl
AC_DEFUN(GROFF_TMAC,
@@ -437,13 +427,11 @@ dnl Check for OS/390 Unix. We test for EBCDIC also -- the Linux port (with
dnl gcc) to OS/390 uses ASCII internally.
dnl
AC_DEFUN(GROFF_OS390,
-[groff_cv_os390="no"
-if test "$groff_cv_ebcdic" = "yes"; then
+[if test "$groff_cv_ebcdic" = "yes"; then
AC_MSG_CHECKING([for OS/390 Unix])
case `uname` in
OS/390)
CFLAGS="$CFLAGS -D_ALL_SOURCE"
- groff_cv_os390="yes"
AC_MSG_RESULT(yes) ;;
*)
AC_MSG_RESULT(no) ;;
@@ -451,52 +439,22 @@ if test "$groff_cv_ebcdic" = "yes"; then
fi])dnl
dnl
dnl
-dnl Finally, we must modify a base function of autoconf to replace the
-dnl ASCII char `012' with its generic equivalent `\n' if we run under
-dnl OS/390 Unix -- unfortunately, not all `tr' variants understand `\n',
-dnl so this hack is necessary.
-dnl
-define([AC_OUTPUT_MAKE_DEFS],
-[# Transform confdefs.h into DEFS.
-dnl Using a here document instead of a string reduces the quoting nightmare.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-changequote(<<, >>)dnl
-s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
-s%[ `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-changequote([, ])dnl
-EOF
-if test "$groff_cv_os390" = "yes"; then
- DEFS=`sed -f conftest.defs confdefs.h | tr '\n' ' '`
-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_LANG_PUSH(C++)
AC_CACHE_VAL(groff_cv_decl_needed_$1,
[AC_TRY_COMPILE([
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
-#else
+#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
-#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -513,4 +471,16 @@ 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
+AC_LANG_POP(C++)])dnl
+dnl
+dnl
+dnl Check for mkstemp() and its function prototype.
+dnl
+AC_DEFUN(GROFF_MKSTEMP,
+[AC_CHECK_FUNC(mkstemp,
+[AC_DEFINE(HAVE_MKSTEMP)
+AC_MSG_CHECKING([for mkstemp prototype in <stdlib.h>])
+AC_EGREP_CPP(mkstemp,
+[#include <stdlib.h>],
+AC_MSG_RESULT(yes);AC_DEFINE(HAVE_MKSTEMP_PROTO),
+AC_MSG_RESULT(no))])])
OpenPOWER on IntegriCloud