Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[Dev] Integrated Petr Machata's patch for long double support by Boos…

  • Loading branch information...
commit 8aa99f2e318b512e168492b62662a35213fa4f06 1 parent 0583ecb
Denis Arnaud authored January 25, 2012
4  libs/math/config/has_long_double_support.cpp
@@ -8,3 +8,7 @@
8 8
 #ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
9 9
 #error "long double support is not supported by Boost.Math on this Plaform: the long double version of the TR1 library will not be built."
10 10
 #endif
  11
+
  12
+int main(int argc, char *argv[]) {
  13
+  return 0;
  14
+}
58  libs/math/src/tr1/CMakeLists.txt
@@ -26,20 +26,6 @@ boost_add_library(math_tr1f
26 26
 	COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
27 27
 )
28 28
 
29  
-boost_add_library(math_tr1l
30  
-
31  
-	assoc_laguerrel.cpp assoc_legendrel.cpp betal.cpp
32  
-	comp_ellint_1l.cpp comp_ellint_2l.cpp comp_ellint_3l.cpp
33  
-	cyl_bessel_il.cpp cyl_bessel_jl.cpp cyl_bessel_kl.cpp
34  
-	cyl_neumannl.cpp ellint_1l.cpp ellint_2l.cpp ellint_3l.cpp
35  
-	expintl.cpp hermitel.cpp laguerrel.cpp legendrel.cpp
36  
-	riemann_zetal.cpp sph_bessell.cpp sph_legendrel.cpp
37  
-	sph_neumannl.cpp
38  
-
39  
-	SHARED_COMPILE_FLAGS "-DBOOST_MATH_TR1_DYN_LINK=1"
40  
-	COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
41  
-)
42  
-
43 29
 boost_add_library(math_c99
44 30
 
45 31
 	acosh.cpp asinh.cpp atanh.cpp cbrt.cpp copysign.cpp erfc.cpp
@@ -63,14 +49,36 @@ boost_add_library(math_c99f
63 49
 	COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
64 50
 )
65 51
 
66  
-boost_add_library(math_c99l
67  
-
68  
-	acoshl.cpp asinhl.cpp atanhl.cpp cbrtl.cpp copysignl.cpp
69  
-	erfcl.cpp erfl.cpp expm1l.cpp fmaxl.cpp fminl.cpp
70  
-	fpclassifyl.cpp hypotl.cpp lgammal.cpp llroundl.cpp log1pl.cpp
71  
-	lroundl.cpp nextafterl.cpp nexttowardl.cpp roundl.cpp
72  
-	tgammal.cpp truncl.cpp
73  
-
74  
-	SHARED_COMPILE_FLAGS "-DBOOST_MATH_TR1_DYN_LINK=1"
75  
-	COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
76  
-)
  52
+try_compile(HAS_LONG_DOUBLE_SUPPORT
  53
+	${CMAKE_CURRENT_SOURCE_DIR}/../../config/
  54
+	${CMAKE_CURRENT_SOURCE_DIR}/../../config/has_long_double_support.cpp)
  55
+
  56
+IF (HAS_LONG_DOUBLE_SUPPORT)
  57
+	boost_add_library(math_tr1l
  58
+
  59
+		assoc_laguerrel.cpp assoc_legendrel.cpp betal.cpp
  60
+		comp_ellint_1l.cpp comp_ellint_2l.cpp comp_ellint_3l.cpp
  61
+		cyl_bessel_il.cpp cyl_bessel_jl.cpp cyl_bessel_kl.cpp
  62
+		cyl_neumannl.cpp ellint_1l.cpp ellint_2l.cpp ellint_3l.cpp
  63
+		expintl.cpp hermitel.cpp laguerrel.cpp legendrel.cpp
  64
+		riemann_zetal.cpp sph_bessell.cpp sph_legendrel.cpp
  65
+		sph_neumannl.cpp
  66
+
  67
+		SHARED_COMPILE_FLAGS "-DBOOST_MATH_TR1_DYN_LINK=1"
  68
+		COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
  69
+	)
  70
+
  71
+	boost_add_library(math_c99l
  72
+
  73
+		acoshl.cpp asinhl.cpp atanhl.cpp cbrtl.cpp copysignl.cpp
  74
+		erfcl.cpp erfl.cpp expm1l.cpp fmaxl.cpp fminl.cpp
  75
+		fpclassifyl.cpp hypotl.cpp lgammal.cpp llroundl.cpp log1pl.cpp
  76
+		lroundl.cpp nextafterl.cpp nexttowardl.cpp roundl.cpp
  77
+		tgammal.cpp truncl.cpp
  78
+
  79
+		SHARED_COMPILE_FLAGS "-DBOOST_MATH_TR1_DYN_LINK=1"
  80
+		COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
  81
+	)
  82
+ELSE ()
  83
+	colormsg(RED "+-- long double not supported, skipping math_*l libraries.")
  84
+ENDIF ()

0 notes on commit 8aa99f2

Please sign in to comment.
Something went wrong with that request. Please try again.