Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions config/opal_check_package.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the fourth argument to AC_CHECK_HEADERS makes this line disagree with the AC_VERBOSE message immediately above, and is certainly wrong if CPPFLAGS is not modified. I don't think this part of the change is good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. Sure, I can fix this.

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
])

Expand Down