diff options
author | Roland Dreier <rolandd@cisco.com> | 2006-05-22 23:00:16 +0000 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-11-09 19:57:06 -0800 |
commit | 901de706050348abe52fea336e924aa3f002f9b8 (patch) | |
tree | 13791be34318884c5d9d146c0425dee7ab3ff609 | |
parent | ba3928180289ac2d7aa8454e7f6a6d3aeb6a10b6 (diff) | |
download | libmthca-901de706050348abe52fea336e924aa3f002f9b8.tar.gz |
Don't build openib_driver_init() without libsysfs
Only build old openib_driver_init() driver entry point if libsysfs
headers are detected.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | configure.in | 1 | ||||
-rw-r--r-- | src/mthca.c | 10 |
3 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,9 @@ +2006-05-22 Roland Dreier <rdreier@cisco.com> + + * configure.in, src/mthca.c (openib_driver_init): Check for the + presence of <sysfs/libsysfs.h>, and if it is not installed, don't + export the old openib_driver_init() entry point. + 2006-05-18 Michael S. Tsirkin <mst@mellanox.co.il> * src/qp.c (mthca_tavor_post_recv): Fix posting of lists of diff --git a/configure.in b/configure.in index 3fd8f1c..63b2942 100644 --- a/configure.in +++ b/configure.in @@ -16,6 +16,7 @@ AC_CHECK_LIB(ibverbs, ibv_get_device_list, [], AC_MSG_ERROR([ibv_get_device_list() not found. libmthca requires libibverbs.])) dnl Checks for header files. +AC_CHECK_HEADERS(sysfs/libsysfs.h) AC_CHECK_HEADER(infiniband/driver.h, [], AC_MSG_ERROR([<infiniband/driver.h> not found. libmthca requires libibverbs.])) AC_HEADER_STDC diff --git a/src/mthca.c b/src/mthca.c index 7c9da18..1ba6597 100644 --- a/src/mthca.c +++ b/src/mthca.c @@ -293,6 +293,15 @@ found: return &dev->ibv_dev; } +/* + * Export the old libsysfs sysfs_class_device-based driver entry point + * if libsysfs headers are installed. It doesn't hurt to export it, + * even if libibverbs is new enough not to use it; but if libsysfs + * headers are not installed, we can assume that the version of + * libibverbs we are building against is new enough not to use + * openib_driver_init(). + */ +#ifdef HAVE_SYSFS_LIBSYSFS_H struct ibv_device *openib_driver_init(struct sysfs_class_device *sysdev) { int abi_ver = 0; @@ -304,3 +313,4 @@ struct ibv_device *openib_driver_init(struct sysfs_class_device *sysdev) return ibv_driver_init(sysdev->path, abi_ver); } +#endif /* HAVE_SYSFS_LIBSYSFS_H */ |