summary refs log tree commit diff
path: root/m4
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-03-21 17:12:32 -0400
committerJune McEnroe <june@causal.agency>2022-03-21 17:12:32 -0400
commit4d3c8fc012e05e90be516bfd8ef7d528123bed12 (patch)
treee51c0ebe3d626e45f0fcff7092e6fdf0af78f279 /m4
parentImport LibreSSL 3.5.0 (diff)
downloadlibretls-4d3c8fc012e05e90be516bfd8ef7d528123bed12.tar.gz
libretls-4d3c8fc012e05e90be516bfd8ef7d528123bed12.zip
Import LibreSSL 3.5.1
Diffstat (limited to 'm4')
-rw-r--r--m4/check-hardening-options.m426
1 files changed, 10 insertions, 16 deletions
diff --git a/m4/check-hardening-options.m4 b/m4/check-hardening-options.m4
index c8ab12e..4b5784b 100644
--- a/m4/check-hardening-options.m4
+++ b/m4/check-hardening-options.m4
@@ -4,16 +4,13 @@ AC_DEFUN([CHECK_CFLAG], [
 	 AC_MSG_CHECKING([if $saved_CC supports "$1"])
 	 old_cflags="$CFLAGS"
 	 CFLAGS="$1 -Wall -Werror"
-	 AC_TRY_LINK([
-		      #include <stdio.h>
-		      ],
-		     [printf("Hello")],
-		     AC_MSG_RESULT([yes])
+	 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[printf("Hello")]])],
+		     [AC_MSG_RESULT([yes])
 		     CFLAGS=$old_cflags
-		     HARDEN_CFLAGS="$HARDEN_CFLAGS $1",
-		     AC_MSG_RESULT([no])
+		     HARDEN_CFLAGS="$HARDEN_CFLAGS $1"],
+		     [AC_MSG_RESULT([no])
 		     CFLAGS=$old_cflags
-		     [$2])
+		     [$2]])
 ])
 
 AC_DEFUN([CHECK_LDFLAG], [
@@ -21,16 +18,13 @@ AC_DEFUN([CHECK_LDFLAG], [
 	 AC_MSG_CHECKING([if $saved_LD supports "$1"])
 	 old_ldflags="$LDFLAGS"
 	 LDFLAGS="$1 -Wall -Werror"
-	 AC_TRY_LINK([
-		      #include <stdio.h>
-		      ],
-		     [printf("Hello")],
-		     AC_MSG_RESULT([yes])
+	 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[printf("Hello")]])],
+		     [AC_MSG_RESULT([yes])
 		     LDFLAGS=$old_ldflags
-		     HARDEN_LDFLAGS="$HARDEN_LDFLAGS $1",
-		     AC_MSG_RESULT([no])
+		     HARDEN_LDFLAGS="$HARDEN_LDFLAGS $1"],
+		     [AC_MSG_RESULT([no])
 		     LDFLAGS=$old_ldflags
-		     [$2])
+		     [$2]])
 ])
 
 AC_DEFUN([DISABLE_AS_EXECUTABLE_STACK], [