From bc96a64f7947ef8c09f59392ec63ddf0937d20f9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 26 Jun 2017 12:31:46 -0400 Subject: [PATCH 110/123] Work around autoconf 2.69 having a terrible AC_HEADER_MAJOR --- configure.ac | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1d8f7e745..70204bbf0 100644 --- a/configure.ac +++ b/configure.ac @@ -424,10 +424,46 @@ else AC_PATH_PROG(HELP2MAN, help2man) fi +# AC_HEADER_MAJOR_OI +# --------------- +AN_FUNCTION([major], [AC_HEADER_MAJOR_OI]) +AN_FUNCTION([makedev], [AC_HEADER_MAJOR_OI]) +AN_FUNCTION([minor], [AC_HEADER_MAJOR_OI]) +AN_HEADER([sys/mkdev.h], [AC_HEADER_MAJOR_OI]) +AC_DEFUN([AC_HEADER_MAJOR_OI], +[AC_CACHE_CHECK(whether sys/sysmacros.h defines makedev, + ac_cv_header_sys_sysmacros_h_makedev, +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [[return makedev(0, 0);]])], + [ac_cv_header_sys_sysmacros_h_makedev=yes], + [ac_cv_header_sys_sysmacros_h_makedev=no]) +]) + +if test $ac_cv_header_sys_sysmacros_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/types.h, + [AC_DEFINE(MAJOR_IN_TYPES, 1, + [Define to 1 if `major', `minor', and `makedev' + are declared in .])]) + fi + +else + AC_DEFINE(MAJOR_IN_SYSMACROS, 1, + [Define to 1 if `major', `minor', and `makedev' + are declared in .]) +fi +])# AC_HEADER_MAJOR_OI + + # Check for functions and headers. AC_CHECK_FUNCS(posix_memalign memalign getextmntent) AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h) -AC_HEADER_MAJOR +AC_HEADER_MAJOR_OI AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default #include -- 2.14.3