Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/981#discussion_r77898778
  
    --- Diff: build/hwloc.m4 ---
    @@ -0,0 +1,105 @@
    +dnl -------------------------------------------------------- -*- autoconf 
-*-
    +dnl Licensed to the Apache Software Foundation (ASF) under one or more
    +dnl contributor license agreements.  See the NOTICE file distributed with
    +dnl this work for additional information regarding copyright ownership.
    +dnl The ASF licenses this file to You under the Apache License, Version 2.0
    +dnl (the "License"); you may not use this file except in compliance with
    +dnl the License.  You may obtain a copy of the License at
    +dnl
    +dnl     http://www.apache.org/licenses/LICENSE-2.0
    +dnl
    +dnl Unless required by applicable law or agreed to in writing, software
    +dnl distributed under the License is distributed on an "AS IS" BASIS,
    +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
implied.
    +dnl See the License for the specific language governing permissions and
    +dnl limitations under the License.
    +
    +dnl
    +dnl hwloc.m4: Trafficserver's hwloc autoconf macros
    +dnl
    +
    +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
    +    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);])],[
    +      AC_SUBST([HWLOC_CFLAGS])
    +      AC_SUBST([HWLOC_LIBS])
    +      AC_MSG_RESULT([yes])
    --- End diff --
    
    You can simplify the ``AC_LINK_IFELSE`` with ``AC_CHECK_LIB``.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to