]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
undo typedef rename; add macro from paul eggert
authorDavid MacKenzie <djm@djmnet.org>
Sat, 1 Oct 1994 23:13:28 +0000 (23:13 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Sat, 1 Oct 1994 23:13:28 +0000 (23:13 +0000)
NEWS
TODO
acconfig.h
acgeneral.m4
acheaders
acspecific.m4
autoconf.texi
doc/autoconf.texi
lib/autoconf/general.m4
lib/autoconf/specific.m4
lib/autoscan/headers

diff --git a/NEWS b/NEWS
index e1faabf0efcaf75fdfb8d94283ed4d90c4a70d79..98d76aff84ec2e371c839677dfc95f56de25d4dc 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -49,7 +49,7 @@ Major changes in release 2.0:
 * 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.
@@ -57,6 +57,7 @@ Major changes in release 2.0:
 * 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
diff --git a/TODO b/TODO
index 294a92241a3e3cc6eb3efd531f93889089d56edc..cdd173355911414e20c3589aca64cae1afd1092c 100644 (file)
--- a/TODO
+++ b/TODO
@@ -49,11 +49,6 @@ Things it might be nice to do someday:
 
 ------------------------------------------------------------------------------
 
-* 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
index a43655bb21b56aec24d88a2a955dc110dbc3f4fa..801a8ac8bcee5d8ff33056ad57874166b5e67630 100644 (file)
@@ -96,6 +96,9 @@
 /* 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
 
index 951e6070abef2502363d324b104b95fec2cc4500..17f471260cbdc0332d0629145a8cd316eb539937 100644 (file)
@@ -1449,8 +1449,8 @@ undefine([AC_CV_NAME])dnl
 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,
index 5b5568040632746eefd572564d363775c30d0c08..0363a38a178f46ca1a8fa4eb3a933be4a4c4bb95 100644 (file)
--- a/acheaders
+++ b/acheaders
@@ -10,6 +10,7 @@ stdlib.h      AC_HEADER_STDC
 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.
index 535536606f285c51227a9f2fee40ab5c62e64d2b..924e55cd30bd2dedb4dca51b38e1d8ed62dca9b3 100644 (file)
@@ -602,6 +602,26 @@ if test $ac_cv_decl_sys_siglist = yes; then
 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
 
@@ -661,16 +681,16 @@ fi
 ])
 
 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,
index 55f3d78a345aed6dd9a7e07bdf3e72c5accd184f..3826ed32ee75b031634b83962acc0cdb11985374 100644 (file)
@@ -2000,6 +2000,32 @@ for example, put it in @file{memchr.c} and use
 @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
@@ -2248,8 +2274,8 @@ If @code{uid_t} is not defined in @file{sys/types.h}, define
 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}.
index 55f3d78a345aed6dd9a7e07bdf3e72c5accd184f..3826ed32ee75b031634b83962acc0cdb11985374 100644 (file)
@@ -2000,6 +2000,32 @@ for example, put it in @file{memchr.c} and use
 @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
@@ -2248,8 +2274,8 @@ If @code{uid_t} is not defined in @file{sys/types.h}, define
 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}.
index 951e6070abef2502363d324b104b95fec2cc4500..17f471260cbdc0332d0629145a8cd316eb539937 100644 (file)
@@ -1449,8 +1449,8 @@ undefine([AC_CV_NAME])dnl
 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,
index 535536606f285c51227a9f2fee40ab5c62e64d2b..924e55cd30bd2dedb4dca51b38e1d8ed62dca9b3 100644 (file)
@@ -602,6 +602,26 @@ if test $ac_cv_decl_sys_siglist = yes; then
 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
 
@@ -661,16 +681,16 @@ fi
 ])
 
 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,
index 5b5568040632746eefd572564d363775c30d0c08..0363a38a178f46ca1a8fa4eb3a933be4a4c4bb95 100644 (file)
@@ -10,6 +10,7 @@ stdlib.h      AC_HEADER_STDC
 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.