@@ -13,7 +13,7 @@ dnl All rights reserved.
13
13
dnl Copyright (c) 2012-2015 Cisco Systems, Inc. All rights reserved.
14
14
dnl Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
15
15
dnl Copyright (c) 2014 Intel, Inc. All rights reserved.
16
- dnl Copyright (c) 2015 Research Organization for Information Science
16
+ dnl Copyright (c) 2015-2016 Research Organization for Information Science
17
17
dnl and Technology (RIST). All rights reserved.
18
18
dnl $COPYRIGHT $
19
19
dnl
@@ -31,15 +31,18 @@ AC_DEFUN([_OPAL_CHECK_PACKAGE_HEADER], [
31
31
# cache variable for the library check. one should not copy this
32
32
# code into other places unless you want much pain and suffering
33
33
AS_VAR_PUSHDEF([opal_Header], [ac_cv_header_$2 ])
34
+ OPAL_VAR_SCOPE_PUSH([dir_prefix])
34
35
35
36
# so this sucks, but there's no way to get through the progression
36
37
# of header includes without killing off the cache variable and trying
37
38
# again...
38
39
unset opal_Header
39
40
41
+ # get rid of the trailing slash(es)
42
+ dir_prefix= $( echo $3 | sed -e ' sX/*$XXg' )
40
43
opal_check_package_header_happy= " no"
41
- AS_IF([test " $3 " = " /usr" || \
42
- test " $3 " = " /usr/local" ],
44
+ AS_IF([test " $dir_prefix " = " /usr" || \
45
+ test " $dir_prefix " = " /usr/local" ],
43
46
[ # try as is...
44
47
AC_VERBOSE([looking for header without includes])
45
48
AC_CHECK_HEADERS([$2 ], [opal_check_package_header_happy= " yes" ], [])
@@ -48,14 +51,15 @@ AC_DEFUN([_OPAL_CHECK_PACKAGE_HEADER], [
48
51
unset opal_Header])])
49
52
50
53
AS_IF([test " $opal_check_package_header_happy " = " no" ],
51
- [AS_IF([test " $3 " != " " ],
52
- [$1 _CPPFLAGS= " $$ 1_CPPFLAGS -I$3 /include"
53
- CPPFLAGS= " $CPPFLAGS -I$3 /include" ])
54
+ [AS_IF([test " $dir_prefix " != " " ],
55
+ [$1 _CPPFLAGS= " $$ 1_CPPFLAGS -I$dir_prefix /include"
56
+ CPPFLAGS= " $CPPFLAGS -I$dir_prefix /include" ])
54
57
AC_CHECK_HEADERS([$2 ], [opal_check_package_header_happy= " yes" ], [], [$6 ])
55
58
AS_IF([test " $opal_check_package_header_happy " = " yes" ], [$4 ], [$5 ])],
56
59
[$4 ])
57
60
unset opal_check_package_header_happy
58
61
62
+ OPAL_VAR_SCOPE_POP([dir_prefix])
59
63
AS_VAR_POPDEF([opal_Header])dnl
60
64
])
61
65
0 commit comments