From ec51cbab9f56e8cc653c0ae136a13c7bdc168fb4 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 4 Sep 2014 16:10:38 +0000 Subject: [PATCH] We are failing to use the system dirname function because we are not correctly flagging that we found it. Modify opal_search_libs_core to set an "opal_have_foo" flag to indicate that we found the specified function, and then modify the have_dirname check to look for it. cmr=v1.8.3:reviewer=jsquyres This commit was SVN r32669. --- config/opal_search_libs.m4 | 11 +++++++++-- configure.ac | 2 +- opal/util/basename.c | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/config/opal_search_libs.m4 b/config/opal_search_libs.m4 index 1caba6fe4d..e684e2b2a7 100644 --- a/config/opal_search_libs.m4 +++ b/config/opal_search_libs.m4 @@ -1,6 +1,7 @@ dnl -*- shell-script -*- dnl dnl Copyright (c) 2013-2014 Cisco Systems, Inc. All rights reserved. +dnl Copyright (c) 2014 Intel, Inc. All rights reserved. dnl $COPYRIGHT$ dnl dnl Additional copyrights may follow @@ -24,16 +25,22 @@ AC_DEFUN([OPAL_SEARCH_LIBS_CORE],[ m4_ifdef([mca_component_configure_active], [m4_fatal([*** OPAL_SEARCH_LIBS_CORE cannot be called from a component configure.m4])]) - OPAL_VAR_SCOPE_PUSH([LIBS_save add]) + OPAL_VAR_SCOPE_PUSH([LIBS_save add uppername]) LIBS_save=$LIBS + AC_MSG_CHECKING([for $1 in lib $2]) AC_SEARCH_LIBS([$1], [$2], [ # Found it! See if anything was added to LIBS add=`printf '%s\n' "$LIBS" | sed -e "s/$LIBS_save$//"` AS_IF([test -n "$add"], [OPAL_WRAPPER_FLAGS_ADD([LIBS], [$add])]) + uppername=m4_toupper($1) + AC_DEFINE_UNQUOTED([OPAL_HAVE_$uppername], [1], + [whether $1 is found and available]) + AC_MSG_RESULT([found...and set OPAL_HAVE_$uppername]) $3], - [$4], [$5]) + [AC_MSG_RESULT([not found]) + $4], [$5]) OPAL_VAR_SCOPE_POP ])dnl diff --git a/configure.ac b/configure.ac index acf27065fe..bc72f68177 100644 --- a/configure.ac +++ b/configure.ac @@ -871,7 +871,7 @@ OPAL_SEARCH_LIBS_CORE([socket], [socket]) # Solaris has sched_yield in -lrt, usually in libc OPAL_SEARCH_LIBS_CORE([sched_yield], [rt]) -# IRIX has dirname in -lgen, usually in libc +# IRIX and CentOS have dirname in -lgen, usually in libc OPAL_SEARCH_LIBS_CORE([dirname], [gen]) # Darwin doesn't need -lm, as it's a symlink to libSystem.dylib diff --git a/opal/util/basename.c b/opal/util/basename.c index 62b66f5437..9c82833996 100644 --- a/opal/util/basename.c +++ b/opal/util/basename.c @@ -12,6 +12,7 @@ * Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2014 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -100,7 +101,7 @@ char *opal_basename(const char *filename) char* opal_dirname(const char* filename) { -#if defined(HAVE_DIRNAME) +#if defined(HAVE_DIRNAME) || defined(OPAL_HAVE_DIRNAME) char* safe_tmp = strdup(filename), *result; result = strdup(dirname(safe_tmp)); free(safe_tmp);