From: Wayne Davison Date: Tue, 7 Apr 2020 22:16:19 +0000 (-0700) Subject: Avoid the include warnings for major(). X-Git-Tag: v3.2.0pre1~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e4a1441cb339214fa9520f6607288865fd2aa2d;p=thirdparty%2Frsync.git Avoid the include warnings for major(). --- diff --git a/configure.ac b/configure.ac index 2752b6a4..5ca7a55e 100644 --- a/configure.ac +++ b/configure.ac @@ -351,7 +351,7 @@ AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \ sys/acl.h acl/libacl.h attr/xattr.h sys/xattr.h sys/extattr.h \ popt.h popt/popt.h linux/falloc.h netinet/in_systm.h netinet/ip.h \ zlib.h) -AC_HEADER_MAJOR +AC_HEADER_MAJOR_FIXED AC_CACHE_CHECK([if makedev takes 3 args],rsync_cv_MAKEDEV_TAKES_3_ARGS,[ AC_RUN_IFELSE([AC_LANG_SOURCE([[ diff --git a/m4/header_major_fixed.m4 b/m4/header_major_fixed.m4 new file mode 100644 index 00000000..395889cd --- /dev/null +++ b/m4/header_major_fixed.m4 @@ -0,0 +1,27 @@ +AC_DEFUN([AC_HEADER_MAJOR_FIXED], +[AC_CACHE_CHECK(whether sys/types.h defines makedev, + ac_cv_header_sys_types_h_makedev, +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [[return makedev(0, 0);]])], + [if grep 'historical compatibility' conftest.err >/dev/null; then + ac_cv_header_sys_types_h_makedev=no + else + ac_cv_header_sys_types_h_makedev=yes + fi], + [ac_cv_header_sys_types_h_makedev=no]) +]) + +if test $ac_cv_header_sys_types_h_makedev = no; then +AC_CHECK_HEADER(sys/mkdev.h, + [AC_DEFINE(MAJOR_IN_MKDEV, 1, + [Define to 1 if `major', `minor', and `makedev' are + declared in .])]) + + if test $ac_cv_header_sys_mkdev_h = no; then + AC_CHECK_HEADER(sys/sysmacros.h, + [AC_DEFINE(MAJOR_IN_SYSMACROS, 1, + [Define to 1 if `major', `minor', and `makedev' + are declared in .])]) + fi +fi +]) diff --git a/prepare-source.mak b/prepare-source.mak index ad291feb..bc1938de 100644 --- a/prepare-source.mak +++ b/prepare-source.mak @@ -1,6 +1,6 @@ conf: configure.sh config.h.in -aclocal.m4: +aclocal.m4: m4/*.m4 aclocal -I m4 configure.sh: configure.ac aclocal.m4