import.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #!/bin/sh
  2. set -e
  3. BASE_URL=https://raw.githubusercontent.com/freebsd/freebsd/"${1}"/lib/msun/src
  4. download_source() {
  5. REMOTE_FILENAME=$1
  6. LOCAL_FILENAME=$2
  7. while true; do
  8. curl -o "src/${LOCAL_FILENAME}" "${BASE_URL}/${REMOTE_FILENAME}" && break
  9. done
  10. }
  11. mkdir -p src
  12. # headers
  13. download_source math.h fdlibm.h
  14. download_source math_private.h math_private.h
  15. # Math.acos
  16. download_source e_acos.c e_acos.cpp
  17. # Math.acosh
  18. download_source e_acosh.c e_acosh.cpp
  19. # Math.asin
  20. download_source e_asin.c e_asin.cpp
  21. # Math.asinh
  22. download_source s_asinh.c s_asinh.cpp
  23. # Math.atan
  24. download_source s_atan.c s_atan.cpp
  25. # Math.atanh
  26. download_source e_atanh.c e_atanh.cpp
  27. # Math.atan2
  28. download_source e_atan2.c e_atan2.cpp
  29. # Math.cbrt
  30. download_source s_cbrt.c s_cbrt.cpp
  31. # Math.ceil
  32. download_source s_ceil.c s_ceil.cpp
  33. download_source s_ceilf.c s_ceilf.cpp
  34. # Math.cos (not used due to poor performance)
  35. # Math.cosh
  36. download_source e_cosh.c e_cosh.cpp
  37. # Math.exp
  38. download_source e_exp.c e_exp.cpp
  39. # Math.expm1
  40. download_source s_expm1.c s_expm1.cpp
  41. # Math.floor and Math.round
  42. download_source s_floor.c s_floor.cpp
  43. # Math.fround
  44. download_source s_floorf.c s_floorf.cpp
  45. # Math.hypot
  46. download_source e_hypot.c e_hypot.cpp
  47. # Math.log
  48. download_source e_log.c e_log.cpp
  49. # Math.log1p
  50. download_source s_log1p.c s_log1p.cpp
  51. # Math.log10
  52. download_source e_log10.c e_log10.cpp
  53. download_source k_log.h k_log.h
  54. # Math.log2
  55. download_source e_log2.c e_log2.cpp
  56. # Math.pow (not used due to poor performance)
  57. # Math.sin (not used due to poor performance)
  58. # Math.sinh
  59. download_source e_sinh.c e_sinh.cpp
  60. # Math.sqrt (not used due to poor performance)
  61. # Math.tan (not used due to poor performance)
  62. # Math.tanh
  63. download_source s_tanh.c s_tanh.cpp
  64. # Math.trunc
  65. download_source s_trunc.c s_trunc.cpp
  66. download_source s_truncf.c s_truncf.cpp
  67. # dependencies
  68. download_source k_exp.c k_exp.cpp
  69. download_source s_copysign.c s_copysign.cpp
  70. download_source s_fabs.c s_fabs.cpp
  71. download_source s_scalbn.c s_scalbn.cpp
  72. # These are not not used in Math.* functions, but used internally.
  73. download_source e_pow.c e_pow.cpp
  74. download_source s_nearbyint.c s_nearbyint.cpp
  75. download_source s_rint.c s_rint.cpp
  76. download_source s_rintf.c s_rintf.cpp