Skip to content

Commit

Permalink
Run compiler test program when compiling natively.
Browse files Browse the repository at this point in the history
ok djm@
  • Loading branch information
daztucker committed Nov 23, 2023
1 parent ee0d305 commit cea007d
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions m4/openssh.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand All @@ -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" ]
Expand All @@ -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" ]
Expand Down

0 comments on commit cea007d

Please sign in to comment.