]> granicus.if.org Git - sudo/commitdiff
Add checks for getprognam(), __progname and err.h
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 2 Apr 2003 18:15:25 +0000 (18:15 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 2 Apr 2003 18:15:25 +0000 (18:15 +0000)
config.h.in
configure.in

index b83a6164c2364b7463f5ee706e4bf04c9ab4ec06..cbcc2200d0a358b2d1a5207586e44757eaa63180 100644 (file)
@@ -75,6 +75,9 @@
 /* Define to 1 if you have the `dispcrypt' function. */
 #undef HAVE_DISPCRYPT
 
+/* Define to 1 if you have the <err.h> header file. */
+#undef HAVE_ERR_H
+
 /* Define to 1 if you have the `flock' function. */
 #undef HAVE_FLOCK
 
 /* 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
 /* 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
 
index 623492b5f9d80243d840bb1f0845db84539adb35..d131cd3413aab4c218f8d833dc5c8782aa1f60a0 100644 (file)
@@ -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