File: x_ac_setproctitle.m4

package info (click to toggle)
slurm-wlm-contrib 24.11.5-2
  • links: PTS, VCS
  • area: contrib
  • in suites: trixie
  • size: 50,596 kB
  • sloc: ansic: 529,598; exp: 64,795; python: 17,051; sh: 9,411; javascript: 6,528; makefile: 4,030; perl: 3,762; pascal: 131
file content (41 lines) | stat: -rw-r--r-- 1,195 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
##*****************************************************************************
#  AUTHOR:
#    Mark Grondona <mgrondona@llnl.gov>
#
#  SYNOPSIS:
#    X_AC_SETPROCTITLE
#
#  DESCRIPTION:
#    Check for setproctitle() system call or emulation.
#
#  WARNINGS:
#    This macro must be placed after AC_PROG_CC or equivalent.
##*****************************************************************************
dnl
dnl Perform checks related to setproctitle() emulation
dnl
AC_DEFUN([X_AC_SETPROCTITLE],
[
#
case "$host" in
*-*-linux*)
     AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
     AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
     ;;
*)
     AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_NONE,
               [Define to the setproctitle() emulation type])
     AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0',
               [Define if you need setproctitle padding])
     ;;
esac

AC_MSG_CHECKING([for __progname])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[extern char *__progname; puts(__progname);]])],[ac_have__progname=yes
],[])
AC_MSG_RESULT(${ac_have__progname=no})
if test "$ac_have__progname" = "yes"; then
  AC_DEFINE([HAVE__PROGNAME], 1, [Define if you have __progname.])
fi

])