Richard Marian Thomaiyar | 14fddef | 2018-07-13 23:55:56 +0530 | [diff] [blame] | 1 | From 02a143f0068cbc6cea71359169210fbb3606d4bb Mon Sep 17 00:00:00 2001 |
| 2 | From: Jackie Huang <jackie.huang@windriver.com> |
| 3 | Date: Mon, 18 Jan 2016 00:24:57 -0500 |
| 4 | Subject: [PATCH] configure: add option for ps |
| 5 | |
| 6 | The configure searches hardcoded host paths for PSPATH |
| 7 | and run ps commands to decide PSARG which will fail |
| 8 | on host without ps: |
| 9 | | configure: error: Cannot find ps in any of /usr/ucb /bin /usr/bin |
| 10 | |
| 11 | So add an option so we can specify the ps at configure |
| 12 | to avoid host contamination. |
| 13 | |
| 14 | Upstream-Status: Inappropriate [cross compile specific] |
| 15 | |
| 16 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> |
Andrew Geissler | f31b8bd | 2020-11-30 19:54:56 -0600 | [diff] [blame] | 17 | [AK: refactored for 4.4.3] |
| 18 | Signed-off-by: Armin Kuster <akuster808@gmail.com> |
Richard Marian Thomaiyar | 14fddef | 2018-07-13 23:55:56 +0530 | [diff] [blame] | 19 | |
Andrew Geissler | f31b8bd | 2020-11-30 19:54:56 -0600 | [diff] [blame] | 20 | Index: samhain-4.4.2/configure.ac |
| 21 | =================================================================== |
| 22 | --- samhain-4.4.2.orig/configure.ac |
| 23 | +++ samhain-4.4.2/configure.ac |
| 24 | @@ -743,56 +743,16 @@ then |
Richard Marian Thomaiyar | 14fddef | 2018-07-13 23:55:56 +0530 | [diff] [blame] | 25 | fi |
| 26 | AC_CHECK_HEADERS(gmp.h) |
| 27 | |
| 28 | -AC_MSG_CHECKING([for ps]) |
| 29 | -PS= |
| 30 | -for ff in /usr/ucb /bin /usr/bin; do |
| 31 | - if test -x "$ff/ps"; then |
| 32 | - PS="$ff/ps" |
| 33 | - AC_MSG_RESULT([$PS]) |
| 34 | - break |
| 35 | - fi |
| 36 | -done |
| 37 | -if test x$PS = x |
| 38 | -then |
| 39 | - AC_MSG_RESULT([no]) |
| 40 | - AC_MSG_ERROR([Cannot find ps in any of /usr/ucb /bin /usr/bin]) |
| 41 | -fi |
| 42 | -AC_DEFINE_UNQUOTED([PSPATH], _("$PS"), [Path to ps]) |
Andrew Geissler | f31b8bd | 2020-11-30 19:54:56 -0600 | [diff] [blame] | 43 | +AC_ARG_WITH(ps-path, |
| 44 | + [ --with-ps-path=PATH set path to ps command ], |
| 45 | + [ |
| 46 | + if test "x${withval}" != xno; then |
| 47 | + pspath="${withval}" |
| 48 | + AC_DEFINE_UNQUOTED([PSPATH], _("${pspath}"), [Path to ps]) |
| 49 | + AC_DEFINE_UNQUOTED([PSARG], _("ax"), [Argument for ps]) |
| 50 | + fi |
| 51 | + ]) |
| 52 | |
Richard Marian Thomaiyar | 14fddef | 2018-07-13 23:55:56 +0530 | [diff] [blame] | 53 | -AC_MSG_CHECKING([how to use ps]) |
| 54 | -$PS ax >/dev/null 2>&1 |
| 55 | -if test $? -eq 0; then |
| 56 | - case "$host_os" in |
| 57 | - *openbsd*) |
| 58 | - one=`$PS akx | wc -l` |
| 59 | - ;; |
| 60 | - *) |
| 61 | - one=`$PS ax | wc -l` |
| 62 | - ;; |
| 63 | - esac |
| 64 | -else |
| 65 | - one=0 |
| 66 | -fi |
| 67 | -$PS -e >/dev/null 2>&1 |
| 68 | -if test $? -eq 0; then |
| 69 | - two=`$PS -e | wc -l` |
| 70 | -else |
| 71 | - two=0 |
| 72 | -fi |
| 73 | -if test $one -ge $two |
| 74 | -then |
| 75 | - case "$host_os" in |
| 76 | - *openbsd*) |
| 77 | - PSARG="akx" |
| 78 | - ;; |
| 79 | - *) |
| 80 | - PSARG="ax" |
| 81 | - ;; |
| 82 | - esac |
| 83 | -else |
| 84 | - PSARG="-e" |
| 85 | -fi |
| 86 | -AC_DEFINE_UNQUOTED([PSARG], _("$PSARG"), [Argument for ps]) |
Richard Marian Thomaiyar | 14fddef | 2018-07-13 23:55:56 +0530 | [diff] [blame] | 87 | AC_MSG_RESULT([$PS $PSARG]) |
| 88 | |
| 89 | dnl ***************************************** |
Andrew Geissler | f31b8bd | 2020-11-30 19:54:56 -0600 | [diff] [blame] | 90 | Index: samhain-4.4.2/aclocal.m4 |
| 91 | =================================================================== |
| 92 | --- samhain-4.4.2.orig/aclocal.m4 |
| 93 | +++ samhain-4.4.2/aclocal.m4 |
| 94 | @@ -409,7 +409,7 @@ x_includes=NONE |
| 95 | x_libraries=NONE |
| 96 | DESTDIR= |
| 97 | SH_ENABLE_OPTS="selinux posix-acl asm ssp db-reload xml-log message-queue login-watch process-check port-check mounts-check logfile-monitor userfiles debug ptrace static network udp nocl stealth micro-stealth install-name identity khide suidcheck base largefile mail external-scripts encrypt srp dnmalloc ipv6 shellexpand suid" |
| 98 | -SH_WITH_OPTS="prelude libprelude-prefix database libwrap cflags libs console altconsole timeserver alttimeserver rnd egd-socket port logserver altlogserver signify pubkey-checksum gpg keyid checksum fp recipient sender trusted tmp-dir config-file log-file pid-file state-dir data-file html-file" |
| 99 | +SH_WITH_OPTS="prelude libprelude-prefix database libwrap cflags libs console altconsole timeserver alttimeserver rnd egd-socket port logserver altlogserver kcheck gpg keyid checksum fp recipient sender trusted tmp-dir config-file log-file pid-file state-dir data-file html-file ps-path" |
| 100 | |
| 101 | # Installation directory options. |
| 102 | # These are left unexpanded so users can "make install exec_prefix=/foo" |