diff --git a/index/native/alire-index-gnat.ads b/index/native/alire-index-gnat.ads index b01918d8..ff8c7b4c 100644 --- a/index/native/alire-index-gnat.ads +++ b/index/native/alire-index-gnat.ads @@ -4,7 +4,11 @@ package Alire.Index.GNAT is ("GNAT is a compiler for the Ada programming language"); Base : constant Release := Project.Unreleased - (Properties => Path ("/usr/bin")); + (Properties => + Path ("/usr/bin"), + + Available_When => + Target = Native); -- If minor versions proved important they could be segregated with platform-specific knowledge diff --git a/src/alire-index.ads b/src/alire-index.ads index 559130e2..3b0df2c6 100644 --- a/src/alire-index.ads +++ b/src/alire-index.ads @@ -244,6 +244,7 @@ package Alire.Index is use all type Licensing.Licenses; use all type Platforms.Compilers; use all type Platforms.Operating_Systems; + use all type Platforms.Targets; use all type Platforms.Versions; use all type Platforms.Word_Sizes; use all type Properties.Property'Class; @@ -328,11 +329,14 @@ package Alire.Index is use all type Requisites.Platform.Distributions.Comparable; function Operating_System is new Requisites.Platform.Op_Systems.Factory; - use all type Requisites.Platform.Op_Systems.Comparable; + use all type Requisites.Platform.Op_Systems.Comparable; function Distro_Release is new Requisites.Platform.Versions.Factory; use all type Requisites.Platform.Versions.Comparable; + function Target is new Requisites.Platform.Targets.Factory; + use all type Requisites.Platform.Targets.Comparable; + function Word_Size is new Requisites.Platform.Word_Sizes.Factory; use all type Requisites.Platform.Word_Sizes.Comparable; diff --git a/src/alire-platforms.ads b/src/alire-platforms.ads index 52ec6baf..d327a99c 100644 --- a/src/alire-platforms.ads +++ b/src/alire-platforms.ads @@ -18,6 +18,10 @@ package Alire.Platforms with Preelaborate is Windows, OS_Unknown); + type Targets is (Native, + Unknown_Cross_Target); + -- Minimal preparations for cross-compiling + type Distributions is (Debian, Ubuntu, Distro_Unknown); diff --git a/src/alire-properties-platform.ads b/src/alire-properties-platform.ads index c19970bf..f6873f6c 100644 --- a/src/alire-properties-platform.ads +++ b/src/alire-properties-platform.ads @@ -13,6 +13,9 @@ package Alire.Properties.Platform with Preelaborate is package Operating_Systems is new Values (Platforms.Operating_Systems, Platforms.Operating_Systems'Image); + package Targets is new Values (Platforms.Targets, + Platforms.Targets'Image); + package Versions is new Values (Platforms.Versions, Platforms.Versions'Image); @@ -26,6 +29,8 @@ package Alire.Properties.Platform with Preelaborate is function System_Is (OS : Platforms.Operating_Systems) return Vector renames Operating_Systems.New_Vector; + function Target_Is (T : Platforms.Targets) return Vector renames Targets.New_Vector; + function Version_Is (V : Platforms.Versions) return Vector renames Versions.New_Vector; function Word_Size_Is (V : Platforms.Word_Sizes) return Vector renames Word_Sizes.New_Vector; diff --git a/src/alire-requisites-platform.ads b/src/alire-requisites-platform.ads index a29457f5..c7e60511 100644 --- a/src/alire-requisites-platform.ads +++ b/src/alire-requisites-platform.ads @@ -48,6 +48,12 @@ package Alire.Requisites.Platform with Preelaborate is package Distribution_Cases_Props is new Conditional.For_Properties.Case_Statements (Ps.Distributions, Distributions.Is_Equal_To); + package Targets is new Comparables + (Ps.Targets, Ps."<", Ps.Targets'Image, + PrPl.Targets.Property, + PrPl.Targets.Element, + "Target"); + package Versions is new Comparables (Ps.Versions, Ps."<", Ps.Versions'Image, PrPl.Versions.Property,