[PATCH 05/11] AC_TRY_COMPILE is deprecated
Ruben Kerkhof
ruben at rubenkerkhof.com
Sat Mar 4 18:13:21 CET 2017
---
configure.ac | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index 4ca956b7..75e90629 100644
--- a/configure.ac
+++ b/configure.ac
@@ -242,12 +242,23 @@ esac
AC_CHECK_HEADER(syslog.h, [AC_DEFINE(HAVE_SYSLOG)])
AC_CHECK_HEADER(alloca.h, [AC_DEFINE(HAVE_ALLOCA_H)])
AC_MSG_CHECKING(whether 'struct sockaddr' has sa_len)
-AC_TRY_COMPILE([#include <sys/types.h>
- #include <sys/socket.h>
- ], [static struct sockaddr sa; int i = sizeof(sa.sa_len);],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_SIN_LEN,,sin_len)],
- AC_MSG_RESULT(no))
+AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ ]],
+ [[
+ static struct sockaddr sa;
+ int i = sizeof(sa.sa_len);
+ ]]
+ )],
+ [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SIN_LEN,,sin_len)
+ ],
+ [AC_MSG_RESULT(no)]
+)
AC_C_BIGENDIAN([AC_DEFINE(CPU_BIG_ENDIAN)], [AC_DEFINE(CPU_LITTLE_ENDIAN)],
[AC_MSG_ERROR([Cannot determine CPU endianity.])])
--
2.12.0
More information about the Bird-users
mailing list