You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2014/03/04 07:52:26 UTC

git commit: TS-2607: Fix broken linking case for Ubuntu 10.04

Repository: trafficserver
Updated Branches:
  refs/heads/master 983e22bc8 -> 17f680231


TS-2607: Fix broken linking case for Ubuntu 10.04


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/17f68023
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/17f68023
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/17f68023

Branch: refs/heads/master
Commit: 17f680231a36fecb703cde36f71b213ff755d44e
Parents: 983e22b
Author: Phil Sorber <so...@apache.org>
Authored: Mon Mar 3 23:51:57 2014 -0700
Committer: Phil Sorber <so...@apache.org>
Committed: Mon Mar 3 23:51:57 2014 -0700

----------------------------------------------------------------------
 configure.ac | 42 +++++++++++++++++++++++++++++-------------
 1 file changed, 29 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/17f68023/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index a9d9a34..7015498 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1356,20 +1356,36 @@ AC_SUBST(use_linux_native_aio)
 # If we don't find it, disable checking for header.
 use_hwloc=0
 AS_IF([test "x$enable_hwloc" = "xyes"], [
-  AC_CHECK_HEADERS([hwloc.h], [],
-    [AC_MSG_WARN([hwloc.h header not found, try --disable-hwloc])], []
-  )
-
-  # Old versions of libhwloc don't have HWLOC_OBJ_PU.
-  AC_CHECK_DECL(HWLOC_OBJ_PU,
-    [AC_DEFINE(HAVE_HWLOC_OBJ_PU, 1, [Whether HWLOC_OBJ_PU is available])], [],
-    [#include <hwloc.h>]
-  )
-
   # Use pkg-config, because some distros (*cough* Ubuntu) put hwloc in unusual places.
-  PKG_CHECK_MODULES([hwloc], [hwloc], [use_hwloc=1], [use_hwloc=0])
-  AC_SUBST([hwloc_CFLAGS])
-  AC_SUBST([hwloc_LIBS])
+  PKG_CHECK_MODULES([hwloc], [hwloc], [
+    SAVE_LIBS="$LIBS"
+    LIBS="-lhwloc"
+    AC_LANG_PUSH([C++])
+    AC_MSG_CHECKING([for hwloc C++ linking])
+    AC_LINK_IFELSE([
+      AC_LANG_PROGRAM([#include <hwloc.h>],[hwloc_topology_t t; hwloc_topology_init(&t); hwloc_get_type_depth(t, HWLOC_OBJ_SOCKET);])],[
+      use_hwloc=1
+      AC_SUBST([hwloc_CFLAGS])
+      AC_SUBST([hwloc_LIBS])
+      AC_MSG_RESULT([yes])
+      # Old versions of libhwloc don't have HWLOC_OBJ_PU.
+      AC_CHECK_DECL(HWLOC_OBJ_PU,
+        [AC_DEFINE(HAVE_HWLOC_OBJ_PU, 1, [Whether HWLOC_OBJ_PU is available])], [],
+        [#include <hwloc.h>]
+      )
+    ], [
+      AC_MSG_RESULT([no])
+      AC_MSG_WARN([hwloc not linkable, try --disable-hwloc])
+      AC_SUBST([hwloc_CFLAGS],[""])
+      AC_SUBST([hwloc_LIBS],[""])
+    ])
+    AC_LANG_POP()
+    LIBS="$SAVE_LIBS"
+  ], [
+    AC_MSG_WARN([hwloc not found, try --disable-hwloc])
+    AC_SUBST([hwloc_CFLAGS],[""])
+    AC_SUBST([hwloc_LIBS],[""])
+  ])
 ])
 
 AC_SUBST(use_hwloc)