trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sor...@apache.org
Subject [trafficserver] 03/03: Checkpoint
Date Tue, 27 Sep 2016 19:37:57 GMT
This is an automated email from the ASF dual-hosted git repository.

sorber pushed a commit to branch make_hwloc_required
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 08dc4910f329b8003ff4d4f1f1e130232723f0d2
Author: Phil Sorber <sorber@apache.org>
AuthorDate: Thu Sep 8 13:19:14 2016 -0600

    Checkpoint
---
 build/hwloc.m4 | 127 ++++++++++++++++++++++++++++-----------------------------
 1 file changed, 62 insertions(+), 65 deletions(-)

diff --git a/build/hwloc.m4 b/build/hwloc.m4
index 323f6e6..f788d60 100644
--- a/build/hwloc.m4
+++ b/build/hwloc.m4
@@ -22,84 +22,81 @@ dnl
 dnl TS_CHECK_HWLOC: look for hwloc libraries and headers
 dnl
 AC_DEFUN([TS_CHECK_HWLOC], [
-hwloc_path_provided=no
-AC_ARG_WITH(hwloc, [AC_HELP_STRING([--with-hwloc=DIR],[use a specific hwloc library])],
-[
-  if test "x$withval" != "xyes" && test "x$withval" != "x"; then
-    hwloc_base_dir="$withval"
-    if test "$withval" != "no"; then
-      hwloc_path_provided=yes
-      case "$withval" in
-      *":"*)
-        hwloc_include="`echo $withval |sed -e 's/:.*$//'`"
-        hwloc_ldflags="`echo $withval |sed -e 's/^.*://'`"
-        AC_MSG_CHECKING(checking for hwloc includes in $hwloc_include libs in $hwloc_ldflags
)
-        ;;
-      *)
-        hwloc_include="$withval/include"
-        hwloc_ldflags="$withval/lib"
-        AC_MSG_CHECKING(checking for hwloc includes in $withval)
-        ;;
-      esac
+  hwloc_path_provided=no
+  AC_ARG_WITH(hwloc, [AC_HELP_STRING([--with-hwloc=DIR],[use a specific hwloc library])],
+  [
+    if test "x$withval" != "xyes" && test "x$withval" != "x"; then
+      hwloc_base_dir="$withval"
+      if test "$withval" != "no"; then
+        hwloc_path_provided=yes
+        case "$withval" in
+        *":"*)
+          hwloc_include="`echo $withval |sed -e 's/:.*$//'`"
+          hwloc_ldflags="`echo $withval |sed -e 's/^.*://'`"
+          AC_MSG_CHECKING(checking for hwloc includes in $hwloc_include libs in $hwloc_ldflags
)
+          ;;
+        *)
+          hwloc_include="$withval/include"
+          hwloc_ldflags="$withval/lib"
+          AC_MSG_CHECKING(checking for hwloc includes in $withval)
+          ;;
+        esac
+      fi
+    fi
+  ])
+
+  if test "x$hwloc_path_provided" = "xno"; then
+    # Use pkg-config, because some distros (*cough* Ubuntu) put hwloc in unusual places.
+    PKG_CHECK_MODULES([HWLOC], [hwloc], [], [
+      AC_SUBST([HWLOC_CFLAGS],[""])
+      AC_SUBST([HWLOC_LIBS],[""])
+      AC_MSG_RESULT([no])
+      $2
+    ])
+  else
+    if test -d $hwloc_include && test -d $hwloc_ldflags && test -f $hwloc_include/hwloc.h;
then
+      saved_ldflags=$LDFLAGS
+      saved_cppflags=$CPPFLAGS
+      hwloc_have_headers=0
+      hwloc_have_libs=0
+      if test "$hwloc_base_dir" != "/usr"; then
+        TS_ADDTO(CPPFLAGS, [-I${hwloc_include}])
+        TS_ADDTO(LDFLAGS, [-L${hwloc_ldflags}])
+        TS_ADDTO_RPATH(${hwloc_ldflags})
+      fi
     fi
   fi
-])
 
-if test "x$hwloc_path_provided" = "xno"; then
-  # Use pkg-config, because some distros (*cough* Ubuntu) put hwloc in unusual places.
-  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);])],[
+  SAVE_LIBS="$LIBS"
+  LIBS="-lhwloc"
+  AC_LANG_PUSH([C++])
+  AC_CHECK_LIBS([hwloc], [hwloc_topology_init], [
+    AC_CHECK_HEADERS(hwloc.h, [
       AC_SUBST([HWLOC_CFLAGS])
       AC_SUBST([HWLOC_LIBS])
       AC_MSG_RESULT([yes])
+      $1
       # 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>]
       )
     ], [
+      CPPFLAGS=$saved_cppflags
+      LDFLAGS=$saved_ldflags
+      AC_SUBST([HWLOC_CFLAGS],[""])
+      AC_SUBST([HWLOC_LIBS],[""])
       AC_MSG_RESULT([no])
-      AC_MSG_ERROR([hwloc not linkable])
+      $2
     ])
-    AC_LANG_POP()
-    LIBS="$SAVE_LIBS"
   ], [
-    AC_MSG_ERROR([hwloc not found])
-  ])
-else
-  if test -d $hwloc_include && test -d $hwloc_ldflags && test -f $hwloc_include/hwloc.h;
then
-    saved_ldflags=$LDFLAGS
-    saved_cppflags=$CPPFLAGS
-    hwloc_have_headers=0
-    hwloc_have_libs=0
-    if test "$hwloc_base_dir" != "/usr"; then
-      TS_ADDTO(CPPFLAGS, [-I${hwloc_include}])
-      TS_ADDTO(LDFLAGS, [-L${hwloc_ldflags}])
-      TS_ADDTO_RPATH(${hwloc_ldflags})
-    fi
-    AC_SEARCH_LIBS([hwloc_code], [hwloc], [hwloc_have_libs=1])
-    if test "$hwloc_have_libs" != "0"; then
-      AC_CHECK_HEADERS(hwloc.h, [hwloc_have_headers=1])
-    fi
-    if test "$hwloc_have_headers" != "0"; then
-      AC_SUBST(HWLOC_LIBS, [-lhwloc])
-      AC_CHECK_DECL(HWLOC_OBJ_PU,
-        [AC_DEFINE(HAVE_HWLOC_OBJ_PU, 1, [Whether HWLOC_OBJ_PU is available])], [],
-        [#include <hwloc.h>]
-      )
-    else
-      AC_MSG_ERROR([hwloc not found])
-      CPPFLAGS=$saved_cppflags
-      LDFLAGS=$saved_ldflags
-    fi
-    AC_MSG_RESULT([ok])
-  else
-    AC_MSG_ERROR([hwloc not found])
-  fi
-fi
+    CPPFLAGS=$saved_cppflags
+    LDFLAGS=$saved_ldflags
+    AC_SUBST([HWLOC_CFLAGS],[""])
+    AC_SUBST([HWLOC_LIBS],[""])
+    AC_MSG_RESULT([no])
+    $2
+  ],[])
+  AC_LANG_POP()
+  LIBS="$SAVE_LIBS"
 ])

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>.

Mime
View raw message