From 1a5a588f0d544762e632af1da044285608ffe1b4 Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Tue, 28 Jun 2016 23:09:36 -0700 Subject: [PATCH] Ok, using AC_TRY_COMPILE while configuring w/ OpenSSL fails when configuring normally (non-cross) & ssl is present. So now we use the AC_TRY_RUN if cross compiling, and assume presence otherwise (since the subsequent header exists checks fail if it's not actually there.) --- configure | 29 +++++++++++++++++------------ configure.ac | 6 +++++- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/configure b/configure index 136b3ad..cc75e04 100755 --- a/configure +++ b/configure @@ -7139,7 +7139,16 @@ else # Basic test to check for compatible library and # correct linking - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$cross_compiling" = yes; then + found_crypto=1 + else + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -7152,22 +7161,18 @@ int main(void) return(RAND_status() <= 0); } -int -main () -{ +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : found_crypto=1 break; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi if test ! -z "$found_crypto" ; then break; diff --git a/configure.ac b/configure.ac index 18944a8..cd4db9b 100644 --- a/configure.ac +++ b/configure.ac @@ -371,7 +371,10 @@ then # Basic test to check for compatible library and # correct linking - AC_TRY_COMPILE( + if test "$cross_compiling" = yes; then + found_crypto=1 + else + AC_TRY_RUN( [ #include #include @@ -388,6 +391,7 @@ int main(void) break; ], [] ) + fi if test ! -z "$found_crypto" ; then break;