From: Todd C. Miller Date: Thu, 7 May 2015 13:34:50 +0000 (-0600) Subject: Add configure check for SIG2STR_MAX, which may be missing on UnixWare. X-Git-Tag: SUDO_1_8_14^2~150 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5647736ef5facda193e03c485427752624754e67;p=sudo Add configure check for SIG2STR_MAX, which may be missing on UnixWare. --- diff --git a/config.h.in b/config.h.in index e66d2b2ba..418b55461 100644 --- a/config.h.in +++ b/config.h.in @@ -133,6 +133,10 @@ don't. */ #undef HAVE_DECL_SETRESUID +/* Define to 1 if you have the declaration of `SIG2STR_MAX', and to 0 if you + don't. */ +#undef HAVE_DECL_SIG2STR_MAX + /* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you don't. */ #undef HAVE_DECL_SIZE_MAX diff --git a/configure b/configure index d3ee17e35..9fb7a8902 100755 --- a/configure +++ b/configure @@ -15878,7 +15878,7 @@ else # We add -Werror if it's gcc to force an error exit if the weak attribute # isn't understood - if test $GCC = yes; then : + if test "$GCC" = yes; then : save_CFLAGS=$CFLAGS CFLAGS=-Werror @@ -15908,7 +15908,7 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # Restore original CFLAGS - if test $GCC = yes; then : + if test "$GCC" = yes; then : CFLAGS=$save_CFLAGS fi @@ -21431,6 +21431,20 @@ do : if test "x$ac_cv_func_sig2str" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIG2STR 1 +_ACEOF + + ac_fn_c_check_decl "$LINENO" "SIG2STR_MAX" "ac_cv_have_decl_SIG2STR_MAX" " +# include + +" +if test "x$ac_cv_have_decl_SIG2STR_MAX" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SIG2STR_MAX $ac_have_decl _ACEOF else diff --git a/configure.ac b/configure.ac index 83e2488e8..d95ecea1c 100644 --- a/configure.ac +++ b/configure.ac @@ -3134,7 +3134,10 @@ AC_INCLUDES_DEFAULT dnl dnl Check for sig2str(), sys_signame or sys_sigabbrev dnl -AC_CHECK_FUNCS([sig2str], [], [ +AC_CHECK_FUNCS([sig2str], [ + AC_CHECK_DECLS(SIG2STR_MAX, [], [], [ +# include +])], [ AC_LIBOBJ(sig2str) SUDO_APPEND_COMPAT_EXP(sudo_sig2str) HAVE_SIGNAME="false" diff --git a/include/sudo_compat.h b/include/sudo_compat.h index dba659634..636086b2a 100644 --- a/include/sudo_compat.h +++ b/include/sudo_compat.h @@ -312,7 +312,7 @@ extern int errno; #endif /* For sig2str() */ -#ifndef HAVE_SIG2STR +#ifndef HAVE_DECL_SIG2STR_MAX # define SIG2STR_MAX 32 #endif