1 dnl We use this until autoconf fixes its version.
2 AC_DEFUN(LYX_FUNC_SELECT_ARGTYPES,
3 [AC_MSG_CHECKING([types of arguments for select()])
4 AC_CACHE_VAL(ac_cv_func_select_arg234,dnl
5 [AC_CACHE_VAL(ac_cv_func_select_arg1,dnl
6 [AC_CACHE_VAL(ac_cv_func_select_arg5,dnl
7 [for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
8 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
10 [#ifdef HAVE_SYS_TYPES_H
11 #include <sys/types.h>
13 #ifdef HAVE_SYS_TIME_H
16 #ifdef HAVE_SYS_SELECT_H
17 #include <sys/select.h>
19 #ifdef HAVE_SYS_SOCKET_H
20 #include <sys/socket.h>
22 extern int 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
23 [ac_not_found=no ; break 3],ac_not_found=yes)
30 if test "$ac_not_found" = yes; then
31 ac_cv_func_select_arg1=int
32 ac_cv_func_select_arg234='int *'
33 ac_cv_func_select_arg5='struct timeval *'
35 AC_MSG_RESULT([$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5])
36 AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1,$ac_cv_func_select_arg1,
37 [Define to the type of arg1 for select().])
38 AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234,($ac_cv_func_select_arg234),
39 [Define to the type of args 2, 3 and 4 for select().])
40 AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5,($ac_cv_func_select_arg5),
41 [Define to the type of arg5 for select().])
44 dnl Check things are declared in headers to avoid errors or warnings.
45 dnl Called like LYX_CHECK_DECL(function, headerfile)
46 dnl Defines HAVE_DECL_{FUNCTION}
47 AC_DEFUN(LYX_CHECK_DECL,
48 [AC_MSG_CHECKING(if $1 is declared by header $2)
49 tr_func=`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
51 tr_hdr=`echo $2 | tr . _`
52 AC_CACHE_VAL([lyx_cv_declare_${tr_hdr}_$1],
53 [AC_EGREP_HEADER($1, $2, [eval "lyx_cv_declare_${tr_hdr}_$1=yes"], [eval "lyx_cv_declare_${tr_hdr}_$1=no"])])
54 if eval "test \"\${lyx_cv_declare_${tr_hdr}_$1}\" = \"yes\""; then
55 AC_DEFINE_UNQUOTED(HAVE_DECL_${tr_func},1,[dummy])
61 dnl This is the multiple headers version of the LYX_CHECK_DECL macro above.
62 dnl Called like LYX_CHECK_DECL_HDRS(function, file1 file2 file3)
63 AC_DEFUN(LYX_CHECK_DECL_HDRS,
66 tr_hdr=`echo $I | tr . _`
67 if test "${got}" = "no"; then
68 LYX_CHECK_DECL($1, $I)
70 if eval "test \"\${lyx_cv_declare_${tr_hdr}_$1}\" = \"yes\""; then