Allow basic connectivity check via rrsync
[rsync.git] / m4 / header_major_fixed.m4
blob0f156aa0ad6f9f8e2915816f327a8aabda006eec
1 AC_DEFUN([AC_HEADER_MAJOR_FIXED],
2 [AC_CACHE_CHECK(whether sys/types.h defines makedev,
3                 ac_cv_header_sys_types_h_makedev,
4 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <sys/types.h>]],
5                                  [[return makedev(0, 0);]])],
6                 [if grep sys/sysmacros.h conftest.err >/dev/null; then
7                    ac_cv_header_sys_types_h_makedev=no
8                  else
9                    ac_cv_header_sys_types_h_makedev=yes
10                  fi],
11                 [ac_cv_header_sys_types_h_makedev=no])
14 if test $ac_cv_header_sys_types_h_makedev = no; then
15 AC_CHECK_HEADER(sys/mkdev.h,
16                 [AC_DEFINE(MAJOR_IN_MKDEV, 1,
17                            [Define to 1 if `major', `minor', and `makedev' are
18                             declared in <mkdev.h>.])])
20   if test $ac_cv_header_sys_mkdev_h = no; then
21     AC_CHECK_HEADER(sys/sysmacros.h,
22                     [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
23                                [Define to 1 if `major', `minor', and `makedev'
24                                 are declared in <sysmacros.h>.])])
25   fi