]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Revamp AC_FUNC_SELECT_ARGTYPES.
authorAkim Demaille <akim@epita.fr>
Wed, 15 Mar 2000 09:55:21 +0000 (09:55 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 15 Mar 2000 09:55:21 +0000 (09:55 +0000)
* acspecific.m4 (AC_FUNC_SELECT_ARGTYPES): Use a single cache
variable instead of three.
Use AC_CACHE_CHECK.
Shorten the name of the var loops, they are no longer cached.
Include sys/types.h unconditionally.
`select' returns an int, fixes Autoconf/46.
Don't display parens in the user messages.

ChangeLog
acspecific.m4
lib/autoconf/specific.m4

index 89997ced522084ef30e814ff01b8064abaa25f5a..b388fdc41a202676abddc21f7cc0092523711dc9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2000-03-15  Akim Demaille  <akim@epita.fr>
+
+       Revamp AC_FUNC_SELECT_ARGTYPES.
+
+       * acspecific.m4 (AC_FUNC_SELECT_ARGTYPES): Use a single cache
+       variable instead of three.
+       Use AC_CACHE_CHECK.
+       Shorten the name of the var loops, they are no longer cached.
+       Include sys/types.h unconditionally.
+       `select' returns an int, fixes Autoconf/46.
+       Don't display parens in the user messages.
+
 2000-03-14  Akim Demaille  <akim@epita.fr>
 
        * autoheader.sh: Use run_m4f, not run_m4.
index 602533a996f7883ce58cece75c515d64144a3321..61aab81726781667339cd6fb60f80d09c94e2040 100644 (file)
@@ -1904,18 +1904,17 @@ AC_SUBST(LIBOBJS)dnl
 
 # AC_FUNC_SELECT_ARGTYPES
 # -----------------------
+# Determine the correct type to be passed to each of the `select'
+# function's arguments, and define those types in `SELECT_TYPE_ARG1',
+# `SELECT_TYPE_ARG234', and `SELECT_TYPE_ARG5'.
 AC_DEFUN(AC_FUNC_SELECT_ARGTYPES,
-[AC_MSG_CHECKING([types of arguments for select()])
- AC_CACHE_VAL(ac_cv_func_select_arg234,dnl
- [AC_CACHE_VAL(ac_cv_func_select_arg1,dnl
-  [AC_CACHE_VAL(ac_cv_func_select_arg5,dnl
-   [for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
-     for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
-      for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
-       AC_TRY_COMPILE(
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_CACHE_CHECK([types of arguments for select],
+[ac_cv_func_select_args],
+[for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
+ for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
+  for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do
+   AC_TRY_COMPILE(
+[#include <sys/types.h>
 #if HAVE_SYS_TIME_H
 # include <sys/time.h>
 #endif
@@ -1925,26 +1924,25 @@ AC_DEFUN(AC_FUNC_SELECT_ARGTYPES,
 #if HAVE_SYS_SOCKET_H
 # include <sys/socket.h>
 #endif
-extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);],,dnl
-        [ac_not_found=no ; break 3],ac_not_found=yes)
-      done
-     done
-    done
-   ])dnl AC_CACHE_VAL
-  ])dnl AC_CACHE_VAL
- ])dnl AC_CACHE_VAL
- if test "$ac_not_found" = yes; then
-  ac_cv_func_select_arg1=int
-  ac_cv_func_select_arg234='int *'
-  ac_cv_func_select_arg5='struct timeval *'
- fi
- AC_MSG_RESULT([$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5])
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1, $ac_cv_func_select_arg1,
-                    [Define to the type of arg 1 for `select'.])
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234, ($ac_cv_func_select_arg234),
-                    [Define to the type of args 2, 3 and 4 for `select'.])
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5, ($ac_cv_func_select_arg5),
-                    [Define to the type of arg 5 for `select'.])
+extern int select ($ac_arg1,$ac_arg234,$ac_arg234,$ac_arg234,$ac_arg5);],,
+    [ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3])
+  done
+ done
+done
+# Provide a safe default value.
+: ${ac_cv_func_select_args=int,int *,struct timeval *}
+])
+ac_save_IFS=$IFS
+IFS=','
+set dummy `echo "$ac_cv_func_select_args" | sed -e 's/\*/\*/g'`
+IFS=$ac_save_IFS
+shift
+AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1, [$]1,
+                   [Define to the type of arg 1 for `select'.])
+AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234, ([$]2),
+                   [Define to the type of args 2, 3 and 4 for `select'.])
+AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5, ([$]3),
+                   [Define to the type of arg 5 for `select'.])
 ])# AC_FUNC_SELECT_ARGTYPES
 
 
index 602533a996f7883ce58cece75c515d64144a3321..61aab81726781667339cd6fb60f80d09c94e2040 100644 (file)
@@ -1904,18 +1904,17 @@ AC_SUBST(LIBOBJS)dnl
 
 # AC_FUNC_SELECT_ARGTYPES
 # -----------------------
+# Determine the correct type to be passed to each of the `select'
+# function's arguments, and define those types in `SELECT_TYPE_ARG1',
+# `SELECT_TYPE_ARG234', and `SELECT_TYPE_ARG5'.
 AC_DEFUN(AC_FUNC_SELECT_ARGTYPES,
-[AC_MSG_CHECKING([types of arguments for select()])
- AC_CACHE_VAL(ac_cv_func_select_arg234,dnl
- [AC_CACHE_VAL(ac_cv_func_select_arg1,dnl
-  [AC_CACHE_VAL(ac_cv_func_select_arg5,dnl
-   [for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
-     for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
-      for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
-       AC_TRY_COMPILE(
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+[AC_CACHE_CHECK([types of arguments for select],
+[ac_cv_func_select_args],
+[for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
+ for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
+  for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do
+   AC_TRY_COMPILE(
+[#include <sys/types.h>
 #if HAVE_SYS_TIME_H
 # include <sys/time.h>
 #endif
@@ -1925,26 +1924,25 @@ AC_DEFUN(AC_FUNC_SELECT_ARGTYPES,
 #if HAVE_SYS_SOCKET_H
 # include <sys/socket.h>
 #endif
-extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);],,dnl
-        [ac_not_found=no ; break 3],ac_not_found=yes)
-      done
-     done
-    done
-   ])dnl AC_CACHE_VAL
-  ])dnl AC_CACHE_VAL
- ])dnl AC_CACHE_VAL
- if test "$ac_not_found" = yes; then
-  ac_cv_func_select_arg1=int
-  ac_cv_func_select_arg234='int *'
-  ac_cv_func_select_arg5='struct timeval *'
- fi
- AC_MSG_RESULT([$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5])
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1, $ac_cv_func_select_arg1,
-                    [Define to the type of arg 1 for `select'.])
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234, ($ac_cv_func_select_arg234),
-                    [Define to the type of args 2, 3 and 4 for `select'.])
- AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5, ($ac_cv_func_select_arg5),
-                    [Define to the type of arg 5 for `select'.])
+extern int select ($ac_arg1,$ac_arg234,$ac_arg234,$ac_arg234,$ac_arg5);],,
+    [ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3])
+  done
+ done
+done
+# Provide a safe default value.
+: ${ac_cv_func_select_args=int,int *,struct timeval *}
+])
+ac_save_IFS=$IFS
+IFS=','
+set dummy `echo "$ac_cv_func_select_args" | sed -e 's/\*/\*/g'`
+IFS=$ac_save_IFS
+shift
+AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1, [$]1,
+                   [Define to the type of arg 1 for `select'.])
+AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234, ([$]2),
+                   [Define to the type of args 2, 3 and 4 for `select'.])
+AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5, ([$]3),
+                   [Define to the type of arg 5 for `select'.])
 ])# AC_FUNC_SELECT_ARGTYPES