]> granicus.if.org Git - sudo/commitdiff
Add checks for __func__ and __FUNCTION__ and mention that we now
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 22 Oct 2011 18:20:52 +0000 (14:20 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 22 Oct 2011 18:20:52 +0000 (14:20 -0400)
require a cpp that supports variadic macros.

README
config.h.in
configure
configure.in

diff --git a/README b/README
index 919c74a6565d97e06382a0e45a97ac4d34e99c08..d5a0b22ee6705005d4631cb69bcc3c3808fc130b 100644 (file)
--- a/README
+++ b/README
@@ -11,11 +11,10 @@ version.  The latest sudo may always be gotten via anonymous ftp from
 ftp.sudo.ws in the directory /pub/sudo/ or from the sudo web site,
 http://www.sudo.ws/
 
-The distribution is sudo-M.m.tar.gz where `M' is the major
-version number and `m' is the minor version number.
-BETA versions of sudo may also be available.  If you join
-the `sudo-workers' mailing list you will get the BETA announcements
-(see the `Mailing lists' section below).
+The distribution is sudo-M.m.tar.gz where `M' is the major version
+number and `m' is the minor version number.  BETA versions of sudo may
+also be available.  If you join the `sudo-workers' mailing list you
+will get the BETA announcements (see the `Mailing lists' section below).
 
 What's new
 ==========
@@ -28,22 +27,22 @@ If you are upgrading from an earlier version of Sudo, please see
 the UPGRADE file in the doc directory.
 
 For a history of sudo please see the HISTORY file in the doc directory.
+You can find a list of contributors to sudo in the doc/CONTRIBUTORS file.
 
 System requirements
 ===================
-To build sudo from the source distribution you need a nominally
-POSIX-compliant operating system (any modern version of BSD, Linux
-or UNIX should work), a working ANSI/ISO C compiler (C89 or higher),
-and the ar, make and ranlib utilities
+To build sudo from the source distribution you need a POSIX-compliant
+operating system (any modern version of BSD, Linux or Unix should
+work), an ANSI/ISO C compiler that supports variadic marcos (a C99
+feature) and the ar, make and ranlib utilities.
 
 If you wish to modify the parser then you will need flex version
 2.5.2 or later and either bison or byacc (sudo comes with a pre-flex'd
 tokenizer and pre-yacc'd grammar parser).  You'll also have to
 uncomment a few lines from the Makefile or run configure with the
---with-devel option.  You can get flex via anonymous ftp from
-ftp://ftp.ee.lbl.gov/pub/flex* as well as any GNU mirror.  You can
-get GNU bison from ftp://ftp.gnu.org/pub/gnu/bison/ or any GNU
-mirror.
+--with-devel option.  You can get flex from http://flex.sourceforge.net/.
+You can get GNU bison from ftp://ftp.gnu.org/pub/gnu/bison/ or any
+GNU mirror.
 
 Building the release
 ====================
index 7a9c248adcf534930d91f456598a76dc72b5e2c1..ecad06b172e3e20392d77be9708983dcce7dd9be 100644 (file)
 /* Define to 1 if you have the `_innetgr' function. */
 #undef HAVE__INNETGR
 
+/* Define to 1 if the compiler supports the C99 __func__ variable. */
+#undef HAVE___FUNC__
+
 /* Define to 1 if your crt0.o defines the __progname symbol for you. */
 #undef HAVE___PROGNAME
 
 /* Define for large files, on AIX-style hosts. */
 #undef _LARGE_FILES
 
+/* Define to __FUNCTION__ if your compiler support __FUNCTION__ but not
+   __func__ */
+#undef __func__
+
 /* Define to `signed' or nothing if compiler does not support a signed type
    qualifier. */
 #undef __signed
index e219c45b8dc9a25f3b85cde322f85e965258cb9f..a133ca6901506559c3f21a3ec1aab4747bbe8a19 100755 (executable)
--- a/configure
+++ b/configure
@@ -17552,6 +17552,74 @@ $as_echo "$sudo_cv___progname" >&6; }
 fi
 done
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__" >&5
+$as_echo_n "checking for __func__... " >&6; }
+if ${sudo_cv___func__+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+(void)puts(__func__);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  sudo_cv___func__=yes
+else
+  sudo_cv___func__=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sudo_cv___func__" >&5
+$as_echo "$sudo_cv___func__" >&6; }
+if test "$sudo_cv___func__" = "yes"; then
+    $as_echo "#define HAVE___FUNC__ 1" >>confdefs.h
+
+elif test -n "$GCC"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __FUNCTION__" >&5
+$as_echo_n "checking for __FUNCTION__... " >&6; }
+    if ${sudo_cv___FUNCTION__+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+(void)puts(__FUNCTION__);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  sudo_cv___FUNCTION__=yes
+else
+  sudo_cv___FUNCTION__=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sudo_cv___FUNCTION__" >&5
+$as_echo "$sudo_cv___FUNCTION__" >&6; }
+    if test "$sudo_cv___FUNCTION__" = "yes"; then
+       $as_echo "#define HAVE___FUNC__ 1" >>confdefs.h
+
+
+$as_echo "#define __func__ __FUNCTION__" >>confdefs.h
+
+    fi
+fi
 
 # gettext() and friends may be located in libc (Linux and Solaris)
 # or in libintl.  However, it is possible to have libintl installed
