diff --git a/config/opal_check_package.m4 b/config/opal_check_package.m4 index 8e3f83d46b2..127f4b82b52 100644 --- a/config/opal_check_package.m4 +++ b/config/opal_check_package.m4 @@ -36,24 +36,39 @@ AC_DEFUN([_OPAL_CHECK_PACKAGE_HEADER], [ unset opal_Header opal_check_package_header_happy="no" - AS_IF([test "$3" = "/usr" || \ + AS_IF([test "$3" = "" || \ + test "$3" = "/usr" || \ test "$3" = "/usr/local"], [ # try as is... AC_VERBOSE([looking for header without includes]) - AC_CHECK_HEADERS([$2], [opal_check_package_header_happy="yes"], []) + AC_CHECK_HEADERS([$2], [opal_check_package_header_happy="yes"], [], [$6]) AS_IF([test "$opal_check_package_header_happy" = "no"], [# no go on the as is - reset the cache and try again unset opal_Header])]) - AS_IF([test "$opal_check_package_header_happy" = "no"], - [AS_IF([test "$3" != ""], - [$1_CPPFLAGS="$$1_CPPFLAGS -I$3/include" - CPPFLAGS="$CPPFLAGS -I$3/include"]) - AC_CHECK_HEADERS([$2], [opal_check_package_header_happy="yes"], [], [$6]) - AS_IF([test "$opal_check_package_header_happy" = "yes"], [$4], [$5])], - [$4]) - unset opal_check_package_header_happy + AS_IF([test "$opal_check_package_header_happy" = "no" && \ + test "$3" != ""], + [$1_CPPFLAGS="$$1_CPPFLAGS -I$3/include" + CPPFLAGS="$CPPFLAGS -I$3/include" + AC_VERBOSE([looking for header in "$3/include"]) + AC_CHECK_HEADERS([$2], [opal_check_package_header_happy="yes"], [], [$6]) + AS_IF([test "$opal_check_package_header_happy" = "no"], + [# still no... - reset the cache and try again + unset opal_Header])]) + + AS_IF([test "$opal_check_package_header_happy" = "no" && \ + test "$3" != ""], + [$1_CPPFLAGS="$$1_CPPFLAGS -I$3" + CPPFLAGS="$CPPFLAGS -I$3" + AC_VERBOSE([looking for header in "$3"]) + AC_CHECK_HEADERS([$2], [opal_check_package_header_happy="yes"], [], [$6]) + AS_IF([test "$opal_check_package_header_happy" = "no"], + [# still no... + unset opal_Header])]) + + AS_IF([test "$opal_check_package_header_happy" = "yes"], [$4], [$5]) + unset opal_check_package_header_happy AS_VAR_POPDEF([opal_Header])dnl ])