From: Todd C. Miller Date: Wed, 2 Apr 2003 18:15:25 +0000 (+0000) Subject: Add checks for getprognam(), __progname and err.h X-Git-Tag: SUDO_1_6_8~355 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d64a83b41eafad89fb29defc971aa40dc44bfae1;p=sudo Add checks for getprognam(), __progname and err.h --- diff --git a/config.h.in b/config.h.in index b83a6164c..cbcc2200d 100644 --- a/config.h.in +++ b/config.h.in @@ -75,6 +75,9 @@ /* Define to 1 if you have the `dispcrypt' function. */ #undef HAVE_DISPCRYPT +/* Define to 1 if you have the header file. */ +#undef HAVE_ERR_H + /* Define to 1 if you have the `flock' function. */ #undef HAVE_FLOCK @@ -103,6 +106,9 @@ /* Define to 1 if you have the `getifaddrs' function. */ #undef HAVE_GETIFADDRS +/* Define to 1 if you have the `getprogname' function. */ +#undef HAVE_GETPROGNAME + /* Define if you have the `getprpwnam' function. (SecureWare-style shadow passwords) */ #undef HAVE_GETPRPWNAM @@ -324,6 +330,9 @@ /* Define to 1 if you have the `_innetgr' function. */ #undef HAVE__INNETGR +/* Define if your crt0.o defines the __progname symbol for you. */ +#undef HAVE___PROGNAME + /* Define if you want the hostname to be entered into the log file. */ #undef HOST_IN_LOG diff --git a/configure.in b/configure.in index 623492b5f..d131cd341 100644 --- a/configure.in +++ b/configure.in @@ -1587,6 +1587,7 @@ dnl AC_HEADER_STDC AC_HEADER_DIRENT AC_CHECK_HEADERS(malloc.h paths.h utime.h netgroup.h sys/sockio.h sys/bsdtypes.h sys/select.h) +AC_CHECK_HEADERS(err.h, , [AC_LIBOBJ(err)]) dnl ultrix termio/termios are broken if test "$OS" != "ultrix"; then AC_SYS_POSIX_TERMIOS @@ -1692,7 +1693,21 @@ dnl if test "$with_DCE" = "yes" -o "$ac_cv_prog_YACC" = "bison -y"; then AC_FUNC_ALLOCA fi - +dnl +dnl Check for getprogname() or __progname +dnl +AC_CHECK_FUNCS(getprogname, , [ + AC_MSG_CHECKING([for __progname]) + AC_CACHE_VAL(sudo_cv___progname, [ + AC_TRY_LINK(, [extern char *__progname; (void)puts(__progname);], + [sudo_cv___progname=yes], [sudo_cv___progname=no])]) + if test "$sudo_cv___progname" = "yes"; then + AC_DEFINE(HAVE___PROGNAME, 1, [Define if your crt0.o defines the __progname symbol for you.]) + else + AC_LIBOBJ(getprogname) + fi + AC_MSG_RESULT($sudo_cv___progname) +]) dnl dnl Kerberos IV dnl