* AC_ARG_PROGRAM, which uses the options --program-prefix,
--program-suffix, and --program-transform-name to change the names
of programs being installed.
-* AC_CHECK_TYPEDEF, which checks whether sys/types.h defines a given type.
+* AC_CHECK_TYPE, which checks whether sys/types.h defines a given type.
* AC_CHECK_LIB, which checks for a particular function in a library.
* AC_MSG_CHECKING and AC_MSG_RESULT to print test results, on a single line,
whether or not the test succeeds. They obsolete AC_CHECKING and AC_VERBOSE.
* AC_FUNC_MEMCMP, to check whether memcmp is 8-bit clean.
* AC_FUNC_STRFTIME, to find strftime even if it's in -lintl.
* AC_FUNC_GETMNTENT, to find getmntent even if it's in -lsun or -lseq.
+* AC_HEADER_SYS_WAIT, to check whether sys/wait.h is POSIX.1 compatible.
** Changed macros:
* Many macros renamed systematically, but old names are accepted for
------------------------------------------------------------------------------
-* Make autoconf diagnose giving too few or too many arguments to macros.
-Maybe even use a scheme that supports naming the formals.
-
-------------------------------------------------------------------------------
-
* Split up AC_SUBST substitutions using a loop to accomodate shells
with severely limited here document sizes, if it turns out to be a problem.
I'm not sure whether the limit is on lines or bytes; if bytes, it
/* Define if you have the strftime function. */
#undef HAVE_STRFTIME
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
/* Define if your struct tm has tm_zone. */
#undef HAVE_TM_ZONE
dnl ### Checking for typedefs
-dnl AC_CHECK_TYPEDEF(TYPE, DEFAULT)
-AC_DEFUN(AC_CHECK_TYPEDEF,
+dnl AC_CHECK_TYPE(TYPE, DEFAULT)
+AC_DEFUN(AC_CHECK_TYPE,
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_MSG_CHECKING(for $1)
AC_CACHE_VAL(ac_cv_type_$1,
stddef.h AC_HEADER_STDC
stdarg.h AC_HEADER_STDC
float.h AC_HEADER_STDC
+sys/wait.h AC_HEADER_SYS_WAIT
X11/Xlib.h AC_PATH_X
# Others.
fi
])
+AC_DEFUN(AC_HEADER_SYS_WAIT,
+[AC_MSG_CHECKING([for sys/wait.h that is POSIX.1 compatible])
+AC_CACHE_VAL(ac_cv_header_sys_wait_h,
+[AC_TRY_LINK([#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif], [int s;
+wait (&s);
+s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;],
+ac_cv_header_sys_wait_h=yes, ac_cv_header_sys_wait_h=no)])dnl
+AC_MSG_RESULT($ac_cv_header_sys_wait_h)
+if test $ac_cv_header_sys_wait_h = yes; then
+ AC_DEFINE(HAVE_SYS_WAIT_H)
+fi
+])
+
dnl ### Checks for typedefs
])
AC_DEFUN(AC_TYPE_SIZE_T,
-[AC_CHECK_TYPEDEF(size_t, unsigned)])
+[AC_CHECK_TYPE(size_t, unsigned)])
AC_DEFUN(AC_TYPE_PID_T,
-[AC_CHECK_TYPEDEF(pid_t, int)])
+[AC_CHECK_TYPE(pid_t, int)])
AC_DEFUN(AC_TYPE_OFF_T,
-[AC_CHECK_TYPEDEF(off_t, long)])
+[AC_CHECK_TYPE(off_t, long)])
AC_DEFUN(AC_TYPE_MODE_T,
-[AC_CHECK_TYPEDEF(mode_t, int)])
+[AC_CHECK_TYPE(mode_t, int)])
dnl Note that identifiers starting with SIG are reserved by ANSI C.
AC_DEFUN(AC_TYPE_SIGNAL,
@samp{AC_REPLACE_FUNCS(memchr)}.
@end defmac
+@defmac AC_HEADER_SYS_WAIT
+@maindex HEADER_SYS_WAIT
+@cvindex HAVE_SYS_WAIT_H
+If @file{sys/wait.h} exists and is compatible with POSIX.1, define
+@code{HAVE_SYS_WAIT_H}. Incompatibility can occur if @file{sys/wait.h}
+does not exist, or if it uses the old BSD @code{union wait} instead of
+@code{int} to store a status value. If @file{sys/wait.h} is not POSIX.1
+compatible, then instead of including it, define the POSIX.1 macros with
+their usual interpretations. Here is an example:
+
+@example
+@group
+#include <sys/types.h>
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+@end group
+@end example
+@end defmac
+
@defmac AC_MEMORY_H
@maindex MEMORY_H
@cvindex NEED_MEMORY_H
This macro is used to check for typedefs not covered by the particular
test macros.
-@defmac AC_CHECK_TYPEDEF (@var{type}, @var{default})
-@maindex CHECK_TYPEDEF
+@defmac AC_CHECK_TYPE (@var{type}, @var{default})
+@maindex CHECK_TYPE
If the type @var{type} is not defined in @file{sys/types.h} or
@file{stdlib.h} (if that is present), define it to be the C (or C++)
builtin type @var{default}; e.g., @samp{short} or @samp{unsigned}.
@samp{AC_REPLACE_FUNCS(memchr)}.
@end defmac
+@defmac AC_HEADER_SYS_WAIT
+@maindex HEADER_SYS_WAIT
+@cvindex HAVE_SYS_WAIT_H
+If @file{sys/wait.h} exists and is compatible with POSIX.1, define
+@code{HAVE_SYS_WAIT_H}. Incompatibility can occur if @file{sys/wait.h}
+does not exist, or if it uses the old BSD @code{union wait} instead of
+@code{int} to store a status value. If @file{sys/wait.h} is not POSIX.1
+compatible, then instead of including it, define the POSIX.1 macros with
+their usual interpretations. Here is an example:
+
+@example
+@group
+#include <sys/types.h>
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+@end group
+@end example
+@end defmac
+
@defmac AC_MEMORY_H
@maindex MEMORY_H
@cvindex NEED_MEMORY_H
This macro is used to check for typedefs not covered by the particular
test macros.
-@defmac AC_CHECK_TYPEDEF (@var{type}, @var{default})
-@maindex CHECK_TYPEDEF
+@defmac AC_CHECK_TYPE (@var{type}, @var{default})
+@maindex CHECK_TYPE
If the type @var{type} is not defined in @file{sys/types.h} or
@file{stdlib.h} (if that is present), define it to be the C (or C++)
builtin type @var{default}; e.g., @samp{short} or @samp{unsigned}.
dnl ### Checking for typedefs
-dnl AC_CHECK_TYPEDEF(TYPE, DEFAULT)
-AC_DEFUN(AC_CHECK_TYPEDEF,
+dnl AC_CHECK_TYPE(TYPE, DEFAULT)
+AC_DEFUN(AC_CHECK_TYPE,
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_MSG_CHECKING(for $1)
AC_CACHE_VAL(ac_cv_type_$1,
fi
])
+AC_DEFUN(AC_HEADER_SYS_WAIT,
+[AC_MSG_CHECKING([for sys/wait.h that is POSIX.1 compatible])
+AC_CACHE_VAL(ac_cv_header_sys_wait_h,
+[AC_TRY_LINK([#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif], [int s;
+wait (&s);
+s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;],
+ac_cv_header_sys_wait_h=yes, ac_cv_header_sys_wait_h=no)])dnl
+AC_MSG_RESULT($ac_cv_header_sys_wait_h)
+if test $ac_cv_header_sys_wait_h = yes; then
+ AC_DEFINE(HAVE_SYS_WAIT_H)
+fi
+])
+
dnl ### Checks for typedefs
])
AC_DEFUN(AC_TYPE_SIZE_T,
-[AC_CHECK_TYPEDEF(size_t, unsigned)])
+[AC_CHECK_TYPE(size_t, unsigned)])
AC_DEFUN(AC_TYPE_PID_T,
-[AC_CHECK_TYPEDEF(pid_t, int)])
+[AC_CHECK_TYPE(pid_t, int)])
AC_DEFUN(AC_TYPE_OFF_T,
-[AC_CHECK_TYPEDEF(off_t, long)])
+[AC_CHECK_TYPE(off_t, long)])
AC_DEFUN(AC_TYPE_MODE_T,
-[AC_CHECK_TYPEDEF(mode_t, int)])
+[AC_CHECK_TYPE(mode_t, int)])
dnl Note that identifiers starting with SIG are reserved by ANSI C.
AC_DEFUN(AC_TYPE_SIGNAL,
stddef.h AC_HEADER_STDC
stdarg.h AC_HEADER_STDC
float.h AC_HEADER_STDC
+sys/wait.h AC_HEADER_SYS_WAIT
X11/Xlib.h AC_PATH_X
# Others.