| Hisham Muhammad | d6231ba | 2006-03-04 18:16:49 +0000 | [diff] [blame] | 1 | # -*- Autoconf -*- |
| 2 | # Process this file with autoconf to produce a configure script. |
| 3 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 4 | # ---------------------------------------------------------------------- |
| 5 | # Autoconf initialization. |
| 6 | # ---------------------------------------------------------------------- |
| 7 | |
| Christian Göttsche | 38b6a01 | 2021-01-22 19:14:53 +0100 | [diff] [blame] | 8 | AC_PREREQ([2.69]) |
| 9 | AC_INIT([htop], [3.0.6-dev], [htop@groups.io], [], [https://htop.dev/]) |
| Hisham Muhammad | 3383d8e | 2015-01-21 23:27:31 -0200 | [diff] [blame] | 10 | |
| Explorer09 | b71b07f | 2016-03-12 12:02:06 +0800 | [diff] [blame] | 11 | AC_CONFIG_SRCDIR([htop.c]) |
| Christian Göttsche | 38b6a01 | 2021-01-22 19:14:53 +0100 | [diff] [blame] | 12 | AC_CONFIG_AUX_DIR([build-aux]) |
| Explorer09 | b71b07f | 2016-03-12 12:02:06 +0800 | [diff] [blame] | 13 | AC_CONFIG_HEADERS([config.h]) |
| Explorer09 | b71b07f | 2016-03-12 12:02:06 +0800 | [diff] [blame] | 14 | |
| Hisham Muhammad | ec17b70 | 2011-09-24 00:30:47 +0000 | [diff] [blame] | 15 | AC_CANONICAL_TARGET |
| Christian Göttsche | 38b6a01 | 2021-01-22 19:14:53 +0100 | [diff] [blame] | 16 | AM_INIT_AUTOMAKE([-Wall std-options subdir-objects]) |
| Hisham Muhammad | d6231ba | 2006-03-04 18:16:49 +0000 | [diff] [blame] | 17 | |
| Hisham Muhammad | 300af4b | 2014-11-19 23:17:16 -0200 | [diff] [blame] | 18 | # ---------------------------------------------------------------------- |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 19 | |
| 20 | |
| 21 | # ---------------------------------------------------------------------- |
| 22 | # Checks for platform. |
| 23 | # ---------------------------------------------------------------------- |
| 24 | |
| 25 | case "$target_os" in |
| 26 | linux*|gnu*) |
| 27 | my_htop_platform=linux |
| 28 | AC_DEFINE([HTOP_LINUX], [], [Building for Linux.]) |
| 29 | ;; |
| 30 | freebsd*|kfreebsd*) |
| 31 | my_htop_platform=freebsd |
| 32 | AC_DEFINE([HTOP_FREEBSD], [], [Building for FreeBSD.]) |
| 33 | ;; |
| 34 | openbsd*) |
| 35 | my_htop_platform=openbsd |
| 36 | AC_DEFINE([HTOP_OPENBSD], [], [Building for OpenBSD.]) |
| 37 | ;; |
| 38 | dragonfly*) |
| 39 | my_htop_platform=dragonflybsd |
| 40 | AC_DEFINE([HTOP_DRAGONFLYBSD], [], [Building for DragonFlyBSD.]) |
| 41 | ;; |
| 42 | darwin*) |
| 43 | my_htop_platform=darwin |
| 44 | AC_DEFINE([HTOP_DARWIN], [], [Building for Darwin.]) |
| 45 | ;; |
| 46 | solaris*) |
| 47 | my_htop_platform=solaris |
| 48 | AC_DEFINE([HTOP_SOLARIS], [], [Building for Solaris.]) |
| 49 | ;; |
| 50 | *) |
| 51 | my_htop_platform=unsupported |
| 52 | AC_DEFINE([HTOP_UNSUPPORTED], [], [Building for an unsupported platform.]) |
| 53 | ;; |
| 54 | esac |
| Hisham Muhammad | 4df76d1 | 2008-03-05 09:46:47 +0000 | [diff] [blame] | 55 | |
| Christian Göttsche | 38b6a01 | 2021-01-22 19:14:53 +0100 | [diff] [blame] | 56 | # Enable extensions, required by hwloc scripts |
| Explorer09 | b71b07f | 2016-03-12 12:02:06 +0800 | [diff] [blame] | 57 | AC_USE_SYSTEM_EXTENSIONS |
| 58 | |
| Hisham Muhammad | eb229d9 | 2014-11-24 18:55:03 -0200 | [diff] [blame] | 59 | # ---------------------------------------------------------------------- |
| Hisham Muhammad | eb229d9 | 2014-11-24 18:55:03 -0200 | [diff] [blame] | 60 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 61 | |
| Hisham Muhammad | 300af4b | 2014-11-19 23:17:16 -0200 | [diff] [blame] | 62 | # ---------------------------------------------------------------------- |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 63 | # Checks for compiler. |
| Hisham Muhammad | 300af4b | 2014-11-19 23:17:16 -0200 | [diff] [blame] | 64 | # ---------------------------------------------------------------------- |
| Hisham Muhammad | e46f142 | 2006-07-12 01:15:14 +0000 | [diff] [blame] | 65 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 66 | AC_PROG_CC |
| 67 | AM_PROG_CC_C_O |
| Christian Göttsche | 38b6a01 | 2021-01-22 19:14:53 +0100 | [diff] [blame] | 68 | AC_PROG_CC_C99 |
| 69 | AS_IF([test "x$ac_cv_prog_cc_c99" = xno], [AC_MSG_ERROR([htop is written in C99. A newer compiler is required.])]) |
| Hisham Muhammad | d6231ba | 2006-03-04 18:16:49 +0000 | [diff] [blame] | 70 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 71 | # ---------------------------------------------------------------------- |
| 72 | |
| 73 | |
| 74 | # ---------------------------------------------------------------------- |
| Christian Göttsche | 575edff | 2021-01-22 19:14:59 +0100 | [diff] [blame] | 75 | # Checks for static build. |
| 76 | # ---------------------------------------------------------------------- |
| 77 | |
| 78 | AC_ARG_ENABLE([static], |
| 79 | [AS_HELP_STRING([--enable-static], |
| 80 | [build a static htop binary @<:@default=no@:>@])], |
| 81 | [], |
| 82 | [enable_static=no]) |
| 83 | case "$enable_static" in |
| 84 | no) |
| 85 | ;; |
| 86 | yes) |
| 87 | AC_DEFINE([BUILD_STATIC], [1], [Define if building static binary.]) |
| 88 | CFLAGS="$CFLAGS -static" |
| 89 | LDFLAGS="$LDFLAGS -static" |
| 90 | ;; |
| 91 | *) |
| 92 | AC_MSG_ERROR([bad value '$enable_static' for --enable-static option]) |
| 93 | ;; |
| 94 | esac |
| 95 | |
| 96 | # ---------------------------------------------------------------------- |
| 97 | |
| 98 | |
| 99 | # ---------------------------------------------------------------------- |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 100 | # Checks for generic header files. |
| 101 | # ---------------------------------------------------------------------- |
| 102 | |
| 103 | AC_HEADER_DIRENT |
| 104 | AC_HEADER_STDC |
| 105 | AC_CHECK_HEADERS([ \ |
| 106 | stdlib.h \ |
| 107 | string.h \ |
| 108 | strings.h \ |
| 109 | sys/param.h \ |
| 110 | sys/time.h \ |
| Nathan Scott | 5b50ae3 | 2021-03-02 15:58:11 +1100 | [diff] [blame^] | 111 | sys/utsname.h \ |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 112 | unistd.h |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 113 | ], [], [AC_MSG_ERROR([can not find required generic header files])]) |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 114 | |
| 115 | AC_HEADER_MAJOR |
| 116 | dnl glibc 2.25 deprecates 'major' and 'minor' in <sys/types.h> and requires to |
| 117 | dnl include <sys/sysmacros.h>. However the logic in AC_HEADER_MAJOR has not yet |
| 118 | dnl been updated in Autoconf 2.69, so use a workaround: |
| 119 | m4_version_prereq([2.70], [], |
| 120 | [if test "x$ac_cv_header_sys_mkdev_h" != xyes; then |
| 121 | AC_CHECK_HEADER([sys/sysmacros.h], [AC_DEFINE([MAJOR_IN_SYSMACROS], [1], |
| 122 | [Define to 1 if `major', `minor', and `makedev' are declared in <sys/sysmacros.h>.])]) |
| 123 | fi]) |
| 124 | |
| 125 | # Optional Section |
| 126 | |
| 127 | AC_CHECK_HEADERS([execinfo.h]) |
| 128 | |
| 129 | if test "$my_htop_platform" = darwin; then |
| 130 | AC_CHECK_HEADERS([mach/mach_time.h]) |
| 131 | fi |
| 132 | |
| 133 | # ---------------------------------------------------------------------- |
| 134 | |
| 135 | |
| 136 | # ---------------------------------------------------------------------- |
| 137 | # Checks for typedefs, structures, and compiler characteristics. |
| 138 | # ---------------------------------------------------------------------- |
| 139 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 140 | AC_TYPE_PID_T |
| 141 | AC_TYPE_UID_T |
| 142 | AC_TYPE_UINT8_T |
| 143 | AC_TYPE_UINT16_T |
| 144 | AC_TYPE_UINT32_T |
| 145 | AC_TYPE_UINT64_T |
| 146 | |
| 147 | # ---------------------------------------------------------------------- |
| 148 | |
| 149 | |
| 150 | # ---------------------------------------------------------------------- |
| 151 | # Checks for generic library functions. |
| 152 | # ---------------------------------------------------------------------- |
| 153 | |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 154 | AC_CHECK_LIB([m], [ceil], [], [AC_MSG_ERROR([can not find required function ceil()])]) |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 155 | |
| 156 | if test "$my_htop_platform" = dragonflybsd; then |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 157 | AC_SEARCH_LIBS([kvm_open], [kvm], [], [AC_MSG_ERROR([can not find required function kvm_open()])]) |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 158 | fi |
| 159 | |
| 160 | if test "$my_htop_platform" = freebsd; then |
| Christian Göttsche | cae47bb | 2021-02-05 15:15:01 +0100 | [diff] [blame] | 161 | if test "$enable_static" = yes; then |
| 162 | AC_SEARCH_LIBS([elf_version], [elf], [], [AC_MSG_ERROR([can not find required function elf_version()])]) |
| 163 | fi |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 164 | AC_SEARCH_LIBS([kvm_open], [kvm], [], [AC_MSG_ERROR([can not find required function kvm_open()])]) |
| 165 | AC_SEARCH_LIBS([devstat_checkversion], [devstat], [], [AC_MSG_ERROR([can not find required function devstat_checkversion()])]) |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 166 | fi |
| 167 | |
| 168 | if test "$my_htop_platform" = linux; then |
| Christian Göttsche | 575edff | 2021-01-22 19:14:59 +0100 | [diff] [blame] | 169 | if test "$enable_static" != yes; then |
| 170 | AC_SEARCH_LIBS([dlopen], [dl dld], [], [AC_MSG_ERROR([can not find required function dlopen()])]) |
| 171 | fi |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 172 | fi |
| 173 | |
| 174 | if test "$my_htop_platform" = openbsd; then |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 175 | AC_SEARCH_LIBS([kvm_open], [kvm], [], [AC_MSG_ERROR([can not find required function kvm_open()])]) |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 176 | fi |
| 177 | |
| 178 | if test "$my_htop_platform" = solaris; then |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 179 | AC_SEARCH_LIBS([kstat_open], [kstat], [], [AC_MSG_ERROR([can not find required function kstat_open()])]) |
| 180 | AC_SEARCH_LIBS([Pgrab_error], [proc], [], [AC_MSG_ERROR([can not find required function Pgrab_error()])]) |
| 181 | AC_SEARCH_LIBS([free], [malloc], [], [AC_MSG_ERROR([can not find required function free()])]) |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 182 | fi |
| 183 | |
| 184 | # Optional Section |
| 185 | |
| 186 | AC_SEARCH_LIBS([clock_gettime], [rt]) |
| 187 | |
| 188 | AC_CHECK_FUNCS([ \ |
| 189 | clock_gettime \ |
| 190 | faccessat \ |
| 191 | fstatat \ |
| 192 | host_get_clock_service \ |
| Christian Göttsche | 7b1fa1b | 2020-12-25 11:03:15 +0100 | [diff] [blame] | 193 | memfd_create\ |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 194 | openat \ |
| 195 | readlinkat \ |
| 196 | ]) |
| 197 | |
| Christian Göttsche | 1d00893 | 2020-10-15 21:12:57 +0200 | [diff] [blame] | 198 | # Add -lexecinfo if needed |
| 199 | AC_SEARCH_LIBS([backtrace], [execinfo]) |
| 200 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 201 | if test "$my_htop_platform" = darwin; then |
| 202 | AC_CHECK_FUNCS([mach_timebase_info]) |
| 203 | fi |
| Christian Goettsche | c2fdfd9 | 2020-10-21 17:06:32 +0200 | [diff] [blame] | 204 | |
| Christian Göttsche | 575edff | 2021-01-22 19:14:59 +0100 | [diff] [blame] | 205 | if test "$my_htop_platform" = linux && test "x$enable_static" = xyes; then |
| 206 | AC_CHECK_LIB([systemd], [sd_bus_open_system]) |
| 207 | fi |
| 208 | |
| Hisham Muhammad | 300af4b | 2014-11-19 23:17:16 -0200 | [diff] [blame] | 209 | # ---------------------------------------------------------------------- |
| Hisham Muhammad | eb229d9 | 2014-11-24 18:55:03 -0200 | [diff] [blame] | 210 | |
| Hisham Muhammad | d6231ba | 2006-03-04 18:16:49 +0000 | [diff] [blame] | 211 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 212 | # ---------------------------------------------------------------------- |
| 213 | # Checks for cross-platform features and flags. |
| 214 | # ---------------------------------------------------------------------- |
| Hisham Muhammad | a5dfaa2 | 2008-09-23 04:31:13 +0000 | [diff] [blame] | 215 | |
| Hisham Muhammad | db68286 | 2015-12-09 17:17:30 -0200 | [diff] [blame] | 216 | # HTOP_CHECK_SCRIPT(LIBNAME, FUNCTION, DEFINE, CONFIG_SCRIPT, ELSE_PART) |
| 217 | m4_define([HTOP_CHECK_SCRIPT], |
| Hisham Muhammad | 96c929f | 2015-11-30 16:36:22 -0200 | [diff] [blame] | 218 | [ |
| Ricardo Martincoski | 78b82d0 | 2016-07-11 20:12:07 -0300 | [diff] [blame] | 219 | if test ! -z "m4_toupper($HTOP_[$1]_CONFIG_SCRIPT)"; then |
| 220 | # to be used to set the path to ncurses*-config when cross-compiling |
| Michael Klein | bc5d469 | 2018-02-26 14:19:01 +0100 | [diff] [blame] | 221 | htop_config_script_libs=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --libs 2> /dev/null) |
| 222 | htop_config_script_cflags=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --cflags 2> /dev/null) |
| Ricardo Martincoski | 78b82d0 | 2016-07-11 20:12:07 -0300 | [diff] [blame] | 223 | else |
| Michael Klein | bc5d469 | 2018-02-26 14:19:01 +0100 | [diff] [blame] | 224 | htop_config_script_libs=$([$4] --libs 2> /dev/null) |
| 225 | htop_config_script_cflags=$([$4] --cflags 2> /dev/null) |
| Ricardo Martincoski | 78b82d0 | 2016-07-11 20:12:07 -0300 | [diff] [blame] | 226 | fi |
| Hisham Muhammad | db68286 | 2015-12-09 17:17:30 -0200 | [diff] [blame] | 227 | htop_script_success=no |
| Michael Klein | bc5d469 | 2018-02-26 14:19:01 +0100 | [diff] [blame] | 228 | htop_save_CFLAGS="$CFLAGS" |
| 229 | if test ! "x$htop_config_script_libs" = x; then |
| Michael Klein | bc5d469 | 2018-02-26 14:19:01 +0100 | [diff] [blame] | 230 | CFLAGS="$htop_config_script_cflags $CFLAGS" |
| Hisham Muhammad | db68286 | 2015-12-09 17:17:30 -0200 | [diff] [blame] | 231 | AC_CHECK_LIB([$1], [$2], [ |
| 232 | AC_DEFINE([$3], 1, [The library is present.]) |
| Michael Klein | bc5d469 | 2018-02-26 14:19:01 +0100 | [diff] [blame] | 233 | LIBS="$htop_config_script_libs $LIBS " |
| Hisham Muhammad | db68286 | 2015-12-09 17:17:30 -0200 | [diff] [blame] | 234 | htop_script_success=yes |
| Michael Klein | bc5d469 | 2018-02-26 14:19:01 +0100 | [diff] [blame] | 235 | ], [ |
| Benny Baumann | 880eeca | 2020-12-12 19:49:52 +0100 | [diff] [blame] | 236 | CFLAGS="$htop_save_CFLAGS" |
| Christian Göttsche | 575edff | 2021-01-22 19:14:59 +0100 | [diff] [blame] | 237 | ], [ |
| 238 | $htop_config_script_libs |
| Michael Klein | bc5d469 | 2018-02-26 14:19:01 +0100 | [diff] [blame] | 239 | ]) |
| Hisham Muhammad | c237702 | 2015-12-06 19:06:23 -0200 | [diff] [blame] | 240 | fi |
| Hisham Muhammad | cccc18d | 2015-12-09 17:34:57 -0200 | [diff] [blame] | 241 | if test "x$htop_script_success" = xno; then |
| Hisham Muhammad | db68286 | 2015-12-09 17:17:30 -0200 | [diff] [blame] | 242 | [$5] |
| 243 | fi |
| 244 | ]) |
| 245 | |
| 246 | # HTOP_CHECK_LIB(LIBNAME, FUNCTION, DEFINE, ELSE_PART) |
| 247 | m4_define([HTOP_CHECK_LIB], |
| 248 | [ |
| Hisham Muhammad | 96c929f | 2015-11-30 16:36:22 -0200 | [diff] [blame] | 249 | AC_CHECK_LIB([$1], [$2], [ |
| Christian Göttsche | 575edff | 2021-01-22 19:14:59 +0100 | [diff] [blame] | 250 | AC_DEFINE([$3], [1], [The library is present.]) |
| Hisham Muhammad | db68286 | 2015-12-09 17:17:30 -0200 | [diff] [blame] | 251 | LIBS="-l[$1] $LIBS " |
| 252 | ], [$4]) |
| Hisham Muhammad | 96c929f | 2015-11-30 16:36:22 -0200 | [diff] [blame] | 253 | ]) |
| 254 | |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 255 | AC_ARG_ENABLE([unicode], |
| 256 | [AS_HELP_STRING([--enable-unicode], |
| 257 | [enable Unicode support @<:@default=yes@:>@])], |
| 258 | [], |
| 259 | [enable_unicode=yes]) |
| Hisham Muhammad | 8fa33dc | 2008-03-09 02:33:23 +0000 | [diff] [blame] | 260 | if test "x$enable_unicode" = xyes; then |
| Christian Göttsche | fd8c061 | 2021-01-28 17:40:33 +0100 | [diff] [blame] | 261 | HTOP_CHECK_SCRIPT([ncursesw6], [waddwstr], [HAVE_LIBNCURSESW], "ncursesw6-config", |
| 262 | HTOP_CHECK_SCRIPT([ncursesw], [waddwstr], [HAVE_LIBNCURSESW], "ncursesw6-config", |
| 263 | HTOP_CHECK_SCRIPT([ncursesw], [wadd_wch], [HAVE_LIBNCURSESW], "ncursesw5-config", |
| 264 | HTOP_CHECK_SCRIPT([ncurses], [wadd_wch], [HAVE_LIBNCURSESW], "ncurses5-config", |
| 265 | HTOP_CHECK_LIB([ncursesw6], [addnwstr], [HAVE_LIBNCURSESW], |
| 266 | HTOP_CHECK_LIB([ncursesw], [addnwstr], [HAVE_LIBNCURSESW], |
| 267 | HTOP_CHECK_LIB([ncurses], [addnwstr], [HAVE_LIBNCURSESW], |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 268 | AC_MSG_ERROR([can not find required library libncursesw; you may want to use --disable-unicode]) |
| Diederik de Groot | b258d6e | 2017-04-19 16:12:17 +0200 | [diff] [blame] | 269 | ))))))) |
| Hisham Muhammad | db68286 | 2015-12-09 17:17:30 -0200 | [diff] [blame] | 270 | |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 271 | AC_CHECK_HEADERS([ncursesw/curses.h], [], |
| 272 | [AC_CHECK_HEADERS([ncurses/ncurses.h], [], |
| 273 | [AC_CHECK_HEADERS([ncurses/curses.h], [], |
| 274 | [AC_CHECK_HEADERS([ncurses.h], [], |
| 275 | [AC_MSG_ERROR([can not find required ncurses header file])])])])]) |
| Christian Göttsche | ead978b | 2020-12-07 15:30:56 +0100 | [diff] [blame] | 276 | |
| 277 | # check if additional linker flags are needed for keypad(3) |
| 278 | # (at this point we already link against a working ncurses library with wide character support) |
| 279 | AC_SEARCH_LIBS([keypad], [tinfow tinfo]) |
| Hisham Muhammad | 8fa33dc | 2008-03-09 02:33:23 +0000 | [diff] [blame] | 280 | else |
| Christian Göttsche | 575edff | 2021-01-22 19:14:59 +0100 | [diff] [blame] | 281 | HTOP_CHECK_SCRIPT([ncurses6], [wnoutrefresh], [HAVE_LIBNCURSES], [ncurses6-config], |
| 282 | HTOP_CHECK_SCRIPT([ncurses], [wnoutrefresh], [HAVE_LIBNCURSES], [ncurses5-config], |
| Christian Göttsche | fd8c061 | 2021-01-28 17:40:33 +0100 | [diff] [blame] | 283 | HTOP_CHECK_LIB([ncurses6], [doupdate], [HAVE_LIBNCURSES], |
| 284 | HTOP_CHECK_LIB([ncurses], [doupdate], [HAVE_LIBNCURSES], |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 285 | AC_MSG_ERROR([can not find required library libncurses]) |
| Hisham Muhammad | db68286 | 2015-12-09 17:17:30 -0200 | [diff] [blame] | 286 | )))) |
| Christian Göttsche | b92f62f | 2020-08-21 10:37:33 +0200 | [diff] [blame] | 287 | |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 288 | AC_CHECK_HEADERS([curses.h], [], |
| 289 | [AC_CHECK_HEADERS([ncurses/curses.h], [], |
| 290 | [AC_CHECK_HEADERS([ncurses/ncurses.h], [], |
| 291 | [AC_CHECK_HEADERS([ncurses.h] ,[], |
| 292 | [AC_MSG_ERROR([can not find required ncurses header file])])])])]) |
| Christian Göttsche | ead978b | 2020-12-07 15:30:56 +0100 | [diff] [blame] | 293 | |
| 294 | # check if additional linker flags are needed for keypad(3) |
| 295 | # (at this point we already link against a working ncurses library) |
| 296 | AC_SEARCH_LIBS([keypad], [tinfo]) |
| Hisham Muhammad | 4c51ad0 | 2007-08-10 05:07:14 +0000 | [diff] [blame] | 297 | fi |
| Christian Göttsche | 575edff | 2021-01-22 19:14:59 +0100 | [diff] [blame] | 298 | if test "$enable_static" = yes; then |
| 299 | AC_SEARCH_LIBS([Gpm_GetEvent], [gpm]) |
| 300 | fi |
| Hisham Muhammad | 4c51ad0 | 2007-08-10 05:07:14 +0000 | [diff] [blame] | 301 | |
| gmbroome | 697f5bb | 2018-03-02 16:20:46 -0500 | [diff] [blame] | 302 | |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 303 | AC_ARG_ENABLE([hwloc], |
| 304 | [AS_HELP_STRING([--enable-hwloc], |
| 305 | [enable hwloc support for CPU affinity; disables Linux affinity; requires libhwloc @<:@default=no@:>@])], |
| 306 | [], |
| 307 | [enable_hwloc=no]) |
| 308 | case "$enable_hwloc" in |
| 309 | no) |
| 310 | ;; |
| 311 | yes) |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 312 | AC_CHECK_LIB([hwloc], [hwloc_get_proc_cpubind], [], [AC_MSG_ERROR([can not find required library libhwloc])]) |
| 313 | AC_CHECK_HEADERS([hwloc.h], [], [AC_MSG_ERROR([can not find require header file hwloc.h])]) |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 314 | ;; |
| 315 | *) |
| 316 | AC_MSG_ERROR([bad value '$enable_hwloc' for --enable-hwloc]) |
| 317 | ;; |
| 318 | esac |
| Christian Göttsche | 005c4d1 | 2020-09-08 16:25:22 +0200 | [diff] [blame] | 319 | |
| Nathan Scott | 5b50ae3 | 2021-03-02 15:58:11 +1100 | [diff] [blame^] | 320 | AC_ARG_WITH([os-release], |
| 321 | [AS_HELP_STRING([--with-os-release=FILE], |
| 322 | [location of an os-release file @<:@default=/etc/os-release@:>@])], |
| 323 | [], |
| 324 | [with_os_release=/etc/os-release]) |
| 325 | if test -n "$with_os_release" -a ! -f "$with_os_release"; then |
| 326 | if test -f "/usr/lib/os-release"; then |
| 327 | with_os_release="/usr/lib/os-release" |
| 328 | fi |
| 329 | fi |
| 330 | AC_DEFINE_UNQUOTED([OSRELEASEFILE], ["$with_os_release"], [File with OS release details.]) |
| 331 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 332 | # ---------------------------------------------------------------------- |
| 333 | |
| 334 | |
| 335 | # ---------------------------------------------------------------------- |
| 336 | # Checks for Linux features and flags. |
| 337 | # ---------------------------------------------------------------------- |
| 338 | |
| 339 | AC_ARG_WITH([proc], |
| 340 | [AS_HELP_STRING([--with-proc=DIR], |
| 341 | [location of a Linux-compatible proc filesystem @<:@default=/proc@:>@])], |
| 342 | [], |
| 343 | [with_proc=/proc]) |
| 344 | if test -z "$with_proc"; then |
| 345 | AC_MSG_ERROR([bad empty value for --with-proc option]) |
| 346 | fi |
| 347 | AC_DEFINE_UNQUOTED([PROCDIR], ["$with_proc"], [Path of proc filesystem.]) |
| 348 | |
| 349 | |
| 350 | AC_ARG_ENABLE([openvz], |
| 351 | [AS_HELP_STRING([--enable-openvz], |
| 352 | [enable OpenVZ support @<:@default=no@:>@])], |
| 353 | [], |
| 354 | [enable_openvz=no]) |
| 355 | if test "x$enable_openvz" = xyes; then |
| 356 | AC_DEFINE([HAVE_OPENVZ], [1], [Define if openvz support enabled.]) |
| 357 | fi |
| 358 | |
| 359 | |
| 360 | AC_ARG_ENABLE([vserver], |
| 361 | [AS_HELP_STRING([--enable-vserver], |
| 362 | [enable VServer support @<:@default=no@:>@])], |
| 363 | [], |
| 364 | [enable_vserver=no]) |
| 365 | if test "x$enable_vserver" = xyes; then |
| 366 | AC_DEFINE([HAVE_VSERVER], [1], [Define if VServer support enabled.]) |
| 367 | fi |
| 368 | |
| 369 | |
| 370 | AC_ARG_ENABLE([ancient_vserver], |
| 371 | [AS_HELP_STRING([--enable-ancient-vserver], |
| 372 | [enable ancient VServer support (implies --enable-vserver) @<:@default=no@:>@])], |
| 373 | [], |
| 374 | [enable_ancient_vserver=no]) |
| 375 | if test "x$enable_ancient_vserver" = xyes; then |
| 376 | AC_DEFINE([HAVE_VSERVER], [1], [Define if VServer support enabled.]) |
| 377 | AC_DEFINE([HAVE_ANCIENT_VSERVER], [1], [Define if ancient vserver support enabled.]) |
| 378 | fi |
| 379 | |
| 380 | |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 381 | AC_ARG_ENABLE([linux_affinity], |
| 382 | [AS_HELP_STRING([--enable-linux-affinity], |
| 383 | [enable Linux sched_setaffinity and sched_getaffinity for affinity support, conflicts with hwloc @<:@default=check@:>@])], |
| 384 | [], |
| 385 | [enable_linux_affinity=check]) |
| Christian Göttsche | 005c4d1 | 2020-09-08 16:25:22 +0200 | [diff] [blame] | 386 | if test "x$enable_linux_affinity" = xcheck; then |
| 387 | if test "x$enable_hwloc" = xyes; then |
| 388 | enable_linux_affinity=no |
| 389 | else |
| 390 | AC_MSG_CHECKING([for usable sched_setaffinity]) |
| 391 | AC_RUN_IFELSE([ |
| 392 | AC_LANG_PROGRAM([[ |
| 393 | #include <sched.h> |
| 394 | #include <errno.h> |
| 395 | static cpu_set_t cpuset; |
| 396 | ]], [[ |
| 397 | CPU_ZERO(&cpuset); |
| 398 | sched_setaffinity(0, sizeof(cpu_set_t), &cpuset); |
| 399 | if (errno == ENOSYS) return 1; |
| 400 | ]])], |
| 401 | [enable_linux_affinity=yes |
| Benny Baumann | 880eeca | 2020-12-12 19:49:52 +0100 | [diff] [blame] | 402 | AC_MSG_RESULT([yes])], |
| Christian Göttsche | 005c4d1 | 2020-09-08 16:25:22 +0200 | [diff] [blame] | 403 | [enable_linux_affinity=no |
| Benny Baumann | 880eeca | 2020-12-12 19:49:52 +0100 | [diff] [blame] | 404 | AC_MSG_RESULT([no])], |
| Christian Göttsche | 005c4d1 | 2020-09-08 16:25:22 +0200 | [diff] [blame] | 405 | [AC_MSG_RESULT([yes (assumed while cross compiling)])]) |
| 406 | fi |
| Hisham Muhammad | dfad0af | 2011-11-23 18:43:35 +0000 | [diff] [blame] | 407 | fi |
| Hisham | 474d26c | 2016-02-14 19:57:29 -0200 | [diff] [blame] | 408 | if test "x$enable_linux_affinity" = xyes; then |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 409 | if test "x$enable_hwloc" = xyes; then |
| 410 | AC_MSG_ERROR([--enable-hwloc and --enable-linux-affinity are mutual exclusive. Specify at most one of them.]) |
| 411 | fi |
| 412 | AC_DEFINE([HAVE_LINUX_AFFINITY], [1], [Define if Linux sched_setaffinity and sched_getaffinity are to be used.]) |
| Hisham Muhammad | 7ca1081 | 2011-11-18 06:08:56 +0000 | [diff] [blame] | 413 | fi |
| 414 | |
| Hisham Muhammad | 543d65c | 2017-07-26 15:40:55 -0300 | [diff] [blame] | 415 | |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 416 | AC_ARG_ENABLE([capabilities], |
| 417 | [AS_HELP_STRING([--enable-capabilities], |
| 418 | [enable Linux capabilities support; requires libcap @<:@default=check@:>@])], |
| 419 | [], |
| 420 | [enable_capabilities=check]) |
| 421 | case "$enable_capabilities" in |
| 422 | no) |
| 423 | ;; |
| 424 | check) |
| 425 | enable_capabilities=yes |
| 426 | AC_CHECK_LIB([cap], [cap_init], [], [enable_capabilities=no]) |
| 427 | AC_CHECK_HEADERS([sys/capability.h], [], [enable_capabilities=no]) |
| 428 | ;; |
| 429 | yes) |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 430 | AC_CHECK_LIB([cap], [cap_init], [], [AC_MSG_ERROR([can not find required library libcap])]) |
| 431 | AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([can not find required header file sys/capability.h])]) |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 432 | ;; |
| 433 | *) |
| 434 | AC_MSG_ERROR([bad value '$enable_capabilities' for --enable-capabilities]) |
| 435 | ;; |
| 436 | esac |
| Christian Göttsche | f4404ef | 2020-09-02 14:39:25 +0200 | [diff] [blame] | 437 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 438 | |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 439 | AC_ARG_ENABLE([delayacct], |
| 440 | [AS_HELP_STRING([--enable-delayacct], |
| 441 | [enable Linux delay accounting support; requires pkg-config, libnl-3 and libnl-genl-3 @<:@default=check@:>@])], |
| 442 | [], |
| 443 | [enable_delayacct=check]) |
| 444 | case "$enable_delayacct" in |
| 445 | no) |
| 446 | ;; |
| 447 | check) |
| Christian Göttsche | 575edff | 2021-01-22 19:14:59 +0100 | [diff] [blame] | 448 | if test "$enable_static" = yes; then |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 449 | enable_delayacct=no |
| Christian Göttsche | 575edff | 2021-01-22 19:14:59 +0100 | [diff] [blame] | 450 | else |
| 451 | m4_ifdef([PKG_PROG_PKG_CONFIG], [ |
| 452 | enable_delayacct=yes |
| 453 | PKG_PROG_PKG_CONFIG() |
| 454 | PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [enable_delayacct=no]) |
| 455 | PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [enable_delayacct=no]) |
| 456 | if test "$enable_delayacct" = yes; then |
| 457 | CFLAGS="$CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS" |
| 458 | LIBS="$LIBS $LIBNL3_LIBS $LIBNL3GENL_LIBS" |
| 459 | AC_DEFINE([HAVE_DELAYACCT], [1], [Define if delay accounting support should be enabled.]) |
| 460 | fi |
| 461 | ], [ |
| 462 | enable_delayacct=no |
| 463 | AC_MSG_NOTICE([Linux delay accounting support can not be enabled, cause pkg-config is required for checking its availability]) |
| 464 | ]) |
| 465 | fi |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 466 | ;; |
| 467 | yes) |
| 468 | m4_ifdef([PKG_PROG_PKG_CONFIG], [ |
| 469 | PKG_PROG_PKG_CONFIG() |
| Christian Göttsche | 759a340 | 2021-01-22 19:14:55 +0100 | [diff] [blame] | 470 | PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [AC_MSG_ERROR([can not find required library libnl3])]) |
| 471 | PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [AC_MSG_ERROR([can not find required library libnl3genl])]) |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 472 | CFLAGS="$CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS" |
| 473 | LIBS="$LIBS $LIBNL3_LIBS $LIBNL3GENL_LIBS" |
| 474 | AC_DEFINE([HAVE_DELAYACCT], [1], [Define if delay accounting support should be enabled.]) |
| 475 | ], [ |
| 476 | pkg_m4_absent=1 |
| 477 | m4_warning([configure is generated without pkg.m4. 'make dist' target will be disabled.]) |
| 478 | 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.]) |
| 479 | ]) |
| 480 | ;; |
| 481 | *) |
| 482 | AC_MSG_ERROR([bad value '$enable_delayacct' for --enable-delayacct]) |
| 483 | ;; |
| 484 | esac |
| André Carvalho | b7b66b7 | 2017-12-04 00:15:29 -0200 | [diff] [blame] | 485 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 486 | |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 487 | AC_ARG_ENABLE([sensors], |
| 488 | [AS_HELP_STRING([--enable-sensors], |
| 489 | [enable libsensors support for reading temperature data; requires only libsensors headers at compile time, at runtime libsensors is loaded via dlopen @<:@default=check@:>@])], |
| 490 | [], |
| 491 | [enable_sensors=check]) |
| 492 | case "$enable_sensors" in |
| 493 | no) |
| 494 | ;; |
| 495 | check) |
| 496 | enable_sensors=yes |
| Christian Göttsche | 575edff | 2021-01-22 19:14:59 +0100 | [diff] [blame] | 497 | if test "$enable_static" = yes; then |
| 498 | AC_CHECK_LIB([sensors], [sensors_init], [], [enable_sensors=no]) |
| 499 | fi |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 500 | AC_CHECK_HEADERS([sensors/sensors.h], [], [enable_sensors=no]) |
| 501 | ;; |
| 502 | yes) |
| Christian Göttsche | 575edff | 2021-01-22 19:14:59 +0100 | [diff] [blame] | 503 | if test "$enable_static" = yes; then |
| 504 | AC_CHECK_LIB([sensors], [sensors_init], [], [AC_MSG_ERROR([can not find required library libsensors])]) |
| 505 | fi |
| 506 | AC_CHECK_HEADERS([sensors/sensors.h], [], [AC_MSG_ERROR([can not find required header file sensors/sensors.h])]) |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 507 | ;; |
| 508 | *) |
| 509 | AC_MSG_ERROR([bad value '$enable_sensors' for --enable-sensors]) |
| 510 | ;; |
| 511 | esac |
| 512 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 513 | # ---------------------------------------------------------------------- |
| 514 | |
| 515 | |
| 516 | # ---------------------------------------------------------------------- |
| 517 | # Checks for compiler warnings. |
| 518 | # ---------------------------------------------------------------------- |
| Christian Göttsche | 1b225cd | 2020-09-10 19:56:33 +0200 | [diff] [blame] | 519 | |
| Christian Göttsche | f4602f7 | 2020-09-08 14:25:46 +0200 | [diff] [blame] | 520 | AM_CFLAGS="\ |
| 521 | -Wall\ |
| 522 | -Wcast-align\ |
| Christian Göttsche | db47207 | 2020-10-04 14:30:35 +0200 | [diff] [blame] | 523 | -Wcast-qual\ |
| Christian Göttsche | f4602f7 | 2020-09-08 14:25:46 +0200 | [diff] [blame] | 524 | -Wextra\ |
| Benny Baumann | ba0fca1 | 2020-09-18 16:58:03 +0200 | [diff] [blame] | 525 | -Wfloat-equal\ |
| Christian Göttsche | c150e4b | 2020-12-18 15:49:37 +0100 | [diff] [blame] | 526 | -Wformat=2\ |
| Christian Göttsche | 4dadbe3 | 2021-01-21 19:49:07 +0100 | [diff] [blame] | 527 | -Winit-self\ |
| Christian Göttsche | f4602f7 | 2020-09-08 14:25:46 +0200 | [diff] [blame] | 528 | -Wmissing-format-attribute\ |
| 529 | -Wmissing-noreturn\ |
| Christian Göttsche | 4e282eb | 2020-09-25 14:03:55 +0200 | [diff] [blame] | 530 | -Wmissing-prototypes\ |
| Christian Göttsche | f4602f7 | 2020-09-08 14:25:46 +0200 | [diff] [blame] | 531 | -Wpointer-arith\ |
| 532 | -Wshadow\ |
| 533 | -Wstrict-prototypes\ |
| 534 | -Wundef\ |
| 535 | -Wunused\ |
| 536 | -Wwrite-strings" |
| 537 | |
| Christian Göttsche | 64a1ab8 | 2021-02-05 15:20:00 +0100 | [diff] [blame] | 538 | # FreeBSD uses C11 _Generic in its isnan implementation, even with -std=c99 |
| 539 | if test "$my_htop_platform" = freebsd; then |
| 540 | AM_CFLAGS="$AM_CFLAGS -Wno-c11-extensions" |
| 541 | fi |
| 542 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 543 | dnl https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html |
| 544 | AC_DEFUN([AX_CHECK_COMPILE_FLAG], |
| Christian Göttsche | 38b6a01 | 2021-01-22 19:14:53 +0100 | [diff] [blame] | 545 | [ |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 546 | AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl |
| 547 | AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ |
| 548 | ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS |
| 549 | _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" |
| 550 | AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], |
| 551 | [AS_VAR_SET(CACHEVAR,[yes])], |
| 552 | [AS_VAR_SET(CACHEVAR,[no])]) |
| 553 | _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) |
| 554 | AS_VAR_IF(CACHEVAR,yes, |
| 555 | [m4_default([$2], :)], |
| 556 | [m4_default([$3], :)]) |
| 557 | AS_VAR_POPDEF([CACHEVAR])dnl |
| 558 | ])dnl AX_CHECK_COMPILE_FLAGS |
| 559 | |
| Benny Baumann | 2cde4a7 | 2020-09-18 19:32:41 +0200 | [diff] [blame] | 560 | AX_CHECK_COMPILE_FLAG([-Wnull-dereference], [AM_CFLAGS="$AM_CFLAGS -Wnull-dereference"], , [-Werror]) |
| 561 | |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 562 | AC_ARG_ENABLE([werror], |
| 563 | [AS_HELP_STRING([--enable-werror], |
| 564 | [Treat warnings as errors @<:@default=no@:>@])], |
| 565 | [], |
| 566 | [enable_werror=no]) |
| 567 | if test "x$enable_werror" = xyes; then |
| 568 | AM_CFLAGS="$AM_CFLAGS -Werror" |
| 569 | fi |
| 570 | |
| 571 | AC_ARG_ENABLE([debug], |
| 572 | [AS_HELP_STRING([--enable-debug], |
| Daniel Lange | 135efd5 | 2021-02-16 11:22:02 +0100 | [diff] [blame] | 573 | [Enable compiling with maximum debug info, asserts and internal sanity checks @<:@default=no@:>@])], |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 574 | [], |
| 575 | [enable_debug=no]) |
| 576 | if test "x$enable_debug" != xyes; then |
| 577 | AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG" |
| Daniel Lange | 135efd5 | 2021-02-16 11:22:02 +0100 | [diff] [blame] | 578 | else |
| 579 | AM_CPPFLAGS="$AM_CPPFLAGS -ggdb3" |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 580 | fi |
| Christian Göttsche | b7f6329 | 2020-09-17 22:23:05 +0200 | [diff] [blame] | 581 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 582 | |
| Christian Göttsche | 57254cd | 2020-08-21 10:37:20 +0200 | [diff] [blame] | 583 | AC_SUBST([AM_CFLAGS]) |
| Christian Göttsche | b7f6329 | 2020-09-17 22:23:05 +0200 | [diff] [blame] | 584 | AC_SUBST([AM_CPPFLAGS]) |
| 585 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 586 | # ---------------------------------------------------------------------- |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 587 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 588 | |
| 589 | # ---------------------------------------------------------------------- |
| Hisham Muhammad | 300af4b | 2014-11-19 23:17:16 -0200 | [diff] [blame] | 590 | # We're done, let's go! |
| 591 | # ---------------------------------------------------------------------- |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 592 | |
| 593 | AC_DEFINE_UNQUOTED([COPYRIGHT], ["(C) 2004-2019 Hisham Muhammad. (C) 2020-2021 htop dev team."], [Copyright message.]) |
| 594 | |
| Hisham Muhammad | a75161f | 2014-11-24 20:11:33 -0200 | [diff] [blame] | 595 | AM_CONDITIONAL([HTOP_LINUX], [test "$my_htop_platform" = linux]) |
| Hisham Muhammad | 8915b29 | 2014-11-27 16:27:34 -0200 | [diff] [blame] | 596 | AM_CONDITIONAL([HTOP_FREEBSD], [test "$my_htop_platform" = freebsd]) |
| Diederik de Groot | b258d6e | 2017-04-19 16:12:17 +0200 | [diff] [blame] | 597 | AM_CONDITIONAL([HTOP_DRAGONFLYBSD], [test "$my_htop_platform" = dragonflybsd]) |
| Michael McConville | a9a5a53 | 2015-09-18 00:46:48 -0400 | [diff] [blame] | 598 | AM_CONDITIONAL([HTOP_OPENBSD], [test "$my_htop_platform" = openbsd]) |
| David Hunt | 70e7c8d | 2015-07-12 13:47:43 -0500 | [diff] [blame] | 599 | AM_CONDITIONAL([HTOP_DARWIN], [test "$my_htop_platform" = darwin]) |
| gmbroome | 697f5bb | 2018-03-02 16:20:46 -0500 | [diff] [blame] | 600 | AM_CONDITIONAL([HTOP_SOLARIS], [test "$my_htop_platform" = solaris]) |
| Hisham Muhammad | a75161f | 2014-11-24 20:11:33 -0200 | [diff] [blame] | 601 | AM_CONDITIONAL([HTOP_UNSUPPORTED], [test "$my_htop_platform" = unsupported]) |
| Christian Göttsche | 38b6a01 | 2021-01-22 19:14:53 +0100 | [diff] [blame] | 602 | |
| Hisham Muhammad | eb229d9 | 2014-11-24 18:55:03 -0200 | [diff] [blame] | 603 | AC_SUBST(my_htop_platform) |
| Daniel Lange | e172282 | 2020-08-24 21:37:28 +0200 | [diff] [blame] | 604 | AC_CONFIG_FILES([Makefile htop.1]) |
| Hisham Muhammad | d6231ba | 2006-03-04 18:16:49 +0000 | [diff] [blame] | 605 | AC_OUTPUT |
| Hisham Muhammad | c39f18a | 2017-07-10 20:14:25 -0300 | [diff] [blame] | 606 | |
| Christian Göttsche | f3623b7 | 2021-01-22 19:14:50 +0100 | [diff] [blame] | 607 | if test "$my_htop_platform" = unsupported; then |
| Hisham Muhammad | c39f18a | 2017-07-10 20:14:25 -0300 | [diff] [blame] | 608 | echo "" |
| 609 | echo "****************************************************************" |
| 610 | echo "WARNING! This platform is not currently supported by htop." |
| 611 | echo "" |
| 612 | echo "The code will build, but it will produce a dummy version of htop" |
| 613 | echo "which shows no processes, using the files from the unsupported/" |
| 614 | echo "directory. This is meant to be a skeleton, to be used as a" |
| 615 | echo "starting point if you are porting htop to a new platform." |
| 616 | echo "****************************************************************" |
| 617 | echo "" |
| 618 | fi |
| Christian Göttsche | 3b084db | 2020-08-28 12:10:31 +0200 | [diff] [blame] | 619 | |
| 620 | AC_MSG_RESULT([ |
| 621 | ${PACKAGE_NAME} ${VERSION} |
| 622 | |
| Christian Göttsche | ffd90c2 | 2020-10-05 12:29:31 +0200 | [diff] [blame] | 623 | platform: $my_htop_platform |
| Nathan Scott | 5b50ae3 | 2021-03-02 15:58:11 +1100 | [diff] [blame^] | 624 | os-release file: $with_os_release |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 625 | (Linux) proc directory: $with_proc |
| Christian Göttsche | ffd90c2 | 2020-10-05 12:29:31 +0200 | [diff] [blame] | 626 | (Linux) openvz: $enable_openvz |
| Christian Göttsche | ffd90c2 | 2020-10-05 12:29:31 +0200 | [diff] [blame] | 627 | (Linux) vserver: $enable_vserver |
| 628 | (Linux) ancient vserver: $enable_ancient_vserver |
| Christian Göttsche | ffd90c2 | 2020-10-05 12:29:31 +0200 | [diff] [blame] | 629 | (Linux) affinity: $enable_linux_affinity |
| 630 | (Linux) delay accounting: $enable_delayacct |
| Christian Göttsche | 5e103ff | 2021-01-22 19:14:46 +0100 | [diff] [blame] | 631 | (Linux) sensors: $enable_sensors |
| 632 | (Linux) capabilities: $enable_capabilities |
| Christian Göttsche | ffd90c2 | 2020-10-05 12:29:31 +0200 | [diff] [blame] | 633 | unicode: $enable_unicode |
| Daniel Lange | 309f1d7 | 2020-11-16 13:29:37 +0100 | [diff] [blame] | 634 | hwloc: $enable_hwloc |
| Daniel Lange | a8a723f | 2020-11-16 17:01:51 +0100 | [diff] [blame] | 635 | debug: $enable_debug |
| Christian Göttsche | 575edff | 2021-01-22 19:14:59 +0100 | [diff] [blame] | 636 | static: $enable_static |
| Christian Göttsche | 3b084db | 2020-08-28 12:10:31 +0200 | [diff] [blame] | 637 | ]) |