From: Sebastien GODARD Date: Sat, 5 Sep 2015 14:29:51 +0000 (+0200) Subject: Make sysstat build on musl (non-glibc) environment X-Git-Tag: v11.1.7~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12d4fea6150b851e5a3c04b2a0cd912d47f83671;p=sysstat Make sysstat build on musl (non-glibc) environment Building sysstat on musl needs two additional header files in common.h: (add an autoconf check for this because I don't know whether all platforms have it) Signed-off-by: Sebastien GODARD --- diff --git a/Makefile.in b/Makefile.in index 58f8bd1..9e0f124 100644 --- a/Makefile.in +++ b/Makefile.in @@ -89,7 +89,11 @@ ifndef ZIP ZIP = @ZIP@ endif -# Settings +# Settings +SYSMACROS = @SYSMACROS@ +ifeq ($(SYSMACROS),y) + DFLAGS += -DHAVE_SYS_SYSMACROS_H +endif NLS = @NLS@ ifeq ($(NLS),y) REQUIRE_NLS = -DUSE_NLS -DPACKAGE=\"$(PACKAGE)\" -DLOCALEDIR=\"$(NLS_DIR)\" diff --git a/common.h b/common.h index 37dc097..e25add9 100644 --- a/common.h +++ b/common.h @@ -11,6 +11,13 @@ #include #include /* For __CPU_SETSIZE */ +#include + +#ifdef HAVE_SYS_SYSMACROS_H +/* Needed on some non-glibc environments */ +#include +#endif + #include "rd_stats.h" /* diff --git a/configure b/configure index d30dded..f9bfebd 100755 --- a/configure +++ b/configure @@ -658,6 +658,7 @@ SA_DIR sa_dir SA_LIB_DIR sa_lib_dir +SYSMACROS INITD_DIR INIT_DIR RC_DIR @@ -4017,6 +4018,7 @@ echo Check header files: echo . HAVE_LIBINTL_H= HAVE_LOCALE_H= +HAVE_SYS_SYSMACROS_H= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : @@ -4419,6 +4421,18 @@ fi done +for ac_header in sys/sysmacros.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SYSMACROS_H 1 +_ACEOF + HAVE_SYS_SYSMACROS_H=1 +fi + +done + echo . echo Check typedefs, structures and compiler characteristics: @@ -4906,6 +4920,13 @@ fi +if test $HAVE_SYS_SYSMACROS_H; then + SYSMACROS="y" +else + SYSMACROS="n" +fi + + # Set sadc directory if test $prefix != "NONE"; then AuxPrefix=$prefix diff --git a/configure.in b/configure.in index bb6bb63..19777ea 100644 --- a/configure.in +++ b/configure.in @@ -57,6 +57,7 @@ echo Check header files: echo . HAVE_LIBINTL_H= HAVE_LOCALE_H= +HAVE_SYS_SYSMACROS_H= AC_HEADER_STDC AC_HEADER_DIRENT AC_CHECK_HEADERS(ctype.h) @@ -70,6 +71,7 @@ AC_CHECK_HEADERS(stdio.h) AC_CHECK_HEADERS(sys/file.h) AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/stat.h) +AC_CHECK_HEADERS(sys/sysmacros.h, HAVE_SYS_SYSMACROS_H=1) echo . echo Check typedefs, structures and compiler characteristics: @@ -200,6 +202,13 @@ AC_SUBST(RC_DIR) AC_SUBST(INIT_DIR) AC_SUBST(INITD_DIR) +if test $HAVE_SYS_SYSMACROS_H; then + SYSMACROS="y" +else + SYSMACROS="n" +fi +AC_SUBST(SYSMACROS) + # Set sadc directory if test $prefix != "NONE"; then AuxPrefix=$prefix