@@ -11,7 +11,7 @@ dnl University of Stuttgart. All rights reserved.
1111dnl Copyright (c) 2004-2006 The Regents of the University of California.
1212dnl All rights reserved.
1313dnl Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
14- dnl Copyright (c) 2008-2012 University of Houston. All rights reserved.
14+ dnl Copyright (c) 2008-2016 University of Houston. All rights reserved.
1515dnl Copyright (c) 2015 Research Organization for Information Science
1616dnl and Technology (RIST). All rights reserved.
1717dnl $COPYRIGHT $
@@ -32,10 +32,6 @@ AC_DEFUN([OMPI_CHECK_PVFS2],[
3232 check_pvfs2_LDFLAGS=
3333 check_pvfs2_LIBS=
3434
35- check_pvfs2_save_LIBS= " $LIBS "
36- check_pvfs2_save_LDFLAGS= " $LDFLAGS "
37- check_pvfs2_save_CPPFLAGS= " $CPPFLAGS "
38-
3935 check_pvfs2_configuration= " none"
4036 ompi_check_pvfs2_happy= " yes"
4137
@@ -46,70 +42,27 @@ AC_DEFUN([OMPI_CHECK_PVFS2],[
4642 [Build Pvfs2 support, optionally adding DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries])])
4743 OPAL_CHECK_WITHDIR([pvfs2], [$with_pvfs2 ], [include/pvfs2.h])
4844
49- AC_ARG_WITH([pvfs2-libs],
50- [AC_HELP_STRING([--with-pvfs2-libs= LIBS],
51- [Libraries to link with for pvfs2])])
52-
53- temp_with_pvfs2= " $with_pvfs2 "
5445 AS_IF([test -z " $with_pvfs2 " ],
55- [with_pvfs2= " /usr/local" ])
46+ [ompi_check_pvfs2_dir= " /usr/local" ],
47+ [ompi_check_pvfs2_dir= $with_pvfs2 ])
5648
57- temp_with_pvfs2_libs= " $with_pvfs2_libs "
58- AS_IF([test -z " $with_pvfs2_libs " ],
59- [with_pvfs2_libs= " pvfs2 pthread" ])
49+ if test -e " $ompi_check_pvfs2_dir /lib64" ; then
50+ ompi_check_pvfs2_libdir=" $ompi_check_pvfs2_dir /lib64"
51+ else
52+ ompi_check_pvfs2_libdir=" $ompi_check_pvfs2_dir /lib"
53+ fi
6054
6155 # Add correct -I and -L flags
62- AS_IF([test -d " $with_pvfs2 /include" ],
63- [check_pvfs2_CPPFLAGS= " -I$with_pvfs2 /include"
64- $1 _CPPFLAGS= " $check_pvfs2_CPPFLAGS "
65- CPPFLAGS= " $CPPFLAGS $check_pvfs2_CPPFLAGS " ],
66- [ompi_check_pvfs2_happy= " no" ])
56+ OPAL_CHECK_PACKAGE([$1 ], [pvfs2.h], [pvfs2], [PVFS_util_resolve], [],
57+ [$ompi_check_pvfs2_dir ], [$ompi_check_pvfs2_libdir ], [ompi_check_pvfs2_happy= " yes" ],
58+ [ompi_check_pvfs2_happy= " no" ])
6759
68- AS_IF([test " $ompi_check_pvfs2_happy " = " yes" ],
69- [AS_IF([test -d " $with_pvfs2 /lib" ],
70- [check_pvfs2_LDFLAGS= " -L$with_pvfs2 /lib"
71- $1 _LDFLAGS= " $check_pvfs2_LDFLAGS "
72- LDFLAGS= " $LDFLAGS $check_pvfs2_LDFLAGS " ],
73- [ompi_check_pvfs2_happy= " no" ])
74- ],[])
7560
76- # Try to find all the pvfs2 libraries
77- AS_IF([test " $ompi_check_pvfs2_happy " = " yes" ],
78- [ AS_IF([test -n " $with_pvfs2_libs " ]
79- [for lib in $with_pvfs2_libs ; do
80- check_pvfs2_LIBS= " $check_pvfs2_LIBS -l$lib "
81- done])
82-
83- $1 _LIBS= " $check_pvfs2_LIBS "
84- LIBS= " $LIBS $check_pvfs2_LIBS "
85-
86- # check for pvfs2
87- AC_CHECK_HEADERS([pvfs2.h],
88- [AC_MSG_CHECKING([if possible to link PVFS2])
89- AC_LINK_IFELSE(
90- [AC_LANG_PROGRAM(
91- [[# include <stdio.h>
92- # include <pvfs2.h>]],
93- [[PVFS_util_resolve(NULL,NULL,NULL,0); ]])],
94- [AC_MSG_RESULT([yes])
95- ompi_check_pvfs2_happy= " yes" ],
96- [AC_MSG_RESULT([no])
97- ompi_check_pvfs2_happy= " no" ])],
98- [ompi_check_pvfs2_happy= " no" ])
99- ])
100-
101-
102- LDFLAGS= " $check_pvfs2_save_LDFLAGS "
103- CPPFLAGS= " $check_pvfs2_save_CPPFLAGS "
104- LIBS= " $check_pvfs2_save_LIBS "
10561 AS_IF([test " $ompi_check_pvfs2_happy " = " yes" ],
10662 [$2 ],
10763 [AS_IF([test ! -z " $with_pvfs2 " && test " $with_pvfs2 " != " no" ],
10864 [echo PVFS2 support not found])
10965 $3 ])
11066
111- with_pvfs2= " $temp_with_pvfs2 "
112- with_pvfs2_libs= " $temp_with_pvfs2_libs "
113-
11467])
11568
0 commit comments