Commit 0ae8b512 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Replace AC_TRY_RUN() with AC_EGREP_CPP() when checking for constants to

work fine with cross-compiled builds.
parent 547c136b
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -125,19 +125,17 @@ dnl CARES_CHECK_CONSTANT(headers, constant name, if found, [if not found])

AC_DEFUN([CARES_CHECK_CONSTANT], [
  AC_MSG_CHECKING([for $2])
  AC_TRY_RUN( 
  AC_EGREP_CPP(VARIABLEWASDEFINED,
   [
      $1

      int main()
      {
      #ifdef $2
          return 0;
        VARIABLEWASDEFINED
      #else
          return 1;
        NJET
      #endif
      }
    ], ac_constant="yes", ac_constant="no")
    ], ac_constant="yes", ac_constant="no"
  )
  if test "$ac_constant" = "yes" ; then
    AC_MSG_RESULT(yes)
    $3