forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,14 @@ | |
# | ||
# SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
||
|
||
import os | ||
|
||
import spack.build_systems.autotools | ||
import spack.build_systems.cmake | ||
from spack.package import * | ||
|
||
|
||
class Cln(AutotoolsPackage): | ||
class Cln(CMakePackage, AutotoolsPackage): | ||
"""CLN is a library for efficient computations with all kinds of numbers | ||
in arbitrary precision. It features number classes for unlimited length | ||
integers, rationals, arbitrary precision floating point numbers and much | ||
|
@@ -40,16 +41,34 @@ class Cln(AutotoolsPackage): | |
|
||
variant("gmp", default=True, description="Enable GMP multiprecision library") | ||
|
||
depends_on("autoconf", type="build") | ||
depends_on("automake", type="build") | ||
depends_on("libtool", type="build") | ||
depends_on("m4", type="build") | ||
# Build system | ||
build_system( | ||
conditional("cmake", when="@1.3:"), | ||
conditional("autotools", when="@:1.2.2"), | ||
default="cmake", | ||
) | ||
|
||
with when("build_system=autotools"): | ||
depends_on("autoconf", type="build") | ||
depends_on("automake", type="build") | ||
depends_on("libtool", type="build") | ||
depends_on("m4", type="build") | ||
depends_on("texinfo", type="build") | ||
# Dependencies required to define macro AC_LIB_LINKFLAGS_FROM_LIBS | ||
depends_on("gettext", type="build") | ||
|
||
with when("build_system=cmake"): | ||
depends_on("cmake", type="build") | ||
|
||
depends_on("[email protected]:", when="+gmp") | ||
depends_on("texinfo", type="build") | ||
|
||
# Dependencies required to define macro AC_LIB_LINKFLAGS_FROM_LIBS | ||
depends_on("gettext", type="build") | ||
|
||
class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder): | ||
def cmake_args(self): | ||
return [self.define_from_variant("CLN_USE_GMP", "gmp")] | ||
|
||
|
||
class AutotoolsBuilder(spack.build_systems.autotools.AutotoolsBuilder): | ||
def autoreconf(self, spec, prefix): | ||
autoreconf_args = ["-i"] | ||
|
||
|