@@ -64,20 +64,13 @@ def emgiacSourceDir = "$externalSourceDir/emgiac"
6464
6565def jsPrebuiltDir = " src/giac.js/prebuilt"
6666def LlvmMpfrA = " $jsPrebuiltDir /libmpfr.a"
67+ def LlvmMpfiA = " $jsPrebuiltDir /libmpfi.a"
6768def LlvmGmpA = " $jsPrebuiltDir /libgmp.a"
68- if (System . env[' EXT_GMPMPFR' ] != null && System . env[' EXT_GMPMPFR' ] == " local" ) {
69- LlvmMpfrA = " $mpfrSourceDir /src/.libs/libmpfr.a"
70- LlvmGmpA = " $gmpSourceDir /.libs/libgmp.a"
71- }
72- if (System . env[' EXT_GMPMPFR' ] != null && System . env[' EXT_GMPMPFR' ] == " emgiac" ) {
73- LlvmMpfrA = " $emgiacSourceDir /giac/libmpfr.a"
74- LlvmGmpA = " $emgiacSourceDir /giac/libgmp.a"
75- }
7669
7770def emsdkDir = file(' emsdk' )
7871def emsdkRunDir = file(" $emsdkDir " )
7972
80- def emscriptenVersion = ' tag-3.1.18 '
73+ def emscriptenVersion = ' tag-3.1.41 '
8174if (System . env[' EMSCRIPTEN_VERSION' ] != null ) {
8275 emscriptenVersion = System . env[' EMSCRIPTEN_VERSION' ]
8376}
@@ -88,7 +81,7 @@ def emccCommand = "${emscriptenDir}/emcc"
8881// End of emscripten related settings. Huh.
8982def java_home = org.gradle.internal.jvm.Jvm . current(). javaHome
9083ext. ggrev = project. findProperty(" revision" ) ?: " SNAPSHOT"
91- def giacVersion = ' "1.2.4 -' + ggrev + ' "'
84+ def giacVersion = ' "1.9.0 -' + ggrev + ' "'
9285println giacVersion
9386import org.apache.tools.ant.taskdefs.condition.Os
9487def isMac = Os . isFamily(Os . FAMILY_MAC )
@@ -934,12 +927,12 @@ tasks.addRule("Pattern: emccCompileWasm_<FILE>Cc: Compile <FILE>.cc into <FILE>.
934927 def commandline = emccCommand
935928 commandline + = ' -DIN_GIAC -DGIAC_GENERIC_CONSTANTS -DHAVE_CONFIG_H -DNO_STDEXCEPT -fno-exceptions' // from old Makefile
936929 commandline + = ' -DVERSION=' + giacVersion
937- commandline + = " -Dgammaf=tgammaf -s ALLOW_MEMORY_GROWTH=1"
930+ commandline + = " -Dgammaf=tgammaf -s ALLOW_MEMORY_GROWTH=1 -std=gnu++14 "
938931 commandline + = " -s WASM=1 -s NO_EXIT_RUNTIME=1"
939932 commandline + = " -s PRECISE_I64_MATH=1 -Oz" // new setting
940933 commandline + = " -DHAVE_UNISTD_H"
941934 commandline + = ' -DGIAC_GGB' // from old Makefile
942- commandline + = ' -DTIMEOUT -DEMCC2 ' // from old config.h
935+ commandline + = ' -DTIMEOUT -DEMCC2 -DHAVE_LIBMPFI ' // from old config.h
943936 commandline + = " -Isrc/giac/headers -c $input -o $output "
944937 println " Compiling: ${ commandline} "
945938 commandLine commandline. split()
@@ -988,11 +981,12 @@ task emccGiacJsWasm(dependsOn: 'emccCompileWasm') {
988981
989982 file(binaryJsDir). mkdirs()
990983 exec {
984+ linkerArgs << LlvmMpfiA
991985 linkerArgs << LlvmMpfrA // mpfr must precede gmp, see http://www.mpfr.org/faq.html, Q5
992986 linkerArgs << LlvmGmpA
993987 linkerArgs << ' --js-library' << ' src/giac.js/js/time.js'
994988
995- linkerArgs << ' -DGIAC_GGB'
989+ linkerArgs << ' -DGIAC_GGB' << " -std=gnu++14 "
996990 linkerArgs << ' -o' << output
997991 // linkerArgs << "-s" << "DISABLE_EXCEPTION_CATCHING=0"
998992 linkerArgs << ' -Oz' << ' -v' << ' -s' << " EXPORTED_FUNCTIONS=['_caseval']"
0 commit comments