2011-06-04 19:56:58 +05:30
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
2013-05-05 05:37:30 +05:30
AC_PREREQ([2.69])
2011-06-04 19:56:58 +05:30
AC_CONFIG_MACRO_DIR([m4])
2011-06-04 23:10:29 +05:30
AC_INIT([procps-ng],
2012-02-11 22:41:11 +05:30
m4_esyscmd([misc/git-version-gen .tarball-version]),
2015-05-10 10:27:50 +05:30
[procps@freelists.org],,[https://gitlab.com/procps-ng/procps])
2015-05-02 05:18:21 +05:30
AM_INIT_AUTOMAKE([foreign 1.11 subdir-objects -Wall -Wno-portability tar-pax no-dist-gzip dist-xz])
2013-08-13 18:51:33 +05:30
AM_SILENT_RULES([yes])
2011-10-12 00:32:59 +05:30
AC_CONFIG_SRCDIR([free.c])
2011-06-04 19:56:58 +05:30
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
2013-05-05 05:37:30 +05:30
AC_USE_SYSTEM_EXTENSIONS(_GNU_SOURCE)
AC_PROG_CXX
AC_PROG_AWK
2011-06-04 19:56:58 +05:30
AC_PROG_CC
2012-02-26 03:22:02 +05:30
AC_PROG_CC_STDC
2012-04-18 00:51:20 +05:30
if test "$cross_compiling" = no; then
if test "x$ac_cv_prog_cc_c99" = "xno" || test "x$ac_cv_prog_cc_c99" = "x"; then
# We might be on RHEL5 with a git checkout and so broken
# autoconf. Check if CC is gcc and if it bails when given -std=gnu99.
# If not, use that. Yuck.
if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
CC="$CC -std=gnu99"
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([],[[
return 0;
]])],
[],
[AC_MSG_ERROR([Could not find a C99 compatible compiler])])
else
AC_MSG_ERROR([Could not find a C99 compatible compiler])
fi
2012-02-26 03:22:02 +05:30
fi
fi
2011-06-04 19:56:58 +05:30
AM_PROG_CC_C_O
2013-05-05 05:37:30 +05:30
AC_PROG_CPP
2011-06-04 19:56:58 +05:30
AC_PROG_INSTALL
AC_PROG_LN_S
2012-01-24 23:31:15 +05:30
PKG_PROG_PKG_CONFIG
2013-05-05 05:37:30 +05:30
AC_PROG_MAKE_SET
2011-12-20 16:42:37 +05:30
2011-06-04 19:56:58 +05:30
# Checks for header files.
AC_HEADER_MAJOR
2013-05-05 05:37:30 +05:30
AC_CHECK_HEADERS([arpa/inet.h fcntl.h langinfo.h libintl.h limits.h locale.h netinet/in.h stdint.h stdio_ext.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/time.h termios.h unistd.h utmp.h values.h wchar.h wctype.h])
2011-06-04 19:56:58 +05:30
# Checks for typedefs, structures, and compiler characteristics.
2013-05-05 05:37:30 +05:30
AC_CHECK_HEADER_STDBOOL
AC_TYPE_UID_T
2011-06-04 19:56:58 +05:30
AC_C_INLINE
2013-05-05 05:37:30 +05:30
AC_TYPE_INT32_T
2011-06-04 19:56:58 +05:30
AC_TYPE_PID_T
2013-05-05 05:37:30 +05:30
AC_C_RESTRICT
2011-06-04 19:56:58 +05:30
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
2013-05-05 05:37:30 +05:30
AC_CHECK_MEMBERS([struct stat.st_rdev])
2011-06-04 19:56:58 +05:30
dnl libtool
LT_INIT
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MBRTOWC
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_STRTOD
2011-10-09 00:44:21 +05:30
AM_GNU_GETTEXT_VERSION([0.14.1])
AM_GNU_GETTEXT([external])
2014-09-15 19:00:08 +05:30
if test -d "$srcdir/po"
then
ALL_LINGUAS=`cd $srcdir/po > /dev/null && echo *.po | sed 's/\.po//g'`
else
ALL_LINGUAS="af am ar as be bg bn_IN bn ca cs cy da de el en_GB es et eu_ES fa fi fr gl gu he hi hr hu hy id is it ja ka kn ko ku lo lt lv mk ml mr ms my nb nl nn no nso or pa pl pt_BR pt ro ru si sk sl sq sr@Latn sr sv ta te th tr uk ur vi zh_CN zh_TW zu"
fi
2011-10-09 00:44:21 +05:30
2013-02-21 00:44:29 +05:30
AC_CHECK_HEADERS(error.h, [], [], AC_INCLUDES_DEFAULT)
2013-02-21 00:40:40 +05:30
AC_CHECK_HEADERS(stdio_ext.h, [], [], AC_INCLUDES_DEFAULT)
2013-02-20 23:01:48 +05:30
AC_MSG_CHECKING(whether program_invocation_name is defined)
AC_TRY_COMPILE([#include <errno.h>],
[program_invocation_name = "test";],
AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME, 1,
[Define if program_invocation_name is defined])
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
2011-10-27 03:59:48 +05:30
AC_MSG_CHECKING(whether program_invocation_short_name is defined)
2012-04-17 00:13:16 +05:30
AC_TRY_COMPILE([#include <errno.h>],
2011-10-27 03:59:48 +05:30
[program_invocation_short_name = "test";],
AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME, 1,
[Define if program_invocation_short_name is defined])
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
2011-10-09 00:44:21 +05:30
2013-05-05 05:37:30 +05:30
dnl watch8bit must be before the AC_ARG_WITH set as it sets up ncurses
AC_SUBST([WITH_WATCH8BIT])
AC_ARG_ENABLE([watch8bit],
2013-08-13 18:51:31 +05:30
AS_HELP_STRING([--enable-watch8bit], [enable watch to be 8bit clean (requires ncursesw)]),
[], [enable_watch8bit=no]
)
2013-05-05 05:37:30 +05:30
if test "$enable_watch8bit" = "yes"; then
AC_DEFINE([WITH_WATCH8BIT], [1], [Enable 8 bit clean watch])
fi
2013-08-07 21:22:38 +05:30
AC_ARG_ENABLE([libselinux],
2013-08-13 18:51:31 +05:30
AS_HELP_STRING([--enable-libselinux], [enable libselinux]),
[], [enable_libselinux=no]
)
2013-08-07 21:22:38 +05:30
if test "$enable_libselinux" = "yes"; then
AC_DEFINE([ENABLE_LIBSELINUX], [1], [Enable libselinux])
fi
2013-05-05 05:37:30 +05:30
# Optional packages - AC_ARG_WITH
2011-06-04 19:56:58 +05:30
AC_ARG_WITH([ncurses],
2011-10-26 16:59:44 +05:30
AS_HELP_STRING([--without-ncurses], [build only applications not needing ncurses]),
2013-08-13 18:51:31 +05:30
[], [with_ncurses=yes]
2011-06-04 19:56:58 +05:30
)
2011-10-27 03:23:55 +05:30
if test "x$with_ncurses" = xno; then
AM_CONDITIONAL(WITH_NCURSES, false)
else
2012-01-24 23:31:15 +05:30
PKG_CHECK_MODULES([NCURSES], [ncurses], [], [
AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
AC_CHECK_HEADERS(curses.h ncurses.h term.h, [], [have_ncurses=no], AC_INCLUDES_DEFAULT)
if test "x$have_ncurses" = xno; then
AC_MSG_ERROR([ncurses support missing/incomplete (for partial build use --without-ncurses)])
fi
NCURSES_LIBS="-lncurses"
])
2011-10-27 03:23:55 +05:30
AM_CONDITIONAL(WITH_NCURSES, true)
2011-12-20 16:42:37 +05:30
if test "$enable_watch8bit" = yes; then
2012-01-24 23:31:15 +05:30
PKG_CHECK_MODULES([NCURSESW], [ncursesw], [WATCH_NCURSES_LIBS="$NCURSESW_LIBS"], [
AC_CHECK_LIB([ncursesw], [addwstr], [WATCH_NCURSES_LIBS=-lncursesw],
[AC_MSG_ERROR([Cannot find ncurses wide library ncursesw with --enable-watch8bit])])
])
2011-12-20 16:42:37 +05:30
else
2012-01-24 23:31:15 +05:30
WATCH_NCURSES_LIBS="$NCURSES_LIBS"
2011-12-20 16:42:37 +05:30
fi
2011-06-04 19:56:58 +05:30
fi
AC_SUBST([NCURSES_LIBS])
2011-12-20 16:42:37 +05:30
AC_SUBST([WATCH_NCURSES_LIBS])
2011-06-04 19:56:58 +05:30
2013-05-05 05:37:30 +05:30
AC_ARG_WITH([systemd],
[AS_HELP_STRING([--with-systemd], [enable systemd support])],
2013-08-13 18:51:31 +05:30
[], [with_systemd=no]
)
2013-05-05 05:37:30 +05:30
if test "x$with_systemd" != xno; then
2013-08-07 15:27:24 +05:30
PKG_CHECK_MODULES([SYSTEMD], [libsystemd-login >= 206], [], [
AC_CHECK_LIB(systemd-login, sd_pid_get_slice, [have_systemd=yes], [have_systemd=no])
2013-05-05 05:37:30 +05:30
if test "x$have_systemd" = xno; then
2014-06-28 10:30:22 +05:30
AC_MSG_ERROR([systemd support missing/incomplete (requires >= 206)])
2013-05-05 05:37:30 +05:30
fi
SYSTEMD_LIBS="-lsystemd-login"
])
AM_CONDITIONAL(WITH_SYSTEMD, true)
AC_DEFINE(WITH_SYSTEMD, 1, [enable systemd support])
else
AM_CONDITIONAL(WITH_SYSTEMD, false)
fi
# AC_ARG_ENABLEs
2013-10-05 00:05:01 +05:30
AC_ARG_ENABLE([pidof],
AS_HELP_STRING([--disable-pidof], [do not build pidof]),
[], [enable_pidof=yes]
)
AM_CONDITIONAL(BUILD_PIDOF, test "x$enable_pidof" = xyes)
2011-10-04 23:46:46 +05:30
AC_ARG_ENABLE([kill],
AS_HELP_STRING([--disable-kill], [do not build kill]),
2013-08-13 18:51:31 +05:30
[], [enable_kill=yes]
2011-10-04 23:46:46 +05:30
)
AM_CONDITIONAL(BUILD_KILL, test "x$enable_kill" = xyes)
2011-12-02 19:02:14 +05:30
AM_CONDITIONAL(LINUX, test "x$host_os" = xlinux-gnu)
2011-10-04 23:46:46 +05:30
2012-03-16 01:59:13 +05:30
AC_ARG_ENABLE([skill],
AS_HELP_STRING([--enable-skill], [build skill and snice]),
2013-08-13 18:51:31 +05:30
[], [enable_skill=no]
2012-03-16 01:59:13 +05:30
)
2012-05-07 01:00:25 +05:30
AM_CONDITIONAL(BUILD_SKILL, test "x$enable_skill" = xyes)
2012-03-16 01:59:13 +05:30
2012-04-29 20:52:29 +05:30
AC_ARG_ENABLE([examples],
AS_HELP_STRING([--enable-examples], [add example files to installation]),
2013-08-13 18:51:31 +05:30
[], [enable_examples=no]
2012-04-29 20:52:29 +05:30
)
AM_CONDITIONAL(EXAMPLE_FILES, test "x$enable_examples" = xyes)
2013-01-29 11:30:00 +05:30
AC_ARG_ENABLE([sigwinch],
AS_HELP_STRING([--enable-sigwinch], [reduce impact of x-windows resize operations on top]),
2013-08-13 18:51:31 +05:30
[], [enable_sigwinch=no]
2013-01-29 11:30:00 +05:30
)
if test "x$enable_sigwinch" = xyes; then
AC_DEFINE(SIGNALS_LESS, 1, [reduce impact of x-windows resize operations on top])
fi
2013-05-14 10:30:00 +05:30
AC_ARG_ENABLE([wide-percent],
AS_HELP_STRING([--enable-wide-percent], [provide extra precision under %CPU and %MEM for top]),
2013-08-13 18:51:31 +05:30
[], [enable_wide_percent=no]
2013-05-14 10:30:00 +05:30
)
if test "x$enable_wide_percent" = xyes; then
AC_DEFINE(BOOST_PERCNT, 1, [provide extra precision under %CPU and %MEM for top])
fi
2013-05-14 10:30:00 +05:30
AC_ARG_ENABLE([wide-memory],
AS_HELP_STRING([--disable-wide-memory], [disable extra precision under memory fields for top]),
2013-08-13 18:51:31 +05:30
[], [enable_wide_memory=yes]
2013-05-14 10:30:00 +05:30
)
2013-08-13 20:14:54 +05:30
if test "x$enable_wide_memory" = xno; then
2013-05-14 10:30:00 +05:30
AC_DEFINE(NOBOOST_MEMS, 1, [disable extra precision under memory fields for top])
fi
2014-06-29 10:30:00 +05:30
AC_ARG_ENABLE([modern-top],
AS_HELP_STRING([--disable-modern-top], [disable new startup defaults, return to original top]),
[], [enable_modern_top=yes]
)
if test "x$enable_modern_top" = xno; then
AC_DEFINE(ORIG_TOPDEFS, 1, [disable new startup defaults, return to original top])
fi
2013-05-05 10:30:00 +05:30
DL_LIB=
2013-04-08 10:30:00 +05:30
AC_ARG_ENABLE([numa],
2013-04-25 10:30:00 +05:30
AS_HELP_STRING([--disable-numa], [disable NUMA/Node support in top]),
2013-08-13 18:51:31 +05:30
[], [enable_numa=yes]
)
if test "x$enable_numa" = xno; then
2013-04-25 10:30:00 +05:30
AC_DEFINE([NUMA_DISABLE], [1], [disable NUMA/Node support in top])
else
AC_SEARCH_LIBS([dlopen], [dl], [],
[AC_MSG_ERROR([dynamic linking unavailable, circumvent with --disable-numa])])
2013-10-01 08:06:58 +05:30
if test "x$ac_cv_search_dlopen" != "xnone required"; then
DL_LIB="$ac_cv_search_dlopen"
fi
2013-04-08 10:30:00 +05:30
fi
2013-05-05 10:30:00 +05:30
AC_SUBST([DL_LIB])
2013-04-08 10:30:00 +05:30
2011-10-05 00:10:19 +05:30
AC_ARG_ENABLE([w-from],
AS_HELP_STRING([--enable-w-from], [enable w from field by default]),
2013-08-13 18:51:31 +05:30
[], [enable_w_from=no]
2011-10-05 00:10:19 +05:30
)
if test "x$enable_w_from" = xyes; then
AC_DEFINE(W_SHOWFROM, 1, [enable w from field by default])
fi
2011-12-05 21:05:35 +05:30
AC_ARG_ENABLE([whining],
2012-02-25 14:31:36 +05:30
AS_HELP_STRING([--disable-whining], [do not print unnecessary warnings (slackware-ism)]),
2013-08-13 18:51:31 +05:30
[], [enable_whining=yes]
2011-12-05 21:05:35 +05:30
)
if test "x$enable_whining" = xyes; then
AC_DEFINE(BUILD_WITH_WHINE, 1, [should extra warnings be printed (slackware-ism)])
fi
2011-10-12 00:32:59 +05:30
if test x"$DEJAGNU" = x
then
2013-05-24 03:05:09 +05:30
DEJAGNU="/dev/null"
2011-10-12 00:32:59 +05:30
fi
AC_SUBST(DEJAGNU)
2011-11-23 16:14:51 +05:30
2013-05-05 05:37:30 +05:30
AC_CHECK_FUNCS([__fpending alarm atexit dup2 getpagesize gettimeofday iswprint memchr memmove memset munmap nl_langinfo putenv regcomp rpmatch select setlocale strcasecmp strchr strcspn strdup strerror strncasecmp strpbrk strrchr strspn strstr strtol strtoul strtoull strverscmp uname utmpname wcwidth])
AC_CONFIG_FILES([Makefile
include/Makefile
2015-05-02 09:58:53 +05:30
man-po/Makefile
po/Makefile.in
2013-05-05 05:37:30 +05:30
proc/libprocps.pc
2015-05-02 09:58:53 +05:30
testsuite/Makefile])
2011-06-04 19:56:58 +05:30
AC_OUTPUT