From df568a576f7b44ac5a2b9b7222c7f39d9932f626 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Wed, 11 Apr 2018 01:26:28 +0200 Subject: Imported Upstream version 2.2.0 --- configure.ac | 59 +++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 14 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 559dc4d..2c4fc5b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.65) -AC_INIT([htop],[2.1.0],[hisham@gobolinux.org]) +AC_INIT([htop],[2.2.0],[hisham@gobolinux.org]) SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}" year=$(date -u -d "@$SOURCE_DATE_EPOCH" "+%Y" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+%Y" 2>/dev/null || date -u "+%Y") @@ -43,6 +43,9 @@ dragonfly*) darwin*) my_htop_platform=darwin ;; +solaris*) + my_htop_platform=solaris + ;; *) my_htop_platform=unsupported ;; @@ -61,6 +64,16 @@ AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h],[ ]) AC_CHECK_HEADERS([execinfo.h],[:],[:]) +AC_HEADER_MAJOR +dnl glibc 2.25 deprecates 'major' and 'minor' in and requires to +dnl include . However the logic in AC_HEADER_MAJOR has not yet +dnl been updated in Autoconf 2.69, so use a workaround: +m4_version_prereq([2.70], [], +[if test "x$ac_cv_header_sys_mkdev_h" = xno; 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]) + # Checks for typedefs, structures, and compiler characteristics. # ---------------------------------------------------------------------- AC_HEADER_STDBOOL @@ -154,20 +167,26 @@ m4_define([HTOP_CHECK_SCRIPT], [ if test ! -z "m4_toupper($HTOP_[$1]_CONFIG_SCRIPT)"; then # to be used to set the path to ncurses*-config when cross-compiling - htop_config_script=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --libs 2> /dev/null) + htop_config_script_libs=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --libs 2> /dev/null) + htop_config_script_cflags=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --cflags 2> /dev/null) else - htop_config_script=$([$4] --libs 2> /dev/null) + htop_config_script_libs=$([$4] --libs 2> /dev/null) + htop_config_script_cflags=$([$4] --cflags 2> /dev/null) fi htop_script_success=no htop_save_LDFLAGS="$LDFLAGS" - if test ! "x$htop_config_script" = x; then - LDFLAGS="$htop_config_script $LDFLAGS" + htop_save_CFLAGS="$CFLAGS" + if test ! "x$htop_config_script_libs" = x; then + LDFLAGS="$htop_config_script_libs $LDFLAGS" + CFLAGS="$htop_config_script_cflags $CFLAGS" AC_CHECK_LIB([$1], [$2], [ AC_DEFINE([$3], 1, [The library is present.]) - LIBS="$htop_config_script $LIBS " + LIBS="$htop_config_script_libs $LIBS " htop_script_success=yes - ], []) - LDFLAGS="$save_LDFLAGS" + ], [ + CFLAGS="$htop_save_CFLAGS" + ]) + LDFLAGS="$htop_save_LDFLAGS" fi if test "x$htop_script_success" = xno; then [$5] @@ -222,6 +241,12 @@ if test "$my_htop_platform" = "openbsd"; then AC_CHECK_LIB([kvm], [kvm_open], [], [missing_libraries="$missing_libraries libkvm"]) fi +if test "$my_htop_platform" = "solaris"; then + AC_CHECK_LIB([kstat], [kstat_open], [], [missing_libraries="$missing_libraries libkstat"]) + AC_CHECK_LIB([proc], [Pgrab_error], [], [missing_libraries="$missing_libraries libproc"]) + AC_CHECK_LIB([malloc], [free], [], [missing_libraries="$missing_libraries libmalloc"]) +fi + AC_ARG_ENABLE(linux_affinity, [AS_HELP_STRING([--enable-linux-affinity], [enable Linux sched_setaffinity and sched_getaffinity for affinity support, disables hwloc])], ,enable_linux_affinity="yes") if test "x$enable_linux_affinity" = xyes -a "x$cross_compiling" = xno; then AC_MSG_CHECKING([for usable sched_setaffinity]) @@ -256,14 +281,19 @@ then AC_DEFINE(HAVE_SETUID_ENABLED, 1, [Define if setuid support should be enabled.]) fi -AC_ARG_ENABLE(delayacct, [AS_HELP_STRING([--enable-delayacct], [enable linux delay accounting])],, enable_delayacct="no") +AC_ARG_ENABLE(delayacct, [AS_HELP_STRING([--enable-delayacct], [enable Linux delay accounting])],, enable_delayacct="no") if test "x$enable_delayacct" = xyes then - PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [missing_libraries="$missing_libraries libnl-3"]) - PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [missing_libraries="$missing_libraries libnl-genl-3"]) - CFLAGS+=" $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS" - LIBS+=" $LIBNL3_LIBS $LIBNL3GENL_LIBS" - AC_DEFINE(HAVE_DELAYACCT, 1, [Define if delay accounting support should be enabled.]) + m4_ifdef([PKG_PROG_PKG_CONFIG], [ + PKG_PROG_PKG_CONFIG() + PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [missing_libraries="$missing_libraries libnl-3"]) + PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [missing_libraries="$missing_libraries libnl-genl-3"]) + CFLAGS="$CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS" + LIBS="$LIBS $LIBNL3_LIBS $LIBNL3GENL_LIBS" + AC_DEFINE(HAVE_DELAYACCT, 1, [Define if delay accounting support should be enabled.]) + ], [ + AC_MSG_ERROR([htop on Linux requires pkg-config for checking delayacct requirements. Please install pkg-config and run ./autogen.sh to rebuild the configure script.]) + ]) fi @@ -285,6 +315,7 @@ AM_CONDITIONAL([HTOP_FREEBSD], [test "$my_htop_platform" = freebsd]) AM_CONDITIONAL([HTOP_DRAGONFLYBSD], [test "$my_htop_platform" = dragonflybsd]) AM_CONDITIONAL([HTOP_OPENBSD], [test "$my_htop_platform" = openbsd]) AM_CONDITIONAL([HTOP_DARWIN], [test "$my_htop_platform" = darwin]) +AM_CONDITIONAL([HTOP_SOLARIS], [test "$my_htop_platform" = solaris]) AM_CONDITIONAL([HTOP_UNSUPPORTED], [test "$my_htop_platform" = unsupported]) AC_SUBST(my_htop_platform) AC_CONFIG_FILES([Makefile htop.1]) -- cgit v1.2.3