about summary refs log tree commit diff
path: root/m4
diff options
context:
space:
mode:
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], [