Run compiler test program when compiling natively.

ok djm@
This commit is contained in:
Darren Tucker 2023-11-22 21:18:55 +11:00
parent ee0d305828
commit cea007d691
No known key found for this signature in database
1 changed files with 27 additions and 6 deletions

View File

@ -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" ]