1##***************************************************************************** 2# AUTHOR: 3# Mark Grondona <mgrondona@llnl.gov> 4# 5# SYNOPSIS: 6# X_AC_SETPROCTITLE 7# 8# DESCRIPTION: 9# Check for setproctitle() system call or emulation. 10# 11# WARNINGS: 12# This macro must be placed after AC_PROG_CC or equivalent. 13##***************************************************************************** 14dnl 15dnl Perform checks related to setproctitle() emulation 16dnl 17AC_DEFUN([X_AC_SETPROCTITLE], 18[ 19# 20case "$host" in 21*-*-linux*) 22 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV) 23 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0') 24 ;; 25*) 26 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_NONE, 27 [Define to the setproctitle() emulation type]) 28 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0', 29 [Define if you need setproctitle padding]) 30 ;; 31esac 32 33AC_MSG_CHECKING([for __progname]) 34AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[extern char *__progname; puts(__progname);]])],[ac_have__progname=yes 35],[]) 36AC_MSG_RESULT(${ac_have__progname=no}) 37if test "$ac_have__progname" = "yes"; then 38 AC_DEFINE([HAVE__PROGNAME], 1, [Define if you have __progname.]) 39fi 40 41]) 42