File tree 3 files changed +15
-5
lines changed
3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -876,9 +876,15 @@ ENDIF()
876
876
# Check for the math library so it can be explicitly linked.
877
877
IF (NOT WIN32 )
878
878
FIND_LIBRARY (HAVE_LIBM NAMES math m libm)
879
- MESSAGE (STATUS "Found Math library: ${HAVE_LIBM} " )
880
879
IF (NOT HAVE_LIBM)
881
- MESSAGE (FATAL_ERROR "Unable to find the math library." )
880
+ CHECK_FUNCTION_EXISTS(exp HAVE_LIBM_FUNC)
881
+ IF (NOT HAVE_LIBM_FUNC)
882
+ MESSAGE (FATAL_ERROR "Unable to find the math library." )
883
+ ELSE (NOT HAVE_LIBM_FUNC)
884
+ SET (HAVE_LIBM "" )
885
+ ENDIF ()
886
+ ELSE (NOT HAVE_LIBM)
887
+ MESSAGE (STATUS "Found Math library: ${HAVE_LIBM} " )
882
888
ENDIF ()
883
889
ENDIF ()
884
890
@@ -1313,6 +1319,7 @@ CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
1313
1319
CHECK_INCLUDE_FILE("winsock2.h" HAVE_WINSOCK2_H)
1314
1320
CHECK_INCLUDE_FILE("ftw.h" HAVE_FTW_H)
1315
1321
CHECK_INCLUDE_FILE("libgen.h" HAVE_LIBGEN_H)
1322
+ CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
1316
1323
1317
1324
# Symbol Exists
1318
1325
CHECK_SYMBOL_EXISTS(isfinite "math.h" HAVE_DECL_ISFINITE)
Original file line number Diff line number Diff line change @@ -388,6 +388,9 @@ are set when opening a binary file on Windows. */
388
388
with zip */
389
389
#cmakedefine HDF5_SUPPORTS_PAR_FILTERS 1
390
390
391
+ /* if true , backtrace support will be used. */
392
+ #cmakedefine HAVE_EXECINFO_H 1
393
+
391
394
/* if true , include JNA bug fix */
392
395
#cmakedefine JNA 1
393
396
Original file line number Diff line number Diff line change 5
5
#include "config.h"
6
6
#include <stdarg.h>
7
7
#include <stdio.h>
8
- #if !defined _WIN32 && !defined __CYGWIN__
8
+ #ifdef HAVE_EXECINFO_H
9
9
#include <execinfo.h>
10
10
#endif
11
11
15
15
16
16
#define STSIZE 1000
17
17
18
- #if !defined _WIN32 && !defined __CYGWIN__
18
+ #ifdef HAVE_EXECINFO_H
19
19
static void * stacktrace [STSIZE ];
20
20
#endif
21
21
22
22
int
23
23
nch5breakpoint (int err )
24
24
{
25
- #if !defined _WIN32 && !defined __CYGWIN__
25
+ #ifdef HAVE_EXECINFO_H
26
26
int count = 0 ;
27
27
char * * trace = NULL ;
28
28
int i ;
You can’t perform that action at this time.
0 commit comments