aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:00:29 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:29 +0200
commiteaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95 (patch)
tree833f3fae6e3604a439f909c245a6e35f574997d7 /configure.ac
parent283707c5e5bc436b78ea23bf5500cb6b16a01148 (diff)
downloaddebian_htop-eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95.tar.gz
debian_htop-eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95.tar.bz2
debian_htop-eaf11cc12a1aa4b050a8a1e7ea3770d3d9c81e95.zip
Imported Upstream version 1.0upstream/1.0
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac57
1 files changed, 41 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index ba95b19..83a096e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,9 +1,14 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.57)
-AC_INIT([htop],[0.9],[loderunner@users.sourceforge.net])
-AM_INIT_AUTOMAKE
+AC_PREREQ(2.65)
+AC_INIT([htop],[1.0],[loderunner@users.sourceforge.net])
+
+# The following two lines are required by hwloc scripts
+AC_USE_SYSTEM_EXTENSIONS
+AC_CANONICAL_TARGET
+
+AM_INIT_AUTOMAKE([1.11])
AC_CONFIG_SRCDIR([htop.c])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
@@ -25,6 +30,7 @@ AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h curses.h],[:],[
missing_headers="$missing_headers $ac_header"
])
+AC_CHECK_HEADERS([execinfo.h],[:],[:])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
@@ -34,8 +40,6 @@ AC_TYPE_UID_T
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
-AC_FUNC_MALLOC
-AC_FUNC_REALLOC
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_CHECK_FUNCS([memmove strncasecmp strstr strdup])
@@ -83,10 +87,15 @@ if test "x$enable_taskstats" = xyes; then
AC_DEFINE(HAVE_TASKSTATS, 1, [Define if taskstats support enabled.])
fi
-AC_ARG_ENABLE(unicode, [AC_HELP_STRING([--enable-unicode], [enable Unicode support])], ,enable_unicode="no")
+AC_ARG_ENABLE(unicode, [AC_HELP_STRING([--enable-unicode], [enable Unicode support])], ,enable_unicode="yes")
if test "x$enable_unicode" = xyes; then
- AC_CHECK_LIB([ncursesw], [refresh], [], [missing_libraries="$missing_libraries libncursesw"])
- AC_CHECK_HEADERS([ncursesw/curses.h],[:],[missing_headers="$missing_headers $ac_header"])
+ AC_CHECK_LIB([ncursesw], [refresh], [], [
+ missing_libraries="$missing_libraries libncursesw"
+ AC_MSG_ERROR([You may want to use --disable-unicode or install libncursesw.])
+ ])
+ AC_CHECK_HEADERS([ncursesw/curses.h],[:],
+ [AC_CHECK_HEADERS([ncurses/ncurses.h],[:],
+ [AC_CHECK_HEADERS([ncurses.h],[:],[missing_headers="$missing_headers $ac_header"])])])
else
AC_CHECK_LIB([ncurses], [refresh], [], [missing_libraries="$missing_libraries libncurses"])
AC_CHECK_HEADERS([curses.h],[:],[missing_headers="$missing_headers $ac_header"])
@@ -99,18 +108,34 @@ if test ! -z "$missing_headers"; then
AC_MSG_ERROR([missing headers: $missing_headers])
fi
-
-
+if test "$cross_compiling" = "no"; then
AC_CHECK_FILE($PROCDIR/stat,,AC_MSG_ERROR(Cannot find /proc/stat. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.))
AC_CHECK_FILE($PROCDIR/meminfo,,AC_MSG_ERROR(Cannot find /proc/meminfo. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.))
+fi
+
+AC_ARG_ENABLE(native_affinity, [AC_HELP_STRING([--enable-native-affinity], [enable native sched_setaffinity and sched_getaffinity for affinity support, disables hwloc])], ,enable_native_affinity="yes")
+if test "x$enable_native_affinity" = xyes; then
+ AC_MSG_CHECKING([for usable sched_setaffinity])
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([[
+ #include <sched.h>
+ #include <errno.h>
+ static cpu_set_t cpuset;
+ ]], [[
+ CPU_ZERO(&cpuset);
+ sched_setaffinity(0, sizeof(cpu_set_t), &cpuset);
+ if (errno == ENOSYS) return 1;
+ ]])],
+ [AC_DEFINE(HAVE_NATIVE_AFFINITY, 1, [Define if native sched_setaffinity and sched_getaffinity are to be used.])
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])])
+fi
-AC_ARG_ENABLE(plpa, [AC_HELP_STRING([--enable-plpa], [enable PLPA support for CPU affinity])], ,enable_plpa="yes")
-PLPA_INCLUDED
-PLPA_INIT([plpa-1.3.2], [plpa_happy=yes], [plpa_happy=no])
-AM_CONDITIONAL([HAVE_PLPA], [test "$plpa_happy" = "yes" && test "$enable_plpa" = "yes"])
-if test "$plpa_happy" = "yes" && test "$enable_plpa" = "yes"
+AC_ARG_ENABLE(hwloc, [AC_HELP_STRING([--enable-hwloc], [enable hwloc support for CPU affinity])],, enable_hwloc="no")
+if test "x$enable_hwloc" = xyes
then
- AC_DEFINE([HAVE_PLPA], [1], [Have plpa])
+ AC_CHECK_LIB([hwloc], [hwloc_linux_get_tid_cpubind], [], [missing_libraries="$missing_libraries libhwloc"])
+ AC_CHECK_HEADERS([hwloc.h],[:], [missing_headers="$missing_headers $ac_header"])
fi
AC_CONFIG_FILES([Makefile htop.1])

© 2014-2024 Faster IT GmbH | imprint | privacy policy