@@ -9,7 +9,7 @@ dnl Copyright © 2004-2012 The Regents of the University of California.
99dnl All rights reserved.
1010dnl Copyright © 2004-2008 High Performance Computing Center Stuttgart,
1111dnl University of Stuttgart. All rights reserved.
12- dnl Copyright © 2006-2015 Cisco Systems, Inc. All rights reserved.
12+ dnl Copyright © 2006-2016 Cisco Systems, Inc. All rights reserved.
1313dnl Copyright © 2012 Blue Brain Project, BBP/EPFL. All rights reserved.
1414dnl Copyright © 2012 Oracle and/or its affiliates. All rights reserved.
1515dnl See COPYING in top-level directory.
@@ -671,8 +671,17 @@ EOF])
671671 AC_CHECK_HEADERS ( [ sys/utsname.h] )
672672 AC_CHECK_FUNCS ( [ uname] )
673673
674- AC_CHECK_HEADERS ( [ valgrind/valgrind.h] )
675- AC_CHECK_DECLS ( [ RUNNING_ON_VALGRIND] ,,[ :] ,[ [ #include <valgrind/valgrind.h>] ] )
674+ dnl Don't check for valgrind in embedded mode because this may conflict
675+ dnl with the embedder projects also checking for it.
676+ dnl We only use Valgrind to nicely disable the x86 backend with a warning,
677+ dnl but we can live without it in embedded mode (it auto-disables itself
678+ dnl because of invalid CPUID outputs).
679+ dnl Non-embedded checks usually go to hwloc_internal.m4 but this one is
680+ dnl is really for the core library.
681+ AS_IF ( [ test "$hwloc_mode" != "embedded"] ,
682+ [ AC_CHECK_HEADERS ( [ valgrind/valgrind.h] )
683+ AC_CHECK_DECLS ( [ RUNNING_ON_VALGRIND] ,,[ :] ,[ [ #include <valgrind/valgrind.h>] ] )
684+ ] )
676685
677686 AC_CHECK_HEADERS ( [ pthread_np.h] )
678687 AC_CHECK_DECLS ( [ pthread_setaffinity_np] ,,[ :] ,[ [
0 commit comments