xmake.lua 1.2 KB

123456789101112131415161718192021222324252627
  1. package("mpc")
  2. set_homepage("http://www.multiprecision.org/mpc/")
  3. set_description("GNU MPC is a C library for the arithmetic of complex numbers with arbitrarily high precision and correct rounding of the result.")
  4. set_license("LGPL-3.0")
  5. add_urls("https://ftp.gnu.org/gnu/mpc/mpc-$(version).tar.gz")
  6. add_versions("1.2.1", "17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459")
  7. add_deps("gmp", "mpfr")
  8. on_install("macosx", "linux", function (package)
  9. local configs = {"--disable-dependency-tracking", "--with-pic"}
  10. table.insert(configs, "--with-gmp=" .. package:dep("gmp"):installdir())
  11. table.insert(configs, "--with-mpfr=" .. package:dep("mpfr"):installdir())
  12. if package:config("shared") then
  13. table.insert(configs, "--enable-shared=yes")
  14. table.insert(configs, "--enable-static=no")
  15. else
  16. table.insert(configs, "--enable-static=yes")
  17. table.insert(configs, "--enable-shared=no")
  18. end
  19. import("package.tools.autoconf").install(package, configs)
  20. end)
  21. on_test(function (package)
  22. assert(package:has_cfuncs("mpc_add", {includes = "mpc.h"}))
  23. end)