@@ -22419,5 +22487,6 @@ fi
 
 
 
+
 
 
index 530665ce082a1ee7abacee3420f4a59ff90f8fd2..a5f38120b01fc246ea56525e7bc2e91d9f29583f 100644 (file)
@@ -2206,6 +2206,25 @@ AC_CHECK_FUNCS(getprogname, , [
     fi
     AC_MSG_RESULT($sudo_cv___progname)
 ])
+dnl
+dnl Check for __func__ or __FUNCTION__
+dnl
+AC_MSG_CHECKING([for __func__])
+AC_CACHE_VAL(sudo_cv___func__, [
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void)puts(__func__);]])], [sudo_cv___func__=yes], [sudo_cv___func__=no])])
+AC_MSG_RESULT($sudo_cv___func__)
+if test "$sudo_cv___func__" = "yes"; then
+    AC_DEFINE(HAVE___FUNC__)
+elif test -n "$GCC"; then
+    AC_MSG_CHECKING([for __FUNCTION__])
+    AC_CACHE_VAL(sudo_cv___FUNCTION__, [
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[(void)puts(__FUNCTION__);]])], [sudo_cv___FUNCTION__=yes], [sudo_cv___FUNCTION__=no])])
+    AC_MSG_RESULT($sudo_cv___FUNCTION__)
+    if test "$sudo_cv___FUNCTION__" = "yes"; then
+       AC_DEFINE(HAVE___FUNC__)
+       AC_DEFINE(__func__, __FUNCTION__, [Define to __FUNCTION__ if your compiler support __FUNCTION__ but not __func__])
+    fi
+fi
 
 # gettext() and friends may be located in libc (Linux and Solaris)
 # or in libintl.  However, it is possible to have libintl installed
@@ -3201,6 +3220,7 @@ AH_TEMPLATE(sig_atomic_t, [Define to `int' if <signal.h> does not define.])
 AH_TEMPLATE(__signed, [Define to `signed' or nothing if compiler does not support a signed type qualifier.])
 AH_TEMPLATE(HAVE_STRUCT_UTMP_UT_EXIT, [Define to 1 if `ut_exit' is a member of `struct utmp'.])
 AH_TEMPLATE(HAVE_STRUCT_UTMPX_UT_EXIT, [Define to 1 if `ut_exit' is a member of `struct utmpx'.])
+AH_TEMPLATE(HAVE___FUNC__, [Define to 1 if the compiler supports the C99 __func__ variable.])
 
 dnl
 dnl Bits to copy verbatim into config.h.in