Skip to content

Commit

Permalink
fix musl build
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Apr 17, 2020
1 parent 525ab4c commit e16d78b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -876,9 +876,15 @@ ENDIF()
# Check for the math library so it can be explicitly linked.
IF(NOT WIN32)
FIND_LIBRARY(HAVE_LIBM NAMES math m libm)
MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}")
IF(NOT HAVE_LIBM)
MESSAGE(FATAL_ERROR "Unable to find the math library.")
CHECK_FUNCTION_EXISTS(exp HAVE_LIBM_FUNC)
IF(NOT HAVE_LIBM_FUNC)
MESSAGE(FATAL_ERROR "Unable to find the math library.")
ELSE(NOT HAVE_LIBM_FUNC)
SET(HAVE_LIBM "")
ENDIF()
ELSE(NOT HAVE_LIBM)
MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}")
ENDIF()
ENDIF()

Expand Down Expand Up @@ -1313,6 +1319,7 @@ CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
CHECK_INCLUDE_FILE("winsock2.h" HAVE_WINSOCK2_H)
CHECK_INCLUDE_FILE("ftw.h" HAVE_FTW_H)
CHECK_INCLUDE_FILE("libgen.h" HAVE_LIBGEN_H)
CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)

# Symbol Exists
CHECK_SYMBOL_EXISTS(isfinite "math.h" HAVE_DECL_ISFINITE)
Expand Down
3 changes: 3 additions & 0 deletions config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ are set when opening a binary file on Windows. */
with zip */
#cmakedefine HDF5_SUPPORTS_PAR_FILTERS 1

/* if true, backtrace support will be used. */
#cmakedefine HAVE_EXECINFO_H 1

/* if true, include JNA bug fix */
#cmakedefine JNA 1

Expand Down
6 changes: 3 additions & 3 deletions libhdf5/hdf5debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#if !defined _WIN32 && !defined __CYGWIN__
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif

Expand All @@ -15,14 +15,14 @@

#define STSIZE 1000

#if !defined _WIN32 && !defined __CYGWIN__
#ifdef HAVE_EXECINFO_H
static void* stacktrace[STSIZE];
#endif

int
nch5breakpoint(int err)
{
#if !defined _WIN32 && !defined __CYGWIN__
#ifdef HAVE_EXECINFO_H
int count = 0;
char** trace = NULL;
int i;
Expand Down

0 comments on commit e16d78b

Please sign in to comment.