Skip to content

Commit

Permalink
configure: more windows-specific checks
Browse files Browse the repository at this point in the history
And add configure messages to delimit those checks

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Jun 23, 2020
1 parent caf17d0 commit 26b841a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 11 additions & 4 deletions config/hwloc.m4
Expand Up @@ -461,6 +461,9 @@ EOF])
AC_CHECK_HEADERS([sys/mman.h])
if test x$hwloc_windows = xyes; then
echo
echo "**** Windows-specific checks"
AC_CHECK_HEADER([windows.h], [
AC_DEFINE([HWLOC_HAVE_WINDOWS_H], [1], [Define to 1 if you have the `windows.h' header.])
])
Expand All @@ -486,10 +489,18 @@ EOF])
[],[],[[#include <windows.h>]])
CPPFLAGS="$old_CPPFLAGS"
AC_CHECK_DECLS([GetModuleFileName], [], [], [#include <windows.h>])
AC_CHECK_LIB([gdi32], [main],
[HWLOC_LIBS="-lgdi32 $HWLOC_LIBS"
AC_DEFINE([HAVE_LIBGDI32], 1, [Define to 1 if we have -lgdi32])])
AC_CHECK_LIB([user32], [PostQuitMessage], [hwloc_have_user32="yes"])
AC_PATH_PROGS([HWLOC_MS_LIB], [lib])
AC_ARG_VAR([HWLOC_MS_LIB], [Path to Microsoft's Visual Studio `lib' tool])
echo "**** end of Windows-specific checks"
echo
fi
AC_CHECK_HEADERS([sys/lgrp_user.h], [
Expand Down Expand Up @@ -627,7 +638,6 @@ return 0;
AC_CHECK_DECLS([getprogname], [], [], [AC_INCLUDES_DEFAULT])
AC_CHECK_DECLS([getexecname], [], [], [AC_INCLUDES_DEFAULT])
AC_CHECK_DECLS([GetModuleFileName], [], [], [#include <windows.h>])
# program_invocation_name and __progname may be available but not exported in headers
AC_MSG_CHECKING([for program_invocation_name])
AC_TRY_LINK([
Expand Down Expand Up @@ -740,9 +750,6 @@ return 0;
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
AC_PATH_PROGS([HWLOC_MS_LIB], [lib])
AC_ARG_VAR([HWLOC_MS_LIB], [Path to Microsoft's Visual Studio `lib' tool])
AC_PATH_PROG([BASH], [bash])
AC_CHECK_FUNCS([ffs], [
Expand Down
4 changes: 2 additions & 2 deletions hwloc/misc.c
@@ -1,6 +1,6 @@
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2018 Inria. All rights reserved.
* Copyright © 2009-2020 Inria. All rights reserved.
* Copyright © 2009-2010 Université Bordeaux
* Copyright © 2009-2018 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
Expand Down Expand Up @@ -114,7 +114,7 @@ void hwloc_add_uname_info(struct hwloc_topology *topology __hwloc_attribute_unus
char *
hwloc_progname(struct hwloc_topology *topology __hwloc_attribute_unused)
{
#if HAVE_DECL_GETMODULEFILENAME
#if (defined HAVE_DECL_GETMODULEFILENAME) && HAVE_DECL_GETMODULEFILENAME
char name[256], *local_basename;
unsigned res = GetModuleFileName(NULL, name, sizeof(name));
if (res == sizeof(name) || !res)
Expand Down

0 comments on commit 26b841a

Please sign in to comment.