blob: bf7b4c959b8f2f37512e2083a9cb4b1a2ebff189 [file] [log] [blame]
Hisham Muhammadd6231ba2006-03-04 18:16:49 +00001# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
Hisham Muhammadec17b702011-09-24 00:30:47 +00004AC_PREREQ(2.65)
Hisham Muhammadc50440f2018-02-04 20:13:55 +01005AC_INIT([htop],[2.1.0],[hisham@gobolinux.org])
Hisham Muhammadec17b702011-09-24 00:30:47 +00006
Hishamc37be402016-05-04 15:34:49 -03007SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
8year=$(date -u -d "@$SOURCE_DATE_EPOCH" "+%Y" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+%Y" 2>/dev/null || date -u "+%Y")
Hisham Muhammad3383d8e2015-01-21 23:27:31 -02009
Explorer09b71b07f2016-03-12 12:02:06 +080010AC_CONFIG_SRCDIR([htop.c])
11AC_CONFIG_AUX_DIR([.])
12AC_CONFIG_HEADERS([config.h])
13AC_CONFIG_MACRO_DIR([m4])
14
15# Required by hwloc scripts
Hisham Muhammadec17b702011-09-24 00:30:47 +000016AC_CANONICAL_TARGET
17
18AM_INIT_AUTOMAKE([1.11])
Hisham Muhammadd6231ba2006-03-04 18:16:49 +000019
20# Checks for programs.
Hisham Muhammad300af4b2014-11-19 23:17:16 -020021# ----------------------------------------------------------------------
Hisham Muhammadd6231ba2006-03-04 18:16:49 +000022AC_PROG_CC
Hisham Muhammad4df76d12008-03-05 09:46:47 +000023AM_PROG_CC_C_O
24
Explorer09b71b07f2016-03-12 12:02:06 +080025# Required by hwloc scripts
26AC_USE_SYSTEM_EXTENSIONS
27
Hisham Muhammadeb229d92014-11-24 18:55:03 -020028# Checks for platform.
29# ----------------------------------------------------------------------
James Clarkea9508272016-04-18 23:55:55 +010030case "$target_os" in
James Clarke2de52862016-04-18 23:57:30 +010031linux*|gnu*)
Hisham Muhammadeb229d92014-11-24 18:55:03 -020032 my_htop_platform=linux
33 ;;
James Clarkea9508272016-04-18 23:55:55 +010034freebsd*|kfreebsd*)
Hisham Muhammad8915b292014-11-27 16:27:34 -020035 my_htop_platform=freebsd
36 ;;
James Clarkea9508272016-04-18 23:55:55 +010037openbsd*)
Michael McConvillea9a5a532015-09-18 00:46:48 -040038 my_htop_platform=openbsd
39 ;;
Diederik de Grootb258d6e2017-04-19 16:12:17 +020040dragonfly*)
41 my_htop_platform=dragonflybsd
42 ;;
James Clarkea9508272016-04-18 23:55:55 +010043darwin*)
David Hunt70e7c8d2015-07-12 13:47:43 -050044 my_htop_platform=darwin
45 ;;
gmbroome697f5bb2018-03-02 16:20:46 -050046solaris*)
47 my_htop_platform=solaris
48 ;;
Hisham Muhammadeb229d92014-11-24 18:55:03 -020049*)
50 my_htop_platform=unsupported
51 ;;
52esac
Hisham Muhammadeb229d92014-11-24 18:55:03 -020053
Hisham Muhammadd6231ba2006-03-04 18:16:49 +000054# Checks for libraries.
Hisham Muhammad300af4b2014-11-19 23:17:16 -020055# ----------------------------------------------------------------------
Hisham Muhammade46f1422006-07-12 01:15:14 +000056AC_CHECK_LIB([m], [ceil], [], [missing_libraries="$missing_libraries libm"])
57
Hisham Muhammadd6231ba2006-03-04 18:16:49 +000058# Checks for header files.
Hisham Muhammad300af4b2014-11-19 23:17:16 -020059# ----------------------------------------------------------------------
Hisham Muhammadd6231ba2006-03-04 18:16:49 +000060AC_HEADER_DIRENT
61AC_HEADER_STDC
Hisham Muhammada0810562013-02-26 17:10:11 +000062AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h],[:],[
Hisham Muhammade46f1422006-07-12 01:15:14 +000063 missing_headers="$missing_headers $ac_header"
64])
Hisham Muhammad36ef1a92010-12-05 15:43:56 +000065AC_CHECK_HEADERS([execinfo.h],[:],[:])
Hisham Muhammade46f1422006-07-12 01:15:14 +000066
Kang-Che Sung (宋岡哲)c01f40e2018-02-26 21:15:05 +080067AC_HEADER_MAJOR
68dnl glibc 2.25 deprecates 'major' and 'minor' in <sys/types.h> and requires to
69dnl include <sys/sysmacros.h>. However the logic in AC_HEADER_MAJOR has not yet
70dnl been updated in Autoconf 2.69, so use a workaround:
71m4_version_prereq([2.70], [],
Jesind4ea7cd2018-02-26 18:07:52 -050072[if test "x$ac_cv_header_sys_mkdev_h" = xno; then
Kang-Che Sung (宋岡哲)c01f40e2018-02-26 21:15:05 +080073 AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
74 [Define to 1 if `major', `minor', and `makedev' are declared in <sys/sysmacros.h>.])])
75fi])
76
Hisham Muhammadd6231ba2006-03-04 18:16:49 +000077# Checks for typedefs, structures, and compiler characteristics.
Hisham Muhammad300af4b2014-11-19 23:17:16 -020078# ----------------------------------------------------------------------
Hisham Muhammadd6231ba2006-03-04 18:16:49 +000079AC_HEADER_STDBOOL
80AC_C_CONST
81AC_TYPE_PID_T
82AC_TYPE_UID_T
83
Hisham Muhammad300af4b2014-11-19 23:17:16 -020084# Checks for library functions and compiler features.
85# ----------------------------------------------------------------------
Hisham Muhammadd6231ba2006-03-04 18:16:49 +000086AC_FUNC_CLOSEDIR_VOID
Hisham Muhammadd6231ba2006-03-04 18:16:49 +000087AC_TYPE_SIGNAL
88AC_FUNC_STAT
89AC_CHECK_FUNCS([memmove strncasecmp strstr strdup])
90
Hisham Muhammad4df76d12008-03-05 09:46:47 +000091save_cflags="${CFLAGS}"
Hisham Muhammadd6231ba2006-03-04 18:16:49 +000092CFLAGS="${CFLAGS} -std=c99"
93AC_MSG_CHECKING([whether gcc -std=c99 option works])
Explorer09f0df28a2016-03-12 11:58:30 +080094AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
95 [AC_INCLUDES_DEFAULT], [[char *a; a = strdup("foo"); int i = 0; i++; // C99]])],
96 [AC_MSG_RESULT([yes])],
97 [AC_MSG_ERROR([htop is written in C99. A newer version of gcc is required.])])
Hisham Muhammad4df76d12008-03-05 09:46:47 +000098CFLAGS="$save_cflags"
Hisham Muhammadd6231ba2006-03-04 18:16:49 +000099
Hisham Muhammadaed9b9d2015-02-04 12:19:04 -0200100save_cflags="${CFLAGS}"
101CFLAGS="$CFLAGS -Wextra"
102AC_MSG_CHECKING([if compiler supports -Wextra])
Explorer09f0df28a2016-03-12 11:58:30 +0800103AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],[
Hisham Muhammadaed9b9d2015-02-04 12:19:04 -0200104 wextra_flag=-Wextra
105 AC_MSG_RESULT([yes])
106],[
107 wextra_flag=
108 AC_MSG_RESULT([no])
109])
110CFLAGS="$save_cflags"
111AC_SUBST(wextra_flag)
112
Hisham Muhammad300af4b2014-11-19 23:17:16 -0200113# Checks for features and flags.
114# ----------------------------------------------------------------------
Hisham Muhammadd6231ba2006-03-04 18:16:49 +0000115PROCDIR=/proc
Hisham Muhammadeb229d92014-11-24 18:55:03 -0200116
Explorer09f0df28a2016-03-12 11:58:30 +0800117AC_ARG_ENABLE(proc, [AS_HELP_STRING([--enable-proc], [use Linux-compatible proc filesystem])], enable_proc="yes", enable_proc="no")
Hisham Muhammadeb229d92014-11-24 18:55:03 -0200118if test "x$enable_proc" = xyes; then
Hisham Muhammada75161f2014-11-24 20:11:33 -0200119 # An enabled proc assumes we're emulating Linux.
120 my_htop_platform=linux
Hisham Muhammadeb229d92014-11-24 18:55:03 -0200121 AC_DEFINE(HAVE_PROC, 1, [Define if using a Linux-compatible proc filesystem.])
122fi
123
Explorer09f0df28a2016-03-12 11:58:30 +0800124AC_ARG_WITH(proc, [AS_HELP_STRING([--with-proc=DIR], [Location of a Linux-compatible proc filesystem (default=/proc).])],
Hisham Muhammadd6231ba2006-03-04 18:16:49 +0000125
Hisham Muhammadeb229d92014-11-24 18:55:03 -0200126if test -n "$withval"; then
127 AC_DEFINE_UNQUOTED(PROCDIR, "$withval", [Path of proc filesystem])
128 PROCDIR="$withval"
129fi,
130AC_DEFINE(PROCDIR, "/proc", [Path of proc filesystem]))
Hisham Muhammadd6231ba2006-03-04 18:16:49 +0000131
Hisham Muhammad300af4b2014-11-19 23:17:16 -0200132if test "x$cross_compiling" = xno; then
Hisham Muhammadeb229d92014-11-24 18:55:03 -0200133 if test "x$enable_proc" = xyes; then
134 AC_CHECK_FILE($PROCDIR/stat,,AC_MSG_ERROR(Cannot find $PROCDIR/stat. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.))
135 AC_CHECK_FILE($PROCDIR/meminfo,,AC_MSG_ERROR(Cannot find $PROCDIR/meminfo. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.))
136 fi
Hisham Muhammad300af4b2014-11-19 23:17:16 -0200137fi
138
Explorer09f0df28a2016-03-12 11:58:30 +0800139AC_ARG_ENABLE(openvz, [AS_HELP_STRING([--enable-openvz], [enable OpenVZ support])], ,enable_openvz="no")
Hisham Muhammad4c51ad02007-08-10 05:07:14 +0000140if test "x$enable_openvz" = xyes; then
Hisham Muhammad8fa33dc2008-03-09 02:33:23 +0000141 AC_DEFINE(HAVE_OPENVZ, 1, [Define if openvz support enabled.])
142fi
143
Explorer09f0df28a2016-03-12 11:58:30 +0800144AC_ARG_ENABLE(cgroup, [AS_HELP_STRING([--enable-cgroup], [enable cgroups support])], ,enable_cgroup="no")
Hisham Muhammad84ed4c02010-10-30 19:24:07 +0000145if test "x$enable_cgroup" = xyes; then
146 AC_DEFINE(HAVE_CGROUP, 1, [Define if cgroup support enabled.])
147fi
148
Explorer09f0df28a2016-03-12 11:58:30 +0800149AC_ARG_ENABLE(vserver, [AS_HELP_STRING([--enable-vserver], [enable VServer support])], ,enable_vserver="no")
Hisham Muhammada5dfaa22008-09-23 04:31:13 +0000150if test "x$enable_vserver" = xyes; then
151 AC_DEFINE(HAVE_VSERVER, 1, [Define if vserver support enabled.])
152fi
153
Explorer09f0df28a2016-03-12 11:58:30 +0800154AC_ARG_ENABLE(ancient_vserver, [AS_HELP_STRING([--enable-ancient-vserver], [enable ancient VServer support (implies --enable-vserver)])], ,enable_ancient_vserver="no")
Hisham Muhammada5dfaa22008-09-23 04:31:13 +0000155if test "x$enable_ancient_vserver" = xyes; then
156 AC_DEFINE(HAVE_VSERVER, 1, [Define if vserver support enabled.])
157 AC_DEFINE(HAVE_ANCIENT_VSERVER, 1, [Define if ancient vserver support enabled.])
158fi
159
Explorer09f0df28a2016-03-12 11:58:30 +0800160AC_ARG_ENABLE(taskstats, [AS_HELP_STRING([--enable-taskstats], [enable per-task IO Stats (taskstats kernel sup required)])], ,enable_taskstats="yes")
Hisham Muhammad12f4f092008-03-09 08:02:22 +0000161if test "x$enable_taskstats" = xyes; then
162 AC_DEFINE(HAVE_TASKSTATS, 1, [Define if taskstats support enabled.])
163fi
164
Hisham Muhammaddb682862015-12-09 17:17:30 -0200165# HTOP_CHECK_SCRIPT(LIBNAME, FUNCTION, DEFINE, CONFIG_SCRIPT, ELSE_PART)
166m4_define([HTOP_CHECK_SCRIPT],
Hisham Muhammad96c929f2015-11-30 16:36:22 -0200167[
Ricardo Martincoski78b82d02016-07-11 20:12:07 -0300168 if test ! -z "m4_toupper($HTOP_[$1]_CONFIG_SCRIPT)"; then
169 # to be used to set the path to ncurses*-config when cross-compiling
Michael Kleinbc5d4692018-02-26 14:19:01 +0100170 htop_config_script_libs=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --libs 2> /dev/null)
171 htop_config_script_cflags=$(m4_toupper($HTOP_[$1]_CONFIG_SCRIPT) --cflags 2> /dev/null)
Ricardo Martincoski78b82d02016-07-11 20:12:07 -0300172 else
Michael Kleinbc5d4692018-02-26 14:19:01 +0100173 htop_config_script_libs=$([$4] --libs 2> /dev/null)
174 htop_config_script_cflags=$([$4] --cflags 2> /dev/null)
Ricardo Martincoski78b82d02016-07-11 20:12:07 -0300175 fi
Hisham Muhammaddb682862015-12-09 17:17:30 -0200176 htop_script_success=no
177 htop_save_LDFLAGS="$LDFLAGS"
Michael Kleinbc5d4692018-02-26 14:19:01 +0100178 htop_save_CFLAGS="$CFLAGS"
179 if test ! "x$htop_config_script_libs" = x; then
180 LDFLAGS="$htop_config_script_libs $LDFLAGS"
181 CFLAGS="$htop_config_script_cflags $CFLAGS"
Hisham Muhammaddb682862015-12-09 17:17:30 -0200182 AC_CHECK_LIB([$1], [$2], [
183 AC_DEFINE([$3], 1, [The library is present.])
Michael Kleinbc5d4692018-02-26 14:19:01 +0100184 LIBS="$htop_config_script_libs $LIBS "
Hisham Muhammaddb682862015-12-09 17:17:30 -0200185 htop_script_success=yes
Michael Kleinbc5d4692018-02-26 14:19:01 +0100186 ], [
187 CFLAGS="$htop_save_CFLAGS"
188 ])
Hisham Muhammaddf9922a2018-02-17 14:50:55 -0200189 LDFLAGS="$htop_save_LDFLAGS"
Hisham Muhammadc2377022015-12-06 19:06:23 -0200190 fi
Hisham Muhammadcccc18d2015-12-09 17:34:57 -0200191 if test "x$htop_script_success" = xno; then
Hisham Muhammaddb682862015-12-09 17:17:30 -0200192 [$5]
193 fi
194])
195
196# HTOP_CHECK_LIB(LIBNAME, FUNCTION, DEFINE, ELSE_PART)
197m4_define([HTOP_CHECK_LIB],
198[
Hisham Muhammad96c929f2015-11-30 16:36:22 -0200199 AC_CHECK_LIB([$1], [$2], [
200 AC_DEFINE([$3], 1, [The library is present.])
Hisham Muhammaddb682862015-12-09 17:17:30 -0200201 LIBS="-l[$1] $LIBS "
202 ], [$4])
Hisham Muhammad96c929f2015-11-30 16:36:22 -0200203])
204
Explorer09f0df28a2016-03-12 11:58:30 +0800205AC_ARG_ENABLE(unicode, [AS_HELP_STRING([--enable-unicode], [enable Unicode support])], ,enable_unicode="yes")
Hisham Muhammad8fa33dc2008-03-09 02:33:23 +0000206if test "x$enable_unicode" = xyes; then
Hisham Muhammaddb682862015-12-09 17:17:30 -0200207 HTOP_CHECK_SCRIPT([ncursesw6], [addnwstr], [HAVE_LIBNCURSESW], "ncursesw6-config",
Diederik de Grootb258d6e2017-04-19 16:12:17 +0200208 HTOP_CHECK_SCRIPT([ncursesw], [addnwstr], [HAVE_LIBNCURSESW], "ncursesw6-config",
209 HTOP_CHECK_SCRIPT([ncursesw], [addnwstr], [HAVE_LIBNCURSESW], "ncursesw5-config",
210 HTOP_CHECK_SCRIPT([ncurses], [addnwstr], [HAVE_LIBNCURSESW], "ncurses5-config",
211 HTOP_CHECK_LIB([ncursesw6], [addnwstr], [HAVE_LIBNCURSESW],
212 HTOP_CHECK_LIB([ncursesw], [addnwstr], [HAVE_LIBNCURSESW],
213 HTOP_CHECK_LIB([ncurses], [addnwstr], [HAVE_LIBNCURSESW],
214 missing_libraries="$missing_libraries libncursesw"
215 AC_MSG_ERROR([You may want to use --disable-unicode or install libncursesw.])
216 )))))))
Hisham Muhammaddb682862015-12-09 17:17:30 -0200217
Hisham Muhammada7bcf1d2011-09-08 01:45:16 +0000218 AC_CHECK_HEADERS([ncursesw/curses.h],[:],
Hisham Muhammada0810562013-02-26 17:10:11 +0000219 [AC_CHECK_HEADERS([ncurses/ncurses.h],[:],
220 [AC_CHECK_HEADERS([ncurses/curses.h],[:],
221 [AC_CHECK_HEADERS([ncurses.h],[:],[missing_headers="$missing_headers $ac_header"])])])])
Hisham Muhammad8fa33dc2008-03-09 02:33:23 +0000222else
Hisham Muhammaddb682862015-12-09 17:17:30 -0200223 HTOP_CHECK_SCRIPT([ncurses6], [refresh], [HAVE_LIBNCURSES], "ncurses6-config",
224 HTOP_CHECK_SCRIPT([ncurses], [refresh], [HAVE_LIBNCURSES], "ncurses5-config",
225 HTOP_CHECK_LIB([ncurses6], [refresh], [HAVE_LIBNCURSES],
226 HTOP_CHECK_LIB([ncurses], [refresh], [HAVE_LIBNCURSES],
227 missing_libraries="$missing_libraries libncurses"
228 ))))
229
Hisham Muhammada0810562013-02-26 17:10:11 +0000230 AC_CHECK_HEADERS([curses.h],[:],
231 [AC_CHECK_HEADERS([ncurses/curses.h],[:],
232 [AC_CHECK_HEADERS([ncurses/ncurses.h],[:],
233 [AC_CHECK_HEADERS([ncurses.h],[:],[missing_headers="$missing_headers $ac_header"])])])])
Hisham Muhammad4c51ad02007-08-10 05:07:14 +0000234fi
235
Hisham Muhammad0aa485c2014-11-27 18:31:39 -0200236if test "$my_htop_platform" = "freebsd"; then
237 AC_CHECK_LIB([kvm], [kvm_open], [], [missing_libraries="$missing_libraries libkvm"])
238fi
239
Michael McConvillea9a5a532015-09-18 00:46:48 -0400240if test "$my_htop_platform" = "openbsd"; then
241 AC_CHECK_LIB([kvm], [kvm_open], [], [missing_libraries="$missing_libraries libkvm"])
242fi
243
gmbroome697f5bb2018-03-02 16:20:46 -0500244if test "$my_htop_platform" = "solaris"; then
245 AC_CHECK_LIB([kstat], [kstat_open], [], [missing_libraries="$missing_libraries libkstat"])
246fi
247
Explorer09f0df28a2016-03-12 11:58:30 +0800248AC_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")
Hisham474d26c2016-02-14 19:57:29 -0200249if test "x$enable_linux_affinity" = xyes -a "x$cross_compiling" = xno; then
Hisham Muhammad7ca10812011-11-18 06:08:56 +0000250 AC_MSG_CHECKING([for usable sched_setaffinity])
251 AC_RUN_IFELSE([
252 AC_LANG_PROGRAM([[
253 #include <sched.h>
254 #include <errno.h>
255 static cpu_set_t cpuset;
256 ]], [[
257 CPU_ZERO(&cpuset);
258 sched_setaffinity(0, sizeof(cpu_set_t), &cpuset);
259 if (errno == ENOSYS) return 1;
260 ]])],
Hisham Muhammaddfad0af2011-11-23 18:43:35 +0000261 [AC_MSG_RESULT([yes])],
Hisham474d26c2016-02-14 19:57:29 -0200262 [enable_linux_affinity=no
Hisham Muhammaddfad0af2011-11-23 18:43:35 +0000263 AC_MSG_RESULT([no])])
264fi
Hisham474d26c2016-02-14 19:57:29 -0200265if test "x$enable_linux_affinity" = xyes; then
266 AC_DEFINE(HAVE_LINUX_AFFINITY, 1, [Define if Linux sched_setaffinity and sched_getaffinity are to be used.])
Hisham Muhammad7ca10812011-11-18 06:08:56 +0000267fi
268
Explorer09f0df28a2016-03-12 11:58:30 +0800269AC_ARG_ENABLE(hwloc, [AS_HELP_STRING([--enable-hwloc], [enable hwloc support for CPU affinity])],, enable_hwloc="no")
Hisham Muhammadec17b702011-09-24 00:30:47 +0000270if test "x$enable_hwloc" = xyes
Hisham Muhammad9604e022010-11-22 12:24:46 +0000271then
Hisham474d26c2016-02-14 19:57:29 -0200272 AC_CHECK_LIB([hwloc], [hwloc_get_proc_cpubind], [], [missing_libraries="$missing_libraries libhwloc"])
Hisham Muhammadbc87a8f2011-11-21 02:52:41 +0000273 AC_CHECK_HEADERS([hwloc.h],[:], [missing_headers="$missing_headers $ac_header"])
Hisham Muhammad4df76d12008-03-05 09:46:47 +0000274fi
275
Hisham Muhammad543d65c2017-07-26 15:40:55 -0300276AC_ARG_ENABLE(setuid, [AS_HELP_STRING([--enable-setuid], [enable setuid support for platforms that need it])],, enable_setuid="no")
277if test "x$enable_setuid" = xyes
278then
279 AC_DEFINE(HAVE_SETUID_ENABLED, 1, [Define if setuid support should be enabled.])
280fi
281
André Carvalhob7b66b72017-12-04 00:15:29 -0200282AC_ARG_ENABLE(delayacct, [AS_HELP_STRING([--enable-delayacct], [enable linux delay accounting])],, enable_delayacct="no")
283if test "x$enable_delayacct" = xyes
284then
Hisham Muhammada32d7522018-02-05 10:22:16 +0100285 PKG_PROG_PKG_CONFIG()
André Carvalhob7b66b72017-12-04 00:15:29 -0200286 PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [missing_libraries="$missing_libraries libnl-3"])
287 PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [missing_libraries="$missing_libraries libnl-genl-3"])
Jesind4ea7cd2018-02-26 18:07:52 -0500288 CFLAGS="$CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS"
289 LIBS="$LIBS $LIBNL3_LIBS $LIBNL3GENL_LIBS"
André Carvalhob7b66b72017-12-04 00:15:29 -0200290 AC_DEFINE(HAVE_DELAYACCT, 1, [Define if delay accounting support should be enabled.])
291fi
292
293
Hisham Muhammad300af4b2014-11-19 23:17:16 -0200294# Bail out on errors.
295# ----------------------------------------------------------------------
296if test ! -z "$missing_libraries"; then
297 AC_MSG_ERROR([missing libraries: $missing_libraries])
298fi
299if test ! -z "$missing_headers"; then
300 AC_MSG_ERROR([missing headers: $missing_headers])
301fi
302
Hisham Muhammad3383d8e2015-01-21 23:27:31 -0200303AC_DEFINE_UNQUOTED(COPYRIGHT, "(C) 2004-$year Hisham Muhammad", [Copyright message.])
304
Hisham Muhammad300af4b2014-11-19 23:17:16 -0200305# We're done, let's go!
306# ----------------------------------------------------------------------
Hisham Muhammada75161f2014-11-24 20:11:33 -0200307AM_CONDITIONAL([HTOP_LINUX], [test "$my_htop_platform" = linux])
Hisham Muhammad8915b292014-11-27 16:27:34 -0200308AM_CONDITIONAL([HTOP_FREEBSD], [test "$my_htop_platform" = freebsd])
Diederik de Grootb258d6e2017-04-19 16:12:17 +0200309AM_CONDITIONAL([HTOP_DRAGONFLYBSD], [test "$my_htop_platform" = dragonflybsd])
Michael McConvillea9a5a532015-09-18 00:46:48 -0400310AM_CONDITIONAL([HTOP_OPENBSD], [test "$my_htop_platform" = openbsd])
David Hunt70e7c8d2015-07-12 13:47:43 -0500311AM_CONDITIONAL([HTOP_DARWIN], [test "$my_htop_platform" = darwin])
gmbroome697f5bb2018-03-02 16:20:46 -0500312AM_CONDITIONAL([HTOP_SOLARIS], [test "$my_htop_platform" = solaris])
Hisham Muhammada75161f2014-11-24 20:11:33 -0200313AM_CONDITIONAL([HTOP_UNSUPPORTED], [test "$my_htop_platform" = unsupported])
Hisham Muhammadeb229d92014-11-24 18:55:03 -0200314AC_SUBST(my_htop_platform)
Hisham Muhammaddd86b9b2009-06-23 14:02:14 +0000315AC_CONFIG_FILES([Makefile htop.1])
Hisham Muhammadd6231ba2006-03-04 18:16:49 +0000316AC_OUTPUT
Hisham Muhammadc39f18a2017-07-10 20:14:25 -0300317
318if test "$my_htop_platform" = "unsupported"
319then
320 echo ""
321 echo "****************************************************************"
322 echo "WARNING! This platform is not currently supported by htop."
323 echo ""
324 echo "The code will build, but it will produce a dummy version of htop"
325 echo "which shows no processes, using the files from the unsupported/"
326 echo "directory. This is meant to be a skeleton, to be used as a"
327 echo "starting point if you are porting htop to a new platform."
328 echo "****************************************************************"
329 echo ""
330fi