Commit 9f318348 authored by Niels Möller's avatar Niels Möller
Browse files

* acinclude.m4: New file.

Rev: acinclude.m4:1.1
Rev: configure.in:1.55
parent 83dc5a4e
dnl AC_CHECK_MEMBER(includes, struct, field)
AC_DEFUN(AC_CHECK_MEMBER,
[ AC_CACHE_CHECK([if $2 has member $3],
lsh_cv_decl_struct_$2_$3,
[AC_TRY_COMPILE([$1],
changequote(<{, }>)dnl
<{ struct $2 x; (void) &x.$3; }>,
changequote([, ])dnl
[lsh_cv_decl_struct_$2_$3=yes],
[lsh_cv_decl_struct_$2_$3=no])])
if eval "test \"`echo '$lsh_cv_decl_struct_'$2`_'$3'\" = yes"; then
AC_DEFINE_UNQUOTED(`echo HAVE_$3 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`)
fi
])
dnl AC_CHECK_VAR(VAR, INCLUDES)
AC_DEFUN(AC_CHECK_VAR,
[ AC_CACHE_CHECK(
[for $1],
lsh_cv_var_$1,
AC_TRY_LINK([$2], [void *p = (void *) &$1;],
[lsh_cv_var_$1=yes],
[lsh_cv_var_$1=no]))
if eval "test \"`echo '$lsh_cv_var_'$1`\" = yes"; then
AC_DEFINE_UNQUOTED(HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`)
fi
])
dnl Try to detect the type of the third arg to getsockname() et al
AC_DEFUN(AC_TYPE_SOCKLEN_T,
[AC_CACHE_CHECK(for socklen_t in sys/socket.h, ac_cv_type_socklen_t,
[AC_EGREP_HEADER(socklen_t, sys/socket.h,
ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no)])
if test $ac_cv_type_socklen_t = no; then
AC_MSG_CHECKING(for AIX)
AC_EGREP_CPP(yes, [
#ifdef _AIX
yes
#endif
],[
AC_MSG_RESULT(yes)
AC_DEFINE(socklen_t, size_t)
],[
AC_MSG_RESULT(no)
AC_DEFINE(socklen_t, int)
])
fi
])
......@@ -201,23 +201,6 @@ AC_CHECK_HEADERS(stropts.h)
AC_CHECK_HEADERS(syslog.h)
AC_CHECK_HEADERS(argp.h)
dnl AC_CHECK_MEMBER(includes, struct, field)
AC_DEFUN(AC_CHECK_MEMBER,
[ AC_CACHE_CHECK([if $2 has member $3],
lsh_cv_decl_struct_$2_$3,
[AC_TRY_COMPILE([$1],
changequote(<{, }>)dnl
<{ struct $2 x; (void) &x.$3; }>,
changequote([, ])dnl
[lsh_cv_decl_struct_$2_$3=yes],
[lsh_cv_decl_struct_$2_$3=no])])
if eval "test \"`echo '$lsh_cv_decl_struct_'$2`_'$3'\" = yes"; then
AC_DEFINE_UNQUOTED(`echo HAVE_$3 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`)
fi
])
AC_CHECK_HEADERS(utmp.h, [have_utmp_h=yes], [have_utmp_h=no])
if test x$have_utmp_h = xyes; then
......@@ -322,19 +305,6 @@ AC_CHECK_FUNCS(mempcpy strndup)
AC_CHECK_FUNCS(flockfile putc_unlocked)
AC_CHECK_FUNCS(fputs_unlocked fwrite_unlocked)
dnl AC_CHECK_VAR(VAR, INCLUDES)
AC_DEFUN(AC_CHECK_VAR,
[ AC_CACHE_CHECK(
[for $1],
lsh_cv_var_$1,
AC_TRY_LINK([$2], [void *p = (void *) &$1;],
[lsh_cv_var_$1=yes],
[lsh_cv_var_$1=no]))
if eval "test \"`echo '$lsh_cv_var_'$1`\" = yes"; then
AC_DEFINE_UNQUOTED(HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`)
fi
])
AC_CHECK_VAR(program_invocation_name, [#include <errno.h>])
AC_CHECK_VAR(program_invocation_short_name, [#include <errno.h>])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment