summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordtucker <dtucker>2013-02-08 00:50:09 +0000
committerdtucker <dtucker>2013-02-08 00:50:09 +0000
commitb75cf8028d64d6fdef4553c07320d3025590ce82 (patch)
tree0bbbde93458027ac12d093ac6f7f84e19fca92b1
parent2d3034af2398caab1ac70a7d570187ce4df3ce53 (diff)
downloadopenssh-b75cf8028d64d6fdef4553c07320d3025590ce82.tar.gz
- (dtucker) [configure.ac openbsd-compat/sys-tree.h] Test if compiler allows
__attribute__ on return values and work around if necessary. ok djm@
-rw-r--r--ChangeLog2
-rw-r--r--configure.ac16
-rw-r--r--openbsd-compat/sys-tree.h5
3 files changed, 21 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c569b81..5e832e7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
20130208
- (djm) [contrib/redhat/sshd.init] treat RETVAL as an integer;
patch from Iain Morgan in bz#2059
+ - (dtucker) [configure.ac openbsd-compat/sys-tree.h] Test if compiler allows
+ __attribute__ on return values and work around if necessary. ok djm@
20130207
- (djm) [configure.ac] Don't probe seccomp capability of running kernel
diff --git a/configure.ac b/configure.ac
index f6110644..6df09e21 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.501 2013/02/06 23:11:05 djm Exp $
+# $Id: configure.ac,v 1.502 2013/02/08 00:50:09 dtucker Exp $
#
# Copyright (c) 1999-2004 Damien Miller
#
@@ -15,7 +15,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
-AC_REVISION($Revision: 1.501 $)
+AC_REVISION($Revision: 1.502 $)
AC_CONFIG_SRCDIR([ssh.c])
AC_LANG([C])
@@ -238,6 +238,18 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
fi
fi
+AC_MSG_CHECKING([if compiler allows __attribute__ on return types])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <stdlib.h>
+__attribute__((__unused__)) static void foo(void){return;}]],
+ [[ exit(0); ]])],
+ [ AC_MSG_RESULT([yes]) ],
+ [ AC_MSG_RESULT([no])
+ AC_DEFINE(NO_ATTRIBUTE_ON_RETURN_TYPE, 1,
+ [compiler does not accept __attribute__ on return types]) ]
+)
+
if test "x$no_attrib_nonnull" != "x1" ; then
AC_DEFINE([HAVE_ATTRIBUTE__NONNULL__], [1], [Have attribute nonnull])
fi
diff --git a/openbsd-compat/sys-tree.h b/openbsd-compat/sys-tree.h
index 058fa3b2..7f7546ec 100644
--- a/openbsd-compat/sys-tree.h
+++ b/openbsd-compat/sys-tree.h
@@ -26,6 +26,11 @@
/* OPENBSD ORIGINAL: sys/sys/tree.h */
+#include "config.h"
+#ifdef NO_ATTRIBUTE_ON_RETURN_TYPE
+# define __attribute__(x)
+#endif
+
#ifndef _SYS_TREE_H_
#define _SYS_TREE_H_