[openssh-commits] [openssh] 03/03: Run compiler test program when compiling natively.

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Nov 23 14:41:58 AEDT 2023


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit cea007d691cfedfa07a5b8599f97ce0511f53fc9
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Wed Nov 22 21:18:55 2023 +1100

    Run compiler test program when compiling natively.
    
    ok djm@
---
 m4/openssh.m4 | 33 +++++++++++++++++++++++++++------
 1 file changed, 27 insertions(+), 6 deletions(-)

diff --git a/m4/openssh.m4 b/m4/openssh.m4
index 386a616f..80254a30 100644
--- a/m4/openssh.m4
+++ b/m4/openssh.m4
@@ -53,8 +53,15 @@ then
 		AC_MSG_RESULT([no])
 		CFLAGS="$saved_CFLAGS"
 else
-		AC_MSG_RESULT([yes])
-		 CFLAGS="$saved_CFLAGS $_define_flag"
+		dnl If we are compiling natively, try running the program.
+		AC_RUN_IFELSE([OSSH_COMPILER_FLAG_TEST_PROGRAM],
+			[ AC_MSG_RESULT([yes])
+			  CFLAGS="$saved_CFLAGS $_define_flag" ],
+			[ AC_MSG_RESULT([no, fails at run time])
+			  CFLAGS="$saved_CFLAGS" ],
+			[ AC_MSG_RESULT([yes])
+			  CFLAGS="$saved_CFLAGS $_define_flag" ],
+		)
 fi],
 		[ AC_MSG_RESULT([no])
 		  CFLAGS="$saved_CFLAGS" ]
@@ -78,8 +85,15 @@ then
 		AC_MSG_RESULT([no])
 		CFLAGS="$saved_CFLAGS"
 else
-		AC_MSG_RESULT([yes])
-		 CFLAGS="$saved_CFLAGS $_define_flag"
+		dnl If we are compiling natively, try running the program.
+		AC_RUN_IFELSE([OSSH_COMPILER_FLAG_TEST_PROGRAM],
+			[ AC_MSG_RESULT([yes])
+			  CFLAGS="$saved_CFLAGS $_define_flag" ],
+			[ AC_MSG_RESULT([no, fails at run time])
+			  CFLAGS="$saved_CFLAGS" ],
+			[ AC_MSG_RESULT([yes])
+			  CFLAGS="$saved_CFLAGS $_define_flag" ],
+		)
 fi],
 		[ AC_MSG_RESULT([no])
 		  CFLAGS="$saved_CFLAGS" ]
@@ -103,8 +117,15 @@ then
 		  AC_MSG_RESULT([no])
 		  LDFLAGS="$saved_LDFLAGS"
 else
-		  AC_MSG_RESULT([yes])
-		  LDFLAGS="$saved_LDFLAGS $_define_flag"
+		  dnl If we are compiling natively, try running the program.
+		  AC_RUN_IFELSE([OSSH_COMPILER_FLAG_TEST_PROGRAM],
+			[ AC_MSG_RESULT([yes])
+			  LDFLAGS="$saved_LDFLAGS $_define_flag" ],
+			[ AC_MSG_RESULT([no, fails at run time])
+			  LDFLAGS="$saved_LDFLAGS" ],
+			[ AC_MSG_RESULT([yes])
+			  LDFLAGS="$saved_LDFLAGS $_define_flag" ]
+		  )
 fi		],
 		[ AC_MSG_RESULT([no])
 		  LDFLAGS="$saved_LDFLAGS" ]

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list