From 9d1c20d26314791b5a83c221bcb4cb247a07d531 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Wed, 5 Feb 2025 18:04:42 +0000 Subject: [PATCH 01/25] Change to GAP stable-4.14 in CI --- .github/workflows/config_options.yml | 4 ++-- .github/workflows/os.yml | 8 ++++---- .github/workflows/ubuntu.yml | 1 + .github/workflows/valgrind.yml | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/config_options.yml b/.github/workflows/config_options.yml index 9d87afffd..1ef1f4b66 100644 --- a/.github/workflows/config_options.yml +++ b/.github/workflows/config_options.yml @@ -56,7 +56,7 @@ jobs: with: GAP_PKGS_TO_CLONE: NautyTracesInterface digraphs/graphviz GAP_PKGS_TO_BUILD: io orb datastructures grape NautyTracesInterface - GAPBRANCH: stable-4.13 + GAPBRANCH: stable-4.14 - name: Build Digraphs . . . uses: gap-actions/build-pkg@v1 with: @@ -95,7 +95,7 @@ jobs: with: GAP_PKGS_TO_CLONE: NautyTracesInterface digraphs/graphviz GAP_PKGS_TO_BUILD: io orb datastructures grape NautyTracesInterface - GAPBRANCH: stable-4.13 + GAPBRANCH: stable-4.14 - name: Build Digraphs . . . uses: gap-actions/build-pkg@v1 with: diff --git a/.github/workflows/os.yml b/.github/workflows/os.yml index 1a1eba4cd..e387d7baa 100644 --- a/.github/workflows/os.yml +++ b/.github/workflows/os.yml @@ -20,7 +20,7 @@ concurrency: jobs: test-unix: - name: ${{ matrix.os }}${{ matrix.ABI }} / GAP stable-4.13 + name: ${{ matrix.os }}${{ matrix.ABI }} / GAP stable-4.14 runs-on: ${{ matrix.os }}-latest strategy: fail-fast: false @@ -47,7 +47,7 @@ jobs: with: GAP_PKGS_TO_CLONE: ${{ matrix.pkgs-to-clone }} GAP_PKGS_TO_BUILD: ${{ matrix.pkgs-to-build }} - GAPBRANCH: stable-4.13 + GAPBRANCH: stable-4.14 ABI: ${{ matrix.ABI }} - name: Build Digraphs . . . uses: gap-actions/build-pkg@v1 @@ -83,7 +83,7 @@ jobs: GAP_TESTFILE: tst/github_actions/extreme.g test-cygwin: - name: cygwin / GAP stable-4.13 + name: cygwin / GAP stable-4.14 runs-on: windows-latest env: CHERE_INVOKING: 1 @@ -94,7 +94,7 @@ jobs: with: GAP_PKGS_TO_CLONE: NautyTracesInterface digraphs/graphviz GAP_PKGS_TO_BUILD: io orb datastructures grape NautyTracesInterface - GAPBRANCH: stable-4.13 + GAPBRANCH: stable-4.14 - uses: gap-actions/build-pkg@cygwin-v1 - name: Install digraphs-lib . . . run: | diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 3ba7c2b88..48b98e386 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -30,6 +30,7 @@ jobs: - stable-4.11 - stable-4.12 - stable-4.13 + - stable-4.14 only-needed: - true - false diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 40227c018..f431b677e 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -20,7 +20,7 @@ concurrency: jobs: test-valgrind: - name: Ubuntu / GAP stable-4.13 / valgrind + name: Ubuntu / GAP stable-4.14 / valgrind runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -33,7 +33,7 @@ jobs: with: GAP_PKGS_TO_CLONE: NautyTracesInterface digraphs/graphviz GAP_PKGS_TO_BUILD: io orb datastructures grape NautyTracesInterface - GAPBRANCH: stable-4.13 + GAPBRANCH: stable-4.14 CONFIGFLAGS: --enable-valgrind - name: Build Digraphs . . . uses: gap-actions/build-pkg@v1 From 4cc0df540943b473bf2f04d10b5f4f4a2943e03c Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Sun, 2 Mar 2025 15:31:16 +0000 Subject: [PATCH 02/25] Add HasPseudoSimilarVertices no docs --- gap/prop.gd | 1 + gap/prop.gi | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/gap/prop.gd b/gap/prop.gd index ee3ab4453..3850bc503 100644 --- a/gap/prop.gd +++ b/gap/prop.gd @@ -53,6 +53,7 @@ DeclareProperty("IsPermutationDigraph", IsDigraph); DeclareProperty("IsDistributiveLatticeDigraph", IsDigraph); DeclareProperty("IsModularLatticeDigraph", IsDigraph); DeclareProperty("IsTwoEdgeTransitive", IsDigraph); +DeclareProperty("HasPseudoSimilarVertices", IsDigraph); DeclareSynonymAttr("IsLatticeDigraph", IsMeetSemilatticeDigraph and IsJoinSemilatticeDigraph); DeclareSynonymAttr("IsPreorderDigraph", diff --git a/gap/prop.gi b/gap/prop.gi index e519535b2..a915e0428 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -699,7 +699,8 @@ function(D) fi; twoEdges := Filtered(Cartesian(DigraphEdges(D), DigraphEdges(D)), - pair -> pair[1][2] = pair[2][1] + + pair -> pair[1][2] = pair[2][1] and pair[1][1] <> pair[2][2]); if Length(twoEdges) = 0 then @@ -709,3 +710,23 @@ function(D) = Length(twoEdges); fi; end); + +InstallMethod(HasPseudoSimilarVertices, +"for a digraph without loops or multiple edges", +[IsDigraph], +function(D) + local u,v; + + for u in DigraphVertices(D) do + for v in DigraphVertices(D) do + if IsIsomorphicDigraph(DigraphRemoveVertex(D,u), + DigraphRemoveVertex(D,v)) + then + if v not in Orbit(AutomorphismGroup(D,u)) then + return true; + fi; + fi; + od; + od; +return false; +end); From f05eaf3de2f05014e0983f668384d1f305a868b2 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Sun, 2 Mar 2025 15:32:36 +0000 Subject: [PATCH 03/25] Fixed syntax --- gap/prop.gi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gap/prop.gi b/gap/prop.gi index a915e0428..378ea23b2 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -722,7 +722,7 @@ function(D) if IsIsomorphicDigraph(DigraphRemoveVertex(D,u), DigraphRemoveVertex(D,v)) then - if v not in Orbit(AutomorphismGroup(D,u)) then + if not v in Orbit(AutomorphismGroup(D,u)) then return true; fi; fi; From 5c5f5e8387aa5ff83e5d674a6b3e2ee860897e94 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Sun, 2 Mar 2025 15:38:57 +0000 Subject: [PATCH 04/25] fixed syntax --- gap/prop.gi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gap/prop.gi b/gap/prop.gi index 378ea23b2..c19f4c7e6 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -715,18 +715,18 @@ InstallMethod(HasPseudoSimilarVertices, "for a digraph without loops or multiple edges", [IsDigraph], function(D) - local u,v; + local u, v; for u in DigraphVertices(D) do for v in DigraphVertices(D) do - if IsIsomorphicDigraph(DigraphRemoveVertex(D,u), - DigraphRemoveVertex(D,v)) + if IsIsomorphicDigraph(DigraphRemoveVertex(D, u), + DigraphRemoveVertex(D, v)) then - if not v in Orbit(AutomorphismGroup(D,u)) then + if not v in Orbit(AutomorphismGroup(D), u) then return true; fi; fi; od; od; -return false; + return false; end); From 81a7065fab1729a18821d1bfdc4146c8479e6d0e Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Wed, 26 Mar 2025 14:23:10 +0000 Subject: [PATCH 05/25] Add HasPSVs --- doc/z-chap5.xml | 1 + gap/prop.gd | 1 - gap/prop.gi | 72 +++++++++++++++++++++++++------------------------ 3 files changed, 38 insertions(+), 36 deletions(-) diff --git a/doc/z-chap5.xml b/doc/z-chap5.xml index c12da5479..247f23626 100644 --- a/doc/z-chap5.xml +++ b/doc/z-chap5.xml @@ -76,6 +76,7 @@ <#Include Label="IsDigraphCore"> <#Include Label="IsEdgeTransitive"> <#Include Label="IsVertexTransitive"> + <#Include Label="IsTwoEdgeTransitive"> diff --git a/gap/prop.gd b/gap/prop.gd index 3850bc503..ee3ab4453 100644 --- a/gap/prop.gd +++ b/gap/prop.gd @@ -53,7 +53,6 @@ DeclareProperty("IsPermutationDigraph", IsDigraph); DeclareProperty("IsDistributiveLatticeDigraph", IsDigraph); DeclareProperty("IsModularLatticeDigraph", IsDigraph); DeclareProperty("IsTwoEdgeTransitive", IsDigraph); -DeclareProperty("HasPseudoSimilarVertices", IsDigraph); DeclareSynonymAttr("IsLatticeDigraph", IsMeetSemilatticeDigraph and IsJoinSemilatticeDigraph); DeclareSynonymAttr("IsPreorderDigraph", diff --git a/gap/prop.gi b/gap/prop.gi index c19f4c7e6..efd167a59 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -691,42 +691,44 @@ InstallMethod(IsTwoEdgeTransitive, "for a digraph without multiple edges", [IsDigraph], function(D) - local twoEdges; - - if IsMultiDigraph(D) then - ErrorNoReturn("the argument must be a digraph with no multiple", - " edges,"); - fi; - - twoEdges := Filtered(Cartesian(DigraphEdges(D), DigraphEdges(D)), - - pair -> pair[1][2] = pair[2][1] - and pair[1][1] <> pair[2][2]); - - if Length(twoEdges) = 0 then + local v, u, w, N, twoEdgeOrbit, aut, numTwoEdges, len; + + aut := AutomorphismGroup(D); + N := OutNeighbours(D); + + if Size(aut) > 10 ^ 3 then + numTwoEdges := 0; + for u in [1 .. Length(N)] do + for v in N[u] do + for w in N[v] do + if u <> w then + numTwoEdges := numTwoEdges + 1; + if IsBound(len) then + if numTwoEdges > len then + return false; + fi; + else + len := Order(aut) / Order(Stabilizer(aut, [u, v, w], OnTuples)); + fi; + fi; + od; + od; + od; return true; else - return OrbitLength(AutomorphismGroup(D), twoEdges[1], OnTuplesTuples) - = Length(twoEdges); - fi; -end); - -InstallMethod(HasPseudoSimilarVertices, -"for a digraph without loops or multiple edges", -[IsDigraph], -function(D) - local u, v; - - for u in DigraphVertices(D) do - for v in DigraphVertices(D) do - if IsIsomorphicDigraph(DigraphRemoveVertex(D, u), - DigraphRemoveVertex(D, v)) - then - if not v in Orbit(AutomorphismGroup(D), u) then - return true; - fi; - fi; + for u in [1 .. Length(N)] do + for v in N[u] do + for w in N[v] do + if u <> w then + if not IsBound(twoEdgeOrbit) then + twoEdgeOrbit := Orbit(AutomorphismGroup(D), [u, v, w], OnTuples); + elif IsBound(twoEdgeOrbit) and not [u, v, w] in twoEdgeOrbit then + return false; + fi; + fi; + od; + od; od; - od; - return false; + return true; + fi; end); From d3dac89ebfc2a9ee2a405be55a0c63d0ec76c344 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Wed, 26 Mar 2025 14:46:21 +0000 Subject: [PATCH 06/25] Is2EdgeTransitive overhaul using Orbit-Stabiliser Theorem --- doc/prop.xml | 17 ++++++++--------- doc/z-chap5.xml | 2 +- gap/prop.gd | 2 +- gap/prop.gi | 27 +++++++++++++++++---------- tst/standard/prop.tst | 18 +++++++++--------- tst/testinstall.tst | 4 ++-- 6 files changed, 38 insertions(+), 32 deletions(-) diff --git a/doc/prop.xml b/doc/prop.xml index 5ea727270..989b2edd0 100644 --- a/doc/prop.xml +++ b/doc/prop.xml @@ -1580,31 +1580,30 @@ false]]> <#/GAPDoc> -<#GAPDoc Label="IsTwoEdgeTransitive"> +<#GAPDoc Label="Is2EdgeTransitive"> - + true or false. - If digraph is a digraph without multiple edges, then IsTwoEdgeTransitive + If digraph is a digraph without multiple edges, then Is2EdgeTransitive returns true if digraph is 2-edge transitive, and false otherwise. A digraph is 2-edge transitive if its automorphism group acts transitively on its 2-edges via the action . - A 2-edge of a digraph is a pair of its edges, such that the range of the - first edge is equal to the source of the second edge. + A 2-edge in a digraph is a triple (u, v, w) of vertices such that, such that (u, v) and (v, w) are both edges.

&MUTABLE_RECOMPUTED_PROP; IsTwoEdgeTransitive(CompleteDigraph(4)); +gap> Is2EdgeTransitive(CompleteDigraph(4)); true -gap> IsTwoEdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1], [3, 4]])) +gap> Is2EdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1], [3, 4]])) false -gap> IsTwoEdgeTransitive(CycleDigraph(5)); +gap> Is2EdgeTransitive(CycleDigraph(5)); true -gap> IsTwoEdgeTransitive(Digraph([[2], [3, 3, 3], []])); +gap> Is2EdgeTransitive(Digraph([[2], [3, 3, 3], []])); Error, the argument must be a digraph with no multiple edges, ]]> diff --git a/doc/z-chap5.xml b/doc/z-chap5.xml index 247f23626..a9c3107f8 100644 --- a/doc/z-chap5.xml +++ b/doc/z-chap5.xml @@ -76,7 +76,7 @@ <#Include Label="IsDigraphCore"> <#Include Label="IsEdgeTransitive"> <#Include Label="IsVertexTransitive"> - <#Include Label="IsTwoEdgeTransitive"> + <#Include Label="Is2EdgeTransitive"> diff --git a/gap/prop.gd b/gap/prop.gd index ee3ab4453..a25712a08 100644 --- a/gap/prop.gd +++ b/gap/prop.gd @@ -52,7 +52,7 @@ DeclareProperty("IsMeetSemilatticeDigraph", IsDigraph); DeclareProperty("IsPermutationDigraph", IsDigraph); DeclareProperty("IsDistributiveLatticeDigraph", IsDigraph); DeclareProperty("IsModularLatticeDigraph", IsDigraph); -DeclareProperty("IsTwoEdgeTransitive", IsDigraph); +DeclareProperty("Is2EdgeTransitive", IsDigraph); DeclareSynonymAttr("IsLatticeDigraph", IsMeetSemilatticeDigraph and IsJoinSemilatticeDigraph); DeclareSynonymAttr("IsPreorderDigraph", diff --git a/gap/prop.gi b/gap/prop.gi index efd167a59..e4bca33ee 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -687,20 +687,27 @@ function(D) return LatticeDigraphEmbedding(N5, D) = fail; end); -InstallMethod(IsTwoEdgeTransitive, -"for a digraph without multiple edges", +InstallMethod(Is2EdgeTransitive, +"for a digraph without loops or multiple edges", [IsDigraph], function(D) - local v, u, w, N, twoEdgeOrbit, aut, numTwoEdges, len; + local v, u, w, OutNeighboursD, twoEdgeOrbit, aut, numTwoEdges, len; + + if IsMultiDigraph(D) then + ErrorNoReturn("the argument must be a digraph with no multiple", + " edges,"); + elif DigraphHasLoops(D) then + ErrorNoReturn("the argument must be a digraph without loops,"); + fi; aut := AutomorphismGroup(D); - N := OutNeighbours(D); + OutNeighboursD := OutNeighbours(D); if Size(aut) > 10 ^ 3 then numTwoEdges := 0; - for u in [1 .. Length(N)] do - for v in N[u] do - for w in N[v] do + for u in [1 .. Length(OutNeighboursD)] do + for v in OutNeighboursD[u] do + for w in OutNeighboursD[v] do if u <> w then numTwoEdges := numTwoEdges + 1; if IsBound(len) then @@ -716,9 +723,9 @@ function(D) od; return true; else - for u in [1 .. Length(N)] do - for v in N[u] do - for w in N[v] do + for u in [1 .. Length(OutNeighboursD)] do + for v in OutNeighboursD[u] do + for w in OutNeighboursD[v] do if u <> w then if not IsBound(twoEdgeOrbit) then twoEdgeOrbit := Orbit(AutomorphismGroup(D), [u, v, w], OnTuples); diff --git a/tst/standard/prop.tst b/tst/standard/prop.tst index b459e4ee3..503ca8dbb 100644 --- a/tst/standard/prop.tst +++ b/tst/standard/prop.tst @@ -1679,22 +1679,22 @@ true gap> IsEdgeTransitive(Digraph([[2], [3, 3, 3], []])); Error, the argument must be a digraph with no multiple edges, -# IsTwoEdgeTransitive -gap> IsTwoEdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1]])); +# Is2EdgeTransitive +gap> Is2EdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1]])); true -gap> IsTwoEdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1], [3, 4]])); +gap> Is2EdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1], [3, 4]])); false -gap> IsTwoEdgeTransitive(CompleteDigraph(4)); +gap> Is2EdgeTransitive(CompleteDigraph(4)); true -gap> IsTwoEdgeTransitive(CycleDigraph(100)); +gap> Is2EdgeTransitive(CycleDigraph(100)); true -gap> IsTwoEdgeTransitive(CompleteBipartiteDigraph(11, 23)); +gap> Is2EdgeTransitive(CompleteBipartiteDigraph(11, 23)); false -gap> IsTwoEdgeTransitive(DigraphByEdges([[1, 2]])); +gap> Is2EdgeTransitive(DigraphByEdges([[1, 2]])); true -gap> IsTwoEdgeTransitive(DigraphByEdges([])); +gap> Is2EdgeTransitive(DigraphByEdges([])); true -gap> IsTwoEdgeTransitive(Digraph([[2], [3, 3, 3], []])); +gap> Is2EdgeTransitive(Digraph([[2], [3, 3, 3], []])); Error, the argument must be a digraph with no multiple edges, # DigraphHasNoVertices and DigraphHasAVertex diff --git a/tst/testinstall.tst b/tst/testinstall.tst index 36a7e9c06..0f5f15ba1 100644 --- a/tst/testinstall.tst +++ b/tst/testinstall.tst @@ -436,8 +436,8 @@ rec( distances := [ [ 0, 5 ], [ 5, 0 ] ], gap> EdgeWeightedDigraphShortestPath(d, 1, 2); [ [ 1, 2 ], [ 1 ] ] -# IsTwoEdgeTransitive -gap> IsTwoEdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1]])); +# Is2EdgeTransitive +gap> Is2EdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1]])); true # Issue 617: bug in DigraphRemoveEdge, wasn't removing edge labels From 51a3664b38bfa9b6ee95595b1133c33dc249c058 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Wed, 26 Mar 2025 15:30:55 +0000 Subject: [PATCH 07/25] Added support for digraphs with loops --- doc/prop.xml | 3 ++- gap/prop.gi | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/prop.xml b/doc/prop.xml index 989b2edd0..c7cd37fe2 100644 --- a/doc/prop.xml +++ b/doc/prop.xml @@ -1591,7 +1591,8 @@ false]]> acts transitively on its 2-edges via the action . - A 2-edge in a digraph is a triple (u, v, w) of vertices such that, such that (u, v) and (v, w) are both edges. + A 2-edge in a digraph is a triple (u, v, w) of vertices, + such that (u, v) and (v, w) are both edges and u is not equal to w.

&MUTABLE_RECOMPUTED_PROP; diff --git a/gap/prop.gi b/gap/prop.gi index e4bca33ee..f38ebc7af 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -688,7 +688,7 @@ function(D) end); InstallMethod(Is2EdgeTransitive, -"for a digraph without loops or multiple edges", +"for a digraph without multiple edges", [IsDigraph], function(D) local v, u, w, OutNeighboursD, twoEdgeOrbit, aut, numTwoEdges, len; @@ -696,8 +696,6 @@ function(D) if IsMultiDigraph(D) then ErrorNoReturn("the argument must be a digraph with no multiple", " edges,"); - elif DigraphHasLoops(D) then - ErrorNoReturn("the argument must be a digraph without loops,"); fi; aut := AutomorphismGroup(D); From c9f28eff2361b2b02fb32fdf0b0a047103237693 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Wed, 26 Mar 2025 15:56:03 +0000 Subject: [PATCH 08/25] Linting --- doc/prop.xml | 2 +- gap/prop.gi | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/prop.xml b/doc/prop.xml index c7cd37fe2..664d0a767 100644 --- a/doc/prop.xml +++ b/doc/prop.xml @@ -1600,7 +1600,7 @@ false]]> Is2EdgeTransitive(CompleteDigraph(4)); true -gap> Is2EdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1], [3, 4]])) +gap> Is2EdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1], [3, 4]])); false gap> Is2EdgeTransitive(CycleDigraph(5)); true diff --git a/gap/prop.gi b/gap/prop.gi index f38ebc7af..67b131e27 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -692,7 +692,7 @@ InstallMethod(Is2EdgeTransitive, [IsDigraph], function(D) local v, u, w, OutNeighboursD, twoEdgeOrbit, aut, numTwoEdges, len; - + if IsMultiDigraph(D) then ErrorNoReturn("the argument must be a digraph with no multiple", " edges,"); @@ -712,7 +712,7 @@ function(D) if numTwoEdges > len then return false; fi; - else + else len := Order(aut) / Order(Stabilizer(aut, [u, v, w], OnTuples)); fi; fi; From 35033ece53077777bdcf23d4b2ba82dacefec8a9 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Wed, 26 Mar 2025 16:13:51 +0000 Subject: [PATCH 09/25] More linting --- doc/prop.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/prop.xml b/doc/prop.xml index 664d0a767..3ab79d840 100644 --- a/doc/prop.xml +++ b/doc/prop.xml @@ -1600,7 +1600,8 @@ false]]> Is2EdgeTransitive(CompleteDigraph(4)); true -gap> Is2EdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1], [3, 4]])); +gap> Is2EdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1], + [3, 4]])); false gap> Is2EdgeTransitive(CycleDigraph(5)); true From 02a088cab663bdad85ded6165580ed094a3a52ec Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Wed, 26 Mar 2025 16:24:44 +0000 Subject: [PATCH 10/25] Edited Documentation --- doc/prop.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/prop.xml b/doc/prop.xml index 3ab79d840..9c148266a 100644 --- a/doc/prop.xml +++ b/doc/prop.xml @@ -1588,7 +1588,7 @@ false]]> If digraph is a digraph without multiple edges, then Is2EdgeTransitive returns true if digraph is 2-edge transitive, and false otherwise. A digraph is 2-edge transitive if its automorphism group - acts transitively on its 2-edges via the action + acts transitively on 2-edges via the action . A 2-edge in a digraph is a triple (u, v, w) of vertices, From e1eb03efeb196576b3c6b7f0e2e411a814ddaf79 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Wed, 26 Mar 2025 16:35:29 +0000 Subject: [PATCH 11/25] Edited Documentation again --- doc/prop.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/prop.xml b/doc/prop.xml index 9c148266a..f171a04fb 100644 --- a/doc/prop.xml +++ b/doc/prop.xml @@ -1600,8 +1600,7 @@ false]]> Is2EdgeTransitive(CompleteDigraph(4)); true -gap> Is2EdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 1], - [3, 4]])); +gap> Is2EdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 4]])); false gap> Is2EdgeTransitive(CycleDigraph(5)); true From bc3d5572c1084056b34b7a61ecc3e924a0826b05 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Sat, 26 Apr 2025 14:39:53 +0100 Subject: [PATCH 12/25] Once more rewritten Is2EdgeTransitive, this time to avoid looping through all triples of vertices, and instead checks center vertices of 2-edges --- doc/prop.xml | 6 +-- gap/prop.gi | 102 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 67 insertions(+), 41 deletions(-) diff --git a/doc/prop.xml b/doc/prop.xml index f171a04fb..ef90cd68c 100644 --- a/doc/prop.xml +++ b/doc/prop.xml @@ -1589,10 +1589,10 @@ false]]> returns true if digraph is 2-edge transitive, and false otherwise. A digraph is 2-edge transitive if its automorphism group acts transitively on 2-edges via the action - . + . - A 2-edge in a digraph is a triple (u, v, w) of vertices, - such that (u, v) and (v, w) are both edges and u is not equal to w. + A 2-edge in a digraph is a triple (u, v, w) of disctinct vertices + such that (u, v) and (v, w) are edges.

&MUTABLE_RECOMPUTED_PROP; diff --git a/gap/prop.gi b/gap/prop.gi index 67b131e27..df16643cd 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -691,49 +691,75 @@ InstallMethod(Is2EdgeTransitive, "for a digraph without multiple edges", [IsDigraph], function(D) - local v, u, w, OutNeighboursD, twoEdgeOrbit, aut, numTwoEdges, len; - + local Aut, O, I, Centers, Count, In, Out, u, v, w; if IsMultiDigraph(D) then ErrorNoReturn("the argument must be a digraph with no multiple", " edges,"); fi; - aut := AutomorphismGroup(D); - OutNeighboursD := OutNeighbours(D); - - if Size(aut) > 10 ^ 3 then - numTwoEdges := 0; - for u in [1 .. Length(OutNeighboursD)] do - for v in OutNeighboursD[u] do - for w in OutNeighboursD[v] do - if u <> w then - numTwoEdges := numTwoEdges + 1; - if IsBound(len) then - if numTwoEdges > len then - return false; - fi; - else - len := Order(aut) / Order(Stabilizer(aut, [u, v, w], OnTuples)); - fi; - fi; - od; - od; - od; - return true; - else - for u in [1 .. Length(OutNeighboursD)] do - for v in OutNeighboursD[u] do - for w in OutNeighboursD[v] do - if u <> w then - if not IsBound(twoEdgeOrbit) then - twoEdgeOrbit := Orbit(AutomorphismGroup(D), [u, v, w], OnTuples); - elif IsBound(twoEdgeOrbit) and not [u, v, w] in twoEdgeOrbit then - return false; - fi; - fi; - od; - od; - od; + Aut := AutomorphismGroup(D); + D := DigraphRemoveLoops(D); + O := D!.OutNeighbours; + I := InNeighbours(D); + Centers := []; + + for u in [1 .. Length(O)] do + if Length(O[u]) > 0 and Length(I[u]) > 0 then + #Centre must not be part of a lone pair + if Length(O[u]) = 1 and Length(I[u]) = 1 then + if O[u][1] = I[u][1] then + continue; + fi; + fi; + if not IsBound(Out) then + Out := Length(O[u]); + In := Length(I[u]); + fi; + #Check that centers have the same in degree + #and out degree + if Out <> Length(O[u]) or In <> Length(I[u]) then + return false; + fi; + Add(Centers, u); + fi; + od; + + #If centers in empty that D is vacuously 2-edge transitive + if Length(Centers) = 0 then return true; fi; + + #Find the number of 2-cycles at a center + Count := 0; + for v in O[Centers[1]] do + if Centers[1] in O[v] then + Count := Count + 1; + fi; + od; + + #Find a 2-edge and check if its orbit length equals the number of 2-edges. + for u in I[Centers[1]] do + if Position(O[Centers[1]], u) = 1 then + if Length(O[Centers[1]]) = 1 then + continue; + else + return (In * Out - Count) * Length(Centers) = + Order(Aut) / Order(Stabilizer(Aut, + [u, + Centers[1], + O[Centers[1]][2]], + OnTuples)); + fi; + else + return (In * Out - Count) * Length(Centers) = + Order(Aut) / Order(Stabilizer(Aut, + [u, + Centers[1], + O[Centers[1]][1]], + OnTuples)); + fi; + od; end); + + + From e62fc7e9e5bb059fcc9ec163c9550790d24dd38f Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Sat, 26 Apr 2025 14:47:42 +0100 Subject: [PATCH 13/25] lint --- doc/prop.xml | 2 +- gap/prop.gi | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/prop.xml b/doc/prop.xml index ef90cd68c..11af93010 100644 --- a/doc/prop.xml +++ b/doc/prop.xml @@ -1591,7 +1591,7 @@ false]]> acts transitively on 2-edges via the action . - A 2-edge in a digraph is a triple (u, v, w) of disctinct vertices + A 2-edge in a digraph is a triple (u, v, w) of distinct vertices such that (u, v) and (v, w) are edges.

diff --git a/gap/prop.gi b/gap/prop.gi index df16643cd..ba005e381 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -691,13 +691,13 @@ InstallMethod(Is2EdgeTransitive, "for a digraph without multiple edges", [IsDigraph], function(D) - local Aut, O, I, Centers, Count, In, Out, u, v, w; + local Aut, O, I, Centers, Count, In, Out, u; if IsMultiDigraph(D) then ErrorNoReturn("the argument must be a digraph with no multiple", " edges,"); fi; - Aut := AutomorphismGroup(D); + Aut := AutomorphismGroup(D); D := DigraphRemoveLoops(D); O := D!.OutNeighbours; I := InNeighbours(D); @@ -706,6 +706,7 @@ function(D) for u in [1 .. Length(O)] do if Length(O[u]) > 0 and Length(I[u]) > 0 then #Centre must not be part of a lone pair + if Length(O[u]) = 1 and Length(I[u]) = 1 then if O[u][1] = I[u][1] then continue; @@ -717,27 +718,29 @@ function(D) fi; #Check that centers have the same in degree #and out degree + if Out <> Length(O[u]) or In <> Length(I[u]) then return false; fi; Add(Centers, u); fi; od; - #If centers in empty that D is vacuously 2-edge transitive + if Length(Centers) = 0 then return true; fi; - #Find the number of 2-cycles at a center + Count := 0; - for v in O[Centers[1]] do - if Centers[1] in O[v] then + for u in O[Centers[1]] do + if Centers[1] in O[u] then Count := Count + 1; fi; od; #Find a 2-edge and check if its orbit length equals the number of 2-edges. + for u in I[Centers[1]] do if Position(O[Centers[1]], u) = 1 then if Length(O[Centers[1]]) = 1 then @@ -760,6 +763,3 @@ function(D) fi; od; end); - - - From 141408188a9496aab0477ce647185da3e339dc01 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Sat, 26 Apr 2025 15:00:27 +0100 Subject: [PATCH 14/25] Added more comments to prop.gi --- gap/prop.gi | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/gap/prop.gi b/gap/prop.gi index ba005e381..e33160847 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -701,23 +701,29 @@ function(D) D := DigraphRemoveLoops(D); O := D!.OutNeighbours; I := InNeighbours(D); + # The list Centers will store all those vertices which lie at the + # center of a 2-edge. + Centers := []; for u in [1 .. Length(O)] do if Length(O[u]) > 0 and Length(I[u]) > 0 then - #Centre must not be part of a lone pair + # If u has precisly one in neighbour and out neighbour, + # we must check these are not the same vertex as then there + # would be no 2-edge centered at u. if Length(O[u]) = 1 and Length(I[u]) = 1 then if O[u][1] = I[u][1] then continue; - fi; + fi; fi; if not IsBound(Out) then Out := Length(O[u]); In := Length(I[u]); fi; - #Check that centers have the same in degree - #and out degree + # For D to be 2-edge transitive, it must be transitive + # on 2-edge centers, so all 2-edge centers must have the + # same in-degree and same out-degree. if Out <> Length(O[u]) or In <> Length(I[u]) then return false; @@ -725,12 +731,15 @@ function(D) Add(Centers, u); fi; od; - #If centers in empty that D is vacuously 2-edge transitive + # If Centers is empty, D has no 2-edges so is vacuously 2-edge + # transtive. if Length(Centers) = 0 then return true; fi; - #Find the number of 2-cycles at a center + # Find the number of 2-cycles at any center. We will have to subtract + # these from the total number of 2-edges as 2-cycles are not classed + # as 2-edges. Count := 0; for u in O[Centers[1]] do @@ -739,7 +748,13 @@ function(D) fi; od; - #Find a 2-edge and check if its orbit length equals the number of 2-edges. + # Find a 2-edge and check if its orbit length equals the number of 2-edges. + # By this point, we know that D is likely a highly symmetric digraph, + # since all 2-edge centers share a common in and out degree + # (This is by no means a guarantee, see Frucht's graph). From testing, + # calculating the stabilizer and using the orbit-stabilizer + # theorem is usually must faster in this case, so we instead determine + # the stabilizer of a 2-edge. for u in I[Centers[1]] do if Position(O[Centers[1]], u) = 1 then From 733cc5f846d22920e7051a5cc875c1ff1ccfca5e Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Sat, 26 Apr 2025 15:03:10 +0100 Subject: [PATCH 15/25] Fix trailing whitespace --- gap/prop.gi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gap/prop.gi b/gap/prop.gi index e33160847..22ee67fae 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -708,7 +708,7 @@ function(D) for u in [1 .. Length(O)] do if Length(O[u]) > 0 and Length(I[u]) > 0 then - # If u has precisly one in neighbour and out neighbour, + # If u has precisely one in neighbour and out neighbour, # we must check these are not the same vertex as then there # would be no 2-edge centered at u. @@ -750,8 +750,8 @@ function(D) # Find a 2-edge and check if its orbit length equals the number of 2-edges. # By this point, we know that D is likely a highly symmetric digraph, - # since all 2-edge centers share a common in and out degree - # (This is by no means a guarantee, see Frucht's graph). From testing, + # since all 2-edge centers share a common in and out degree + # (This is by no means a guarantee, see Frucht's graph). From testing, # calculating the stabilizer and using the orbit-stabilizer # theorem is usually must faster in this case, so we instead determine # the stabilizer of a 2-edge. From 5ef192f2e5a1ddac2d9aae36b519cdc2dea207eb Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Wed, 24 Sep 2025 15:47:50 +0100 Subject: [PATCH 16/25] Added IsTwoEdgeTransitive as synonym for Is2EdgeTransitive --- gap/prop.gd | 1 + 1 file changed, 1 insertion(+) diff --git a/gap/prop.gd b/gap/prop.gd index a25712a08..630a42ac9 100644 --- a/gap/prop.gd +++ b/gap/prop.gd @@ -69,6 +69,7 @@ DeclareSynonymAttr("IsEquivalenceDigraph", DeclareSynonymAttr("IsAntiSymmetricDigraph", IsAntisymmetricDigraph); DeclareSynonymAttr("IsNullDigraph", IsEmptyDigraph); DeclareSynonymAttr("IsQuasiorderDigraph", IsPreorderDigraph); +DeclareSynonymAttr("IsTwoEdgeTransitive", Is2EdgeTransitive); DeclareOperation("DIGRAPHS_IsJoinSemilatticeAndJoinTable", [IsDigraph]); DeclareOperation("DIGRAPHS_IsMeetSemilatticeAndMeetTable", [IsDigraph]); From 851b036b5f7b0ef20496f57a28592aac8595285a Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Wed, 24 Sep 2025 15:56:50 +0100 Subject: [PATCH 17/25] lint --- configure~ | 6995 +++++++++++++++++++++++++++++++++++++++++++ doc/prop.xml.save | 1610 ++++++++++ gap/digraph.gi.save | 1859 ++++++++++++ src/pkgconfig.h.in~ | 72 + 4 files changed, 10536 insertions(+) create mode 100755 configure~ create mode 100644 doc/prop.xml.save create mode 100644 gap/digraph.gi.save create mode 100644 src/pkgconfig.h.in~ diff --git a/configure~ b/configure~ new file mode 100755 index 000000000..54fe27b2a --- /dev/null +++ b/configure~ @@ -0,0 +1,6995 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.71 for digraphs GAP package. +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else \$as_nop + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else $as_nop + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='digraphs' +PACKAGE_TARNAME='digraphs' +PACKAGE_VERSION='GAP package' +PACKAGE_STRING='digraphs GAP package' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="src/digraphs.c" +ac_default_prefix='${abs_top_builddir}/../../bin/' +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +ac_subst_vars='LTLIBOBJS +LIBOBJS +WITH_INCLUDED_BLISS +PLANARITY_SUITE_DIR +WITH_INCLUDED_PLANARITY +WARNING_CFLAGS +WARNING_CXXFLAGS +SED +CODE_COVERAGE_LDFLAGS +CODE_COVERAGE_CXXFLAGS +CODE_COVERAGE_CFLAGS +ENABLE_STATS +KERNEL_DEBUG +GAP_LIBS +GAP_LDFLAGS +GAP_CFLAGS +GAP_CPPFLAGS +GAPROOT +GAPARCH +ac_ct_CXX +CXXFLAGS +CXX +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_gaproot +enable_debug +enable_stats +enable_code_coverage +enable_compile_warnings +with_external_planarity +with_external_bliss +with_intrinsics +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures digraphs GAP package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/digraphs] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of digraphs GAP package:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-debug enable debug mode + --enable-stats enable stats mode + --enable-code-coverage Whether to enable code coverage support + --enable-compile-warnings + enable compiler warnings + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gaproot= specify root of GAP installation + --with-external-planarity + use external planarity + --with-external-bliss use external bliss + --without-intrinsics do not use compiler intrinsics even if available + + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +digraphs configure GAP package +generated by GNU Autoconf 2.71 + +Copyright (C) 2021 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by digraphs $as_me GAP package, which was +generated by GNU Autoconf 2.71. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_config_headers="$ac_config_headers gen/pkgconfig.h:src/pkgconfig.h.in" + + + + +ac_config_commands="$ac_config_commands src/digraphs-config.h" + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else $as_nop + ac_file='' +fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+y} +ac_save_CXXFLAGS=$CXXFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +else $as_nop + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else $as_nop + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_cxx11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_cxx11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_cxx98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_cxx98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # Make sure CDPATH is portably set to a sensible value + CDPATH=${ZSH_VERSION+.}: + + GAP_CPPFLAGS="" + + ###################################### + # Find the GAP root directory by + # checking for the sysinfo.gap file + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GAP root directory" >&5 +printf %s "checking for GAP root directory... " >&6; } + GAPROOT="../.." + + # Allow the user to specify the location of GAP + +# Check whether --with-gaproot was given. +if test ${with_gaproot+y} +then : + withval=$with_gaproot; GAPROOT="$withval" +fi + + + # Convert the path to absolute + GAPROOT=`cd $GAPROOT > /dev/null 2>&1 && pwd` + + if test -e ${GAPROOT}/sysinfo.gap; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${GAPROOT}" >&5 +printf "%s\n" "${GAPROOT}" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Not found" >&5 +printf "%s\n" "Not found" >&6; } + + echo "" + echo "********************************************************************" + echo " ERROR" + echo "" + echo " Cannot find your GAP installation. Please specify the location of" + echo " GAP's root directory using --with-gaproot=" + echo "" + echo " The GAP root directory (as far as this package is concerned) is" + echo " the one containing the file sysinfo.gap" + echo "********************************************************************" + echo "" + + as_fn_error $? "Unable to find GAP root directory" "$LINENO" 5 + fi + + ##################################### + # Now find the architecture + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GAP architecture" >&5 +printf %s "checking for GAP architecture... " >&6; } + GAPARCH="Unknown" + . $GAPROOT/sysinfo.gap + if test "x$GAParch" != "x"; then + GAPARCH=$GAParch + fi + + if test "x$GAPARCH" = "xUnknown" ; then + echo "" + echo "********************************************************************" + echo " ERROR" + echo "" + echo " Found a GAP installation at $GAPROOT but could not find" + echo " information about GAP's architecture in the file" + echo " ${GAPROOT}/sysinfo.gap ." + echo " This file should be present: please check your GAP installation." + echo "********************************************************************" + echo "" + + as_fn_error $? "Unable to find plausible GAParch information." "$LINENO" 5 + fi + + # require GAP >= 4.9 + if test "x$GAP_CPPFLAGS" = x; then + echo "" + echo "********************************************************************" + echo " ERROR" + echo "" + echo " This version of GAP is too old and not supported by this package." + echo "********************************************************************" + echo "" + as_fn_error $? "No GAP_CPPFLAGS is given" "$LINENO" 5 + fi + + # compatibility with GAP 4.9 (not needed in GAP >= 4.10) + GAP_CPPFLAGS="$GAP_CPPFLAGS -I${GAP_LIB_DIR}/src" + + + + + + + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + +# Check whether --enable-debug was given. +if test ${enable_debug+y} +then : + enableval=$enable_debug; +printf "%s\n" "#define KERNEL_DEBUG 1" >>confdefs.h + +else $as_nop + enable_debug=no + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable debug mode" >&5 +printf %s "checking whether to enable debug mode... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5 +printf "%s\n" "$enable_debug" >&6; } +KERNEL_DEBUG=$enable_debug + + +# Check whether --enable-stats was given. +if test ${enable_stats+y} +then : + enableval=$enable_stats; +printf "%s\n" "#define ENABLE_STATS 1" >>confdefs.h + +else $as_nop + enable_stats=no + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable stats mode" >&5 +printf %s "checking whether to enable stats mode... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_stats" >&5 +printf "%s\n" "$enable_stats" >&6; } +ENABLE_STATS=$enable_debug + + +# Check whether --enable-code-coverage was given. +if test ${enable_code_coverage+y} +then : + enableval=$enable_code_coverage; +else $as_nop + enable_code_coverage=no +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 +printf %s "checking whether to build with code coverage support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5 +printf "%s\n" "$enable_code_coverage" >&6; } + +if test "$enable_code_coverage" = "yes" +then : + + CODE_COVERAGE_CFLAGS="-DNDEBUG -O0 -g --coverage" + CODE_COVERAGE_CXXFLAGS="-DNDEBUG -O0 -g --coverage" + CODE_COVERAGE_LDFLAGS="--coverage" + + + + +fi + + +# Enable compiler warnings + +# Check whether --enable-compile-warnings was given. +if test ${enable_compile_warnings+y} +then : + enableval=$enable_compile_warnings; enable_compile_warnings=yes +else $as_nop + enable_compile_warnings=no +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether enable compiler warnings" >&5 +printf %s "checking whether enable compiler warnings... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_compile_warnings" >&5 +printf "%s\n" "$enable_compile_warnings" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + +if test "x$enable_compile_warnings" != "xno" +then : + ax_enable_compile_warnings=yes + + + + + + + + + + # Variable names + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + # Always pass -Werror=unknown-warning-option to get Clang to fail on bad + # flags, otherwise they are always appended to the warn_cxxflags variable, + # and Clang warns on them for every compilation unit. + # If this is passed to GCC, it will explode, so the flag must be enabled + # conditionally. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Werror=unknown-warning-option" >&5 +printf %s "checking whether C++ compiler accepts -Werror=unknown-warning-option... " >&6; } +if test ${ax_cv_check_cxxflags___Werror_unknown_warning_option+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS -Werror=unknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_check_cxxflags___Werror_unknown_warning_option=yes +else $as_nop + ax_cv_check_cxxflags___Werror_unknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Werror_unknown_warning_option" >&5 +printf "%s\n" "$ax_cv_check_cxxflags___Werror_unknown_warning_option" >&6; } +if test "x$ax_cv_check_cxxflags___Werror_unknown_warning_option" = xyes +then : + + ax_compiler_flags_test="-Werror=unknown-warning-option" + +else $as_nop + + ax_compiler_flags_test="" + +fi + + + # Check that -Wno-suggest-attribute=format is supported + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Wno-suggest-attribute=format" >&5 +printf %s "checking whether C++ compiler accepts -Wno-suggest-attribute=format... " >&6; } +if test ${ax_cv_check_cxxflags___Wno_suggest_attribute_format+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS -Wno-suggest-attribute=format" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_check_cxxflags___Wno_suggest_attribute_format=yes +else $as_nop + ax_cv_check_cxxflags___Wno_suggest_attribute_format=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Wno_suggest_attribute_format" >&5 +printf "%s\n" "$ax_cv_check_cxxflags___Wno_suggest_attribute_format" >&6; } +if test "x$ax_cv_check_cxxflags___Wno_suggest_attribute_format" = xyes +then : + + ax_compiler_no_suggest_attribute_flags="-Wno-suggest-attribute=format" + +else $as_nop + + ax_compiler_no_suggest_attribute_flags="" + +fi + + + # Base flags + + + + +for flag in -fno-strict-aliasing -pedantic -Wold-style-cast ; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +printf %s "checking whether C++ compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + +if test ${WARNING_CXXFLAGS+y} +then : + + case " $WARNING_CXXFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS already contains \$flag"; } >&5 + (: WARNING_CXXFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARNING_CXXFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 + (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + WARNING_CXXFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 + (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else $as_nop + : +fi + +done + + + if test "$ax_enable_compile_warnings" != "no" +then : + + # "yes" flags + + + + +for flag in -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wredundant-decls -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type -Wno-overloaded-virtual -Wswitch-enum -Wswitch-default ; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +printf %s "checking whether C++ compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + +if test ${WARNING_CXXFLAGS+y} +then : + + case " $WARNING_CXXFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS already contains \$flag"; } >&5 + (: WARNING_CXXFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARNING_CXXFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 + (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + WARNING_CXXFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 + (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else $as_nop + : +fi + +done + + +fi + if test "$ax_enable_compile_warnings" = "error" +then : + + # "error" flags; -Werror has to be appended unconditionally because + # it's not possible to test for + # + # suggest-attribute=format is disabled because it gives too many false + # positives + +if test ${WARNING_CXXFLAGS+y} +then : + + case " $WARNING_CXXFLAGS " in #( + *" -Werror "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS already contains -Werror"; } >&5 + (: WARNING_CXXFLAGS already contains -Werror) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARNING_CXXFLAGS " -Werror" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 + (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + WARNING_CXXFLAGS=-Werror + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 + (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + + + + + + +for flag in $ax_compiler_no_suggest_attribute_flags ; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +printf %s "checking whether C++ compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + +if test ${WARNING_CXXFLAGS+y} +then : + + case " $WARNING_CXXFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS already contains \$flag"; } >&5 + (: WARNING_CXXFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARNING_CXXFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 + (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + WARNING_CXXFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 + (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else $as_nop + : +fi + +done + + +fi + + # In the flags below, when disabling specific flags, always add *both* + # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example) + # we enable -Werror, disable a flag, and a build bot passes CXXFLAGS=-Wall, + # which effectively turns that flag back on again as an error. + for flag in $WARNING_CXXFLAGS; do + case $flag in #( + -Wno-*=*) : + ;; #( + -Wno-*) : + + + + + +for flag in -Wno-error=$(printf "%s\n" $flag | $SED 's/^-Wno-//'); do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +printf %s "checking whether C++ compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CXXFLAGS + CXXFLAGS="$CXXFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXXFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + +if test ${WARNING_CXXFLAGS+y} +then : + + case " $WARNING_CXXFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS already contains \$flag"; } >&5 + (: WARNING_CXXFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARNING_CXXFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 + (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + WARNING_CXXFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 + (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else $as_nop + : +fi + +done + + ;; #( + *) : + ;; +esac + done + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + # Substitute the variables + + + +fi + + +if test "x$enable_compile_warnings" != "xno" +then : + ax_enable_compile_warnings=yes + + + + + + + + + + # Variable names + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifndef __cplusplus + #error "no C++" + #endif +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_compiler_cxx=yes; +else $as_nop + ax_compiler_cxx=no; +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Always pass -Werror=unknown-warning-option to get Clang to fail on bad + # flags, otherwise they are always appended to the warn_cflags variable, and + # Clang warns on them for every compilation unit. + # If this is passed to GCC, it will explode, so the flag must be enabled + # conditionally. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror=unknown-warning-option" >&5 +printf %s "checking whether C compiler accepts -Werror=unknown-warning-option... " >&6; } +if test ${ax_cv_check_cflags___Werror_unknown_warning_option+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_check_cflags___Werror_unknown_warning_option=yes +else $as_nop + ax_cv_check_cflags___Werror_unknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Werror_unknown_warning_option" >&5 +printf "%s\n" "$ax_cv_check_cflags___Werror_unknown_warning_option" >&6; } +if test "x$ax_cv_check_cflags___Werror_unknown_warning_option" = xyes +then : + + ax_compiler_flags_test="-Werror=unknown-warning-option" + +else $as_nop + + ax_compiler_flags_test="" + +fi + + + # Check that -Wno-suggest-attribute=format is supported + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wno-suggest-attribute=format" >&5 +printf %s "checking whether C compiler accepts -Wno-suggest-attribute=format... " >&6; } +if test ${ax_cv_check_cflags___Wno_suggest_attribute_format+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -Wno-suggest-attribute=format" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_check_cflags___Wno_suggest_attribute_format=yes +else $as_nop + ax_cv_check_cflags___Wno_suggest_attribute_format=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wno_suggest_attribute_format" >&5 +printf "%s\n" "$ax_cv_check_cflags___Wno_suggest_attribute_format" >&6; } +if test "x$ax_cv_check_cflags___Wno_suggest_attribute_format" = xyes +then : + + ax_compiler_no_suggest_attribute_flags="-Wno-suggest-attribute=format" + +else $as_nop + + ax_compiler_no_suggest_attribute_flags="" + +fi + + + # Base flags + + + + +for flag in -fno-strict-aliasing -pedantic ; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + +if test ${WARNING_CFLAGS+y} +then : + + case " $WARNING_CFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS already contains \$flag"; } >&5 + (: WARNING_CFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARNING_CFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 + (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + WARNING_CFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 + (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else $as_nop + : +fi + +done + + + if test "$ax_enable_compile_warnings" != "no" +then : + + if test "$ax_compiler_cxx" = "no" ; then + # C-only flags. Warn in C++ + + + + +for flag in -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -Wimplicit-function-declaration -Wold-style-definition -Wjump-misses-init ; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + +if test ${WARNING_CFLAGS+y} +then : + + case " $WARNING_CFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS already contains \$flag"; } >&5 + (: WARNING_CFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARNING_CFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 + (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + WARNING_CFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 + (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else $as_nop + : +fi + +done + + fi + + # "yes" flags + + + + +for flag in -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wredundant-decls -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type -Wswitch-enum -Wswitch-default -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -Wnull-dereference -Wdouble-promotion ; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + +if test ${WARNING_CFLAGS+y} +then : + + case " $WARNING_CFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS already contains \$flag"; } >&5 + (: WARNING_CFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARNING_CFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 + (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + WARNING_CFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 + (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else $as_nop + : +fi + +done + + +fi + if test "$ax_enable_compile_warnings" = "error" +then : + + # "error" flags; -Werror has to be appended unconditionally because + # it's not possible to test for + # + # suggest-attribute=format is disabled because it gives too many false + # positives + +if test ${WARNING_CFLAGS+y} +then : + + case " $WARNING_CFLAGS " in #( + *" -Werror "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS already contains -Werror"; } >&5 + (: WARNING_CFLAGS already contains -Werror) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARNING_CFLAGS " -Werror" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 + (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + WARNING_CFLAGS=-Werror + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 + (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + + + + + + +for flag in $ax_compiler_no_suggest_attribute_flags ; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + +if test ${WARNING_CFLAGS+y} +then : + + case " $WARNING_CFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS already contains \$flag"; } >&5 + (: WARNING_CFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARNING_CFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 + (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + WARNING_CFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 + (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else $as_nop + : +fi + +done + + +fi + + # In the flags below, when disabling specific flags, always add *both* + # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example) + # we enable -Werror, disable a flag, and a build bot passes CFLAGS=-Wall, + # which effectively turns that flag back on again as an error. + for flag in $WARNING_CFLAGS; do + case $flag in #( + -Wno-*=*) : + ;; #( + -Wno-*) : + + + + + +for flag in -Wno-error=$(printf "%s\n" $flag | $SED 's/^-Wno-//'); do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + +if test ${WARNING_CFLAGS+y} +then : + + case " $WARNING_CFLAGS " in #( + *" $flag "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS already contains \$flag"; } >&5 + (: WARNING_CFLAGS already contains $flag) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : + + as_fn_append WARNING_CFLAGS " $flag" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 + (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac + +else $as_nop + + WARNING_CFLAGS=$flag + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 + (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + +fi + +else $as_nop + : +fi + +done + + ;; #( + *) : + ;; +esac + done + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + # Substitute the variables + + + +fi + +# Check for system planarity suite + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi + + +# Check whether --with-external-planarity was given. +if test ${with_external_planarity+y} +then : + withval=$with_external_planarity; +else $as_nop + with_external_planarity=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use external planarity" >&5 +printf %s "checking whether to use external planarity... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_external_planarity" >&5 +printf "%s\n" "$with_external_planarity" >&6; } + if test "x$with_external_planarity" = xyes ; then + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gp_InitGraph in -lplanarity" >&5 +printf %s "checking for gp_InitGraph in -lplanarity... " >&6; } +if test ${ac_cv_lib_planarity_gp_InitGraph+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lplanarity $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char gp_InitGraph (); +int +main (void) +{ +return gp_InitGraph (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_planarity_gp_InitGraph=yes +else $as_nop + ac_cv_lib_planarity_gp_InitGraph=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_planarity_gp_InitGraph" >&5 +printf "%s\n" "$ac_cv_lib_planarity_gp_InitGraph" >&6; } +if test "x$ac_cv_lib_planarity_gp_InitGraph" = xyes +then : + printf "%s\n" "#define HAVE_LIBPLANARITY 1" >>confdefs.h + + LIBS="-lplanarity $LIBS" + +else $as_nop + as_fn_error $? "no external libplanarity found" "$LINENO" 5 +fi + + + ac_fn_c_check_header_compile "$LINENO" "planarity/graph.h" "ac_cv_header_planarity_graph_h" "$ac_includes_default" +if test "x$ac_cv_header_planarity_graph_h" = xyes +then : + +else $as_nop + as_fn_error $? "no external planarity headers found" "$LINENO" 5 +fi + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + fi + if test "x$with_external_planarity" = xno ; then + WITH_INCLUDED_PLANARITY=yes + + +printf "%s\n" "#define WITH_INCLUDED_PLANARITY 1" >>confdefs.h + + fi + +if test "x$with_external_planarity" = xno ; then + PLANARITY_SUITE_DIR=extern/edge-addition-planarity-suite-Version_3.0.1.0 + +fi + +# Check for system bliss suite + + +# Check whether --with-external-bliss was given. +if test ${with_external_bliss+y} +then : + withval=$with_external_bliss; +else $as_nop + with_external_bliss=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use external bliss" >&5 +printf %s "checking whether to use external bliss... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_external_bliss" >&5 +printf "%s\n" "$with_external_bliss" >&6; } + if test "x$with_external_bliss" = xyes ; then + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bliss_add_edge in -lbliss" >&5 +printf %s "checking for bliss_add_edge in -lbliss... " >&6; } +if test ${ac_cv_lib_bliss_bliss_add_edge+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbliss $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char bliss_add_edge (); +int +main (void) +{ +return bliss_add_edge (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_bliss_bliss_add_edge=yes +else $as_nop + ac_cv_lib_bliss_bliss_add_edge=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bliss_bliss_add_edge" >&5 +printf "%s\n" "$ac_cv_lib_bliss_bliss_add_edge" >&6; } +if test "x$ac_cv_lib_bliss_bliss_add_edge" = xyes +then : + printf "%s\n" "#define HAVE_LIBBLISS 1" >>confdefs.h + + LIBS="-lbliss $LIBS" + +else $as_nop + as_fn_error $? "no external libbliss found" "$LINENO" 5 +fi + + + ac_fn_c_check_header_compile "$LINENO" "bliss/bliss_C.h" "ac_cv_header_bliss_bliss_C_h" "$ac_includes_default" +if test "x$ac_cv_header_bliss_bliss_C_h" = xyes +then : + +else $as_nop + as_fn_error $? "no external bliss headers found" "$LINENO" 5 +fi + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + fi + if test "x$with_external_bliss" = xno ; then + WITH_INCLUDED_BLISS=yes + + +printf "%s\n" "#define WITH_INCLUDED_BLISS 1" >>confdefs.h + + fi + + +# Check whether to use -mpopcnt and __builtin_ctzl + +# Check whether --with-intrinsics was given. +if test ${with_intrinsics+y} +then : + withval=$with_intrinsics; +fi + + +if test "x$with_intrinsics" = "xno" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: compiler intrinsics will not be used even if available" >&5 +printf "%s\n" "$as_me: compiler intrinsics will not be used even if available" >&6;} +fi + + + +if test "x$with_intrinsics" != "xno" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_ctzll" >&5 +printf %s "checking for __builtin_ctzll... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +__builtin_ctzll(0); + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + have___builtin_ctzll=yes +else $as_nop + have___builtin_ctzll=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have___builtin_ctzll" >&5 +printf "%s\n" "$have___builtin_ctzll" >&6; } + if test yes = $have___builtin_ctzll +then : + +printf "%s\n" "#define HAVE___BUILTIN_CTZLL 1" >>confdefs.h + +fi +fi + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by digraphs $as_me GAP package, which was +generated by GNU Autoconf 2.71. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +digraphs config.status GAP package +configured by $0, generated by GNU Autoconf 2.71, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2021 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +PACKAGE="$PACKAGE" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "gen/pkgconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS gen/pkgconfig.h:src/pkgconfig.h.in" ;; + "src/digraphs-config.h") CONFIG_COMMANDS="$CONFIG_COMMANDS src/digraphs-config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "src/digraphs-config.h":C) ac_prefix_conf_OUT=`echo src/digraphs-config.h` +ac_prefix_conf_DEF=`echo _$ac_prefix_conf_OUT | sed -e "y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:" -e "s/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g"` +ac_prefix_conf_PKG=`echo digraphs` +ac_prefix_conf_LOW=`echo _$ac_prefix_conf_PKG | sed -e "y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:"` +ac_prefix_conf_UPP=`echo $ac_prefix_conf_PKG | sed -e "y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:" -e "/^[0123456789]/s/^/_/"` +ac_prefix_conf_INP=`echo "gen/pkgconfig.h" | sed -e 's/ *//'` +if test ".$ac_prefix_conf_INP" = "."; then + for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue + case "$ac_file" in + *.h) ac_prefix_conf_INP=$ac_file ;; + *) + esac + test ".$ac_prefix_conf_INP" != "." && break + done +fi +if test ".$ac_prefix_conf_INP" = "."; then + case "$ac_prefix_conf_OUT" in + */*) ac_prefix_conf_INP=`basename "$ac_prefix_conf_OUT"` + ;; + *-*) ac_prefix_conf_INP=`echo "$ac_prefix_conf_OUT" | sed -e "s/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*-//"` + ;; + *) ac_prefix_conf_INP=config.h + ;; + esac +fi +if test -z "$ac_prefix_conf_PKG" ; then + as_fn_error $? "no prefix for _PREFIX_PKG_CONFIG_H" "$LINENO" 5 +else + if test ! -f "$ac_prefix_conf_INP" ; then if test -f "$srcdir/$ac_prefix_conf_INP" ; then + ac_prefix_conf_INP="$srcdir/$ac_prefix_conf_INP" + fi fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines" >&5 +printf "%s\n" "$as_me: creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines" >&6;} + if test -f $ac_prefix_conf_INP ; then + printf "%s\n" "s/^#undef *\\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]\\)/#undef $ac_prefix_conf_UPP""_\\1/" > conftest.prefix + printf "%s\n" "s/^#undef *\\([abcdefghijklmnopqrstuvwxyz]\\)/#undef $ac_prefix_conf_LOW""_\\1/" >> conftest.prefix + printf "%s\n" "s/^#define *\\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*\\)\\(.*\\)/#ifndef $ac_prefix_conf_UPP""_\\1\\" >> conftest.prefix + printf "%s\n" "#define $ac_prefix_conf_UPP""_\\1\\2\\" >> conftest.prefix + printf "%s\n" "#endif/" >> conftest.prefix + printf "%s\n" "s/^#define *\\([abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*\\)\\(.*\\)/#ifndef $ac_prefix_conf_LOW""_\\1\\" >> conftest.prefix + printf "%s\n" "#define $ac_prefix_conf_LOW""_\\1\\2\\" >> conftest.prefix + printf "%s\n" "#endif/" >> conftest.prefix + # now executing _script on _DEF input to create _OUT output file + echo "#ifndef $ac_prefix_conf_DEF" >$tmp/pconfig.h + echo "#define $ac_prefix_conf_DEF 1" >>$tmp/pconfig.h + echo ' ' >>$tmp/pconfig.h + echo /'*' $ac_prefix_conf_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h + + sed -f conftest.prefix $ac_prefix_conf_INP >>$tmp/pconfig.h + echo ' ' >>$tmp/pconfig.h + echo '/* once:' $ac_prefix_conf_DEF '*/' >>$tmp/pconfig.h + echo "#endif" >>$tmp/pconfig.h + if cmp -s $ac_prefix_conf_OUT $tmp/pconfig.h 2>/dev/null; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_prefix_conf_OUT is unchanged" >&5 +printf "%s\n" "$as_me: $ac_prefix_conf_OUT is unchanged" >&6;} + else + ac_dir=`$as_dirname -- "$ac_prefix_conf_OUT" || +$as_expr X"$ac_prefix_conf_OUT" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_prefix_conf_OUT" : 'X\(//\)[^/]' \| \ + X"$ac_prefix_conf_OUT" : 'X\(//\)$' \| \ + X"$ac_prefix_conf_OUT" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_prefix_conf_OUT" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + rm -f "$ac_prefix_conf_OUT" + mv $tmp/pconfig.h "$ac_prefix_conf_OUT" + fi + else + as_fn_error $? "input file $ac_prefix_conf_INP does not exist - skip generating $ac_prefix_conf_OUT" "$LINENO" 5 + fi + rm -f conftest.* +fi + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + diff --git a/doc/prop.xml.save b/doc/prop.xml.save new file mode 100644 index 000000000..e8e2d4f6a --- /dev/null +++ b/doc/prop.xml.save @@ -0,0 +1,1610 @@ +############################################################################# +## +#W prop.xml +#Y Copyright (C) 2014-21 James D. Mitchell +## +## Licensing information can be found in the README file of this package. +## +############################################################################# +## + +<#GAPDoc Label="IsMultiDigraph"> + + + true or false. + + A multidigraph is one that has at least two + edges with equal source and range.

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph(["a", "b", "c"], ["a", "b", "b"], ["b", "c", "a"]); + +gap> IsMultiDigraph(D); +false +gap> D := DigraphFromDigraph6String("&Bug"); + +gap> IsDuplicateFree(DigraphEdges(D)); +true +gap> IsMultiDigraph(D); +false +gap> D := Digraph([[1, 2, 3, 2], [2, 1], [3]]); + +gap> IsDuplicateFree(DigraphEdges(D)); +false +gap> IsMultiDigraph(D); +true +gap> D := DigraphMutableCopy(D); + +gap> IsMultiDigraph(D); +true]]> + + +<#/GAPDoc> + +<#GAPDoc Label="DigraphHasLoops"> + + + true or false. + + Returns true if the digraph digraph has loops, and + false if it does not. A loop is an edge with equal source and range. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[1, 2], [2]]); + +gap> DigraphEdges(D); +[ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ] ] +gap> DigraphHasLoops(D); +true +gap> D := Digraph([[2, 3], [1], [2]]); + +gap> DigraphEdges(D); +[ [ 1, 2 ], [ 1, 3 ], [ 2, 1 ], [ 3, 2 ] ] +gap> DigraphHasLoops(D); +false +gap> D := CompleteDigraph(IsMutableDigraph, 4); + +gap> DigraphHasLoops(D); +false]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsAcyclicDigraph"> + + + true or false. + + This property is true if the digraph digraph is acyclic, and + false if it is not. A digraph is acyclic if every directed + cycle on the digraph is trivial. See Section for the definition of a directed cycle, and of a trivial + directed cycle.

+ + The method used in this operation has complexity O(m+n) where + m is the number of edges (counting multiple edges as one) and + n is the number of vertices in the digraph.

+ + &MUTABLE_RECOMPUTED_PROP; + + Petersen := Graph(SymmetricGroup(5), [[1, 2]], OnSets, +> function(x, y) +> return IsEmpty(Intersection(x, y)); +> end);; +gap> D := Digraph(Petersen); + +gap> IsAcyclicDigraph(D); +false +gap> D := DigraphFromDiSparse6String( +> ".b_OGCIDBaPGkULEbQHCeRIdrHcuZMfRyDAbPhTi|zF"); + +gap> IsAcyclicDigraph(D); +true +gap> IsAcyclicDigraph(ChainDigraph(10)); +true +gap> D := CompleteDigraph(IsMutableDigraph, 4); + +gap> IsAcyclicDigraph(D); +false +gap> IsAcyclicDigraph(CycleDigraph(10)); +false]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsAperiodicDigraph"> + + + true or false. + + This property is true if the digraph digraph + is aperiodic, i.e. if its is equal to 1. + Otherwise, the property is false. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[6], [1], [2], [3], [4, 4], [5]]); + +gap> IsAperiodicDigraph(D); +false +gap> D := Digraph([[2], [3, 5], [4], [5], [1, 2]]); + +gap> IsAperiodicDigraph(D); +true +gap> D := Digraph(IsMutableDigraph, [[2], [3, 5], [4], [5], [1, 2]]); + +gap> IsAperiodicDigraph(D); +true]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsStronglyConnectedDigraph"> + + + true or false. + + This property is true if the digraph digraph is strongly + connected and false if it is not.

+ + A digraph digraph is strongly connected if there is a directed + path from every vertex to every other vertex. See Section for the definition of a directed + path.

+ + The method used in this operation is based on Gabow's Algorithm and has complexity O(m+n), where m is + the number of edges (counting multiple edges as one) and n is the + number of vertices in the digraph. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := CycleDigraph(250000); + +gap> IsStronglyConnectedDigraph(D); +true +gap> D := DigraphRemoveEdges(D, [[250000, 1]]); + +gap> IsStronglyConnectedDigraph(D); +false +gap> D := CycleDigraph(IsMutableDigraph, 250000); + +gap> IsStronglyConnectedDigraph(D); +true +gap> DigraphRemoveEdge(D, [250000, 1]); + +gap> IsStronglyConnectedDigraph(D); +false +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsConnectedDigraph"> + + + true or false. + + This property is true if the digraph digraph + is weakly connected and false if it is not. A digraph + digraph is weakly connected if it is possible to travel + from any vertex to any other vertex by traversing edges in either + direction (possibly against the orientation of some of them).

+ + The method used in this function has complexity O(m) if the + digraph's attribute is set, otherwise it has + complexity O(m+n) (where + m is the number of edges and + n is the number of vertices of the digraph). +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[2], [3], []]);; +gap> IsConnectedDigraph(D); +true +gap> D := Digraph([[1, 3], [4], [3], []]);; +gap> IsConnectedDigraph(D); +false +gap> D := Digraph(IsMutableDigraph, [[2], [3], []]);; +gap> IsConnectedDigraph(D); +true +gap> D := Digraph(IsMutableDigraph, [[1, 3], [4], [3], []]);; +gap> IsConnectedDigraph(D); +false]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsBiconnectedDigraph"> + + + true or false. + + A connected digraph is biconnected if it is still connected (in the + sense of ) when any vertex is removed. + If D has at least 3 vertices, then IsBiconnectedDigraph + implies ; + see or for a more + detailed explanation. +

+ + IsBiconnectedDigraph returns true if the digraph + digraph is biconnected, and false if it is not. In + particular, IsBiconnectedDigraph returns false if + digraph is not connected.

+ + Multiple edges are ignored by this method.

+ + The method used in this operation has complexity O(m+n) where + m is the number of edges and n is the number of vertices in + the digraph. +

+ + See also , , and + . +

+ + &MUTABLE_RECOMPUTED_PROP; + + IsBiconnectedDigraph(Digraph([[1, 3], [2, 3], [3]])); +false +gap> IsBiconnectedDigraph(CycleDigraph(5)); +true +gap> D := Digraph([[1, 1], [1, 1, 2], [3], [3, 3, 4, 4]]);; +gap> IsBiconnectedDigraph(D); +false +gap> D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4); + +gap> IsBiconnectedDigraph(D); +true]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsBipartiteDigraph"> + + + true or false. + + This property is true if the digraph digraph is bipartite, and + false if it is not. A digraph is bipartite if and only if the + vertices of digraph can be partitioned into two non-empty sets such + that the source and range of any edge of digraph lie in distinct sets. + Equivalently, a digraph is bipartite if and only if it is 2-colorable; see + .

+ + See also . +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := ChainDigraph(4); + +gap> IsBipartiteDigraph(D); +true +gap> D := CycleDigraph(3); + +gap> IsBipartiteDigraph(D); +false +gap> D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4); + +gap> IsBipartiteDigraph(D); +true]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsCompleteBipartiteDigraph"> + + + true or false. + + Returns true if the digraph digraph is a complete bipartite + digraph, and false if it is not.

+ + A digraph is a complete bipartite digraph if it is bipartite, see + , and there exists a unique edge with + source i and range j if and only if i and j lie + in different bicomponents of digraph, see .

+ + Equivalently, a bipartite digraph with bicomponents of size m and + n is complete precisely when it has 2mn edges, none of which + are multiple edges.

+ + See also . +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := CycleDigraph(2); + +gap> IsCompleteBipartiteDigraph(D); +true +gap> D := CycleDigraph(4); + +gap> IsBipartiteDigraph(D); +true +gap> IsCompleteBipartiteDigraph(D); +false +gap> D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4); + +gap> IsCompleteBipartiteDigraph(D); +true]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsCompleteMultipartiteDigraph"> + + + true or false. + + This property returns true if digraph is a complete + multipartite digraph, and false if not.

+ + A digraph is a complete multipartite digraph if and only if + its vertices can be partitioned into at least two maximal independent sets, + where every possible edge between these independent sets occurs in the + digraph exactly once. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := CompleteMultipartiteDigraph([2, 4, 6]); + +gap> IsCompleteMultipartiteDigraph(D); +true +gap> D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4); + +gap> IsCompleteMultipartiteDigraph(D); +true]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsCompleteDigraph"> + + + true or false. + + Returns true if the digraph digraph is complete, and + false if it is not.

+ + A digraph is complete if it has no loops, and for all + distinct vertices i and j, + there is exactly one edge with source i and range j. + + Equivalently, a digraph with n vertices is complete precisely when + it has n(n - 1) edges, no loops, and no multiple edges. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[2, 3], [1, 3], [1, 2]]); + +gap> IsCompleteDigraph(D); +true +gap> D := Digraph([[2, 2], [1]]); + +gap> IsCompleteDigraph(D); +false +gap> D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4); + +gap> IsCompleteDigraph(D); +false]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsTournament"> + + + true or false. + + This property is true if the digraph digraph is a tournament, + and false if it is not.

+ + A tournament is an orientation of a complete (undirected) graph. + Specifically, a tournament is a digraph which has a unique directed edge + (of some orientation) between any pair of distinct vertices, and no loops. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[2, 3, 4], [3, 4], [4], []]); + +gap> IsTournament(D); +true +gap> D := Digraph([[2], [1], [3]]); + +gap> IsTournament(D); +false +gap> D := CycleDigraph(IsMutableDigraph, 3); + +gap> IsTournament(D); +true +gap> DigraphRemoveEdge(D, 1, 2); + +gap> IsTournament(D); +false +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsChainDigraph"> + + + true or false. + + IsChainDigraph returns true if the digraph digraph is + isomorphic to the chain digraph with the same number of vertices as + digraph, and false if it is not; see .

+ + A digraph is a chain if and only if it is a directed tree, in which + every vertex has out degree at most one; see + and . +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[1, 3], [2, 3], [3]]); + +gap> IsChainDigraph(D); +false +gap> D := ChainDigraph(5); + +gap> IsChainDigraph(D); +true +gap> D := DigraphReverse(D); + +gap> IsChainDigraph(D); +true +gap> D := ChainDigraph(IsMutableDigraph, 5); + +gap> IsChainDigraph(D); +true +gap> DigraphReverse(D); + +gap> IsChainDigraph(D); +true]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsCycleDigraph"> + + + true or false. + + IsCycleDigraph returns true if the digraph digraph is + isomorphic to the cycle digraph with the same number of vertices as + digraph, and false if it is not; see .

+ + A digraph is a cycle if and only if it is strongly connected and has + the same number of edges as vertices. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[1, 3], [2, 3], [3]]); + +gap> IsCycleDigraph(D); +false +gap> D := CycleDigraph(5); + +gap> IsCycleDigraph(D); +true +gap> D := OnDigraphs(D, (1, 2, 3)); + +gap> D = CycleDigraph(5); +false +gap> IsCycleDigraph(D); +true]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsDigraphCore"> + + + true or false. + + This property returns true if digraph is a core, + and false if it is not.

+ + A digraph D is a core if and only if it has no proper + subdigraphs A such that there exists a homomorphism from D + to A. In other words, a digraph D is a core if and only if + every endomorphism on D is an automorphism on D. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := CompleteDigraph(6); + +gap> IsDigraphCore(D); +true +gap> D := DigraphSymmetricClosure(CycleDigraph(6)); + +gap> DigraphHomomorphism(D, CompleteDigraph(2)); +Transformation( [ 1, 2, 1, 2, 1, 2 ] ) +gap> IsDigraphCore(D); +false +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsDirectedTree"> + + + true or false. + + Returns true if the digraph digraph is a directed tree, and + false if it is not.

+ + A directed tree is an acyclic digraph with precisely 1 source, + such that no two vertices share an out-neighbour. + Note that the empty digraph with zero vertices is not considered + to be a directed tree, because it has no source.

+ + See also . +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[], [2]]); + +gap> IsDirectedTree(D); +false +gap> D := Digraph([[3], [3], []]); + +gap> IsDirectedTree(D); +false +gap> D := Digraph([[2], [3], []]); + +gap> IsDirectedTree(D); +true +gap> D := Digraph([[2, 3], [6], [4, 5], [], [], []]); + +gap> IsDirectedTree(D); +true +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsUndirectedTree"> + + + + true or false. + + The property IsUndirectedTree returns true if the digraph + digraph is an undirected tree, and the property + IsUndirectedForest returns true if digraph is an + undirected forest; otherwise, these properties return false.

+ + An undirected tree is a symmetric digraph without loops, in which for + any pair of distinct vertices u and v, there is exactly one + directed path from u to v. See and , and see + Section for the definition of + directed path. This definition implies that an undirected tree has + no multiple edges.

+ + An undirected forest is a digraph, each of whose connected components + is an undirected tree. In other words, an undirected forest is isomorphic to + a disjoint union of undirected trees. See and . In particular, every + undirected tree is an undirected forest.

+ + Please note that the digraph with zero vertices is considered to be neither + an undirected tree nor an undirected forest. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[3], [3], [1, 2]]); + +gap> IsUndirectedTree(D); +true +gap> IsSymmetricDigraph(D) and not DigraphHasLoops(D); +true +gap> D := Digraph([[3], [5], [1, 4], [3], [2]]); + +gap> IsConnectedDigraph(D); +false +gap> IsUndirectedTree(D); +false +gap> IsUndirectedForest(D); +true +gap> D := Digraph([[1, 2], [1], [2]]); + +gap> IsUndirectedTree(D) or IsUndirectedForest(D); +false +gap> IsSymmetricDigraph(D) or not DigraphHasLoops(D); +false]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsEdgeTransitive"> + + + true or false. + + If digraph is a digraph without multiple edges, then + IsEdgeTransitive returns true if digraph + is edge transitive, and false otherwise. A digraph is + edge transitive if its automorphism group acts + transitively on its edges (via the action + ). +

+ + &MUTABLE_RECOMPUTED_PROP; + + IsEdgeTransitive(CompleteDigraph(2)); +true +gap> IsEdgeTransitive(ChainDigraph(3)); +false +gap> IsEdgeTransitive(Digraph([[2], [3, 3, 3], []])); +Error, the argument must be a digraph with no multiple edges, +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsVertexTransitive"> + + + true or false. + + If digraph is a digraph, then IsVertexTransitive returns + true if digraph is vertex transitive, and false + otherwise. A digraph is vertex transitive if its automorphism group + acts transitively on its vertices. +

+ + &MUTABLE_RECOMPUTED_PROP; + + IsVertexTransitive(CompleteDigraph(2)); +true +gap> IsVertexTransitive(ChainDigraph(3)); +false +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsEmptyDigraph"> + + + + true or false. + + Returns true if the digraph digraph is empty, and + false if it is not. A digraph is empty if it has no + edges.

+ + is a synonym for . + See also . +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[], []]); + +gap> IsEmptyDigraph(D); +true +gap> IsNullDigraph(D); +true +gap> D := Digraph([[], [1]]); + +gap> IsEmptyDigraph(D); +false +gap> IsNullDigraph(D); +false]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsNonemptyDigraph"> + + + true or false. + + Returns true if the digraph digraph is nonempty, and + false if it is not. A digraph is nonempty if it has at + least one edge.

+ + See also . +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[], []]); + +gap> IsNonemptyDigraph(D); +false +gap> D := Digraph([[], [1]]); + +gap> IsNonemptyDigraph(D); +true]]> + + +<#/GAPDoc> + +<#GAPDoc Label="DigraphHasAVertex"> + + + true or false. + + Returns true if the digraph digraph has at least one vertex, + and false if it does not.

+ + See also . +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([]); + +gap> DigraphHasAVertex(D); +false +gap> D := Digraph([[]]); + +gap> DigraphHasAVertex(D); +true +gap> D := Digraph([[], [1]]); + +gap> DigraphHasAVertex(D); +true]]> + + +<#/GAPDoc> + +<#GAPDoc Label="DigraphHasNoVertices"> + + + true or false. + + Returns true if the digraph digraph is the unique digraph + with zero vertices, and false otherwise.

+ + See also . +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([]); + +gap> DigraphHasNoVertices(D); +true +gap> D := Digraph([[]]); + +gap> DigraphHasNoVertices(D); +false +gap> D := Digraph([[], [1]]); + +gap> DigraphHasNoVertices(D); +false]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsEulerianDigraph"> + + + true or false. + + This property returns true if the digraph digraph is Eulerian. +

+ + A connected digraph is called Eulerian if there exists a directed + circuit on the digraph which includes every edge exactly once. See + Section for the definition of + a directed circuit. Note that the empty digraph with at most one vertex is + considered to be Eulerian. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[]]); + +gap> IsEulerianDigraph(D); +true +gap> D := Digraph([[2], []]); + +gap> IsEulerianDigraph(D); +false +gap> D := Digraph([[3], [], [2]]); + +gap> IsEulerianDigraph(D); +false +gap> D := Digraph([[2], [3], [1]]); + +gap> IsEulerianDigraph(D); +true +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsFunctionalDigraph"> + + + true or false. + + This property is true if the digraph digraph is + functional.

+ + A digraph is functional if every vertex is the source of a + unique edge. +

+ + &MUTABLE_RECOMPUTED_PROP; + + gr1 := Digraph([[3], [2], [2], [1], [6], [5]]); + +gap> IsFunctionalDigraph(gr1); +true +gap> gr2 := Digraph([[1, 2], [1]]); + +gap> IsFunctionalDigraph(gr2); +false +gap> gr3 := Digraph(3, [1, 2, 3], [2, 3, 1]); + +gap> IsFunctionalDigraph(gr3); +true +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsPermutationDigraph"> + + + true or false. + + This property is true if the digraph digraph is + functional and each node has only one in-neighbour.

+ + &MUTABLE_RECOMPUTED_PROP; + + gr1 := Digraph([[3], [2], [2], [1], [6], [5]]); + +gap> IsPermutationDigraph(gr1); +false +gap> gr2 := Digraph([[1, 2], [1]]); + +gap> IsPermutationDigraph(gr2); +false +gap> gr3 := Digraph(3, [1, 2, 3], [2, 3, 1]); + +gap> IsPermutationDigraph(gr3); +true +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsHamiltonianDigraph"> + + + true or false. + + If digraph is Hamiltonian, then this property returns + true, and false if it is not.

+ + A digraph with n vertices is Hamiltonian if it has a + directed cycle of length n. See Section for the definition of a directed cycle. + Note the empty digraphs on 0 and 1 vertices are considered to be + Hamiltonian.

+ + The method used in this operation has the worst case complexity as + . +

+ + &MUTABLE_RECOMPUTED_PROP; + + g := Digraph([[]]); + +gap> IsHamiltonianDigraph(g); +true +gap> g := Digraph([[2], [1]]); + +gap> IsHamiltonianDigraph(g); +true +gap> g := Digraph([[3], [], [2]]); + +gap> IsHamiltonianDigraph(g); +false +gap> g := Digraph([[2], [3], [1]]); + +gap> IsHamiltonianDigraph(g); +true +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsRegularDigraph"> + + + true or false. + + This property is true if there is an integer n such that + for every vertex v of digraph digraph there are exactly + n edges starting and terminating at v. In other words, + the property is true if digraph is both in-regular and + and out-regular. + + See also and + . +

+ + &MUTABLE_RECOMPUTED_PROP; + + IsRegularDigraph(CompleteDigraph(4)); +true +gap> IsRegularDigraph(ChainDigraph(4)); +false +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsInRegularDigraph"> + + + true or false. + + This property is true if there is an integer n such that + for every vertex v of digraph digraph there are exactly + n edges terminating in v. + + See also and + . +

+ + &MUTABLE_RECOMPUTED_PROP; + + IsInRegularDigraph(CompleteDigraph(4)); +true +gap> IsInRegularDigraph(ChainDigraph(4)); +false +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsOutRegularDigraph"> + + + true or false. + + This property is true if there is an integer n such that + for every vertex v of digraph digraph there are exactly + n edges starting at v. +

+ + See also and + . +

+ + &MUTABLE_RECOMPUTED_PROP; + + IsOutRegularDigraph(CompleteDigraph(4)); +true +gap> IsOutRegularDigraph(ChainDigraph(4)); +false +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsDistanceRegularDigraph"> + + + true or false. + + If digraph is a connected symmetric graph, this property returns + true if for any two vertices u and v of digraph + and any two integers i and j between 0 and the + diameter of digraph, the number of vertices at distance i + from u and distance j from v depends only on + i, j, and the distance between vertices u and + v.

+ + Alternatively, a distance regular graph is a graph for which there exist + integers b_i, c_i, and i such that for any two + vertices u, v in digraph which are distance i + apart, there are exactly b_i neighbors of v which are at + distance i - 1 away from u, and c_i neighbors of + v which are at distance i + 1 away from u. This + definition is used to check whether digraph is distance regular.

+ + In the case where digraph is not symmetric or not connected, the + property is false. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := DigraphSymmetricClosure(ChainDigraph(5));; +gap> IsDistanceRegularDigraph(D); +false +gap> D := Digraph([[2, 3, 4], [1, 3, 4], [1, 2, 4], [1, 2, 3]]); + +gap> IsDistanceRegularDigraph(D); +true +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsReflexiveDigraph"> + + + true or false. + + This property is true if the digraph digraph is + reflexive, and false if it is not. + A digraph is reflexive if it has a loop at every vertex.

+

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[1, 2], [2]]); + +gap> IsReflexiveDigraph(D); +true +gap> D := Digraph([[3, 1], [4, 2], [3], [2, 1]]); + +gap> IsReflexiveDigraph(D); +false +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsSymmetricDigraph"> + + + true or false. + + This property is true if the digraph digraph + is symmetric, and false if it is not.

+ + A symmetric digraph is one where for each non-loop edge, having + source u and range v, there is a corresponding edge with + source v and range u. If there are n edges with + source u and range v, then there must be precisely n + edges with source v and range u. In other words, a symmetric + digraph has a symmetric adjacency matrix . +

+ + &MUTABLE_RECOMPUTED_PROP; + + gr1 := Digraph([[2], [1, 3], [2, 3]]); + +gap> IsSymmetricDigraph(gr1); +true +gap> adj1 := AdjacencyMatrix(gr1);; +gap> Display(adj1); +[ [ 0, 1, 0 ], + [ 1, 0, 1 ], + [ 0, 1, 1 ] ] +gap> adj1 = TransposedMat(adj1); +true +gap> gr1 = DigraphReverse(gr1); +true +gap> gr2 := Digraph([[2, 3], [1, 3], [2, 3]]); + +gap> IsSymmetricDigraph(gr2); +false +gap> adj2 := AdjacencyMatrix(gr2);; +gap> Display(adj2); +[ [ 0, 1, 1 ], + [ 1, 0, 1 ], + [ 0, 1, 1 ] ] +gap> adj2 = TransposedMat(adj2); +false +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsAntisymmetricDigraph"> + + + + true or false. + + This property is true if the digraph digraph + is antisymmetric, and false if it is not. +

+ + A digraph is antisymmetric if whenever there is an edge with source + u and range v, and an edge with source v and range + u, then the vertices u and v are equal. +

+ + &MUTABLE_RECOMPUTED_PROP; + + gr1 := Digraph([[2], [1, 3], [2, 3]]); + +gap> IsAntisymmetricDigraph(gr1); +false +gap> DigraphEdges(gr1){[1, 2]}; +[ [ 1, 2 ], [ 2, 1 ] ] +gap> gr2 := Digraph([[1, 2], [3, 3], [1]]); + +gap> IsAntisymmetricDigraph(gr2); +true +gap> DigraphEdges(gr2); +[ [ 1, 1 ], [ 1, 2 ], [ 2, 3 ], [ 2, 3 ], [ 3, 1 ] ] +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsTransitiveDigraph"> + + + true or false. + + This property is true if the digraph digraph + is transitive, and false if it is not. + + A digraph is transitive if whenever [ i, j ] and + [ j, k ] are edges of the digraph, then [ i, k ] is also an + edge of the digraph.

+ + Let n be the number of vertices of an arbitrary digraph, and let + m be the number of edges. + For general digraphs, the methods used for this property use a version + of the Floyd-Warshall algorithm, and have complexity O(n^3). + + However for digraphs which are topologically sortable + [], then methods with + complexity O(m + n + m \cdot n) will be used when appropriate. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[1, 2], [3], [3]]); + +gap> IsTransitiveDigraph(D); +false +gap> gr2 := Digraph([[1, 2, 3], [3], [3]]); + +gap> IsTransitiveDigraph(gr2); +true +gap> gr2 = DigraphTransitiveClosure(D); +true +gap> gr3 := Digraph([[1, 2, 2, 3], [3, 3], [3]]); + +gap> IsTransitiveDigraph(gr3); +true +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsMeetSemilatticeDigraph"> + + + + + true or false. + + IsMeetSemilatticeDigraph returns true if the digraph + digraph is a meet semilattice; IsJoinSemilatticeDigraph + returns true if the digraph digraph is a join semilattice; + and IsLatticeDigraph returns true if the digraph + digraph is both a meet and a join semilattice. +

+ + For a partial order digraph the + corresponding partial order is the relation \leq, defined by + x \leq y if and only if [x, y] is an edge. + A digraph is a meet semilattice if it is a partial order and every + pair of vertices has a greatest lower bound (meet) with respect to the + aforementioned relation. A join semilattice is a partial order where + every pair of vertices has a least upper bound (join) with respect to + the relation. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[1, 3], [2, 3], [3]]); + +gap> IsMeetSemilatticeDigraph(D); +false +gap> IsJoinSemilatticeDigraph(D); +true +gap> IsLatticeDigraph(D); +false +gap> D := Digraph([[1], [2], [1 .. 3]]); + +gap> IsJoinSemilatticeDigraph(D); +false +gap> IsMeetSemilatticeDigraph(D); +true +gap> IsLatticeDigraph(D); +false +gap> D := Digraph([[1 .. 4], [2, 4], [3, 4], [4]]); + +gap> IsMeetSemilatticeDigraph(D); +true +gap> IsJoinSemilatticeDigraph(D); +true +gap> IsLatticeDigraph(D); +true +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsDistributiveLatticeDigraph"> + + + true or false. + + IsDistributiveLatticeDigraph returns true if the digraph + digraph is a distributive lattice digraph.

+ + A distributive lattice digraph is a lattice digraph () which is distributive. That is to say, the + functions and distribute over each other.

+ + Equivalently, a distributive lattice digraph is a lattice digraph in which + the lattice digraphs representing M3 and N5 are not + embeddable as lattices + (see https://en.wikipedia.org/wiki/Distributive_lattice and + ).

+ + + + +      + +

The lattices M3 and N5.
+ + ]]> + + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[2, 3], [4], [4], []]); + +gap> D := DigraphReflexiveTransitiveClosure(D); + +gap> IsDistributiveLatticeDigraph(D); +true +gap> N5 := Digraph([[2, 4], [3], [5], [5], []]); + +gap> N5 := DigraphReflexiveTransitiveClosure(N5); + +gap> IsDistributiveLatticeDigraph(N5); +false]]> +
+
+<#/GAPDoc> + +<#GAPDoc Label="IsModularLatticeDigraph"> + + + true or false. + + IsModularLatticeDigraph returns true if the digraph + digraph is a modular lattice digraph.

+ + A modular lattice digraph is a lattice digraph () which is modular. That is to say, the lattice + digraph representing N5 is not embeddable as a lattice (see + https://en.wikipedia.org/wiki/Modular_lattice and ).

+ + + + +

The lattice N5.
+ + ]]> + + + &MUTABLE_RECOMPUTED_PROP; + + D := ChainDigraph(5); + +gap> D := DigraphReflexiveTransitiveClosure(D); + +gap> IsModularLatticeDigraph(D); +true +gap> N5 := Digraph([[2, 3], [4], [4], []]); + +gap> DigraphReflexiveTransitiveClosure(N5); + +gap> IsModularLatticeDigraph(N5); +false +]]> +
+
+<#/GAPDoc> + +<#GAPDoc Label="IsPreorderDigraph"> + + + + true or false. + + A digraph is a preorder digraph if and only if the digraph satisfies both + and . + A preorder digraph (or quasiorder digraph) digraph corresponds to + the preorder relation \leq defined by x \leq y if and only + if [x, y] is an edge of digraph. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[1], [2, 3], [2, 3]]); + +gap> IsPreorderDigraph(D); +true +gap> D := Digraph([[1 .. 4], [1 .. 4], [1 .. 4], [1 .. 4]]); + +gap> IsPreorderDigraph(D); +true +gap> D := Digraph([[2], [3], [4], [5], [1]]); + +gap> IsPreorderDigraph(D); +false +gap> D := Digraph([[1], [1, 2], [2, 3]]); + +gap> IsQuasiorderDigraph(D); +false +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsPartialOrderDigraph"> + + + true or false. + + A digraph is a partial order digraph if and only if the digraph satisfies + all of , + and . + A partial order digraph corresponds + to the partial order relation \leq defined by x \leq y if and + only if [x, y] is an edge of digraph. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[1, 3], [2, 3], [3]]); + +gap> IsPartialOrderDigraph(D); +true +gap> D := CycleDigraph(5); + +gap> IsPartialOrderDigraph(D); +false +gap> D := Digraph([[1, 1], [1, 1, 2], [3], [3, 3, 4, 4]]); + +gap> IsPartialOrderDigraph(D); +true +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsEquivalenceDigraph"> + + + true or false. + + A digraph is an equivalence digraph if and only if the digraph satisfies + all of , + and . + A partial order digraph corresponds to an equivalence relation. +

+ + &MUTABLE_RECOMPUTED_PROP; + + D := Digraph([[1, 3], [2], [1, 3]]); + +gap> IsEquivalenceDigraph(D); +true +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsBridgelessDigraph"> + + + true or false. + + A connected digraph is bridgeless if it is still connected (in the + sense of ) when any edge is removed. + If digraph has at least 3 vertices, then implies IsBridgelessDigraph; + see or for a more + detailed explanation. +

+ + IsBridgelessDigraph returns true if the digraph + digraph is bridgeless, and false if it is not. In + particular, IsBridgelessDigraph returns false if + digraph is not connected.

+ + Multiple edges are ignored by this method.

+ + The method used in this operation has complexity O(m+n) where + m is the number of edges and n is the number of vertices in + the digraph. +

+ + See also , , and + .

+ + &MUTABLE_RECOMPUTED_PROP; + + IsBridgelessDigraph(Digraph([[1, 3], [2, 3], [3]])); +false +gap> IsBridgelessDigraph(CycleDigraph(5)); +true +gap> D := Digraph([[1, 1], [1, 1, 2], [3], [3, 3, 4, 4]]);; +gap> IsBridgelessDigraph(D); +false +gap> D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4); + +gap> IsBridgelessDigraph(D); +true +gap> D := Digraph([[2, 5], [1, 3, 4, 5], [2, 4], [2, 3], [1, 2]]); + +gap> IsBridgelessDigraph(D); +true +gap> IsBiconnectedDigraph(D); +false +gap> D := Digraph([[2], [3], [4], [2]]); + +gap> IsBridgelessDigraph(D); +false +gap> IsBiconnectedDigraph(D); +false +gap> IsBridgelessDigraph(ChainDigraph(2)); +false +gap> IsBiconnectedDigraph(ChainDigraph(2)); +true +]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsUpperSemimodularDigraph"> + + + + true or false. + + IsUpperSemimodularDigraph returns true if the digraph + D represents an upper semimodular lattice and false if it + does not. Similarly, IsLowerSemimodularDigraph returns true + if D represents a lower semimodular lattice and false if + it does not.

+ + In a lattice we say that a vertex a covers a vertex b + if a is greater than b, and there are no further vertices + between a and b. A lattice is upper semimodular if + whenever the meet of a and b is covered by a, the join + of a and b covers b. Lower semimodularity is + defined analogously.

+ + See also , , + and . + + &MUTABLE_RECOMPUTED_PROP; + + D := DigraphFromDigraph6String( +> "&M~~sc`lYUZO__KIBboC_@h?U_?_GL?A_?c"); + +gap> IsUpperSemimodularDigraph(D); +true +gap> IsLowerSemimodularDigraph(D); +false]]> + + +<#/GAPDoc> + +<#GAPDoc Label="IsTwoEdgeTransitive"> + + + true or false. + + If digraph is a digraph, then IsTwoEdgeTransitive returns + true if digraph is 2-edge transitive, and false + otherwise. A digraph is 2-edge transitive if its automorphism group + acts transitively on its 2-edges via the action + . + + A 2-edge of a digraph is a pair of its edges, such that the range of the + first edge is equal to the source of the second edge. +

+ + &MUTABLE_RECOMPUTED_PROP; + + IsTwoEdgeTransitive(CompleteDigraph(4)); +true +gap> IsTwoEdgeTransitive(DigraphByEdges([[1,2],[2,3],[3,1],[3,4]])) +false +gap> IsTwoEdgeTransitive(CycleDigraph(5)); +true +]]> + + +<#/GAPDoc> diff --git a/gap/digraph.gi.save b/gap/digraph.gi.save new file mode 100644 index 000000000..8cd890a3e --- /dev/null +++ b/gap/digraph.gi.save @@ -0,0 +1,1859 @@ +############################################################################# +## +## digraph.gi +## Copyright (C) 2014-21 James D. Mitchell +## +## Licensing information can be found in the README file of this package. +## +############################################################################# +## + +######################################################################## +# This file is organised as follows: +# +# 1. Digraph types +# 2. Digraph no-check constructors +# 3. Digraph copies +# 4. PostMakeImmutable +# 5. Digraph constructors +# 6. Printing, viewing, strings +# 7. Operators +# 8. Digraph by-something constructors +# 9. Converters to/from other types -> digraph +# 10. Random digraphs +# +######################################################################## + +BindGlobal("DIGRAPHS_NamedDigraphs", fail); +BindGlobal("DIGRAPHS_NamedDigraphsTests", fail); + +BindGlobal("DIGRAPHS_LoadNamedDigraphs", function() + # Check if the database has already been loaded + if DIGRAPHS_NamedDigraphs = fail then + MakeReadWriteGlobal("DIGRAPHS_NamedDigraphs"); + UnbindGlobal("DIGRAPHS_NamedDigraphs"); + + # Initialise empty record + BindGlobal("DIGRAPHS_NamedDigraphs", rec()); + + # Populate record with entries from the named digraphs main database + Read(Concatenation(DIGRAPHS_Dir(), "/data/named-digraphs-main-database.g")); + fi; +end); + +BindGlobal("DIGRAPHS_LoadNamedDigraphsTests", function() + # INTENDED ONLY FOR TESTING PURPOSES + # Check if the database has already been loaded + if DIGRAPHS_NamedDigraphsTests = fail then + MakeReadWriteGlobal("DIGRAPHS_NamedDigraphsTests"); + UnbindGlobal("DIGRAPHS_NamedDigraphsTests"); + + # Initialise empty record + BindGlobal("DIGRAPHS_NamedDigraphsTests", rec()); + + # Populate record with entries from the named digraphs test database + Read(Concatenation(DIGRAPHS_Dir(), "/data/named-digraphs-test-database.g")); + fi; +end); + +InstallMethod(DigraphMutabilityFilter, "for a digraph", [IsDigraph], +function(D) + if IsMutableDigraph(D) then + return IsMutableDigraph; + else + return IsImmutableDigraph; + fi; +end); + +######################################################################## +# 1. Digraph types +######################################################################## + +BindGlobal("DigraphByOutNeighboursType", NewType(DigraphFamily, + IsDigraphByOutNeighboursRep)); + +######################################################################## +# 2. Digraph no-check constructors +######################################################################## + +InstallMethod(ConvertToMutableDigraphNC, "for a record", [IsRecord], +function(record) + local D; + Assert(1, IsBound(record.OutNeighbours)); + Assert(1, Length(NamesOfComponents(record)) = 1); + D := Objectify(DigraphByOutNeighboursType, record); + SetFilterObj(D, IsMutable); + return D; +end); + +InstallMethod(ConvertToMutableDigraphNC, "for a dense list of out-neighbours", +[IsDenseList], +function(list) + local record; + record := rec(OutNeighbours := list); + Perform(record.OutNeighbours, IsSet); + return ConvertToMutableDigraphNC(record); +end); + +InstallMethod(ConvertToImmutableDigraphNC, "for a record", [IsRecord], +record -> MakeImmutable(ConvertToMutableDigraphNC(record))); + +InstallMethod(ConvertToImmutableDigraphNC, +"for a dense list of out-neighbours", +[IsDenseList], +list -> MakeImmutable(ConvertToMutableDigraphNC(list))); + +InstallMethod(DigraphConsNC, "for IsMutableDigraph and a record", +[IsMutableDigraph, IsRecord], +function(_, record) + local required, out, name; + required := ["DigraphRange", "DigraphSource", "DigraphNrVertices"]; + for name in required do + Assert(1, IsBound(record.(name))); + od; + for name in Difference(RecNames(record), required) do + Info(InfoWarning, 1, "ignoring record component \"", name, "\"!"); + od; + out := DIGRAPH_OUT_NEIGHBOURS_FROM_SOURCE_RANGE(record.DigraphNrVertices, + record.DigraphSource, + record.DigraphRange); + return ConvertToMutableDigraphNC(out); +end); + +InstallMethod(DigraphConsNC, +"for IsMutableDigraph and a dense list of out-neighbours", +[IsMutableDigraph, IsDenseList], +function(_, list) + Assert(1, not IsMutable(list)); + return ConvertToMutableDigraphNC(List(list, ShallowCopy)); +end); + +InstallMethod(DigraphConsNC, +"for IsMutableDigraph and a dense mutable list of out-neighbours", +[IsMutableDigraph, IsDenseList and IsMutable], +{_, list} -> ConvertToMutableDigraphNC(StructuralCopy(list))); + +InstallMethod(DigraphConsNC, "for IsImmutableDigraph and a record", +[IsImmutableDigraph, IsRecord], +function(_, record) + local D; + D := MakeImmutable(DigraphConsNC(IsMutableDigraph, record)); + SetDigraphSource(D, StructuralCopy(record.DigraphSource)); + SetDigraphRange(D, StructuralCopy(record.DigraphRange)); + return D; +end); + +InstallMethod(DigraphConsNC, "for IsImmutableDigraph and a dense list", +[IsImmutableDigraph, IsDenseList], +{_, list} -> MakeImmutable(DigraphConsNC(IsMutableDigraph, list))); + +InstallMethod(DigraphNC, "for a function and a dense list", +[IsFunction, IsDenseList], DigraphConsNC); + +InstallMethod(DigraphNC, "for a dense list", [IsDenseList], +list -> DigraphConsNC(IsImmutableDigraph, list)); + +InstallMethod(DigraphNC, "for a function and a record", +[IsFunction, IsRecord], DigraphConsNC); + +InstallMethod(DigraphNC, "for a record", [IsRecord], +record -> DigraphConsNC(IsImmutableDigraph, record)); + +######################################################################## +# 3. Digraph copies +######################################################################## + +InstallMethod(DigraphMutableCopy, "for a digraph by out-neighbours", +[IsDigraphByOutNeighboursRep], +function(D) + local copy; + copy := ConvertToMutableDigraphNC(OutNeighboursMutableCopy(D)); + SetDigraphVertexLabels(copy, StructuralCopy(DigraphVertexLabels(D))); + if HaveEdgeLabelsBeenAssigned(D) then + SetDigraphEdgeLabelsNC(copy, StructuralCopy(DigraphEdgeLabelsNC(D))); + fi; + return copy; +end); + +InstallMethod(DigraphImmutableCopy, "for a digraph by out-neighbours", +[IsDigraphByOutNeighboursRep], +function(D) + local copy; + copy := ConvertToImmutableDigraphNC(OutNeighboursMutableCopy(D)); + SetDigraphVertexLabels(copy, StructuralCopy(DigraphVertexLabels(D))); + if HaveEdgeLabelsBeenAssigned(D) then + SetDigraphEdgeLabelsNC(copy, StructuralCopy(DigraphEdgeLabelsNC(D))); + fi; + return copy; +end); + +InstallMethod(DigraphCopySameMutability, "for a mutable digraph", +[IsMutableDigraph], DigraphMutableCopy); + +InstallMethod(DigraphCopySameMutability, "for an immutable digraph", +[IsImmutableDigraph], DigraphImmutableCopy); + +InstallMethod(DigraphImmutableCopyIfMutable, "for a mutable digraph", +[IsMutableDigraph], DigraphImmutableCopy); + +InstallMethod(DigraphImmutableCopyIfMutable, "for an immutable digraph", +[IsImmutableDigraph], IdFunc); + +InstallMethod(DigraphImmutableCopyIfImmutable, "for a mutable digraph", +[IsMutableDigraph], IdFunc); + +InstallMethod(DigraphImmutableCopyIfImmutable, "for an immutable digraph", +[IsImmutableDigraph], DigraphImmutableCopy); + +InstallMethod(DigraphMutableCopyIfImmutable, "for a mutable digraph", +[IsMutableDigraph], IdFunc); + +InstallMethod(DigraphMutableCopyIfImmutable, "for an immutable digraph", +[IsImmutableDigraph], DigraphMutableCopy); + +InstallMethod(DigraphMutableCopyIfMutable, "for a mutable digraph", +[IsMutableDigraph], DigraphMutableCopy); + +InstallMethod(DigraphMutableCopyIfMutable, "for an immutable digraph", +[IsImmutableDigraph], IdFunc); + +######################################################################## +# 4. PostMakeImmutable +######################################################################## + +InstallMethod(PostMakeImmutable, "for a digraph", +[IsDigraph and IsDigraphByOutNeighboursRep], +function(D) + MakeImmutable(D!.OutNeighbours); + SetFilterObj(D, IsImmutableDigraph); + SetFilterObj(D, IsAttributeStoringRep); +end); + +######################################################################## +# 5. Digraph constructors +######################################################################## + +InstallMethod(DigraphCons, "for IsMutableDigraph and a record", +[IsMutableDigraph, IsRecord], +function(_, record) + local D, cmp, labels, i; + + if IsGraph(record) then + # IsGraph is a function not a filter, so we cannot have a separate method + D := DigraphNC(IsMutableDigraph, + List(Vertices(record), x -> Adjacency(record, x))); + if IsBound(record.names) then + SetDigraphVertexLabels(D, StructuralCopy(record.names)); + fi; + return D; + fi; + + if not (IsBound(record.DigraphSource) + and IsBound(record.DigraphRange) + and (IsBound(record.DigraphVertices) or + IsBound(record.DigraphNrVertices))) then + ErrorNoReturn("the argument must be a record with components ", + "'DigraphSource', 'DigraphRange', and either ", + "'DigraphVertices' or 'DigraphNrVertices' (but not both),"); + elif not IsList(record.DigraphSource) + or not IsList(record.DigraphRange) then + ErrorNoReturn("the record components 'DigraphSource' and 'DigraphRange' ", + "must be lists,"); + elif Length(record.DigraphSource) <> Length(record.DigraphRange) then + ErrorNoReturn("the record components 'DigraphSource' and 'DigraphRange' ", + "must have equal length,"); + elif IsBound(record.DigraphVertices) + and IsBound(record.DigraphNrVertices) then + ErrorNoReturn("the record must only have one of the components ", + "'DigraphVertices' and 'DigraphNrVertices', not both,"); + fi; + + if IsBound(record.DigraphNrVertices) then + if (not IsInt(record.DigraphNrVertices)) + or record.DigraphNrVertices < 0 then + ErrorNoReturn("the record component 'DigraphNrVertices' ", + "must be a non-negative integer,"); + fi; + cmp := x -> IsPosInt(x) and x < record.DigraphNrVertices + 1; + else + Assert(1, IsBound(record.DigraphVertices)); + if not IsList(record.DigraphVertices) then + ErrorNoReturn("the record component 'DigraphVertices' must be a list,"); + elif not IsDuplicateFreeList(record.DigraphVertices) then + ErrorNoReturn("the record component 'DigraphVertices' must be ", + "duplicate-free,"); + fi; + cmp := x -> x in record.DigraphVertices; + record.DigraphNrVertices := Length(record.DigraphVertices); + fi; + + if not ForAll(record.DigraphSource, cmp) then + ErrorNoReturn("the record component 'DigraphSource' is invalid,"); + elif not ForAll(record.DigraphRange, cmp) then + ErrorNoReturn("the record component 'DigraphRange' is invalid,"); + fi; + + record := StructuralCopy(record); + + # Rewrite the vertices to numbers + if IsBound(record.DigraphVertices) then + if record.DigraphVertices <> [1 .. record.DigraphNrVertices] then + for i in [1 .. Length(record.DigraphSource)] do + record.DigraphRange[i] := Position(record.DigraphVertices, + record.DigraphRange[i]); + record.DigraphSource[i] := Position(record.DigraphVertices, + record.DigraphSource[i]); + od; + labels := record.DigraphVertices; + Unbind(record.DigraphVertices); + fi; + fi; + + record.DigraphRange := Permuted(record.DigraphRange, + Sortex(record.DigraphSource)); + D := DigraphNC(IsMutableDigraph, record); + if IsBound(labels) then + SetDigraphVertexLabels(D, labels); + fi; + return D; +end); + +InstallMethod(DigraphCons, +"for IsMutableDigraph and a dense list of out-neighbours", +[IsMutableDigraph, IsDenseList], +function(_, list) + local sublist, v; + for sublist in list do + if not IsHomogeneousList(sublist) then + ErrorNoReturn("the argument must be a list of lists of positive ", + "integers not exceeding the length of the argument,"); + fi; + for v in sublist do + if not IsPosInt(v) or v > Length(list) then + ErrorNoReturn("the argument must be a list of lists of ", + "positive integers not exceeding the length of ", + "the argument,"); + fi; + od; + od; + return DigraphNC(IsMutableDigraph, list); +end); + +InstallMethod(DigraphCons, "for IsMutableDigraph, a list, and function", +[IsMutableDigraph, IsList, IsFunction], +function(_, list, func) + local N, out, x, i, j; + N := Size(list); # number of vertices + out := List([1 .. N], x -> []); + for i in [1 .. N] do + x := list[i]; + for j in [1 .. N] do + if func(x, list[j]) then + Add(out[i], j); + fi; + od; + od; + return ConvertToMutableDigraphNC(out); +end); + +InstallMethod(DigraphCons, +"for IsMutableDigraph, a number of vertices, source, and range", +[IsMutableDigraph, IsInt, IsList, IsList], +function(_, N, src, ran) + return DigraphCons(IsMutableDigraph, rec(DigraphNrVertices := N, + DigraphSource := src, + DigraphRange := ran)); +end); + +InstallMethod(DigraphCons, +"for IsMutableDigraph, a list of vertices, source, and range", +[IsMutableDigraph, IsList, IsList, IsList], +function(_, domain, src, ran) + local D; + D := DigraphCons(IsMutableDigraph, rec(DigraphVertices := domain, + DigraphSource := src, + DigraphRange := ran)); + SetDigraphVertexLabels(D, domain); + return D; +end); + +InstallMethod(DigraphCons, "for IsImmutableDigraph and a record", +[IsImmutableDigraph, IsRecord], +function(_, record) + local D; + D := MakeImmutable(DigraphCons(IsMutableDigraph, record)); + if IsGraph(record) then + # IsGraph is a function not a filter, so we cannot have a separate method + # for this. + if not IsTrivial(record.group) then + Assert(1, IsPermGroup(record.group)); + SetDigraphGroup(D, record.group); + SetDigraphSchreierVector(D, record.schreierVector); + SetRepresentativeOutNeighbours(D, record.adjacencies); + fi; + else + SetDigraphNrEdges(D, Length(record.DigraphSource)); + fi; + return D; +end); + +InstallMethod(DigraphCons, +"for IsImmutableDigraph and a dense list of out-neighbours", +[IsImmutableDigraph, IsDenseList], +{_, list} -> MakeImmutable(DigraphCons(IsMutableDigraph, list))); + +InstallMethod(DigraphCons, "for IsImmutableDigraph, a list, and function", +[IsImmutableDigraph, IsList, IsFunction], +function(_, list, func) + local D; + D := MakeImmutable(DigraphCons(IsMutableDigraph, list, func)); + SetDigraphAdjacencyFunction(D, {u, v} -> func(list[u], list[v])); + SetFilterObj(D, IsDigraphWithAdjacencyFunction); + SetDigraphVertexLabels(D, list); + return D; +end); + +InstallMethod(DigraphCons, +"for IsImmutableDigraph, a number of vertices, source, and range", +[IsImmutableDigraph, IsInt, IsList, IsList], +{_, N, src, ran} +-> MakeImmutable(DigraphCons(IsMutableDigraph, N, src, ran))); + +InstallMethod(DigraphCons, +"for IsImmutableDigraph, a list of vertices, source, and range", +[IsImmutableDigraph, IsList, IsList, IsList], +{_, domain, src, ran} -> +MakeImmutable(DigraphCons(IsMutableDigraph, domain, src, ran))); + +InstallMethod(Digraph, "for a filter and a record", [IsFunction, IsRecord], +DigraphCons); + +InstallMethod(Digraph, "for a record", [IsRecord], +record -> DigraphCons(IsImmutableDigraph, record)); + +InstallMethod(Digraph, "for a filter and a list", [IsFunction, IsList], +DigraphCons); + +InstallMethod(Digraph, "for a list", [IsList], +list -> DigraphCons(IsImmutableDigraph, list)); + +InstallMethod(Digraph, "for a filter, a list, and a function", +[IsFunction, IsList, IsFunction], +DigraphCons); + +InstallMethod(Digraph, "for a list and a function", [IsList, IsFunction], +{list, func} -> DigraphCons(IsImmutableDigraph, list, func)); + +InstallMethod(Digraph, "for a filter, integer, list, and list", +[IsFunction, IsInt, IsList, IsList], +DigraphCons); + +InstallMethod(Digraph, "for an integer, list, and list", +[IsInt, IsList, IsList], +{n, src, ran} -> DigraphCons(IsImmutableDigraph, n, src, ran)); + +InstallMethod(Digraph, "for a filter, list, list, and list", +[IsFunction, IsList, IsList, IsList], +DigraphCons); + +InstallMethod(Digraph, "for a list, list, and list", [IsList, IsList, IsList], +{dom, src, ran} -> DigraphCons(IsImmutableDigraph, dom, src, ran)); + +InstallMethod(Digraph, "for a string naming a digraph", [IsString], +function(name) + # edge case to avoid interfering with Digraph([]) + if name = "" then + TryNextMethod(); + fi; + + # standardise string format to search database + name := LowercaseString(name); + RemoveCharacters(name, " \n\t\r"); + + # load database if not already done + DIGRAPHS_LoadNamedDigraphs(); + + if not name in RecNames(DIGRAPHS_NamedDigraphs) then + ErrorNoReturn("named digraph not found; see ListNamedDigraphs,"); + fi; + return DigraphFromDiSparse6String(DIGRAPHS_NamedDigraphs.(name)); +end); + +InstallMethod(ListNamedDigraphs, +"for a string and a pos int", +[IsString, IsPosInt], +function(s, level) + local l, cands, func; + # standardise request + s := LowercaseString(s); + RemoveCharacters(s, " \n\t\r"); + l := Length(s); + + # load database if not already done + DIGRAPHS_LoadNamedDigraphs(); + + # retrieve candidates + cands := RecNames(DIGRAPHS_NamedDigraphs); + if l = 0 then + return cands; + fi; + + # print warning if level higher than ones here that have methods + if level > 3 then + Info(InfoWarning, 1, "ListNamedDigraphs: second argument is"); + Info(InfoWarning, 1, "greater than level of greatest flexibility."); + Info(InfoWarning, 1, "Using = 3 instead."); + level := 3; + fi; + + if level = 1 then + func := c -> Length(c) >= l and c{[1 .. l]} = s; + elif level = 2 then + func := c -> PositionSublist(c, s) <> fail; + else + s := Filtered(s, x -> IsDigitChar(x) or IsAlphaChar(x)); + func := c -> PositionSublist(Filtered(c, x -> IsDigitChar(x) or + IsAlphaChar(x)), s) <> fail; + fi; + return Filtered(cands, func); +end); + +# if search function called with no level, assume a substring search with +# special chars +InstallMethod(ListNamedDigraphs, "for a string", [IsString], +x -> ListNamedDigraphs(x, 2)); + +######################################################################## +# 6. Printing, viewing, strings +######################################################################## + +InstallMethod(ViewString, "for a digraph", [IsDigraph], +function(D) + local n, m, display_nredges, displayed_bipartite, str, x; + + n := DigraphNrVertices(D); + m := DigraphNrEdges(D); + display_nredges := true; + displayed_bipartite := false; + + str := "<"; + if IsMutableDigraph(D) then + Append(str, "mutable "); + elif IsImmutableDigraph(D) then + Append(str, "immutable "); + fi; + + Assert(1, IsMutableDigraph(D) or IsImmutableDigraph(D)); + + if m = 0 then + if IsImmutableDigraph(D) then + SetIsEmptyDigraph(D, true); + fi; + Append(str, "empty "); + display_nredges := false; + elif n > 1 then + if HasIsCycleDigraph(D) and IsCycleDigraph(D) then + Append(str, "cycle "); + display_nredges := false; + elif HasIsChainDigraph(D) and IsChainDigraph(D) then + Append(str, "chain "); + display_nredges := false; + elif HasIsCompleteDigraph(D) and IsCompleteDigraph(D) then + Append(str, "complete "); + display_nredges := false; + elif HasIsCompleteBipartiteDigraph(D) and IsCompleteBipartiteDigraph(D) then + Append(str, "complete bipartite "); + displayed_bipartite := true; + elif HasIsCompleteMultipartiteDigraph(D) + and IsCompleteMultipartiteDigraph(D) then + Append(str, "complete multipartite "); + elif HasIsLatticeDigraph(D) and IsLatticeDigraph(D) then + Append(str, "lattice "); + elif HasIsJoinSemilatticeDigraph(D) and IsJoinSemilatticeDigraph(D) then + Append(str, "join semilattice "); + elif HasIsMeetSemilatticeDigraph(D) and IsMeetSemilatticeDigraph(D) then + Append(str, "meet semilattice "); + elif HasIsUndirectedTree(D) and IsUndirectedTree(D) then + Append(str, "undirected tree "); + display_nredges := false; + elif HasIsUndirectedForest(D) and IsUndirectedForest(D) then + Append(str, "undirected forest "); + elif HasIsDirectedTree(D) and IsDirectedTree(D) then + Append(str, "directed tree "); + display_nredges := false; + else + if HasIsEulerianDigraph(D) and IsEulerianDigraph(D) then + Append(str, "Eulerian "); + if HasIsHamiltonianDigraph(D) and IsHamiltonianDigraph(D) then + Append(str, "and "); + fi; + fi; + if HasIsHamiltonianDigraph(D) and IsHamiltonianDigraph(D) then + Append(str, "Hamiltonian "); + fi; + if HasIsStronglyConnectedDigraph(D) and IsStronglyConnectedDigraph(D) + and not (HasIsEulerianDigraph(D) and IsEulerianDigraph(D)) + and not (HasIsHamiltonianDigraph(D) and IsHamiltonianDigraph(D)) + and not (HasIsSymmetricDigraph(D) and IsSymmetricDigraph(D)) then + Append(str, "strongly connected "); + fi; + if HasIsBiconnectedDigraph(D) and IsBiconnectedDigraph(D) then + Append(str, "biconnected "); + elif ((HasIsSymmetricDigraph(D) and IsSymmetricDigraph(D)) + or not (HasIsStronglyConnectedDigraph(D) + and IsStronglyConnectedDigraph(D))) + and not (HasIsTournament(D) and IsTournament(D)) + and HasIsConnectedDigraph(D) and IsConnectedDigraph(D) then + Append(str, "connected "); + fi; + if HasIsBipartiteDigraph(D) and IsBipartiteDigraph(D) then + Append(str, "bipartite "); + displayed_bipartite := true; + fi; + if HasIsEdgeTransitive(D) and IsEdgeTransitive(D) and + HasIsVertexTransitive(D) and IsVertexTransitive(D) then + Append(str, "edge- and vertex-transitive "); + elif HasIsEdgeTransitive(D) and IsEdgeTransitive(D) then + Append(str, "edge-transitive "); + elif HasIsVertexTransitive(D) and IsVertexTransitive(D) then + Append(str, "vertex-transitive "); + elif HasIsRegularDigraph(D) and IsRegularDigraph(D) then + Append(str, "regular "); + elif HasIsOutRegularDigraph(D) and IsOutRegularDigraph(D) then + Append(str, "out-regular "); + elif HasIsInRegularDigraph(D) and IsInRegularDigraph(D) then + Append(str, "in-regular "); + fi; + if HasIsAcyclicDigraph(D) and IsAcyclicDigraph(D) then + Append(str, "acyclic "); + elif HasIsPartialOrderDigraph(D) and IsPartialOrderDigraph(D) then + Append(str, "partial order "); + elif HasIsEquivalenceDigraph(D) and IsEquivalenceDigraph(D) then + Append(str, "equivalence "); + elif HasIsFunctionalDigraph(D) and IsFunctionalDigraph(D) then + Append(str, "functional "); + display_nredges := false; + elif HasIsPreorderDigraph(D) and IsPreorderDigraph(D) then + Append(str, "preorder "); + else + if HasIsReflexiveDigraph(D) and IsReflexiveDigraph(D) then + Append(str, "reflexive "); + fi; + if HasIsSymmetricDigraph(D) and IsSymmetricDigraph(D) then + Append(str, "symmetric "); + elif HasIsAntisymmetricDigraph(D) and IsAntisymmetricDigraph(D) + and not (HasIsTournament(D) and IsTournament(D)) then + Append(str, "antisymmetric "); + fi; + if HasIsTransitiveDigraph(D) and IsTransitiveDigraph(D) then + Append(str, "transitive "); + fi; + fi; + fi; + fi; + + if IsMultiDigraph(D) then + Append(str, "multi"); + fi; + + if not (HasIsCycleDigraph(D) and IsCycleDigraph(D)) + and HasIsTournament(D) and IsTournament(D) and n > 1 then + Append(str, "tournament "); + display_nredges := false; + else + Append(str, "digraph "); + fi; + Append(str, "with "); + + if displayed_bipartite then + x := List(DigraphBicomponents(D), Length); + Append(str, "bicomponent sizes "); + Append(str, String(x[1])); + Append(str, " and "); + Append(str, String(x[2])); + Append(str, ">"); + return str; + fi; + + Append(str, String(n)); + if n = 1 then + Append(str, " vertex"); + else + Append(str, " vertices"); + fi; + if display_nredges then + Append(str, ", "); + Append(str, String(m)); + if m = 1 then + Append(str, " edge"); + else + Append(str, " edges"); + fi; + fi; + Append(str, ">"); + return str; +end); + +InstallMethod(PrintString, "for a digraph", [IsDigraph], String); + +InstallMethod(String, "for a digraph", +[IsDigraph], +function(D) + local n, N, i, mut, streps, outnbs_rep, lengths, strings, + out_neighbours_string, creators_streps, creators_props, props; + if IsMutableDigraph(D) then + mut := "IsMutableDigraph, "; + else + mut := ""; + fi; + if IsSymmetricDigraph(D) and not DigraphHasLoops(D) then + streps := [Graph6String, Sparse6String]; + creators_streps := ["DigraphFromGraph6String", + "DigraphFromSparse6String"]; + else + streps := [Digraph6String, DiSparse6String]; + creators_streps := ["DigraphFromDigraph6String", + "DigraphFromDiSparse6String"]; + fi; + streps := List(streps, f -> f(D)); + strings := []; + for n in [1 .. Length(streps)] do + Add(strings, Concatenation(creators_streps[n], "(", mut, "\"", + ReplacedString(streps[n], "\\", "\\\\"), "\"", ")")); + od; + + out_neighbours_string := String(OutNeighbours(D)); + # print empty lists with two spaces for consistency + # see https://github.com/gap-system/gap/pull/5418 + out_neighbours_string := ReplacedString(out_neighbours_string, "[ ]", "[ ]"); + outnbs_rep := Concatenation("Digraph(", mut, out_neighbours_string, ")"); + Add(strings, String(outnbs_rep)); + + N := DigraphNrVertices(D); + props := [x -> IsCycleDigraph(x) + and x = CycleDigraph(DigraphNrVertices(x)), + IsCompleteDigraph, + x -> IsChainDigraph(x) + and x = ChainDigraph(DigraphNrVertices(x)), + IsEmptyDigraph]; + creators_props := ["CycleDigraph", + "CompleteDigraph", + "ChainDigraph", + "EmptyDigraph"]; + for i in [1 .. Length(props)] do + if props[i](D) then + Add(strings, Concatenation(creators_props[i], "(", mut, String(N), ")")); + fi; + od; + + lengths := List(strings, Length); + return strings[Position(lengths, Minimum(lengths))]; +end); + +######################################################################## +# 7. Operators +######################################################################## + +InstallMethod(\=, "for two digraphs", [IsDigraph, IsDigraph], DIGRAPH_EQUALS); + +InstallMethod(\<, "for two digraphs", [IsDigraph, IsDigraph], DIGRAPH_LT); + +######################################################################## +# 8. Digraph by-something constructors +######################################################################## + +InstallMethod(DigraphByAdjacencyMatrixConsNC, +"for IsMutableDigraph and a homogeneous list", +[IsMutableDigraph, IsHomogeneousList], +function(_, mat) + local add_edge, n, list, i, j; + + if IsInt(mat[1][1]) then + add_edge := function(i, j) + local k; + for k in [1 .. mat[i][j]] do + Add(list[i], j); + od; + end; + else # boolean matrix + add_edge := function(i, j) + if mat[i][j] then + Add(list[i], j); + fi; + end; + fi; + + n := Length(mat); + list := EmptyPlist(n); + for i in [1 .. n] do + list[i] := []; + for j in [1 .. n] do + add_edge(i, j); + od; + od; + return DigraphNC(IsMutableDigraph, list); +end); + +InstallMethod(DigraphByAdjacencyMatrixCons, +"for IsMutableDigraph and a homogeneous list", +[IsMutableDigraph, IsHomogeneousList], +function(_, mat) + local n, i, j; + n := Length(mat); + if not IsRectangularTable(mat) or Length(mat[1]) <> n then + ErrorNoReturn("the argument must be a square matrix,"); + elif not IsBool(mat[1][1]) then + for i in [1 .. n] do + for j in [1 .. n] do + if not (IsInt(mat[i][j]) and mat[i][j] >= 0) then + ErrorNoReturn("the argument must be a matrix of ", + "non-negative integers,"); + fi; + od; + od; + fi; + return DigraphByAdjacencyMatrixConsNC(IsMutableDigraph, mat); +end); + +InstallMethod(DigraphByAdjacencyMatrixCons, +"for IsMutableDigraph and an empty list", +[IsMutableDigraph, IsList and IsEmpty], DigraphByAdjacencyMatrixConsNC); + +InstallMethod(DigraphByAdjacencyMatrixConsNC, +"for IsMutableDigraph and an empty list", +[IsMutableDigraph, IsList and IsEmpty], +{_, dummy} -> EmptyDigraph(IsMutableDigraph, 0)); + +InstallMethod(DigraphByAdjacencyMatrixCons, +"for IsImmutableDigraph and a homogeneous list", +[IsImmutableDigraph, IsHomogeneousList], +function(_, mat) + local D; + D := MakeImmutable(DigraphByAdjacencyMatrixCons(IsMutableDigraph, mat)); + if IsEmpty(mat) or IsInt(mat[1][1]) then + SetAdjacencyMatrix(D, mat); + else + Assert(1, IsBool(mat[1][1])); + SetBooleanAdjacencyMatrix(D, mat); + fi; + return D; +end); + +InstallMethod(DigraphByAdjacencyMatrix, "for a function and a homogeneous list", +[IsFunction, IsHomogeneousList], +DigraphByAdjacencyMatrixCons); + +InstallMethod(DigraphByAdjacencyMatrix, "for a homogeneous list", +[IsHomogeneousList], +mat -> DigraphByAdjacencyMatrixCons(IsImmutableDigraph, mat)); + +InstallMethod(DigraphByEdgesCons, +"for IsMutableDigraph, a list, and an integer", +[IsMutableDigraph, IsList, IsInt], +function(_, edges, n) + local pos, list, edge; + if IsEmpty(edges) then + return NullDigraph(IsMutableDigraph, n); + fi; + pos := 0; + for edge in edges do + pos := pos + 1; + if not IsList(edge) then + ErrorNoReturn("the 1st argument (list of edges) must be a list of ", + "lists, but found ", + TNAM_OBJ(edge), + " in position ", + pos); + elif Length(edge) <> 2 then + ErrorNoReturn("the 1st argument (list of edges) must be a list of lists ", + "of length 2, found ", edge, " (length ", Length(edge), + " in position ", pos, ")"); + elif not IsPosInt(edge[1]) or not IsPosInt(edge[2]) then + ErrorNoReturn("the 1st argument (list of edges) must be pairs of ", + "positive integers but found ", edge, " in position ", pos); + elif edge[1] > n or edge[2] > n then + ErrorNoReturn("the 1st argument (list of edges) must be pairs of ", + "positive integers <= ", n, " but found ", edge, + " in position ", pos); + fi; + od; + list := List([1 .. n], x -> []); + for edge in edges do + Add(list[edge[1]], edge[2]); + od; + return DigraphNC(IsMutableDigraph, list); +end); + +InstallMethod(DigraphByEdgesCons, "for IsMutableDigraph and a list", +[IsMutableDigraph, IsList], +function(_, edges) + local n; + if IsEmpty(edges) then + n := 0; + else + n := Maximum(List(edges, Maximum)); + fi; + return DigraphByEdgesCons(IsMutableDigraph, edges, n); +end); + +InstallMethod(DigraphByEdgesCons, "for an ImmutableDigraph and a list", +[IsImmutableDigraph, IsList], +function(_, edges) + local D; + D := MakeImmutable(DigraphByEdges(IsMutableDigraph, edges)); + SetDigraphEdges(D, edges); + SetDigraphNrEdges(D, Length(edges)); + return D; +end); + +InstallMethod(DigraphByEdgesCons, +"for IsImmutableDigraph, a list, and an integer", +[IsImmutableDigraph, IsList, IsInt], +function(_, edges, n) + local D; + D := MakeImmutable(DigraphByEdges(IsMutableDigraph, edges, n)); + SetDigraphEdges(D, edges); + SetDigraphNrEdges(D, Length(edges)); + return D; +end); + +InstallMethod(DigraphByEdges, "for a list and an integer", +[IsList, IsInt], +{edges, n} -> DigraphByEdgesCons(IsImmutableDigraph, edges, n)); + +InstallMethod(DigraphByEdges, "for a list", [IsList], +edges -> DigraphByEdgesCons(IsImmutableDigraph, edges)); + +InstallMethod(DigraphByEdges, "for a function, a list, and an integer", +[IsFunction, IsList, IsInt], DigraphByEdgesCons); + +InstallMethod(DigraphByEdges, "for a function and a list", +[IsFunction, IsList], DigraphByEdgesCons); + +InstallMethod(DigraphByInNeighboursCons, "for IsMutableDigraph, and a list", +[IsMutableDigraph, IsList], +function(_, list) + local n, x; + n := Length(list); # number of vertices + for x in list do + if not ForAll(x, i -> IsPosInt(i) and i <= n) then + ErrorNoReturn("the argument must be a list of lists of positive ", + "integers not exceeding the length of the argument,"); + fi; + od; + return DigraphByInNeighboursConsNC(IsMutableDigraph, list); +end); + +InstallMethod(DigraphByInNeighboursCons, "for IsImmutableDigraph and a list", +[IsImmutableDigraph, IsList], +function(_, list) + local D; + D := MakeImmutable(DigraphByInNeighboursCons(IsMutableDigraph, list)); + SetInNeighbours(D, list); + return D; +end); + +InstallMethod(DigraphByInNeighboursConsNC, "for IsMutableDigraph and a list", +[IsMutableDigraph, IsList], +{_, list} -> DigraphNC(IsMutableDigraph, DIGRAPH_IN_OUT_NBS(list))); + +InstallMethod(DigraphByInNeighboursConsNC, "for IsImmutableDigraph and a list", +[IsImmutableDigraph, IsList], +function(_, list) + local D; + D := MakeImmutable(DigraphByInNeighboursConsNC(IsMutableDigraph, list)); + SetInNeighbours(D, list); + return D; +end); + +InstallMethod(DigraphByInNeighbours, "for a list", [IsList], +list -> DigraphByInNeighboursCons(IsImmutableDigraph, list)); + +InstallMethod(DigraphByInNeighbours, "for a function and a list", +[IsFunction, IsList], +DigraphByInNeighboursCons); + +######################################################################## +# 9. Converters to/from other types -> digraph . . . +######################################################################## + +InstallMethod(AsDigraphCons, "for IsMutableDigraph and a binary relation", +[IsMutableDigraph, IsBinaryRelation], +function(_, rel) + local dom, list, i; + dom := GeneratorsOfDomain(UnderlyingDomainOfBinaryRelation(rel)); + if not IsRange(dom) or dom[1] <> 1 then + ErrorNoReturn("the argument must be a binary relation ", + "on the domain [1 .. n] for some positive integer n,"); + fi; + list := EmptyPlist(Length(dom)); + for i in dom do + list[i] := ImagesElm(rel, i); + od; + return Digraph(IsMutableDigraph, list); +end); + +InstallMethod(AsDigraphCons, "for IsImmutableDigraph and a binary relation", +[IsImmutableDigraph, IsBinaryRelation], +function(_, rel) + local D; + D := MakeImmutable(AsDigraph(IsMutableDigraph, rel)); + SetIsMultiDigraph(D, false); + if HasIsReflexiveBinaryRelation(rel) then + SetIsReflexiveDigraph(D, IsReflexiveBinaryRelation(rel)); + fi; + if HasIsSymmetricBinaryRelation(rel) then + SetIsSymmetricDigraph(D, IsSymmetricBinaryRelation(rel)); + fi; + if HasIsTransitiveBinaryRelation(rel) then + SetIsTransitiveDigraph(D, IsTransitiveBinaryRelation(rel)); + fi; + if HasIsAntisymmetricBinaryRelation(rel) then + SetIsAntisymmetricDigraph(D, IsAntisymmetricBinaryRelation(rel)); + fi; + return D; +end); + +InstallMethod(AsDigraph, "for a binary relation", [IsBinaryRelation], +rel -> AsDigraphCons(IsImmutableDigraph, rel)); + +InstallMethod(AsDigraph, "for a function and a binary relation", +[IsFunction, IsBinaryRelation], AsDigraphCons); + +InstallMethod(AsDigraphCons, +"for IsMutableDigraph, a transformation, and an integer", +[IsMutableDigraph, IsTransformation, IsInt], +function(_, f, n) + local list, x, i; + if n < 0 then + ErrorNoReturn("the 2nd argument should be a non-negative integer,"); + fi; + + list := EmptyPlist(n); + for i in [1 .. n] do + x := i ^ f; + if x > n then + return fail; + fi; + list[i] := [x]; + od; + return DigraphNC(IsMutableDigraph, list); +end); + +InstallMethod(AsDigraphCons, +"for IsImmutableDigraph, a transformation, and an integer", +[IsImmutableDigraph, IsTransformation, IsInt], +function(_, f, n) + local D; + D := AsDigraph(IsMutableDigraph, f, n); + if D <> fail then + D := MakeImmutable(D); + SetDigraphNrEdges(D, n); + SetIsMultiDigraph(D, false); + SetIsFunctionalDigraph(D, true); + fi; + return D; +end); + +InstallMethod(AsDigraph, "for a function, a transformation, and an integer", +[IsFunction, IsTransformation, IsInt], AsDigraphCons); + +InstallMethod(AsDigraph, "for a transformation and an integer", +[IsTransformation, IsInt], +{t, n} -> AsDigraphCons(IsImmutableDigraph, t, n)); + +InstallMethod(AsDigraph, "for a function and a transformation", +[IsFunction, IsTransformation], +{func, t} -> AsDigraphCons(func, t, DegreeOfTransformation(t))); + +InstallMethod(AsDigraph, "for a transformation", [IsTransformation], +t -> AsDigraphCons(IsImmutableDigraph, t, DegreeOfTransformation(t))); + +InstallMethod(AsDigraph, "for a function, a perm, and an integer", +[IsFunction, IsPerm, IsInt], +{func, p, n} -> AsDigraphCons(func, AsTransformation(p), n)); + +InstallMethod(AsDigraph, "for a perm and an integer", +[IsPerm, IsInt], +{p, n} -> AsDigraph(AsTransformation(p), n)); + +InstallMethod(AsDigraph, "for a function and a perm", +[IsFunction, IsPerm], +{func, p} -> AsDigraph(func, AsTransformation(p))); + +InstallMethod(AsDigraph, "for a perm", [IsPerm], +p -> AsDigraph(AsTransformation(p))); + +InstallMethod(AsDigraphCons, +"for IsMutableDigraph, a partial perm, and an integer", +[IsMutableDigraph, IsPartialPerm, IsInt], +function(_, f, n) + local list, x, i; + if n < 0 then + ErrorNoReturn("the 2nd argument should be a non-negative integer,"); + fi; + + list := EmptyPlist(n); + for i in [1 .. n] do + x := i ^ f; + if x > n then + return fail; + elif x <> 0 then + list[i] := [x]; + else + list[i] := []; + fi; + od; + return DigraphNC(IsMutableDigraph, list); +end); + +InstallMethod(AsDigraphCons, +"for IsImmutableDigraph, a partial perm, and an integer", +[IsImmutableDigraph, IsPartialPerm, IsInt], +function(_, f, n) + local D; + D := AsDigraph(IsMutableDigraph, f, n); + if D <> fail then + D := MakeImmutable(D); + SetIsMultiDigraph(D, false); + fi; + return D; +end); + +InstallMethod(AsDigraph, "for a function, a partial perm, and an integer", +[IsFunction, IsPartialPerm, IsInt], AsDigraphCons); + +InstallMethod(AsDigraph, "for a partial perm and an integer", +[IsPartialPerm, IsInt], +{t, n} -> AsDigraphCons(IsImmutableDigraph, t, n)); + +InstallMethod(AsDigraph, "for a function and a partial perm", +[IsFunction, IsPartialPerm], +{func, t} -> AsDigraphCons(func, t, Maximum(DegreeOfPartialPerm(t), + CodegreeOfPartialPerm(t)))); + +InstallMethod(AsDigraph, "for a partial perm", [IsPartialPerm], +t -> AsDigraphCons(IsImmutableDigraph, t, Maximum(DegreeOfPartialPerm(t), + CodegreeOfPartialPerm(t)))); + +InstallMethod(AsBinaryRelation, "for a digraph", [IsDigraphByOutNeighboursRep], +function(D) + local rel; + if DigraphHasNoVertices(D) then + ErrorNoReturn("the argument must be a digraph with at least 1 ", + "vertex,"); + elif IsMultiDigraph(D) then + ErrorNoReturn("the argument must be a digraph with no multiple edges"); + fi; + # Can translate known attributes of to the relation, e.g. symmetry + rel := BinaryRelationOnPointsNC(OutNeighbours(D)); + if HasIsReflexiveDigraph(D) then + SetIsReflexiveBinaryRelation(rel, IsReflexiveDigraph(D)); + fi; + if HasIsSymmetricDigraph(D) then + SetIsSymmetricBinaryRelation(rel, IsSymmetricDigraph(D)); + fi; + if HasIsTransitiveDigraph(D) then + SetIsTransitiveBinaryRelation(rel, IsTransitiveDigraph(D)); + fi; + if HasIsAntisymmetricDigraph(D) then + SetIsAntisymmetricBinaryRelation(rel, IsAntisymmetricDigraph(D)); + fi; + return rel; +end); + +InstallMethod(AsSemigroup, "for a function and a digraph", +[IsFunction, IsDigraph], +function(filt, D) + local red, top, im, max, n, gens, i; + + if filt <> IsPartialPermSemigroup then + TryNextMethod(); + elif not IsJoinSemilatticeDigraph(D) then + if IsMeetSemilatticeDigraph(D) then + return AsSemigroup(IsPartialPermSemigroup, + DigraphReverse(DigraphMutableCopyIfMutable(D))); + fi; + ErrorNoReturn("the 2nd argument must be digraph that is a join or ", + "meet semilattice,"); + fi; + + D := DigraphMutableCopyIfMutable(D); + red := DigraphReflexiveTransitiveReduction(D); + top := DigraphTopologicalSort(D); + # im[i] will store the image of the idempotent partial perm corresponding to + # vertex i of the argument + im := []; + im[top[1]] := []; + max := 1; + + n := DigraphNrVertices(D); + # For each vertex, the corresponding idempotent has an image + # containing all images of idempotents below it. + for i in [2 .. n] do + im[top[i]] := Union(List(OutNeighboursOfVertex(red, top[i]), j -> im[j])); + # When there is only one neighbour, we must add a point to the image to + # distinguish the two idempotent partial perms. + if Length(OutNeighboursOfVertex(red, top[i])) = 1 then + Add(im[top[i]], max); + max := max + 1; + fi; + od; + + # Determine a small generating set + gens := Filtered([1 .. n], j -> Size(InNeighboursOfVertex(red, j)) < 2); + return Semigroup(List(gens, g -> PartialPerm(im[g], im[g]))); +end); + +InstallMethod(AsMonoid, "for a function and a digraph", +[IsFunction, IsDigraph], +function(filt, D) + if not (filt = IsPartialPermMonoid or filt = IsPartialPermSemigroup) then + ErrorNoReturn("the 1st argument must be IsPartialPermMonoid or ", + "IsPartialPermSemigroup,"); + elif not IsLatticeDigraph(D) then + ErrorNoReturn("the 2nd argument must be a lattice digraph,"); + fi; + return AsSemigroup(IsPartialPermSemigroup, D); +end); + +InstallMethod(AsSemigroup, +"for a function, a digraph, and a dense list", +[IsFunction, IsDigraph, IsDenseList, IsDenseList], +function(filt, digraph, gps, homs) + local red, n, hom_table, reps, rep, top, doms, starts, degs, max, gens, img, + start, deg, x, queue, j, k, g, y, hom, edge, i, gen; + + if filt <> IsPartialPermSemigroup then + TryNextMethod(); + elif not IsJoinSemilatticeDigraph(digraph) then + if IsMeetSemilatticeDigraph(digraph) then + return AsSemigroup(IsPartialPermSemigroup, + DigraphReverse(DigraphMutableCopyIfMutable(digraph)), + gps, + homs); + else + ErrorNoReturn("the second argument must be a join semilattice ", + "digraph or a meet semilattice digraph,"); + fi; + elif not ForAll(gps, IsGroup) then + ErrorNoReturn("the third argument must be a list of groups,"); + elif not Length(gps) = DigraphNrVertices(digraph) then + ErrorNoReturn("the third argument must have length equal to the number ", + "of vertices in the second argument,"); + fi; + + digraph := DigraphMutableCopyIfMutable(digraph); + red := DigraphReflexiveTransitiveReduction(digraph); + MakeImmutable(digraph); + if not Length(homs) = DigraphNrEdges(red) or + not ForAll(homs, x -> Length(x) = 3 and + IsPosInt(x[1]) and + IsPosInt(x[2]) and + IsDigraphEdge(red, [x[1], x[2]]) and + IsGroupHomomorphism(x[3]) and + Source(x[3]) = gps[x[1]] and + Range(x[3]) = gps[x[2]]) then + ErrorNoReturn("the third argument must be a list of triples [i, j, hom] ", + "of length equal to the number of edges in the reflexive ", + "transitive reduction of the second argument, where [i, j] ", + "is an edge in the reflex transitive reduction and hom is ", + "a group homomorphism from group i to group j,"); + fi; + + n := DigraphNrVertices(digraph); + + hom_table := List([1 .. n], x -> []); + for hom in homs do + hom_table[hom[1]][hom[2]] := hom[3]; + od; + + for edge in DigraphEdges(red) do + if not IsBound(hom_table[edge[1]][edge[2]]) then + ErrorNoReturn("the fourth argument must contain a triple [i, j, hom] ", + "for each edge [i, j] in the reflexive transitive ", + "reduction of the second argument,"); + fi; + od; + + reps := []; + for i in [1 .. n] do + rep := IsomorphismPermGroup(gps[i]); + rep := rep * SmallerDegreePermutationRepresentation(Image(rep)); + Add(reps, rep); + od; + + top := DigraphTopologicalSort(digraph); + doms := []; + starts := []; + degs := List([1 .. n], i -> NrMovedPoints(Image(reps[i]))); + for i in [1 .. n] do + if degs[i] = 0 then + degs[i] := 1; + fi; + od; + max := degs[top[1]] + 1; + doms[top[1]] := [1 .. max - 1]; + starts[top[1]] := 1; + + for i in [2 .. n] do + doms[top[i]] := Union(List(OutNeighboursOfVertex(red, top[i]), + j -> doms[j])); + Append(doms[top[i]], [max .. max + degs[top[i]] - 1]); + starts[top[i]] := max; + max := max + degs[top[i]]; + od; + + gens := []; + for i in [1 .. n] do + for gen in GeneratorsOfGroup(gps[top[i]]) do + img := []; + start := starts[top[i]]; + deg := degs[top[i]]; + x := ListPerm(gen ^ reps[top[i]]); + + # make sure the partial permutation is defined on the whole domain + img{[start .. start + deg - 1]} := [1 .. deg] + start - 1; + # now the actual representation + img{[start .. start + Length(x) - 1]} := x + start - 1; + + # travel up all the paths from top[i], applying the homomorphisms + # and storing the results as permutations on the appropriate set + # of points + queue := List(OutNeighboursOfVertex(red, top[i]), y -> [top[i], y, gen]); + while Length(queue) > 0 do + j := queue[1][1]; + k := queue[1][2]; + g := queue[1][3]; + start := starts[k]; + deg := degs[k]; + Remove(queue, 1); + x := g ^ hom_table[j][k]; + Append(queue, List(OutNeighboursOfVertex(red, k), y -> [k, y, x])); + x := x ^ reps[k]; + + # Check that compositions of homomorphisms commute. + # If img[start] is bound then we have already found some composition of + # homomorphisms which takes us into gps[k], so we must ensure that this + # agrees with the composition we are currently considering. + if IsBound(img[start]) then + y := PermList(img{[start .. start + deg - 1]} - start + 1); + if x <> y then + ErrorNoReturn("the homomorphisms given must form a commutative", + " diagram,"); + fi; + fi; + x := ListPerm(x); + img{[start .. start + deg - 1]} := [1 .. deg] + start - 1; + img{[start .. start + Length(x) - 1]} := x + start - 1; + od; + img := Compacted(img); + Add(gens, PartialPerm(doms[top[i]], img)); + od; + od; + return Semigroup(gens); +end); + +######################################################################## +# 10. Random digraphs +######################################################################## + +InstallMethod(RandomDigraphCons, "for IsMutableDigraph and an integer", +[IsMutableDigraph, IsInt], +{_, n} +-> RandomDigraphCons(IsMutableDigraph, n, Float(Random([0 .. n])) / n)); + +InstallMethod(RandomDigraphCons, "for IsMutableDigraph and an integer", +[IsImmutableDigraph, IsInt], +{_, n} +-> RandomDigraphCons(IsImmutableDigraph, n, Float(Random([0 .. n])) / n)); + +InstallMethod(RandomDigraphCons, "for IsHamiltonianDigraph and an integer", +[IsHamiltonianDigraph, IsInt], +{_, n} +-> RandomDigraphCons(IsHamiltonianDigraph, n, Float(Random([0 .. n])) / n)); + +InstallMethod(RandomDigraphCons, "for IsEulerianDigraph and an integer", +[IsEulerianDigraph, IsInt], +{_, n} +-> RandomDigraphCons(IsEulerianDigraph, n, Float(Random([0 .. n])) / n)); + +InstallMethod(RandomDigraphCons, "for IsConnectedDigraph and an integer", +[IsConnectedDigraph, IsInt], +{_, n} +-> RandomDigraphCons(IsConnectedDigraph, n, Float(Random([0 .. n])) / n)); + +InstallMethod(RandomDigraphCons, "for IsAcyclicDigraph and an integer", +[IsAcyclicDigraph, IsInt], +{_, n} +-> RandomDigraphCons(IsAcyclicDigraph, n, Float(Random([0 .. n])) / n)); + +InstallMethod(RandomDigraphCons, "for IsSymmetricDigraph and an integer", +[IsSymmetricDigraph, IsInt], +{_, n} +-> RandomDigraphCons(IsSymmetricDigraph, n, Float(Random([0 .. n])) / n)); + +InstallMethod(RandomDigraphCons, +"for IsMutableDigraph, an integer, and a rational", +[IsMutableDigraph, IsInt, IsRat], +{_, n, p} -> RandomDigraphCons(IsMutableDigraph, n, Float(p))); + +InstallMethod(RandomDigraphCons, +"for IsImmutableDigraph, an integer, and a rational", +[IsImmutableDigraph, IsInt, IsRat], +{_, n, p} -> RandomDigraphCons(IsImmutableDigraph, n, Float(p))); + +InstallMethod(RandomDigraphCons, +"for IsHamiltonianDigraph, an integer, and a rational", +[IsHamiltonianDigraph, IsInt, IsRat], +{_, n, p} -> RandomDigraphCons(IsHamiltonianDigraph, n, Float(p))); + +InstallMethod(RandomDigraphCons, +"for IsEulerianDigraph, an integer, and a rational", +[IsEulerianDigraph, IsInt, IsRat], +{_, n, p} -> RandomDigraphCons(IsEulerianDigraph, n, Float(p))); + +InstallMethod(RandomDigraphCons, +"for IsConnectedDigraph, an integer, and a rational", +[IsConnectedDigraph, IsInt, IsRat], +{_, n, p} -> RandomDigraphCons(IsConnectedDigraph, n, Float(p))); + +InstallMethod(RandomDigraphCons, +"for IsStronglyConnectedDigraph, an integer, and a rational", +[IsStronglyConnectedDigraph, IsInt, IsRat], +{filt, n, p} -> RandomDigraphCons(IsStronglyConnectedDigraph, n, Float(p))); + +InstallMethod(RandomDigraphCons, +"for IsAcyclicDigraph, an integer, and a rational", +[IsAcyclicDigraph, IsInt, IsRat], +{_, n, p} -> RandomDigraphCons(IsAcyclicDigraph, n, Float(p))); + +InstallMethod(RandomDigraphCons, +"for IsSymmetricDigraph, an integer, and a rational", +[IsSymmetricDigraph, IsInt, IsRat], +{_, n, p} -> RandomDigraphCons(IsSymmetricDigraph, n, Float(p))); + +InstallMethod(RandomDigraphCons, +"for IsMutableDigraph, a positive integer, and a float", +[IsMutableDigraph, IsPosInt, IsFloat], +function(_, n, p) + if p < 0.0 or 1.0 < p then + ErrorNoReturn("the 2nd argument

must be between 0 and 1,"); + fi; + return DigraphNC(IsMutableDigraph, RANDOM_DIGRAPH(n, Int(p * 10000))); +end); + +# This function takes an existing adjacency list after solely creating +# a Hamiltonian cycle or tree, and randomly adds edges between all +# remaining vertices in the graph. +BindGlobal("DIGRAPHS_FillOutGraph", function(n, p, adjacencyList) + local vertices, probability, i, j; + + vertices := [1 .. n]; + probability := [0 .. 99]; + + for i in vertices do + for j in vertices do + if (not (j in adjacencyList[i])) then + if Float(Random(probability) / 100) < p then + Add(adjacencyList[i], j); + fi; + fi; + od; + od; + + return adjacencyList; +end); + +InstallMethod(RandomDigraphCons, +"for IsHamiltonianDigraph, a positive integer, and a float", +[IsHamiltonianDigraph, IsPosInt, IsFloat], +function(_, n, p) + local adjacencyList, vertices, i, startVertex, hamiltonianCycle, x, j; + + adjacencyList := EmptyPlist(n); + + vertices := [1 .. n]; + + for i in vertices do + Add(adjacencyList, []); + od; + + # Edge Case + if n = 1 then + if Float(Random([0 .. 99]) / 100) < p then + Add(adjacencyList[1], 1); + fi; + return DigraphNC(adjacencyList); + fi; + + # Starting from a random vertex, we create a Hamiltonian cycle + startVertex := Remove(vertices, Random(vertices)); + hamiltonianCycle := EmptyPlist(n); + hamiltonianCycle[1] := startVertex; + + # While there are remaining n-1 vertices to be added to the Hamiltonian + # cycle + for x in [1 .. n - 1] do + # Create a random edge from the last vertex in the cycle + # to a random vertex not in the cycle + i := hamiltonianCycle[x]; + j := Remove(vertices, Random([1 .. Length(vertices)])); + Add(hamiltonianCycle, j); + Add(adjacencyList[i], j); + od; + + Add(adjacencyList[hamiltonianCycle[n]], startVertex); + + # Once we have created a Hamiltonian cycle, fill out the rest of the graph + # with random edges according to p + adjacencyList := DIGRAPHS_FillOutGraph(n, p, adjacencyList); + + return DigraphNC(adjacencyList); +end); + +InstallMethod(RandomDigraphCons, +"for IsEulerianDigraph, a positive integer, and a float", +[IsEulerianDigraph, IsPosInt, IsFloat], +function(_, n, p) + local adjacencyList, vertices, probability, startVertex, circuitVertex, i, + continueCircuit, verticesToConsider, connectedVertices, verticesToCheck; + + adjacencyList := EmptyPlist(n); + + vertices := [1 .. n]; + probability := [0 .. 99]; + + for i in vertices do + Add(adjacencyList, []); + od; + + # Edge Case + if n = 1 then + if Float(Random(probability) / 100) < p then + Add(adjacencyList[1], 1); + fi; + return DigraphNC(adjacencyList); + fi; + + # Starting from a random vertex, we create an Eulerian circuit + startVertex := Random(vertices); + circuitVertex := startVertex; + continueCircuit := true; + + # This will keep track of the vertices left to consider when deciding + # whether to extend the cycle. For example, if we want to extend from the + # current circuitVertex, we can check - verticesToConsider[circuitVertex] - + # to see which vertices it hasn't previously considered. + verticesToConsider := EmptyPlist(n); + for i in vertices do + Add(verticesToConsider, [1 .. n]); + od; + + # Eulerian graphs must be connected, so we store a list of connected + # vertices and check if a vertex isn't in the list + connectedVertices := [startVertex]; + + while continueCircuit do + while Length(verticesToConsider[circuitVertex]) > 0 do + # From the remaining vertices to check, select a random one to see + # if an edge will be added + i := Random(verticesToConsider[circuitVertex]); + Remove(verticesToConsider[circuitVertex], + Position(verticesToConsider[circuitVertex], i)); + + # Check that the edge doesn't already exist + if (not (i in adjacencyList[circuitVertex])) then + # First we guarantee that we get a connected graph by checking + # if the vertex isn't already connected + if (not (i in connectedVertices)) then + Add(adjacencyList[circuitVertex], i); + Add(connectedVertices, i); + circuitVertex := i; + break; + elif Float(Random(probability) / 100) < p then + Add(adjacencyList[circuitVertex], i); + circuitVertex := i; + break; + fi; + fi; + od; + + # If there are not more vertices to consider, we can end the circuit + if Length(verticesToConsider[circuitVertex]) = 0 then + continueCircuit := false; + fi; + od; + + # Finish the circuit by adding an edge back to the start vertex + # (if it isn't already at the start vertex) + if circuitVertex <> startVertex then + # If an edge already exists between the finish vertex and the start + # vertex, we must find another path to the start vertex to avoid + # generating a multidigraph. + while (startVertex in adjacencyList[circuitVertex]) do + # Here we consider all possible edges again, including previously + # rejected edges, to guarantee a path back to the start + verticesToCheck := [1 .. n]; + while Length(verticesToCheck) > 0 do + i := Remove(verticesToCheck, + Random([1 .. Length(verticesToCheck)])); + if (not (i in adjacencyList[circuitVertex])) then + Add(adjacencyList[circuitVertex], i); + circuitVertex := i; + break; + fi; + od; + od; + Add(adjacencyList[circuitVertex], startVertex); + fi; + + return DigraphNC(adjacencyList); +end); + +InstallMethod(RandomDigraphCons, +"for IsConnectedDigraph, a positive integer, and a float", +[IsConnectedDigraph, IsPosInt, IsFloat], +function(_, n, p) + local adjacencyList, vertices, startVertex, tree, x, i, j; + + adjacencyList := EmptyPlist(n); + + vertices := [1 .. n]; + + for i in vertices do + Add(adjacencyList, []); + od; + + # Starting from a random vertex, we first create a tree to guarantee + # connectivity + startVertex := Remove(vertices, Random(vertices)); + tree := [startVertex]; + + # While there are n-1 remaining vertices to be added to the tree + for x in [1 .. n - 1] do + # Create an edge from a random vertex in the tree, to a random vertex + # outside of it + i := Random(tree); + j := Remove(vertices, Random([1 .. Length(vertices)])); + Add(tree, j); + Add(adjacencyList[i], j); + od; + + # Once the tree has been created, we fill out the rest of the graph with + # random edges according to p + adjacencyList := DIGRAPHS_FillOutGraph(n, p, adjacencyList); + return DigraphNC(adjacencyList); +end); + +InstallMethod(RandomDigraphCons, +"for IsStronglyConnectedDigraph, a positive integer, and a float", +[IsStronglyConnectedDigraph, IsPosInt, IsFloat], +function(_, n, p) + local d, adjMatrix, stronglyConnectedComponents, + scc_a, scc_b, i, random_u, random_v; + + d := RandomDigraph(n, p); + + stronglyConnectedComponents := DigraphStronglyConnectedComponents(d); + + adjMatrix := AdjacencyMatrixMutableCopy(d); + + for i in [1 .. Size(stronglyConnectedComponents.comps) - 1] do + scc_a := stronglyConnectedComponents.comps[i]; + scc_b := stronglyConnectedComponents.comps[i + 1]; + + # add a connection from u to v + random_u := Random(scc_a); + random_v := Random(scc_b); + + adjMatrix[random_u][random_v] := 1; + od; + + # connect end scc to first scc + scc_a := stronglyConnectedComponents.comps[ + Size(stronglyConnectedComponents.comps)]; + scc_b := stronglyConnectedComponents.comps[1]; + + # add a connection from u to v + random_u := Random(scc_a); + random_v := Random(scc_b); + + adjMatrix[random_u][random_v] := 1; + + return DigraphByAdjacencyMatrix(adjMatrix); +end); + +InstallMethod(RandomDigraphCons, +"for IsAcyclicDigraph, a positive integer, and a float", +[IsAcyclicDigraph, IsPosInt, IsFloat], +function(_, n, p) + local adjacencyList, vertices, probability, i, j; + + adjacencyList := EmptyPlist(n); + + vertices := [1 .. n]; + probability := [0 .. 99]; + + for i in vertices do + Add(adjacencyList, []); + od; + + # We shuffle the vertices and treat the order of the vertices as a + # hierarchy where all vertices to the right of a vertex in the list are + # potential edges. This idea is that the edges flow downwards in the + # hierarchy, avoiding cycles. + Shuffle(vertices); + + # From position i in the list, we consider all vertices j to the right of i + for i in vertices do + for j in [i + 1 .. n] do + if Float(Random(probability) / 100) < p then + Add(adjacencyList[vertices[i]], vertices[j]); + fi; + od; + od; + + return DigraphNC(adjacencyList); +end); + +InstallMethod(RandomDigraphCons, +"for IsSymmetricDigraph, a positive integer, and a float", +[IsSymmetricDigraph, IsPosInt, IsFloat], +function(_, n, p) + local adjacencyList, vertices, probability, i, j; + + adjacencyList := EmptyPlist(n); + + vertices := [1 .. n]; + probability := [0 .. 99]; + + for i in vertices do + Add(adjacencyList, []); + od; + + for i in vertices do + for j in [i .. n] do + if Float(Random(probability) / 100) < p then + # If it's a self-loop, only add one edge otherwise we would + # have a multi-edge. + if i = j then + Add(adjacencyList[i], j); + else + Add(adjacencyList[i], j); + Add(adjacencyList[j], i); + fi; + fi; + od; + od; + + return DigraphNC(adjacencyList); +end); + +InstallMethod(RandomDigraphCons, +"for IsImmutableDigraph, a positive integer, and a float", +[IsImmutableDigraph, IsPosInt, IsFloat], +function(_, n, p) + local D; + D := MakeImmutable(RandomDigraphCons(IsMutableDigraph, n, p)); + SetIsMultiDigraph(D, false); + return D; +end); + +InstallMethod(RandomDigraph, "for a pos int", [IsPosInt], +n -> RandomDigraphCons(IsImmutableDigraph, n)); + +InstallMethod(RandomDigraph, "for a pos int and a rational", [IsPosInt, IsRat], +{n, p} -> RandomDigraphCons(IsImmutableDigraph, n, p)); + +InstallMethod(RandomDigraph, "for a pos int and a float", [IsPosInt, IsFloat], +{n, p} -> RandomDigraphCons(IsImmutableDigraph, n, p)); + +InstallMethod(RandomDigraph, "for a func and a pos int", [IsFunction, IsPosInt], +RandomDigraphCons); + +InstallMethod(RandomDigraph, "for a func, a pos int, and a rational", +[IsFunction, IsPosInt, IsRat], RandomDigraphCons); + +InstallMethod(RandomDigraph, "for a func, a pos int, and a float", +[IsFunction, IsPosInt, IsFloat], RandomDigraphCons); + +InstallMethod(RandomMultiDigraph, "for a pos int", [IsPosInt], +n -> RandomMultiDigraph(n, Random([1 .. (n * (n - 1)) / 2]))); + +InstallMethod(RandomMultiDigraph, "for two pos ints", [IsPosInt, IsPosInt], +{n, m} -> DigraphNC(RANDOM_MULTI_DIGRAPH(n, m))); + +InstallMethod(RandomTournamentCons, "for IsMutableDigraph and an integer", +[IsMutableDigraph, IsInt], +function(_, n) + local choice, nodes, list, v, w; + if n < 0 then + ErrorNoReturn("the argument must be a non-negative integer,"); + elif n = 0 then + return EmptyDigraph(IsMutableDigraph, 0); + fi; + choice := [true, false]; + nodes := [1 .. n]; + list := List(nodes, x -> []); + for v in nodes do + for w in [(v + 1) .. n] do + if Random(choice) then + Add(list[v], w); + else + Add(list[w], v); + fi; + od; + od; + return DigraphNC(IsMutableDigraph, list); +end); + +InstallMethod(RandomTournamentCons, "for IsImmutableDigraph and an integer", +[IsImmutableDigraph, IsInt], +function(_, n) + local D; + D := MakeImmutable(RandomTournamentCons(IsMutableDigraph, n)); + SetIsTournament(D, true); + SetIsMultiDigraph(D, false); + SetIsSymmetricDigraph(D, n <= 1); + SetIsEmptyDigraph(D, n <= 1); + SetDigraphHasLoops(D, false); + SetDigraphNrEdges(D, Binomial(n, 2)); + return D; +end); + +InstallMethod(RandomTournament, "for an integer", [IsInt], +n -> RandomTournamentCons(IsImmutableDigraph, n)); + +InstallMethod(RandomTournament, "for a func and an integer", +[IsFunction, IsInt], {func, n} -> RandomTournamentCons(func, n)); + +InstallMethod(RandomLatticeCons, "for IsMutableDigraph and a pos int", +[IsMutableDigraph, IsPosInt], +function(_, n) + local fam, rand_blist; + + fam := [BlistList([1 .. n], [])]; + + while Length(fam) < n do + rand_blist := List([1 .. n], x -> Random([true, false])); + UniteSet(fam, List(fam, x -> UnionBlist(x, rand_blist))); + od; + + return Digraph(IsMutableDigraph, fam, IsSubsetBlist); +end); + +InstallMethod(RandomLatticeCons, "for IsImmutableDigraph and a pos int", +[IsImmutableDigraph, IsPosInt], +function(_, n) + local D; + D := MakeImmutable(RandomLatticeCons(IsMutableDigraph, n)); + SetIsLatticeDigraph(D, true); + return D; +end); + +InstallMethod(RandomLattice, "for a pos int", [IsPosInt], +n -> RandomLatticeCons(IsImmutableDigraph, n)); + +InstallMethod(RandomLattice, "for a func and a pos int", [IsFunction, IsPosInt], +RandomLatticeCons); diff --git a/src/pkgconfig.h.in~ b/src/pkgconfig.h.in~ new file mode 100644 index 000000000..8ec139a7f --- /dev/null +++ b/src/pkgconfig.h.in~ @@ -0,0 +1,72 @@ +/* src/pkgconfig.h.in. Generated from configure.ac by autoheader. */ + +/* define if building in stats mode */ +#undef ENABLE_STATS + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `bliss' library (-lbliss). */ +#undef HAVE_LIBBLISS + +/* Define to 1 if you have the `planarity' library (-lplanarity). */ +#undef HAVE_LIBPLANARITY + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if the system has the `__builtin_ctzll' built-in function */ +#undef HAVE___BUILTIN_CTZLL + +/* define if building in debug mode */ +#undef KERNEL_DEBUG + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#undef STDC_HEADERS + +/* define that we should use the vendored bliss */ +#undef WITH_INCLUDED_BLISS + +/* define that we should use the vendored planarity */ +#undef WITH_INCLUDED_PLANARITY From d3dfdcd8f38388919eb500b01dbc5299fe109588 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Thu, 25 Sep 2025 11:53:57 +0100 Subject: [PATCH 18/25] Removed spurious files and added what happens when the argument of Is2EdgeTransitive has multiple edges to doc --- configure~ | 6995 ------------------------------------------- doc/prop.xml | 2 +- doc/prop.xml.save | 1610 ---------- gap/digraph.gi.save | 1859 ------------ src/pkgconfig.h.in~ | 72 - 5 files changed, 1 insertion(+), 10537 deletions(-) delete mode 100755 configure~ delete mode 100644 doc/prop.xml.save delete mode 100644 gap/digraph.gi.save delete mode 100644 src/pkgconfig.h.in~ diff --git a/configure~ b/configure~ deleted file mode 100755 index 54fe27b2a..000000000 --- a/configure~ +++ /dev/null @@ -1,6995 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for digraphs GAP package. -# -# -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, -# Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. -as_nl=' -' -export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi - -# The user is always right. -if ${PATH_SEPARATOR+false} :; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ) -then : - -else \$as_nop - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -blah=\$(echo \$(echo blah)) -test x\"\$blah\" = xblah || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null -then : - as_have_required=yes -else $as_nop - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null -then : - -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : - CONFIG_SHELL=$as_shell as_have_required=yes - if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null -then : - break 2 -fi -fi - done;; - esac - as_found=false -done -IFS=$as_save_IFS -if $as_found -then : - -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null -then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi -fi - - - if test "x$CONFIG_SHELL" != x -then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno -then : - printf "%s\n" "$0: This script requires a shell more modern than all" - printf "%s\n" "$0: the shells that I found on your system." - if test ${ZSH_VERSION+y} ; then - printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" - printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." - else - printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else $as_nop - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else $as_nop - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - printf "%s\n" "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='digraphs' -PACKAGE_TARNAME='digraphs' -PACKAGE_VERSION='GAP package' -PACKAGE_STRING='digraphs GAP package' -PACKAGE_BUGREPORT='' -PACKAGE_URL='' - -ac_unique_file="src/digraphs.c" -ac_default_prefix='${abs_top_builddir}/../../bin/' -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_STDIO_H -# include -#endif -#ifdef HAVE_STDLIB_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_header_c_list= -ac_subst_vars='LTLIBOBJS -LIBOBJS -WITH_INCLUDED_BLISS -PLANARITY_SUITE_DIR -WITH_INCLUDED_PLANARITY -WARNING_CFLAGS -WARNING_CXXFLAGS -SED -CODE_COVERAGE_LDFLAGS -CODE_COVERAGE_CXXFLAGS -CODE_COVERAGE_CFLAGS -ENABLE_STATS -KERNEL_DEBUG -GAP_LIBS -GAP_LDFLAGS -GAP_CFLAGS -GAP_CPPFLAGS -GAPROOT -GAPARCH -ac_ct_CXX -CXXFLAGS -CXX -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -runstatedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_gaproot -enable_debug -enable_stats -enable_code_coverage -enable_compile_warnings -with_external_planarity -with_external_bliss -with_intrinsics -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CXX -CXXFLAGS -CCC' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" - ac_useropt_orig=$ac_useropt - ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures digraphs GAP package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/digraphs] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of digraphs GAP package:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-debug enable debug mode - --enable-stats enable stats mode - --enable-code-coverage Whether to enable code coverage support - --enable-compile-warnings - enable compiler warnings - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gaproot= specify root of GAP installation - --with-external-planarity - use external planarity - --with-external-bliss use external bliss - --without-intrinsics do not use compiler intrinsics even if available - - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CXX C++ compiler command - CXXFLAGS C++ compiler flags - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for configure.gnu first; this name is used for a wrapper for - # Metaconfig's "Configure" on case-insensitive file systems. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -digraphs configure GAP package -generated by GNU Autoconf 2.71 - -Copyright (C) 2021 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_cxx_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_link -ac_configure_args_raw= -for ac_arg -do - case $ac_arg in - *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append ac_configure_args_raw " '$ac_arg'" -done - -case $ac_configure_args_raw in - *$as_nl*) - ac_safe_unquote= ;; - *) - ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. - ac_unsafe_a="$ac_unsafe_z#~" - ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" - ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; -esac - -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by digraphs $as_me GAP package, which was -generated by GNU Autoconf 2.71. Invocation command line was - - $ $0$ac_configure_args_raw - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - printf "%s\n" "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Sanitize IFS. - IFS=" "" $as_nl" - # Save into config.log some information that might help in debugging. - { - echo - - printf "%s\n" "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - printf "%s\n" "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - printf "%s\n" "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - printf "%s\n" "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - printf "%s\n" "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - printf "%s\n" "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - printf "%s\n" "$as_me: caught signal $ac_signal" - printf "%s\n" "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -printf "%s\n" "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h - -printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - ac_site_files="$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - ac_site_files="$prefix/share/config.site $prefix/etc/config.site" -else - ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" -fi - -for ac_site_file in $ac_site_files -do - case $ac_site_file in #( - */*) : - ;; #( - *) : - ac_site_file=./$ac_site_file ;; -esac - if test -f "$ac_site_file" && test -r "$ac_site_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -printf "%s\n" "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -printf "%s\n" "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Test code for whether the C compiler supports C89 (global declarations) -ac_c_conftest_c89_globals=' -/* Does the compiler advertise C89 conformance? - Do not test the value of __STDC__, because some compilers set it to 0 - while being otherwise adequately conformant. */ -#if !defined __STDC__ -# error "Compiler does not advertise C89 conformance" -#endif - -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ -struct buf { int x; }; -struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not \xHH hex character constants. - These do not provoke an error unfortunately, instead are silently treated - as an "x". The following induces an error, until -std is added to get - proper ANSI mode. Curiously \x00 != x always comes out true, for an - array size at least. It is necessary to write \x00 == 0 to get something - that is true only with -std. */ -int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) '\''x'\'' -int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), - int, int);' - -# Test code for whether the C compiler supports C89 (body of main). -ac_c_conftest_c89_main=' -ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); -' - -# Test code for whether the C compiler supports C99 (global declarations) -ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L -# error "Compiler does not advertise C99 conformance" -#endif - -#include -extern int puts (const char *); -extern int printf (const char *, ...); -extern int dprintf (int, const char *, ...); -extern void *malloc (size_t); - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -// dprintf is used instead of fprintf to avoid needing to declare -// FILE and stderr. -#define debug(...) dprintf (2, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - #error "your preprocessor is broken" -#endif -#if BIG_OK -#else - #error "your preprocessor is broken" -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static bool -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str = ""; - int number = 0; - float fnumber = 0; - - while (*format) - { - switch (*format++) - { - case '\''s'\'': // string - str = va_arg (args_copy, const char *); - break; - case '\''d'\'': // int - number = va_arg (args_copy, int); - break; - case '\''f'\'': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); - - return *str && number && fnumber; -} -' - -# Test code for whether the C compiler supports C99 (body of main). -ac_c_conftest_c99_main=' - // Check bool. - _Bool success = false; - success |= (argc != 0); - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - - ni.number = 58; - - int dynamic_array[ni.number]; - dynamic_array[0] = argv[0][0]; - dynamic_array[ni.number - 1] = 543; - - // work around unused variable warnings - ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' - || dynamic_array[ni.number - 1] != 543); -' - -# Test code for whether the C compiler supports C11 (global declarations) -ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L -# error "Compiler does not advertise C11 conformance" -#endif - -// Check _Alignas. -char _Alignas (double) aligned_as_double; -char _Alignas (0) no_special_alignment; -extern char aligned_as_int; -char _Alignas (0) _Alignas (int) aligned_as_int; - -// Check _Alignof. -enum -{ - int_alignment = _Alignof (int), - int_array_alignment = _Alignof (int[100]), - char_alignment = _Alignof (char) -}; -_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); - -// Check _Noreturn. -int _Noreturn does_not_return (void) { for (;;) continue; } - -// Check _Static_assert. -struct test_static_assert -{ - int x; - _Static_assert (sizeof (int) <= sizeof (long int), - "_Static_assert does not work in struct"); - long int y; -}; - -// Check UTF-8 literals. -#define u8 syntax error! -char const utf8_literal[] = u8"happens to be ASCII" "another string"; - -// Check duplicate typedefs. -typedef long *long_ptr; -typedef long int *long_ptr; -typedef long_ptr long_ptr; - -// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. -struct anonymous -{ - union { - struct { int i; int j; }; - struct { int k; long int l; } w; - }; - int m; -} v1; -' - -# Test code for whether the C compiler supports C11 (body of main). -ac_c_conftest_c11_main=' - _Static_assert ((offsetof (struct anonymous, i) - == offsetof (struct anonymous, w.k)), - "Anonymous union alignment botch"); - v1.i = 2; - v1.w.k = 5; - ok |= v1.i != 5; -' - -# Test code for whether the C compiler supports C11 (complete). -ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} -${ac_c_conftest_c11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - ${ac_c_conftest_c11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C99 (complete). -ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} -${ac_c_conftest_c99_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - ${ac_c_conftest_c99_main} - return ok; -} -" - -# Test code for whether the C compiler supports C89 (complete). -ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_c_conftest_c89_main} - return ok; -} -" - -# Test code for whether the C++ compiler supports C++98 (global declarations) -ac_cxx_conftest_cxx98_globals=' -// Does the compiler advertise C++98 conformance? -#if !defined __cplusplus || __cplusplus < 199711L -# error "Compiler does not advertise C++98 conformance" -#endif - -// These inclusions are to reject old compilers that -// lack the unsuffixed header files. -#include -#include - -// and are *not* freestanding headers in C++98. -extern void assert (int); -namespace std { - extern int strcmp (const char *, const char *); -} - -// Namespaces, exceptions, and templates were all added after "C++ 2.0". -using std::exception; -using std::strcmp; - -namespace { - -void test_exception_syntax() -{ - try { - throw "test"; - } catch (const char *s) { - // Extra parentheses suppress a warning when building autoconf itself, - // due to lint rules shared with more typical C programs. - assert (!(strcmp) (s, "test")); - } -} - -template struct test_template -{ - T const val; - explicit test_template(T t) : val(t) {} - template T add(U u) { return static_cast(u) + val; } -}; - -} // anonymous namespace -' - -# Test code for whether the C++ compiler supports C++98 (body of main) -ac_cxx_conftest_cxx98_main=' - assert (argc); - assert (! argv[0]); -{ - test_exception_syntax (); - test_template tt (2.0); - assert (tt.add (4) == 6.0); - assert (true && !false); -} -' - -# Test code for whether the C++ compiler supports C++11 (global declarations) -ac_cxx_conftest_cxx11_globals=' -// Does the compiler advertise C++ 2011 conformance? -#if !defined __cplusplus || __cplusplus < 201103L -# error "Compiler does not advertise C++11 conformance" -#endif - -namespace cxx11test -{ - constexpr int get_val() { return 20; } - - struct testinit - { - int i; - double d; - }; - - class delegate - { - public: - delegate(int n) : n(n) {} - delegate(): delegate(2354) {} - - virtual int getval() { return this->n; }; - protected: - int n; - }; - - class overridden : public delegate - { - public: - overridden(int n): delegate(n) {} - virtual int getval() override final { return this->n * 2; } - }; - - class nocopy - { - public: - nocopy(int i): i(i) {} - nocopy() = default; - nocopy(const nocopy&) = delete; - nocopy & operator=(const nocopy&) = delete; - private: - int i; - }; - - // for testing lambda expressions - template Ret eval(Fn f, Ret v) - { - return f(v); - } - - // for testing variadic templates and trailing return types - template auto sum(V first) -> V - { - return first; - } - template auto sum(V first, Args... rest) -> V - { - return first + sum(rest...); - } -} -' - -# Test code for whether the C++ compiler supports C++11 (body of main) -ac_cxx_conftest_cxx11_main=' -{ - // Test auto and decltype - auto a1 = 6538; - auto a2 = 48573953.4; - auto a3 = "String literal"; - - int total = 0; - for (auto i = a3; *i; ++i) { total += *i; } - - decltype(a2) a4 = 34895.034; -} -{ - // Test constexpr - short sa[cxx11test::get_val()] = { 0 }; -} -{ - // Test initializer lists - cxx11test::testinit il = { 4323, 435234.23544 }; -} -{ - // Test range-based for - int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, - 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; - for (auto &x : array) { x += 23; } -} -{ - // Test lambda expressions - using cxx11test::eval; - assert (eval ([](int x) { return x*2; }, 21) == 42); - double d = 2.0; - assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); - assert (d == 5.0); - assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); - assert (d == 5.0); -} -{ - // Test use of variadic templates - using cxx11test::sum; - auto a = sum(1); - auto b = sum(1, 2); - auto c = sum(1.0, 2.0, 3.0); -} -{ - // Test constructor delegation - cxx11test::delegate d1; - cxx11test::delegate d2(); - cxx11test::delegate d3(45); -} -{ - // Test override and final - cxx11test::overridden o1(55464); -} -{ - // Test nullptr - char *c = nullptr; -} -{ - // Test template brackets - test_template<::test_template> v(test_template(12)); -} -{ - // Unicode literals - char const *utf8 = u8"UTF-8 string \u2500"; - char16_t const *utf16 = u"UTF-8 string \u2500"; - char32_t const *utf32 = U"UTF-32 string \u2500"; -} -' - -# Test code for whether the C compiler supports C++11 (complete). -ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} -${ac_cxx_conftest_cxx11_globals} - -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_cxx_conftest_cxx98_main} - ${ac_cxx_conftest_cxx11_main} - return ok; -} -" - -# Test code for whether the C compiler supports C++98 (complete). -ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} -int -main (int argc, char **argv) -{ - int ok = 0; - ${ac_cxx_conftest_cxx98_main} - return ok; -} -" - -as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" -as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" -as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" -as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" -as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" -as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" -as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" -as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" -as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' - and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_config_headers="$ac_config_headers gen/pkgconfig.h:src/pkgconfig.h.in" - - - - -ac_config_commands="$ac_config_commands src/digraphs-config.h" - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. -set dummy ${ac_tool_prefix}clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -printf "%s\n" "$CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "clang", so it can be a program name with args. -set dummy clang; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="clang" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -printf "%s\n" "$ac_ct_CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -fi - - -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion -version; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -printf %s "checking whether the C compiler works... " >&6; } -ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else $as_nop - ac_file='' -fi -if test -z "$ac_file" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -printf %s "checking for C compiler default output file name... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -printf "%s\n" "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -printf %s "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -printf "%s\n" "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -printf %s "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -printf "%s\n" "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -printf %s "checking for suffix of object files... " >&6; } -if test ${ac_cv_objext+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -printf "%s\n" "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 -printf %s "checking whether the compiler supports GNU C... " >&6; } -if test ${ac_cv_c_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+y} -ac_save_CFLAGS=$CFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -printf %s "checking whether $CC accepts -g... " >&6; } -if test ${ac_cv_prog_cc_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -printf "%s\n" "$ac_cv_prog_cc_g" >&6; } -if test $ac_test_CFLAGS; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -ac_prog_cc_stdc=no -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 -printf %s "checking for $CC option to enable C11 features... " >&6; } -if test ${ac_cv_prog_cc_c11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c11_program -_ACEOF -for ac_arg in '' -std=gnu11 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c11" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 -printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 -printf %s "checking for $CC option to enable C99 features... " >&6; } -if test ${ac_cv_prog_cc_c99+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c99_program -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c99" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 -fi -fi -if test x$ac_prog_cc_stdc = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 -printf %s "checking for $CC option to enable C89 features... " >&6; } -if test ${ac_cv_prog_cc_c89+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_c_conftest_c89_program -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi - -if test "x$ac_cv_prog_cc_c89" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" -fi - ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 -fi -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -printf "%s\n" "$CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -printf "%s\n" "$ac_ct_CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 -printf %s "checking whether the compiler supports GNU C++... " >&6; } -if test ${ac_cv_cxx_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+y} -ac_save_CXXFLAGS=$CXXFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -printf %s "checking whether $CXX accepts -g... " >&6; } -if test ${ac_cv_prog_cxx_g+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_g=yes -else $as_nop - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - -else $as_nop - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } -if test $ac_test_CXXFLAGS; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_prog_cxx_stdcxx=no -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 -printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx11+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx11=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx11_program -_ACEOF -for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx11=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx11" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX -fi - -if test "x$ac_cv_prog_cxx_cxx11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx11" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx11" -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 -fi -fi -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 -printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx98+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx98=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx98_program -_ACEOF -for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_cxx98=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx98" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX -fi - -if test "x$ac_cv_prog_cxx_cxx98" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx98" = x -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx98" -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 -fi -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - # Make sure CDPATH is portably set to a sensible value - CDPATH=${ZSH_VERSION+.}: - - GAP_CPPFLAGS="" - - ###################################### - # Find the GAP root directory by - # checking for the sysinfo.gap file - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GAP root directory" >&5 -printf %s "checking for GAP root directory... " >&6; } - GAPROOT="../.." - - # Allow the user to specify the location of GAP - -# Check whether --with-gaproot was given. -if test ${with_gaproot+y} -then : - withval=$with_gaproot; GAPROOT="$withval" -fi - - - # Convert the path to absolute - GAPROOT=`cd $GAPROOT > /dev/null 2>&1 && pwd` - - if test -e ${GAPROOT}/sysinfo.gap; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${GAPROOT}" >&5 -printf "%s\n" "${GAPROOT}" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Not found" >&5 -printf "%s\n" "Not found" >&6; } - - echo "" - echo "********************************************************************" - echo " ERROR" - echo "" - echo " Cannot find your GAP installation. Please specify the location of" - echo " GAP's root directory using --with-gaproot=" - echo "" - echo " The GAP root directory (as far as this package is concerned) is" - echo " the one containing the file sysinfo.gap" - echo "********************************************************************" - echo "" - - as_fn_error $? "Unable to find GAP root directory" "$LINENO" 5 - fi - - ##################################### - # Now find the architecture - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GAP architecture" >&5 -printf %s "checking for GAP architecture... " >&6; } - GAPARCH="Unknown" - . $GAPROOT/sysinfo.gap - if test "x$GAParch" != "x"; then - GAPARCH=$GAParch - fi - - if test "x$GAPARCH" = "xUnknown" ; then - echo "" - echo "********************************************************************" - echo " ERROR" - echo "" - echo " Found a GAP installation at $GAPROOT but could not find" - echo " information about GAP's architecture in the file" - echo " ${GAPROOT}/sysinfo.gap ." - echo " This file should be present: please check your GAP installation." - echo "********************************************************************" - echo "" - - as_fn_error $? "Unable to find plausible GAParch information." "$LINENO" 5 - fi - - # require GAP >= 4.9 - if test "x$GAP_CPPFLAGS" = x; then - echo "" - echo "********************************************************************" - echo " ERROR" - echo "" - echo " This version of GAP is too old and not supported by this package." - echo "********************************************************************" - echo "" - as_fn_error $? "No GAP_CPPFLAGS is given" "$LINENO" 5 - fi - - # compatibility with GAP 4.9 (not needed in GAP >= 4.10) - GAP_CPPFLAGS="$GAP_CPPFLAGS -I${GAP_LIB_DIR}/src" - - - - - - - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - -# Check whether --enable-debug was given. -if test ${enable_debug+y} -then : - enableval=$enable_debug; -printf "%s\n" "#define KERNEL_DEBUG 1" >>confdefs.h - -else $as_nop - enable_debug=no - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable debug mode" >&5 -printf %s "checking whether to enable debug mode... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5 -printf "%s\n" "$enable_debug" >&6; } -KERNEL_DEBUG=$enable_debug - - -# Check whether --enable-stats was given. -if test ${enable_stats+y} -then : - enableval=$enable_stats; -printf "%s\n" "#define ENABLE_STATS 1" >>confdefs.h - -else $as_nop - enable_stats=no - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable stats mode" >&5 -printf %s "checking whether to enable stats mode... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_stats" >&5 -printf "%s\n" "$enable_stats" >&6; } -ENABLE_STATS=$enable_debug - - -# Check whether --enable-code-coverage was given. -if test ${enable_code_coverage+y} -then : - enableval=$enable_code_coverage; -else $as_nop - enable_code_coverage=no -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 -printf %s "checking whether to build with code coverage support... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5 -printf "%s\n" "$enable_code_coverage" >&6; } - -if test "$enable_code_coverage" = "yes" -then : - - CODE_COVERAGE_CFLAGS="-DNDEBUG -O0 -g --coverage" - CODE_COVERAGE_CXXFLAGS="-DNDEBUG -O0 -g --coverage" - CODE_COVERAGE_LDFLAGS="--coverage" - - - - -fi - - -# Enable compiler warnings - -# Check whether --enable-compile-warnings was given. -if test ${enable_compile_warnings+y} -then : - enableval=$enable_compile_warnings; enable_compile_warnings=yes -else $as_nop - enable_compile_warnings=no -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether enable compiler warnings" >&5 -printf %s "checking whether enable compiler warnings... " >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_compile_warnings" >&5 -printf "%s\n" "$enable_compile_warnings" >&6; } - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -printf %s "checking for a sed that does not truncate output... " >&6; } -if test ${ac_cv_path_SED+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in sed gsed - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -printf "%s\n" "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - - -if test "x$enable_compile_warnings" != "xno" -then : - ax_enable_compile_warnings=yes - - - - - - - - - - # Variable names - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - # Always pass -Werror=unknown-warning-option to get Clang to fail on bad - # flags, otherwise they are always appended to the warn_cxxflags variable, - # and Clang warns on them for every compilation unit. - # If this is passed to GCC, it will explode, so the flag must be enabled - # conditionally. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Werror=unknown-warning-option" >&5 -printf %s "checking whether C++ compiler accepts -Werror=unknown-warning-option... " >&6; } -if test ${ax_cv_check_cxxflags___Werror_unknown_warning_option+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CXXFLAGS - CXXFLAGS="$CXXFLAGS -Werror=unknown-warning-option" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ax_cv_check_cxxflags___Werror_unknown_warning_option=yes -else $as_nop - ax_cv_check_cxxflags___Werror_unknown_warning_option=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS=$ax_check_save_flags -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Werror_unknown_warning_option" >&5 -printf "%s\n" "$ax_cv_check_cxxflags___Werror_unknown_warning_option" >&6; } -if test "x$ax_cv_check_cxxflags___Werror_unknown_warning_option" = xyes -then : - - ax_compiler_flags_test="-Werror=unknown-warning-option" - -else $as_nop - - ax_compiler_flags_test="" - -fi - - - # Check that -Wno-suggest-attribute=format is supported - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -Wno-suggest-attribute=format" >&5 -printf %s "checking whether C++ compiler accepts -Wno-suggest-attribute=format... " >&6; } -if test ${ax_cv_check_cxxflags___Wno_suggest_attribute_format+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CXXFLAGS - CXXFLAGS="$CXXFLAGS -Wno-suggest-attribute=format" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ax_cv_check_cxxflags___Wno_suggest_attribute_format=yes -else $as_nop - ax_cv_check_cxxflags___Wno_suggest_attribute_format=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS=$ax_check_save_flags -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cxxflags___Wno_suggest_attribute_format" >&5 -printf "%s\n" "$ax_cv_check_cxxflags___Wno_suggest_attribute_format" >&6; } -if test "x$ax_cv_check_cxxflags___Wno_suggest_attribute_format" = xyes -then : - - ax_compiler_no_suggest_attribute_flags="-Wno-suggest-attribute=format" - -else $as_nop - - ax_compiler_no_suggest_attribute_flags="" - -fi - - - # Base flags - - - - -for flag in -fno-strict-aliasing -pedantic -Wold-style-cast ; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -printf %s "checking whether C++ compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CXXFLAGS - CXXFLAGS="$CXXFLAGS $ax_compiler_flags_test $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : - -if test ${WARNING_CXXFLAGS+y} -then : - - case " $WARNING_CXXFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS already contains \$flag"; } >&5 - (: WARNING_CXXFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append WARNING_CXXFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 - (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else $as_nop - - WARNING_CXXFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 - (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -else $as_nop - : -fi - -done - - - if test "$ax_enable_compile_warnings" != "no" -then : - - # "yes" flags - - - - -for flag in -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wredundant-decls -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type -Wno-overloaded-virtual -Wswitch-enum -Wswitch-default ; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -printf %s "checking whether C++ compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CXXFLAGS - CXXFLAGS="$CXXFLAGS $ax_compiler_flags_test $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : - -if test ${WARNING_CXXFLAGS+y} -then : - - case " $WARNING_CXXFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS already contains \$flag"; } >&5 - (: WARNING_CXXFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append WARNING_CXXFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 - (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else $as_nop - - WARNING_CXXFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 - (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -else $as_nop - : -fi - -done - - -fi - if test "$ax_enable_compile_warnings" = "error" -then : - - # "error" flags; -Werror has to be appended unconditionally because - # it's not possible to test for - # - # suggest-attribute=format is disabled because it gives too many false - # positives - -if test ${WARNING_CXXFLAGS+y} -then : - - case " $WARNING_CXXFLAGS " in #( - *" -Werror "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS already contains -Werror"; } >&5 - (: WARNING_CXXFLAGS already contains -Werror) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append WARNING_CXXFLAGS " -Werror" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 - (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else $as_nop - - WARNING_CXXFLAGS=-Werror - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 - (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - - - - - - -for flag in $ax_compiler_no_suggest_attribute_flags ; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -printf %s "checking whether C++ compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CXXFLAGS - CXXFLAGS="$CXXFLAGS $ax_compiler_flags_test $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : - -if test ${WARNING_CXXFLAGS+y} -then : - - case " $WARNING_CXXFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS already contains \$flag"; } >&5 - (: WARNING_CXXFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append WARNING_CXXFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 - (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else $as_nop - - WARNING_CXXFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 - (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -else $as_nop - : -fi - -done - - -fi - - # In the flags below, when disabling specific flags, always add *both* - # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example) - # we enable -Werror, disable a flag, and a build bot passes CXXFLAGS=-Wall, - # which effectively turns that flag back on again as an error. - for flag in $WARNING_CXXFLAGS; do - case $flag in #( - -Wno-*=*) : - ;; #( - -Wno-*) : - - - - - -for flag in -Wno-error=$(printf "%s\n" $flag | $SED 's/^-Wno-//'); do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -printf %s "checking whether C++ compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CXXFLAGS - CXXFLAGS="$CXXFLAGS $ax_compiler_flags_test $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : - -if test ${WARNING_CXXFLAGS+y} -then : - - case " $WARNING_CXXFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS already contains \$flag"; } >&5 - (: WARNING_CXXFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append WARNING_CXXFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 - (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else $as_nop - - WARNING_CXXFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CXXFLAGS=\"\$WARNING_CXXFLAGS\""; } >&5 - (: WARNING_CXXFLAGS="$WARNING_CXXFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -else $as_nop - : -fi - -done - - ;; #( - *) : - ;; -esac - done - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - # Substitute the variables - - - -fi - - -if test "x$enable_compile_warnings" != "xno" -then : - ax_enable_compile_warnings=yes - - - - - - - - - - # Variable names - - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #ifndef __cplusplus - #error "no C++" - #endif -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ax_compiler_cxx=yes; -else $as_nop - ax_compiler_cxx=no; -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - - # Always pass -Werror=unknown-warning-option to get Clang to fail on bad - # flags, otherwise they are always appended to the warn_cflags variable, and - # Clang warns on them for every compilation unit. - # If this is passed to GCC, it will explode, so the flag must be enabled - # conditionally. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror=unknown-warning-option" >&5 -printf %s "checking whether C compiler accepts -Werror=unknown-warning-option... " >&6; } -if test ${ax_cv_check_cflags___Werror_unknown_warning_option+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS -Werror=unknown-warning-option" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ax_cv_check_cflags___Werror_unknown_warning_option=yes -else $as_nop - ax_cv_check_cflags___Werror_unknown_warning_option=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Werror_unknown_warning_option" >&5 -printf "%s\n" "$ax_cv_check_cflags___Werror_unknown_warning_option" >&6; } -if test "x$ax_cv_check_cflags___Werror_unknown_warning_option" = xyes -then : - - ax_compiler_flags_test="-Werror=unknown-warning-option" - -else $as_nop - - ax_compiler_flags_test="" - -fi - - - # Check that -Wno-suggest-attribute=format is supported - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wno-suggest-attribute=format" >&5 -printf %s "checking whether C compiler accepts -Wno-suggest-attribute=format... " >&6; } -if test ${ax_cv_check_cflags___Wno_suggest_attribute_format+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS -Wno-suggest-attribute=format" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ax_cv_check_cflags___Wno_suggest_attribute_format=yes -else $as_nop - ax_cv_check_cflags___Wno_suggest_attribute_format=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wno_suggest_attribute_format" >&5 -printf "%s\n" "$ax_cv_check_cflags___Wno_suggest_attribute_format" >&6; } -if test "x$ax_cv_check_cflags___Wno_suggest_attribute_format" = xyes -then : - - ax_compiler_no_suggest_attribute_flags="-Wno-suggest-attribute=format" - -else $as_nop - - ax_compiler_no_suggest_attribute_flags="" - -fi - - - # Base flags - - - - -for flag in -fno-strict-aliasing -pedantic ; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -printf %s "checking whether C compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : - -if test ${WARNING_CFLAGS+y} -then : - - case " $WARNING_CFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS already contains \$flag"; } >&5 - (: WARNING_CFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append WARNING_CFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 - (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else $as_nop - - WARNING_CFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 - (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -else $as_nop - : -fi - -done - - - if test "$ax_enable_compile_warnings" != "no" -then : - - if test "$ax_compiler_cxx" = "no" ; then - # C-only flags. Warn in C++ - - - - -for flag in -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -Wimplicit-function-declaration -Wold-style-definition -Wjump-misses-init ; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -printf %s "checking whether C compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : - -if test ${WARNING_CFLAGS+y} -then : - - case " $WARNING_CFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS already contains \$flag"; } >&5 - (: WARNING_CFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append WARNING_CFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 - (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else $as_nop - - WARNING_CFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 - (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -else $as_nop - : -fi - -done - - fi - - # "yes" flags - - - - -for flag in -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wredundant-decls -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type -Wswitch-enum -Wswitch-default -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -Wnull-dereference -Wdouble-promotion ; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -printf %s "checking whether C compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : - -if test ${WARNING_CFLAGS+y} -then : - - case " $WARNING_CFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS already contains \$flag"; } >&5 - (: WARNING_CFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append WARNING_CFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 - (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else $as_nop - - WARNING_CFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 - (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -else $as_nop - : -fi - -done - - -fi - if test "$ax_enable_compile_warnings" = "error" -then : - - # "error" flags; -Werror has to be appended unconditionally because - # it's not possible to test for - # - # suggest-attribute=format is disabled because it gives too many false - # positives - -if test ${WARNING_CFLAGS+y} -then : - - case " $WARNING_CFLAGS " in #( - *" -Werror "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS already contains -Werror"; } >&5 - (: WARNING_CFLAGS already contains -Werror) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append WARNING_CFLAGS " -Werror" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 - (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else $as_nop - - WARNING_CFLAGS=-Werror - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 - (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - - - - - - -for flag in $ax_compiler_no_suggest_attribute_flags ; do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -printf %s "checking whether C compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : - -if test ${WARNING_CFLAGS+y} -then : - - case " $WARNING_CFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS already contains \$flag"; } >&5 - (: WARNING_CFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append WARNING_CFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 - (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else $as_nop - - WARNING_CFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 - (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -else $as_nop - : -fi - -done - - -fi - - # In the flags below, when disabling specific flags, always add *both* - # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example) - # we enable -Werror, disable a flag, and a build bot passes CFLAGS=-Wall, - # which effectively turns that flag back on again as an error. - for flag in $WARNING_CFLAGS; do - case $flag in #( - -Wno-*=*) : - ;; #( - -Wno-*) : - - - - - -for flag in -Wno-error=$(printf "%s\n" $flag | $SED 's/^-Wno-//'); do - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh` -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -printf %s "checking whether C compiler accepts $flag... " >&6; } -if eval test \${$as_CACHEVAR+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS $ax_compiler_flags_test $flag" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -eval ac_res=\$$as_CACHEVAR - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes" -then : - -if test ${WARNING_CFLAGS+y} -then : - - case " $WARNING_CFLAGS " in #( - *" $flag "*) : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS already contains \$flag"; } >&5 - (: WARNING_CFLAGS already contains $flag) 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append WARNING_CFLAGS " $flag" - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 - (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else $as_nop - - WARNING_CFLAGS=$flag - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : WARNING_CFLAGS=\"\$WARNING_CFLAGS\""; } >&5 - (: WARNING_CFLAGS="$WARNING_CFLAGS") 2>&5 - ac_status=$? - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -else $as_nop - : -fi - -done - - ;; #( - *) : - ;; -esac - done - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - # Substitute the variables - - - -fi - -# Check for system planarity suite - -ac_header= ac_cache= -for ac_item in $ac_header_c_list -do - if test $ac_cache; then - ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" - if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then - printf "%s\n" "#define $ac_item 1" >> confdefs.h - fi - ac_header= ac_cache= - elif test $ac_header; then - ac_cache=$ac_item - else - ac_header=$ac_item - fi -done - - - - - - - - -if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes -then : - -printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h - -fi - - -# Check whether --with-external-planarity was given. -if test ${with_external_planarity+y} -then : - withval=$with_external_planarity; -else $as_nop - with_external_planarity=no -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use external planarity" >&5 -printf %s "checking whether to use external planarity... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_external_planarity" >&5 -printf "%s\n" "$with_external_planarity" >&6; } - if test "x$with_external_planarity" = xyes ; then - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gp_InitGraph in -lplanarity" >&5 -printf %s "checking for gp_InitGraph in -lplanarity... " >&6; } -if test ${ac_cv_lib_planarity_gp_InitGraph+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lplanarity $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gp_InitGraph (); -int -main (void) -{ -return gp_InitGraph (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_planarity_gp_InitGraph=yes -else $as_nop - ac_cv_lib_planarity_gp_InitGraph=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_planarity_gp_InitGraph" >&5 -printf "%s\n" "$ac_cv_lib_planarity_gp_InitGraph" >&6; } -if test "x$ac_cv_lib_planarity_gp_InitGraph" = xyes -then : - printf "%s\n" "#define HAVE_LIBPLANARITY 1" >>confdefs.h - - LIBS="-lplanarity $LIBS" - -else $as_nop - as_fn_error $? "no external libplanarity found" "$LINENO" 5 -fi - - - ac_fn_c_check_header_compile "$LINENO" "planarity/graph.h" "ac_cv_header_planarity_graph_h" "$ac_includes_default" -if test "x$ac_cv_header_planarity_graph_h" = xyes -then : - -else $as_nop - as_fn_error $? "no external planarity headers found" "$LINENO" 5 -fi - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - fi - if test "x$with_external_planarity" = xno ; then - WITH_INCLUDED_PLANARITY=yes - - -printf "%s\n" "#define WITH_INCLUDED_PLANARITY 1" >>confdefs.h - - fi - -if test "x$with_external_planarity" = xno ; then - PLANARITY_SUITE_DIR=extern/edge-addition-planarity-suite-Version_3.0.1.0 - -fi - -# Check for system bliss suite - - -# Check whether --with-external-bliss was given. -if test ${with_external_bliss+y} -then : - withval=$with_external_bliss; -else $as_nop - with_external_bliss=no -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use external bliss" >&5 -printf %s "checking whether to use external bliss... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_external_bliss" >&5 -printf "%s\n" "$with_external_bliss" >&6; } - if test "x$with_external_bliss" = xyes ; then - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bliss_add_edge in -lbliss" >&5 -printf %s "checking for bliss_add_edge in -lbliss... " >&6; } -if test ${ac_cv_lib_bliss_bliss_add_edge+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbliss $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char bliss_add_edge (); -int -main (void) -{ -return bliss_add_edge (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_bliss_bliss_add_edge=yes -else $as_nop - ac_cv_lib_bliss_bliss_add_edge=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bliss_bliss_add_edge" >&5 -printf "%s\n" "$ac_cv_lib_bliss_bliss_add_edge" >&6; } -if test "x$ac_cv_lib_bliss_bliss_add_edge" = xyes -then : - printf "%s\n" "#define HAVE_LIBBLISS 1" >>confdefs.h - - LIBS="-lbliss $LIBS" - -else $as_nop - as_fn_error $? "no external libbliss found" "$LINENO" 5 -fi - - - ac_fn_c_check_header_compile "$LINENO" "bliss/bliss_C.h" "ac_cv_header_bliss_bliss_C_h" "$ac_includes_default" -if test "x$ac_cv_header_bliss_bliss_C_h" = xyes -then : - -else $as_nop - as_fn_error $? "no external bliss headers found" "$LINENO" 5 -fi - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - fi - if test "x$with_external_bliss" = xno ; then - WITH_INCLUDED_BLISS=yes - - -printf "%s\n" "#define WITH_INCLUDED_BLISS 1" >>confdefs.h - - fi - - -# Check whether to use -mpopcnt and __builtin_ctzl - -# Check whether --with-intrinsics was given. -if test ${with_intrinsics+y} -then : - withval=$with_intrinsics; -fi - - -if test "x$with_intrinsics" = "xno" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: compiler intrinsics will not be used even if available" >&5 -printf "%s\n" "$as_me: compiler intrinsics will not be used even if available" >&6;} -fi - - - -if test "x$with_intrinsics" != "xno" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_ctzll" >&5 -printf %s "checking for __builtin_ctzll... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main (void) -{ -__builtin_ctzll(0); - - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO" -then : - have___builtin_ctzll=yes -else $as_nop - have___builtin_ctzll=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have___builtin_ctzll" >&5 -printf "%s\n" "$have___builtin_ctzll" >&6; } - if test yes = $have___builtin_ctzll -then : - -printf "%s\n" "#define HAVE___BUILTIN_CTZLL 1" >>confdefs.h - -fi -fi - -ac_config_files="$ac_config_files Makefile" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -printf "%s\n" "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. -as_nl=' -' -export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi - -# The user is always right. -if ${PATH_SEPARATOR+false} :; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - printf "%s\n" "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else $as_nop - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else $as_nop - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by digraphs $as_me GAP package, which was -generated by GNU Autoconf 2.71. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` -ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config='$ac_cs_config_escaped' -ac_cs_version="\\ -digraphs config.status GAP package -configured by $0, generated by GNU Autoconf 2.71, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2021 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - printf "%s\n" "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - printf "%s\n" "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - printf "%s\n" "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - printf "%s\n" "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -PACKAGE="$PACKAGE" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "gen/pkgconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS gen/pkgconfig.h:src/pkgconfig.h.in" ;; - "src/digraphs-config.h") CONFIG_COMMANDS="$CONFIG_COMMANDS src/digraphs-config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files - test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers - test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -printf "%s\n" "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`printf "%s\n" "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - printf "%s\n" "/* $configure_input */" >&1 \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - printf "%s\n" "/* $configure_input */" >&1 \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi - ;; - - :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -printf "%s\n" "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "src/digraphs-config.h":C) ac_prefix_conf_OUT=`echo src/digraphs-config.h` -ac_prefix_conf_DEF=`echo _$ac_prefix_conf_OUT | sed -e "y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:" -e "s/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g"` -ac_prefix_conf_PKG=`echo digraphs` -ac_prefix_conf_LOW=`echo _$ac_prefix_conf_PKG | sed -e "y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:"` -ac_prefix_conf_UPP=`echo $ac_prefix_conf_PKG | sed -e "y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:" -e "/^[0123456789]/s/^/_/"` -ac_prefix_conf_INP=`echo "gen/pkgconfig.h" | sed -e 's/ *//'` -if test ".$ac_prefix_conf_INP" = "."; then - for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue - case "$ac_file" in - *.h) ac_prefix_conf_INP=$ac_file ;; - *) - esac - test ".$ac_prefix_conf_INP" != "." && break - done -fi -if test ".$ac_prefix_conf_INP" = "."; then - case "$ac_prefix_conf_OUT" in - */*) ac_prefix_conf_INP=`basename "$ac_prefix_conf_OUT"` - ;; - *-*) ac_prefix_conf_INP=`echo "$ac_prefix_conf_OUT" | sed -e "s/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*-//"` - ;; - *) ac_prefix_conf_INP=config.h - ;; - esac -fi -if test -z "$ac_prefix_conf_PKG" ; then - as_fn_error $? "no prefix for _PREFIX_PKG_CONFIG_H" "$LINENO" 5 -else - if test ! -f "$ac_prefix_conf_INP" ; then if test -f "$srcdir/$ac_prefix_conf_INP" ; then - ac_prefix_conf_INP="$srcdir/$ac_prefix_conf_INP" - fi fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines" >&5 -printf "%s\n" "$as_me: creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines" >&6;} - if test -f $ac_prefix_conf_INP ; then - printf "%s\n" "s/^#undef *\\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]\\)/#undef $ac_prefix_conf_UPP""_\\1/" > conftest.prefix - printf "%s\n" "s/^#undef *\\([abcdefghijklmnopqrstuvwxyz]\\)/#undef $ac_prefix_conf_LOW""_\\1/" >> conftest.prefix - printf "%s\n" "s/^#define *\\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*\\)\\(.*\\)/#ifndef $ac_prefix_conf_UPP""_\\1\\" >> conftest.prefix - printf "%s\n" "#define $ac_prefix_conf_UPP""_\\1\\2\\" >> conftest.prefix - printf "%s\n" "#endif/" >> conftest.prefix - printf "%s\n" "s/^#define *\\([abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*\\)\\(.*\\)/#ifndef $ac_prefix_conf_LOW""_\\1\\" >> conftest.prefix - printf "%s\n" "#define $ac_prefix_conf_LOW""_\\1\\2\\" >> conftest.prefix - printf "%s\n" "#endif/" >> conftest.prefix - # now executing _script on _DEF input to create _OUT output file - echo "#ifndef $ac_prefix_conf_DEF" >$tmp/pconfig.h - echo "#define $ac_prefix_conf_DEF 1" >>$tmp/pconfig.h - echo ' ' >>$tmp/pconfig.h - echo /'*' $ac_prefix_conf_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h - - sed -f conftest.prefix $ac_prefix_conf_INP >>$tmp/pconfig.h - echo ' ' >>$tmp/pconfig.h - echo '/* once:' $ac_prefix_conf_DEF '*/' >>$tmp/pconfig.h - echo "#endif" >>$tmp/pconfig.h - if cmp -s $ac_prefix_conf_OUT $tmp/pconfig.h 2>/dev/null; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_prefix_conf_OUT is unchanged" >&5 -printf "%s\n" "$as_me: $ac_prefix_conf_OUT is unchanged" >&6;} - else - ac_dir=`$as_dirname -- "$ac_prefix_conf_OUT" || -$as_expr X"$ac_prefix_conf_OUT" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_prefix_conf_OUT" : 'X\(//\)[^/]' \| \ - X"$ac_prefix_conf_OUT" : 'X\(//\)$' \| \ - X"$ac_prefix_conf_OUT" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$ac_prefix_conf_OUT" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - rm -f "$ac_prefix_conf_OUT" - mv $tmp/pconfig.h "$ac_prefix_conf_OUT" - fi - else - as_fn_error $? "input file $ac_prefix_conf_INP does not exist - skip generating $ac_prefix_conf_OUT" "$LINENO" 5 - fi - rm -f conftest.* -fi - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - diff --git a/doc/prop.xml b/doc/prop.xml index 143474a3c..4fd2d8539 100644 --- a/doc/prop.xml +++ b/doc/prop.xml @@ -1598,7 +1598,7 @@ false]]> returns true if digraph is 2-edge transitive, and false otherwise. A digraph is 2-edge transitive if its automorphism group acts transitively on 2-edges via the action - . + . If digraph<\A> is a digraph with multiple edges, then Is2EdgeTransitive<\C> returns an error. A 2-edge in a digraph is a triple (u, v, w) of distinct vertices such that (u, v) and (v, w) are edges. diff --git a/doc/prop.xml.save b/doc/prop.xml.save deleted file mode 100644 index e8e2d4f6a..000000000 --- a/doc/prop.xml.save +++ /dev/null @@ -1,1610 +0,0 @@ -############################################################################# -## -#W prop.xml -#Y Copyright (C) 2014-21 James D. Mitchell -## -## Licensing information can be found in the README file of this package. -## -############################################################################# -## - -<#GAPDoc Label="IsMultiDigraph"> - - - true or false. - - A multidigraph is one that has at least two - edges with equal source and range.

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph(["a", "b", "c"], ["a", "b", "b"], ["b", "c", "a"]); - -gap> IsMultiDigraph(D); -false -gap> D := DigraphFromDigraph6String("&Bug"); - -gap> IsDuplicateFree(DigraphEdges(D)); -true -gap> IsMultiDigraph(D); -false -gap> D := Digraph([[1, 2, 3, 2], [2, 1], [3]]); - -gap> IsDuplicateFree(DigraphEdges(D)); -false -gap> IsMultiDigraph(D); -true -gap> D := DigraphMutableCopy(D); - -gap> IsMultiDigraph(D); -true]]> - - -<#/GAPDoc> - -<#GAPDoc Label="DigraphHasLoops"> - - - true or false. - - Returns true if the digraph digraph has loops, and - false if it does not. A loop is an edge with equal source and range. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[1, 2], [2]]); - -gap> DigraphEdges(D); -[ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ] ] -gap> DigraphHasLoops(D); -true -gap> D := Digraph([[2, 3], [1], [2]]); - -gap> DigraphEdges(D); -[ [ 1, 2 ], [ 1, 3 ], [ 2, 1 ], [ 3, 2 ] ] -gap> DigraphHasLoops(D); -false -gap> D := CompleteDigraph(IsMutableDigraph, 4); - -gap> DigraphHasLoops(D); -false]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsAcyclicDigraph"> - - - true or false. - - This property is true if the digraph digraph is acyclic, and - false if it is not. A digraph is acyclic if every directed - cycle on the digraph is trivial. See Section for the definition of a directed cycle, and of a trivial - directed cycle.

- - The method used in this operation has complexity O(m+n) where - m is the number of edges (counting multiple edges as one) and - n is the number of vertices in the digraph.

- - &MUTABLE_RECOMPUTED_PROP; - - Petersen := Graph(SymmetricGroup(5), [[1, 2]], OnSets, -> function(x, y) -> return IsEmpty(Intersection(x, y)); -> end);; -gap> D := Digraph(Petersen); - -gap> IsAcyclicDigraph(D); -false -gap> D := DigraphFromDiSparse6String( -> ".b_OGCIDBaPGkULEbQHCeRIdrHcuZMfRyDAbPhTi|zF"); - -gap> IsAcyclicDigraph(D); -true -gap> IsAcyclicDigraph(ChainDigraph(10)); -true -gap> D := CompleteDigraph(IsMutableDigraph, 4); - -gap> IsAcyclicDigraph(D); -false -gap> IsAcyclicDigraph(CycleDigraph(10)); -false]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsAperiodicDigraph"> - - - true or false. - - This property is true if the digraph digraph - is aperiodic, i.e. if its is equal to 1. - Otherwise, the property is false. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[6], [1], [2], [3], [4, 4], [5]]); - -gap> IsAperiodicDigraph(D); -false -gap> D := Digraph([[2], [3, 5], [4], [5], [1, 2]]); - -gap> IsAperiodicDigraph(D); -true -gap> D := Digraph(IsMutableDigraph, [[2], [3, 5], [4], [5], [1, 2]]); - -gap> IsAperiodicDigraph(D); -true]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsStronglyConnectedDigraph"> - - - true or false. - - This property is true if the digraph digraph is strongly - connected and false if it is not.

- - A digraph digraph is strongly connected if there is a directed - path from every vertex to every other vertex. See Section for the definition of a directed - path.

- - The method used in this operation is based on Gabow's Algorithm and has complexity O(m+n), where m is - the number of edges (counting multiple edges as one) and n is the - number of vertices in the digraph. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := CycleDigraph(250000); - -gap> IsStronglyConnectedDigraph(D); -true -gap> D := DigraphRemoveEdges(D, [[250000, 1]]); - -gap> IsStronglyConnectedDigraph(D); -false -gap> D := CycleDigraph(IsMutableDigraph, 250000); - -gap> IsStronglyConnectedDigraph(D); -true -gap> DigraphRemoveEdge(D, [250000, 1]); - -gap> IsStronglyConnectedDigraph(D); -false -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsConnectedDigraph"> - - - true or false. - - This property is true if the digraph digraph - is weakly connected and false if it is not. A digraph - digraph is weakly connected if it is possible to travel - from any vertex to any other vertex by traversing edges in either - direction (possibly against the orientation of some of them).

- - The method used in this function has complexity O(m) if the - digraph's attribute is set, otherwise it has - complexity O(m+n) (where - m is the number of edges and - n is the number of vertices of the digraph). -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[2], [3], []]);; -gap> IsConnectedDigraph(D); -true -gap> D := Digraph([[1, 3], [4], [3], []]);; -gap> IsConnectedDigraph(D); -false -gap> D := Digraph(IsMutableDigraph, [[2], [3], []]);; -gap> IsConnectedDigraph(D); -true -gap> D := Digraph(IsMutableDigraph, [[1, 3], [4], [3], []]);; -gap> IsConnectedDigraph(D); -false]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsBiconnectedDigraph"> - - - true or false. - - A connected digraph is biconnected if it is still connected (in the - sense of ) when any vertex is removed. - If D has at least 3 vertices, then IsBiconnectedDigraph - implies ; - see or for a more - detailed explanation. -

- - IsBiconnectedDigraph returns true if the digraph - digraph is biconnected, and false if it is not. In - particular, IsBiconnectedDigraph returns false if - digraph is not connected.

- - Multiple edges are ignored by this method.

- - The method used in this operation has complexity O(m+n) where - m is the number of edges and n is the number of vertices in - the digraph. -

- - See also , , and - . -

- - &MUTABLE_RECOMPUTED_PROP; - - IsBiconnectedDigraph(Digraph([[1, 3], [2, 3], [3]])); -false -gap> IsBiconnectedDigraph(CycleDigraph(5)); -true -gap> D := Digraph([[1, 1], [1, 1, 2], [3], [3, 3, 4, 4]]);; -gap> IsBiconnectedDigraph(D); -false -gap> D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4); - -gap> IsBiconnectedDigraph(D); -true]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsBipartiteDigraph"> - - - true or false. - - This property is true if the digraph digraph is bipartite, and - false if it is not. A digraph is bipartite if and only if the - vertices of digraph can be partitioned into two non-empty sets such - that the source and range of any edge of digraph lie in distinct sets. - Equivalently, a digraph is bipartite if and only if it is 2-colorable; see - .

- - See also . -

- - &MUTABLE_RECOMPUTED_PROP; - - D := ChainDigraph(4); - -gap> IsBipartiteDigraph(D); -true -gap> D := CycleDigraph(3); - -gap> IsBipartiteDigraph(D); -false -gap> D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4); - -gap> IsBipartiteDigraph(D); -true]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsCompleteBipartiteDigraph"> - - - true or false. - - Returns true if the digraph digraph is a complete bipartite - digraph, and false if it is not.

- - A digraph is a complete bipartite digraph if it is bipartite, see - , and there exists a unique edge with - source i and range j if and only if i and j lie - in different bicomponents of digraph, see .

- - Equivalently, a bipartite digraph with bicomponents of size m and - n is complete precisely when it has 2mn edges, none of which - are multiple edges.

- - See also . -

- - &MUTABLE_RECOMPUTED_PROP; - - D := CycleDigraph(2); - -gap> IsCompleteBipartiteDigraph(D); -true -gap> D := CycleDigraph(4); - -gap> IsBipartiteDigraph(D); -true -gap> IsCompleteBipartiteDigraph(D); -false -gap> D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4); - -gap> IsCompleteBipartiteDigraph(D); -true]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsCompleteMultipartiteDigraph"> - - - true or false. - - This property returns true if digraph is a complete - multipartite digraph, and false if not.

- - A digraph is a complete multipartite digraph if and only if - its vertices can be partitioned into at least two maximal independent sets, - where every possible edge between these independent sets occurs in the - digraph exactly once. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := CompleteMultipartiteDigraph([2, 4, 6]); - -gap> IsCompleteMultipartiteDigraph(D); -true -gap> D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4); - -gap> IsCompleteMultipartiteDigraph(D); -true]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsCompleteDigraph"> - - - true or false. - - Returns true if the digraph digraph is complete, and - false if it is not.

- - A digraph is complete if it has no loops, and for all - distinct vertices i and j, - there is exactly one edge with source i and range j. - - Equivalently, a digraph with n vertices is complete precisely when - it has n(n - 1) edges, no loops, and no multiple edges. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[2, 3], [1, 3], [1, 2]]); - -gap> IsCompleteDigraph(D); -true -gap> D := Digraph([[2, 2], [1]]); - -gap> IsCompleteDigraph(D); -false -gap> D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4); - -gap> IsCompleteDigraph(D); -false]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsTournament"> - - - true or false. - - This property is true if the digraph digraph is a tournament, - and false if it is not.

- - A tournament is an orientation of a complete (undirected) graph. - Specifically, a tournament is a digraph which has a unique directed edge - (of some orientation) between any pair of distinct vertices, and no loops. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[2, 3, 4], [3, 4], [4], []]); - -gap> IsTournament(D); -true -gap> D := Digraph([[2], [1], [3]]); - -gap> IsTournament(D); -false -gap> D := CycleDigraph(IsMutableDigraph, 3); - -gap> IsTournament(D); -true -gap> DigraphRemoveEdge(D, 1, 2); - -gap> IsTournament(D); -false -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsChainDigraph"> - - - true or false. - - IsChainDigraph returns true if the digraph digraph is - isomorphic to the chain digraph with the same number of vertices as - digraph, and false if it is not; see .

- - A digraph is a chain if and only if it is a directed tree, in which - every vertex has out degree at most one; see - and . -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[1, 3], [2, 3], [3]]); - -gap> IsChainDigraph(D); -false -gap> D := ChainDigraph(5); - -gap> IsChainDigraph(D); -true -gap> D := DigraphReverse(D); - -gap> IsChainDigraph(D); -true -gap> D := ChainDigraph(IsMutableDigraph, 5); - -gap> IsChainDigraph(D); -true -gap> DigraphReverse(D); - -gap> IsChainDigraph(D); -true]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsCycleDigraph"> - - - true or false. - - IsCycleDigraph returns true if the digraph digraph is - isomorphic to the cycle digraph with the same number of vertices as - digraph, and false if it is not; see .

- - A digraph is a cycle if and only if it is strongly connected and has - the same number of edges as vertices. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[1, 3], [2, 3], [3]]); - -gap> IsCycleDigraph(D); -false -gap> D := CycleDigraph(5); - -gap> IsCycleDigraph(D); -true -gap> D := OnDigraphs(D, (1, 2, 3)); - -gap> D = CycleDigraph(5); -false -gap> IsCycleDigraph(D); -true]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsDigraphCore"> - - - true or false. - - This property returns true if digraph is a core, - and false if it is not.

- - A digraph D is a core if and only if it has no proper - subdigraphs A such that there exists a homomorphism from D - to A. In other words, a digraph D is a core if and only if - every endomorphism on D is an automorphism on D. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := CompleteDigraph(6); - -gap> IsDigraphCore(D); -true -gap> D := DigraphSymmetricClosure(CycleDigraph(6)); - -gap> DigraphHomomorphism(D, CompleteDigraph(2)); -Transformation( [ 1, 2, 1, 2, 1, 2 ] ) -gap> IsDigraphCore(D); -false -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsDirectedTree"> - - - true or false. - - Returns true if the digraph digraph is a directed tree, and - false if it is not.

- - A directed tree is an acyclic digraph with precisely 1 source, - such that no two vertices share an out-neighbour. - Note that the empty digraph with zero vertices is not considered - to be a directed tree, because it has no source.

- - See also . -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[], [2]]); - -gap> IsDirectedTree(D); -false -gap> D := Digraph([[3], [3], []]); - -gap> IsDirectedTree(D); -false -gap> D := Digraph([[2], [3], []]); - -gap> IsDirectedTree(D); -true -gap> D := Digraph([[2, 3], [6], [4, 5], [], [], []]); - -gap> IsDirectedTree(D); -true -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsUndirectedTree"> - - - - true or false. - - The property IsUndirectedTree returns true if the digraph - digraph is an undirected tree, and the property - IsUndirectedForest returns true if digraph is an - undirected forest; otherwise, these properties return false.

- - An undirected tree is a symmetric digraph without loops, in which for - any pair of distinct vertices u and v, there is exactly one - directed path from u to v. See and , and see - Section for the definition of - directed path. This definition implies that an undirected tree has - no multiple edges.

- - An undirected forest is a digraph, each of whose connected components - is an undirected tree. In other words, an undirected forest is isomorphic to - a disjoint union of undirected trees. See and . In particular, every - undirected tree is an undirected forest.

- - Please note that the digraph with zero vertices is considered to be neither - an undirected tree nor an undirected forest. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[3], [3], [1, 2]]); - -gap> IsUndirectedTree(D); -true -gap> IsSymmetricDigraph(D) and not DigraphHasLoops(D); -true -gap> D := Digraph([[3], [5], [1, 4], [3], [2]]); - -gap> IsConnectedDigraph(D); -false -gap> IsUndirectedTree(D); -false -gap> IsUndirectedForest(D); -true -gap> D := Digraph([[1, 2], [1], [2]]); - -gap> IsUndirectedTree(D) or IsUndirectedForest(D); -false -gap> IsSymmetricDigraph(D) or not DigraphHasLoops(D); -false]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsEdgeTransitive"> - - - true or false. - - If digraph is a digraph without multiple edges, then - IsEdgeTransitive returns true if digraph - is edge transitive, and false otherwise. A digraph is - edge transitive if its automorphism group acts - transitively on its edges (via the action - ). -

- - &MUTABLE_RECOMPUTED_PROP; - - IsEdgeTransitive(CompleteDigraph(2)); -true -gap> IsEdgeTransitive(ChainDigraph(3)); -false -gap> IsEdgeTransitive(Digraph([[2], [3, 3, 3], []])); -Error, the argument must be a digraph with no multiple edges, -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsVertexTransitive"> - - - true or false. - - If digraph is a digraph, then IsVertexTransitive returns - true if digraph is vertex transitive, and false - otherwise. A digraph is vertex transitive if its automorphism group - acts transitively on its vertices. -

- - &MUTABLE_RECOMPUTED_PROP; - - IsVertexTransitive(CompleteDigraph(2)); -true -gap> IsVertexTransitive(ChainDigraph(3)); -false -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsEmptyDigraph"> - - - - true or false. - - Returns true if the digraph digraph is empty, and - false if it is not. A digraph is empty if it has no - edges.

- - is a synonym for . - See also . -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[], []]); - -gap> IsEmptyDigraph(D); -true -gap> IsNullDigraph(D); -true -gap> D := Digraph([[], [1]]); - -gap> IsEmptyDigraph(D); -false -gap> IsNullDigraph(D); -false]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsNonemptyDigraph"> - - - true or false. - - Returns true if the digraph digraph is nonempty, and - false if it is not. A digraph is nonempty if it has at - least one edge.

- - See also . -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[], []]); - -gap> IsNonemptyDigraph(D); -false -gap> D := Digraph([[], [1]]); - -gap> IsNonemptyDigraph(D); -true]]> - - -<#/GAPDoc> - -<#GAPDoc Label="DigraphHasAVertex"> - - - true or false. - - Returns true if the digraph digraph has at least one vertex, - and false if it does not.

- - See also . -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([]); - -gap> DigraphHasAVertex(D); -false -gap> D := Digraph([[]]); - -gap> DigraphHasAVertex(D); -true -gap> D := Digraph([[], [1]]); - -gap> DigraphHasAVertex(D); -true]]> - - -<#/GAPDoc> - -<#GAPDoc Label="DigraphHasNoVertices"> - - - true or false. - - Returns true if the digraph digraph is the unique digraph - with zero vertices, and false otherwise.

- - See also . -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([]); - -gap> DigraphHasNoVertices(D); -true -gap> D := Digraph([[]]); - -gap> DigraphHasNoVertices(D); -false -gap> D := Digraph([[], [1]]); - -gap> DigraphHasNoVertices(D); -false]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsEulerianDigraph"> - - - true or false. - - This property returns true if the digraph digraph is Eulerian. -

- - A connected digraph is called Eulerian if there exists a directed - circuit on the digraph which includes every edge exactly once. See - Section for the definition of - a directed circuit. Note that the empty digraph with at most one vertex is - considered to be Eulerian. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[]]); - -gap> IsEulerianDigraph(D); -true -gap> D := Digraph([[2], []]); - -gap> IsEulerianDigraph(D); -false -gap> D := Digraph([[3], [], [2]]); - -gap> IsEulerianDigraph(D); -false -gap> D := Digraph([[2], [3], [1]]); - -gap> IsEulerianDigraph(D); -true -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsFunctionalDigraph"> - - - true or false. - - This property is true if the digraph digraph is - functional.

- - A digraph is functional if every vertex is the source of a - unique edge. -

- - &MUTABLE_RECOMPUTED_PROP; - - gr1 := Digraph([[3], [2], [2], [1], [6], [5]]); - -gap> IsFunctionalDigraph(gr1); -true -gap> gr2 := Digraph([[1, 2], [1]]); - -gap> IsFunctionalDigraph(gr2); -false -gap> gr3 := Digraph(3, [1, 2, 3], [2, 3, 1]); - -gap> IsFunctionalDigraph(gr3); -true -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsPermutationDigraph"> - - - true or false. - - This property is true if the digraph digraph is - functional and each node has only one in-neighbour.

- - &MUTABLE_RECOMPUTED_PROP; - - gr1 := Digraph([[3], [2], [2], [1], [6], [5]]); - -gap> IsPermutationDigraph(gr1); -false -gap> gr2 := Digraph([[1, 2], [1]]); - -gap> IsPermutationDigraph(gr2); -false -gap> gr3 := Digraph(3, [1, 2, 3], [2, 3, 1]); - -gap> IsPermutationDigraph(gr3); -true -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsHamiltonianDigraph"> - - - true or false. - - If digraph is Hamiltonian, then this property returns - true, and false if it is not.

- - A digraph with n vertices is Hamiltonian if it has a - directed cycle of length n. See Section for the definition of a directed cycle. - Note the empty digraphs on 0 and 1 vertices are considered to be - Hamiltonian.

- - The method used in this operation has the worst case complexity as - . -

- - &MUTABLE_RECOMPUTED_PROP; - - g := Digraph([[]]); - -gap> IsHamiltonianDigraph(g); -true -gap> g := Digraph([[2], [1]]); - -gap> IsHamiltonianDigraph(g); -true -gap> g := Digraph([[3], [], [2]]); - -gap> IsHamiltonianDigraph(g); -false -gap> g := Digraph([[2], [3], [1]]); - -gap> IsHamiltonianDigraph(g); -true -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsRegularDigraph"> - - - true or false. - - This property is true if there is an integer n such that - for every vertex v of digraph digraph there are exactly - n edges starting and terminating at v. In other words, - the property is true if digraph is both in-regular and - and out-regular. - - See also and - . -

- - &MUTABLE_RECOMPUTED_PROP; - - IsRegularDigraph(CompleteDigraph(4)); -true -gap> IsRegularDigraph(ChainDigraph(4)); -false -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsInRegularDigraph"> - - - true or false. - - This property is true if there is an integer n such that - for every vertex v of digraph digraph there are exactly - n edges terminating in v. - - See also and - . -

- - &MUTABLE_RECOMPUTED_PROP; - - IsInRegularDigraph(CompleteDigraph(4)); -true -gap> IsInRegularDigraph(ChainDigraph(4)); -false -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsOutRegularDigraph"> - - - true or false. - - This property is true if there is an integer n such that - for every vertex v of digraph digraph there are exactly - n edges starting at v. -

- - See also and - . -

- - &MUTABLE_RECOMPUTED_PROP; - - IsOutRegularDigraph(CompleteDigraph(4)); -true -gap> IsOutRegularDigraph(ChainDigraph(4)); -false -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsDistanceRegularDigraph"> - - - true or false. - - If digraph is a connected symmetric graph, this property returns - true if for any two vertices u and v of digraph - and any two integers i and j between 0 and the - diameter of digraph, the number of vertices at distance i - from u and distance j from v depends only on - i, j, and the distance between vertices u and - v.

- - Alternatively, a distance regular graph is a graph for which there exist - integers b_i, c_i, and i such that for any two - vertices u, v in digraph which are distance i - apart, there are exactly b_i neighbors of v which are at - distance i - 1 away from u, and c_i neighbors of - v which are at distance i + 1 away from u. This - definition is used to check whether digraph is distance regular.

- - In the case where digraph is not symmetric or not connected, the - property is false. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := DigraphSymmetricClosure(ChainDigraph(5));; -gap> IsDistanceRegularDigraph(D); -false -gap> D := Digraph([[2, 3, 4], [1, 3, 4], [1, 2, 4], [1, 2, 3]]); - -gap> IsDistanceRegularDigraph(D); -true -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsReflexiveDigraph"> - - - true or false. - - This property is true if the digraph digraph is - reflexive, and false if it is not. - A digraph is reflexive if it has a loop at every vertex.

-

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[1, 2], [2]]); - -gap> IsReflexiveDigraph(D); -true -gap> D := Digraph([[3, 1], [4, 2], [3], [2, 1]]); - -gap> IsReflexiveDigraph(D); -false -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsSymmetricDigraph"> - - - true or false. - - This property is true if the digraph digraph - is symmetric, and false if it is not.

- - A symmetric digraph is one where for each non-loop edge, having - source u and range v, there is a corresponding edge with - source v and range u. If there are n edges with - source u and range v, then there must be precisely n - edges with source v and range u. In other words, a symmetric - digraph has a symmetric adjacency matrix . -

- - &MUTABLE_RECOMPUTED_PROP; - - gr1 := Digraph([[2], [1, 3], [2, 3]]); - -gap> IsSymmetricDigraph(gr1); -true -gap> adj1 := AdjacencyMatrix(gr1);; -gap> Display(adj1); -[ [ 0, 1, 0 ], - [ 1, 0, 1 ], - [ 0, 1, 1 ] ] -gap> adj1 = TransposedMat(adj1); -true -gap> gr1 = DigraphReverse(gr1); -true -gap> gr2 := Digraph([[2, 3], [1, 3], [2, 3]]); - -gap> IsSymmetricDigraph(gr2); -false -gap> adj2 := AdjacencyMatrix(gr2);; -gap> Display(adj2); -[ [ 0, 1, 1 ], - [ 1, 0, 1 ], - [ 0, 1, 1 ] ] -gap> adj2 = TransposedMat(adj2); -false -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsAntisymmetricDigraph"> - - - - true or false. - - This property is true if the digraph digraph - is antisymmetric, and false if it is not. -

- - A digraph is antisymmetric if whenever there is an edge with source - u and range v, and an edge with source v and range - u, then the vertices u and v are equal. -

- - &MUTABLE_RECOMPUTED_PROP; - - gr1 := Digraph([[2], [1, 3], [2, 3]]); - -gap> IsAntisymmetricDigraph(gr1); -false -gap> DigraphEdges(gr1){[1, 2]}; -[ [ 1, 2 ], [ 2, 1 ] ] -gap> gr2 := Digraph([[1, 2], [3, 3], [1]]); - -gap> IsAntisymmetricDigraph(gr2); -true -gap> DigraphEdges(gr2); -[ [ 1, 1 ], [ 1, 2 ], [ 2, 3 ], [ 2, 3 ], [ 3, 1 ] ] -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsTransitiveDigraph"> - - - true or false. - - This property is true if the digraph digraph - is transitive, and false if it is not. - - A digraph is transitive if whenever [ i, j ] and - [ j, k ] are edges of the digraph, then [ i, k ] is also an - edge of the digraph.

- - Let n be the number of vertices of an arbitrary digraph, and let - m be the number of edges. - For general digraphs, the methods used for this property use a version - of the Floyd-Warshall algorithm, and have complexity O(n^3). - - However for digraphs which are topologically sortable - [], then methods with - complexity O(m + n + m \cdot n) will be used when appropriate. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[1, 2], [3], [3]]); - -gap> IsTransitiveDigraph(D); -false -gap> gr2 := Digraph([[1, 2, 3], [3], [3]]); - -gap> IsTransitiveDigraph(gr2); -true -gap> gr2 = DigraphTransitiveClosure(D); -true -gap> gr3 := Digraph([[1, 2, 2, 3], [3, 3], [3]]); - -gap> IsTransitiveDigraph(gr3); -true -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsMeetSemilatticeDigraph"> - - - - - true or false. - - IsMeetSemilatticeDigraph returns true if the digraph - digraph is a meet semilattice; IsJoinSemilatticeDigraph - returns true if the digraph digraph is a join semilattice; - and IsLatticeDigraph returns true if the digraph - digraph is both a meet and a join semilattice. -

- - For a partial order digraph the - corresponding partial order is the relation \leq, defined by - x \leq y if and only if [x, y] is an edge. - A digraph is a meet semilattice if it is a partial order and every - pair of vertices has a greatest lower bound (meet) with respect to the - aforementioned relation. A join semilattice is a partial order where - every pair of vertices has a least upper bound (join) with respect to - the relation. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[1, 3], [2, 3], [3]]); - -gap> IsMeetSemilatticeDigraph(D); -false -gap> IsJoinSemilatticeDigraph(D); -true -gap> IsLatticeDigraph(D); -false -gap> D := Digraph([[1], [2], [1 .. 3]]); - -gap> IsJoinSemilatticeDigraph(D); -false -gap> IsMeetSemilatticeDigraph(D); -true -gap> IsLatticeDigraph(D); -false -gap> D := Digraph([[1 .. 4], [2, 4], [3, 4], [4]]); - -gap> IsMeetSemilatticeDigraph(D); -true -gap> IsJoinSemilatticeDigraph(D); -true -gap> IsLatticeDigraph(D); -true -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsDistributiveLatticeDigraph"> - - - true or false. - - IsDistributiveLatticeDigraph returns true if the digraph - digraph is a distributive lattice digraph.

- - A distributive lattice digraph is a lattice digraph () which is distributive. That is to say, the - functions and distribute over each other.

- - Equivalently, a distributive lattice digraph is a lattice digraph in which - the lattice digraphs representing M3 and N5 are not - embeddable as lattices - (see https://en.wikipedia.org/wiki/Distributive_lattice and - ).

- - - - -      - -

The lattices M3 and N5.
- - ]]> - - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[2, 3], [4], [4], []]); - -gap> D := DigraphReflexiveTransitiveClosure(D); - -gap> IsDistributiveLatticeDigraph(D); -true -gap> N5 := Digraph([[2, 4], [3], [5], [5], []]); - -gap> N5 := DigraphReflexiveTransitiveClosure(N5); - -gap> IsDistributiveLatticeDigraph(N5); -false]]> -
-
-<#/GAPDoc> - -<#GAPDoc Label="IsModularLatticeDigraph"> - - - true or false. - - IsModularLatticeDigraph returns true if the digraph - digraph is a modular lattice digraph.

- - A modular lattice digraph is a lattice digraph () which is modular. That is to say, the lattice - digraph representing N5 is not embeddable as a lattice (see - https://en.wikipedia.org/wiki/Modular_lattice and ).

- - - - -

The lattice N5.
- - ]]> - - - &MUTABLE_RECOMPUTED_PROP; - - D := ChainDigraph(5); - -gap> D := DigraphReflexiveTransitiveClosure(D); - -gap> IsModularLatticeDigraph(D); -true -gap> N5 := Digraph([[2, 3], [4], [4], []]); - -gap> DigraphReflexiveTransitiveClosure(N5); - -gap> IsModularLatticeDigraph(N5); -false -]]> -
-
-<#/GAPDoc> - -<#GAPDoc Label="IsPreorderDigraph"> - - - - true or false. - - A digraph is a preorder digraph if and only if the digraph satisfies both - and . - A preorder digraph (or quasiorder digraph) digraph corresponds to - the preorder relation \leq defined by x \leq y if and only - if [x, y] is an edge of digraph. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[1], [2, 3], [2, 3]]); - -gap> IsPreorderDigraph(D); -true -gap> D := Digraph([[1 .. 4], [1 .. 4], [1 .. 4], [1 .. 4]]); - -gap> IsPreorderDigraph(D); -true -gap> D := Digraph([[2], [3], [4], [5], [1]]); - -gap> IsPreorderDigraph(D); -false -gap> D := Digraph([[1], [1, 2], [2, 3]]); - -gap> IsQuasiorderDigraph(D); -false -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsPartialOrderDigraph"> - - - true or false. - - A digraph is a partial order digraph if and only if the digraph satisfies - all of , - and . - A partial order digraph corresponds - to the partial order relation \leq defined by x \leq y if and - only if [x, y] is an edge of digraph. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[1, 3], [2, 3], [3]]); - -gap> IsPartialOrderDigraph(D); -true -gap> D := CycleDigraph(5); - -gap> IsPartialOrderDigraph(D); -false -gap> D := Digraph([[1, 1], [1, 1, 2], [3], [3, 3, 4, 4]]); - -gap> IsPartialOrderDigraph(D); -true -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsEquivalenceDigraph"> - - - true or false. - - A digraph is an equivalence digraph if and only if the digraph satisfies - all of , - and . - A partial order digraph corresponds to an equivalence relation. -

- - &MUTABLE_RECOMPUTED_PROP; - - D := Digraph([[1, 3], [2], [1, 3]]); - -gap> IsEquivalenceDigraph(D); -true -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsBridgelessDigraph"> - - - true or false. - - A connected digraph is bridgeless if it is still connected (in the - sense of ) when any edge is removed. - If digraph has at least 3 vertices, then implies IsBridgelessDigraph; - see or for a more - detailed explanation. -

- - IsBridgelessDigraph returns true if the digraph - digraph is bridgeless, and false if it is not. In - particular, IsBridgelessDigraph returns false if - digraph is not connected.

- - Multiple edges are ignored by this method.

- - The method used in this operation has complexity O(m+n) where - m is the number of edges and n is the number of vertices in - the digraph. -

- - See also , , and - .

- - &MUTABLE_RECOMPUTED_PROP; - - IsBridgelessDigraph(Digraph([[1, 3], [2, 3], [3]])); -false -gap> IsBridgelessDigraph(CycleDigraph(5)); -true -gap> D := Digraph([[1, 1], [1, 1, 2], [3], [3, 3, 4, 4]]);; -gap> IsBridgelessDigraph(D); -false -gap> D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4); - -gap> IsBridgelessDigraph(D); -true -gap> D := Digraph([[2, 5], [1, 3, 4, 5], [2, 4], [2, 3], [1, 2]]); - -gap> IsBridgelessDigraph(D); -true -gap> IsBiconnectedDigraph(D); -false -gap> D := Digraph([[2], [3], [4], [2]]); - -gap> IsBridgelessDigraph(D); -false -gap> IsBiconnectedDigraph(D); -false -gap> IsBridgelessDigraph(ChainDigraph(2)); -false -gap> IsBiconnectedDigraph(ChainDigraph(2)); -true -]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsUpperSemimodularDigraph"> - - - - true or false. - - IsUpperSemimodularDigraph returns true if the digraph - D represents an upper semimodular lattice and false if it - does not. Similarly, IsLowerSemimodularDigraph returns true - if D represents a lower semimodular lattice and false if - it does not.

- - In a lattice we say that a vertex a covers a vertex b - if a is greater than b, and there are no further vertices - between a and b. A lattice is upper semimodular if - whenever the meet of a and b is covered by a, the join - of a and b covers b. Lower semimodularity is - defined analogously.

- - See also , , - and . - - &MUTABLE_RECOMPUTED_PROP; - - D := DigraphFromDigraph6String( -> "&M~~sc`lYUZO__KIBboC_@h?U_?_GL?A_?c"); - -gap> IsUpperSemimodularDigraph(D); -true -gap> IsLowerSemimodularDigraph(D); -false]]> - - -<#/GAPDoc> - -<#GAPDoc Label="IsTwoEdgeTransitive"> - - - true or false. - - If digraph is a digraph, then IsTwoEdgeTransitive returns - true if digraph is 2-edge transitive, and false - otherwise. A digraph is 2-edge transitive if its automorphism group - acts transitively on its 2-edges via the action - . - - A 2-edge of a digraph is a pair of its edges, such that the range of the - first edge is equal to the source of the second edge. -

- - &MUTABLE_RECOMPUTED_PROP; - - IsTwoEdgeTransitive(CompleteDigraph(4)); -true -gap> IsTwoEdgeTransitive(DigraphByEdges([[1,2],[2,3],[3,1],[3,4]])) -false -gap> IsTwoEdgeTransitive(CycleDigraph(5)); -true -]]> - - -<#/GAPDoc> diff --git a/gap/digraph.gi.save b/gap/digraph.gi.save deleted file mode 100644 index 8cd890a3e..000000000 --- a/gap/digraph.gi.save +++ /dev/null @@ -1,1859 +0,0 @@ -############################################################################# -## -## digraph.gi -## Copyright (C) 2014-21 James D. Mitchell -## -## Licensing information can be found in the README file of this package. -## -############################################################################# -## - -######################################################################## -# This file is organised as follows: -# -# 1. Digraph types -# 2. Digraph no-check constructors -# 3. Digraph copies -# 4. PostMakeImmutable -# 5. Digraph constructors -# 6. Printing, viewing, strings -# 7. Operators -# 8. Digraph by-something constructors -# 9. Converters to/from other types -> digraph -# 10. Random digraphs -# -######################################################################## - -BindGlobal("DIGRAPHS_NamedDigraphs", fail); -BindGlobal("DIGRAPHS_NamedDigraphsTests", fail); - -BindGlobal("DIGRAPHS_LoadNamedDigraphs", function() - # Check if the database has already been loaded - if DIGRAPHS_NamedDigraphs = fail then - MakeReadWriteGlobal("DIGRAPHS_NamedDigraphs"); - UnbindGlobal("DIGRAPHS_NamedDigraphs"); - - # Initialise empty record - BindGlobal("DIGRAPHS_NamedDigraphs", rec()); - - # Populate record with entries from the named digraphs main database - Read(Concatenation(DIGRAPHS_Dir(), "/data/named-digraphs-main-database.g")); - fi; -end); - -BindGlobal("DIGRAPHS_LoadNamedDigraphsTests", function() - # INTENDED ONLY FOR TESTING PURPOSES - # Check if the database has already been loaded - if DIGRAPHS_NamedDigraphsTests = fail then - MakeReadWriteGlobal("DIGRAPHS_NamedDigraphsTests"); - UnbindGlobal("DIGRAPHS_NamedDigraphsTests"); - - # Initialise empty record - BindGlobal("DIGRAPHS_NamedDigraphsTests", rec()); - - # Populate record with entries from the named digraphs test database - Read(Concatenation(DIGRAPHS_Dir(), "/data/named-digraphs-test-database.g")); - fi; -end); - -InstallMethod(DigraphMutabilityFilter, "for a digraph", [IsDigraph], -function(D) - if IsMutableDigraph(D) then - return IsMutableDigraph; - else - return IsImmutableDigraph; - fi; -end); - -######################################################################## -# 1. Digraph types -######################################################################## - -BindGlobal("DigraphByOutNeighboursType", NewType(DigraphFamily, - IsDigraphByOutNeighboursRep)); - -######################################################################## -# 2. Digraph no-check constructors -######################################################################## - -InstallMethod(ConvertToMutableDigraphNC, "for a record", [IsRecord], -function(record) - local D; - Assert(1, IsBound(record.OutNeighbours)); - Assert(1, Length(NamesOfComponents(record)) = 1); - D := Objectify(DigraphByOutNeighboursType, record); - SetFilterObj(D, IsMutable); - return D; -end); - -InstallMethod(ConvertToMutableDigraphNC, "for a dense list of out-neighbours", -[IsDenseList], -function(list) - local record; - record := rec(OutNeighbours := list); - Perform(record.OutNeighbours, IsSet); - return ConvertToMutableDigraphNC(record); -end); - -InstallMethod(ConvertToImmutableDigraphNC, "for a record", [IsRecord], -record -> MakeImmutable(ConvertToMutableDigraphNC(record))); - -InstallMethod(ConvertToImmutableDigraphNC, -"for a dense list of out-neighbours", -[IsDenseList], -list -> MakeImmutable(ConvertToMutableDigraphNC(list))); - -InstallMethod(DigraphConsNC, "for IsMutableDigraph and a record", -[IsMutableDigraph, IsRecord], -function(_, record) - local required, out, name; - required := ["DigraphRange", "DigraphSource", "DigraphNrVertices"]; - for name in required do - Assert(1, IsBound(record.(name))); - od; - for name in Difference(RecNames(record), required) do - Info(InfoWarning, 1, "ignoring record component \"", name, "\"!"); - od; - out := DIGRAPH_OUT_NEIGHBOURS_FROM_SOURCE_RANGE(record.DigraphNrVertices, - record.DigraphSource, - record.DigraphRange); - return ConvertToMutableDigraphNC(out); -end); - -InstallMethod(DigraphConsNC, -"for IsMutableDigraph and a dense list of out-neighbours", -[IsMutableDigraph, IsDenseList], -function(_, list) - Assert(1, not IsMutable(list)); - return ConvertToMutableDigraphNC(List(list, ShallowCopy)); -end); - -InstallMethod(DigraphConsNC, -"for IsMutableDigraph and a dense mutable list of out-neighbours", -[IsMutableDigraph, IsDenseList and IsMutable], -{_, list} -> ConvertToMutableDigraphNC(StructuralCopy(list))); - -InstallMethod(DigraphConsNC, "for IsImmutableDigraph and a record", -[IsImmutableDigraph, IsRecord], -function(_, record) - local D; - D := MakeImmutable(DigraphConsNC(IsMutableDigraph, record)); - SetDigraphSource(D, StructuralCopy(record.DigraphSource)); - SetDigraphRange(D, StructuralCopy(record.DigraphRange)); - return D; -end); - -InstallMethod(DigraphConsNC, "for IsImmutableDigraph and a dense list", -[IsImmutableDigraph, IsDenseList], -{_, list} -> MakeImmutable(DigraphConsNC(IsMutableDigraph, list))); - -InstallMethod(DigraphNC, "for a function and a dense list", -[IsFunction, IsDenseList], DigraphConsNC); - -InstallMethod(DigraphNC, "for a dense list", [IsDenseList], -list -> DigraphConsNC(IsImmutableDigraph, list)); - -InstallMethod(DigraphNC, "for a function and a record", -[IsFunction, IsRecord], DigraphConsNC); - -InstallMethod(DigraphNC, "for a record", [IsRecord], -record -> DigraphConsNC(IsImmutableDigraph, record)); - -######################################################################## -# 3. Digraph copies -######################################################################## - -InstallMethod(DigraphMutableCopy, "for a digraph by out-neighbours", -[IsDigraphByOutNeighboursRep], -function(D) - local copy; - copy := ConvertToMutableDigraphNC(OutNeighboursMutableCopy(D)); - SetDigraphVertexLabels(copy, StructuralCopy(DigraphVertexLabels(D))); - if HaveEdgeLabelsBeenAssigned(D) then - SetDigraphEdgeLabelsNC(copy, StructuralCopy(DigraphEdgeLabelsNC(D))); - fi; - return copy; -end); - -InstallMethod(DigraphImmutableCopy, "for a digraph by out-neighbours", -[IsDigraphByOutNeighboursRep], -function(D) - local copy; - copy := ConvertToImmutableDigraphNC(OutNeighboursMutableCopy(D)); - SetDigraphVertexLabels(copy, StructuralCopy(DigraphVertexLabels(D))); - if HaveEdgeLabelsBeenAssigned(D) then - SetDigraphEdgeLabelsNC(copy, StructuralCopy(DigraphEdgeLabelsNC(D))); - fi; - return copy; -end); - -InstallMethod(DigraphCopySameMutability, "for a mutable digraph", -[IsMutableDigraph], DigraphMutableCopy); - -InstallMethod(DigraphCopySameMutability, "for an immutable digraph", -[IsImmutableDigraph], DigraphImmutableCopy); - -InstallMethod(DigraphImmutableCopyIfMutable, "for a mutable digraph", -[IsMutableDigraph], DigraphImmutableCopy); - -InstallMethod(DigraphImmutableCopyIfMutable, "for an immutable digraph", -[IsImmutableDigraph], IdFunc); - -InstallMethod(DigraphImmutableCopyIfImmutable, "for a mutable digraph", -[IsMutableDigraph], IdFunc); - -InstallMethod(DigraphImmutableCopyIfImmutable, "for an immutable digraph", -[IsImmutableDigraph], DigraphImmutableCopy); - -InstallMethod(DigraphMutableCopyIfImmutable, "for a mutable digraph", -[IsMutableDigraph], IdFunc); - -InstallMethod(DigraphMutableCopyIfImmutable, "for an immutable digraph", -[IsImmutableDigraph], DigraphMutableCopy); - -InstallMethod(DigraphMutableCopyIfMutable, "for a mutable digraph", -[IsMutableDigraph], DigraphMutableCopy); - -InstallMethod(DigraphMutableCopyIfMutable, "for an immutable digraph", -[IsImmutableDigraph], IdFunc); - -######################################################################## -# 4. PostMakeImmutable -######################################################################## - -InstallMethod(PostMakeImmutable, "for a digraph", -[IsDigraph and IsDigraphByOutNeighboursRep], -function(D) - MakeImmutable(D!.OutNeighbours); - SetFilterObj(D, IsImmutableDigraph); - SetFilterObj(D, IsAttributeStoringRep); -end); - -######################################################################## -# 5. Digraph constructors -######################################################################## - -InstallMethod(DigraphCons, "for IsMutableDigraph and a record", -[IsMutableDigraph, IsRecord], -function(_, record) - local D, cmp, labels, i; - - if IsGraph(record) then - # IsGraph is a function not a filter, so we cannot have a separate method - D := DigraphNC(IsMutableDigraph, - List(Vertices(record), x -> Adjacency(record, x))); - if IsBound(record.names) then - SetDigraphVertexLabels(D, StructuralCopy(record.names)); - fi; - return D; - fi; - - if not (IsBound(record.DigraphSource) - and IsBound(record.DigraphRange) - and (IsBound(record.DigraphVertices) or - IsBound(record.DigraphNrVertices))) then - ErrorNoReturn("the argument must be a record with components ", - "'DigraphSource', 'DigraphRange', and either ", - "'DigraphVertices' or 'DigraphNrVertices' (but not both),"); - elif not IsList(record.DigraphSource) - or not IsList(record.DigraphRange) then - ErrorNoReturn("the record components 'DigraphSource' and 'DigraphRange' ", - "must be lists,"); - elif Length(record.DigraphSource) <> Length(record.DigraphRange) then - ErrorNoReturn("the record components 'DigraphSource' and 'DigraphRange' ", - "must have equal length,"); - elif IsBound(record.DigraphVertices) - and IsBound(record.DigraphNrVertices) then - ErrorNoReturn("the record must only have one of the components ", - "'DigraphVertices' and 'DigraphNrVertices', not both,"); - fi; - - if IsBound(record.DigraphNrVertices) then - if (not IsInt(record.DigraphNrVertices)) - or record.DigraphNrVertices < 0 then - ErrorNoReturn("the record component 'DigraphNrVertices' ", - "must be a non-negative integer,"); - fi; - cmp := x -> IsPosInt(x) and x < record.DigraphNrVertices + 1; - else - Assert(1, IsBound(record.DigraphVertices)); - if not IsList(record.DigraphVertices) then - ErrorNoReturn("the record component 'DigraphVertices' must be a list,"); - elif not IsDuplicateFreeList(record.DigraphVertices) then - ErrorNoReturn("the record component 'DigraphVertices' must be ", - "duplicate-free,"); - fi; - cmp := x -> x in record.DigraphVertices; - record.DigraphNrVertices := Length(record.DigraphVertices); - fi; - - if not ForAll(record.DigraphSource, cmp) then - ErrorNoReturn("the record component 'DigraphSource' is invalid,"); - elif not ForAll(record.DigraphRange, cmp) then - ErrorNoReturn("the record component 'DigraphRange' is invalid,"); - fi; - - record := StructuralCopy(record); - - # Rewrite the vertices to numbers - if IsBound(record.DigraphVertices) then - if record.DigraphVertices <> [1 .. record.DigraphNrVertices] then - for i in [1 .. Length(record.DigraphSource)] do - record.DigraphRange[i] := Position(record.DigraphVertices, - record.DigraphRange[i]); - record.DigraphSource[i] := Position(record.DigraphVertices, - record.DigraphSource[i]); - od; - labels := record.DigraphVertices; - Unbind(record.DigraphVertices); - fi; - fi; - - record.DigraphRange := Permuted(record.DigraphRange, - Sortex(record.DigraphSource)); - D := DigraphNC(IsMutableDigraph, record); - if IsBound(labels) then - SetDigraphVertexLabels(D, labels); - fi; - return D; -end); - -InstallMethod(DigraphCons, -"for IsMutableDigraph and a dense list of out-neighbours", -[IsMutableDigraph, IsDenseList], -function(_, list) - local sublist, v; - for sublist in list do - if not IsHomogeneousList(sublist) then - ErrorNoReturn("the argument must be a list of lists of positive ", - "integers not exceeding the length of the argument,"); - fi; - for v in sublist do - if not IsPosInt(v) or v > Length(list) then - ErrorNoReturn("the argument must be a list of lists of ", - "positive integers not exceeding the length of ", - "the argument,"); - fi; - od; - od; - return DigraphNC(IsMutableDigraph, list); -end); - -InstallMethod(DigraphCons, "for IsMutableDigraph, a list, and function", -[IsMutableDigraph, IsList, IsFunction], -function(_, list, func) - local N, out, x, i, j; - N := Size(list); # number of vertices - out := List([1 .. N], x -> []); - for i in [1 .. N] do - x := list[i]; - for j in [1 .. N] do - if func(x, list[j]) then - Add(out[i], j); - fi; - od; - od; - return ConvertToMutableDigraphNC(out); -end); - -InstallMethod(DigraphCons, -"for IsMutableDigraph, a number of vertices, source, and range", -[IsMutableDigraph, IsInt, IsList, IsList], -function(_, N, src, ran) - return DigraphCons(IsMutableDigraph, rec(DigraphNrVertices := N, - DigraphSource := src, - DigraphRange := ran)); -end); - -InstallMethod(DigraphCons, -"for IsMutableDigraph, a list of vertices, source, and range", -[IsMutableDigraph, IsList, IsList, IsList], -function(_, domain, src, ran) - local D; - D := DigraphCons(IsMutableDigraph, rec(DigraphVertices := domain, - DigraphSource := src, - DigraphRange := ran)); - SetDigraphVertexLabels(D, domain); - return D; -end); - -InstallMethod(DigraphCons, "for IsImmutableDigraph and a record", -[IsImmutableDigraph, IsRecord], -function(_, record) - local D; - D := MakeImmutable(DigraphCons(IsMutableDigraph, record)); - if IsGraph(record) then - # IsGraph is a function not a filter, so we cannot have a separate method - # for this. - if not IsTrivial(record.group) then - Assert(1, IsPermGroup(record.group)); - SetDigraphGroup(D, record.group); - SetDigraphSchreierVector(D, record.schreierVector); - SetRepresentativeOutNeighbours(D, record.adjacencies); - fi; - else - SetDigraphNrEdges(D, Length(record.DigraphSource)); - fi; - return D; -end); - -InstallMethod(DigraphCons, -"for IsImmutableDigraph and a dense list of out-neighbours", -[IsImmutableDigraph, IsDenseList], -{_, list} -> MakeImmutable(DigraphCons(IsMutableDigraph, list))); - -InstallMethod(DigraphCons, "for IsImmutableDigraph, a list, and function", -[IsImmutableDigraph, IsList, IsFunction], -function(_, list, func) - local D; - D := MakeImmutable(DigraphCons(IsMutableDigraph, list, func)); - SetDigraphAdjacencyFunction(D, {u, v} -> func(list[u], list[v])); - SetFilterObj(D, IsDigraphWithAdjacencyFunction); - SetDigraphVertexLabels(D, list); - return D; -end); - -InstallMethod(DigraphCons, -"for IsImmutableDigraph, a number of vertices, source, and range", -[IsImmutableDigraph, IsInt, IsList, IsList], -{_, N, src, ran} --> MakeImmutable(DigraphCons(IsMutableDigraph, N, src, ran))); - -InstallMethod(DigraphCons, -"for IsImmutableDigraph, a list of vertices, source, and range", -[IsImmutableDigraph, IsList, IsList, IsList], -{_, domain, src, ran} -> -MakeImmutable(DigraphCons(IsMutableDigraph, domain, src, ran))); - -InstallMethod(Digraph, "for a filter and a record", [IsFunction, IsRecord], -DigraphCons); - -InstallMethod(Digraph, "for a record", [IsRecord], -record -> DigraphCons(IsImmutableDigraph, record)); - -InstallMethod(Digraph, "for a filter and a list", [IsFunction, IsList], -DigraphCons); - -InstallMethod(Digraph, "for a list", [IsList], -list -> DigraphCons(IsImmutableDigraph, list)); - -InstallMethod(Digraph, "for a filter, a list, and a function", -[IsFunction, IsList, IsFunction], -DigraphCons); - -InstallMethod(Digraph, "for a list and a function", [IsList, IsFunction], -{list, func} -> DigraphCons(IsImmutableDigraph, list, func)); - -InstallMethod(Digraph, "for a filter, integer, list, and list", -[IsFunction, IsInt, IsList, IsList], -DigraphCons); - -InstallMethod(Digraph, "for an integer, list, and list", -[IsInt, IsList, IsList], -{n, src, ran} -> DigraphCons(IsImmutableDigraph, n, src, ran)); - -InstallMethod(Digraph, "for a filter, list, list, and list", -[IsFunction, IsList, IsList, IsList], -DigraphCons); - -InstallMethod(Digraph, "for a list, list, and list", [IsList, IsList, IsList], -{dom, src, ran} -> DigraphCons(IsImmutableDigraph, dom, src, ran)); - -InstallMethod(Digraph, "for a string naming a digraph", [IsString], -function(name) - # edge case to avoid interfering with Digraph([]) - if name = "" then - TryNextMethod(); - fi; - - # standardise string format to search database - name := LowercaseString(name); - RemoveCharacters(name, " \n\t\r"); - - # load database if not already done - DIGRAPHS_LoadNamedDigraphs(); - - if not name in RecNames(DIGRAPHS_NamedDigraphs) then - ErrorNoReturn("named digraph not found; see ListNamedDigraphs,"); - fi; - return DigraphFromDiSparse6String(DIGRAPHS_NamedDigraphs.(name)); -end); - -InstallMethod(ListNamedDigraphs, -"for a string and a pos int", -[IsString, IsPosInt], -function(s, level) - local l, cands, func; - # standardise request - s := LowercaseString(s); - RemoveCharacters(s, " \n\t\r"); - l := Length(s); - - # load database if not already done - DIGRAPHS_LoadNamedDigraphs(); - - # retrieve candidates - cands := RecNames(DIGRAPHS_NamedDigraphs); - if l = 0 then - return cands; - fi; - - # print warning if level higher than ones here that have methods - if level > 3 then - Info(InfoWarning, 1, "ListNamedDigraphs: second argument is"); - Info(InfoWarning, 1, "greater than level of greatest flexibility."); - Info(InfoWarning, 1, "Using = 3 instead."); - level := 3; - fi; - - if level = 1 then - func := c -> Length(c) >= l and c{[1 .. l]} = s; - elif level = 2 then - func := c -> PositionSublist(c, s) <> fail; - else - s := Filtered(s, x -> IsDigitChar(x) or IsAlphaChar(x)); - func := c -> PositionSublist(Filtered(c, x -> IsDigitChar(x) or - IsAlphaChar(x)), s) <> fail; - fi; - return Filtered(cands, func); -end); - -# if search function called with no level, assume a substring search with -# special chars -InstallMethod(ListNamedDigraphs, "for a string", [IsString], -x -> ListNamedDigraphs(x, 2)); - -######################################################################## -# 6. Printing, viewing, strings -######################################################################## - -InstallMethod(ViewString, "for a digraph", [IsDigraph], -function(D) - local n, m, display_nredges, displayed_bipartite, str, x; - - n := DigraphNrVertices(D); - m := DigraphNrEdges(D); - display_nredges := true; - displayed_bipartite := false; - - str := "<"; - if IsMutableDigraph(D) then - Append(str, "mutable "); - elif IsImmutableDigraph(D) then - Append(str, "immutable "); - fi; - - Assert(1, IsMutableDigraph(D) or IsImmutableDigraph(D)); - - if m = 0 then - if IsImmutableDigraph(D) then - SetIsEmptyDigraph(D, true); - fi; - Append(str, "empty "); - display_nredges := false; - elif n > 1 then - if HasIsCycleDigraph(D) and IsCycleDigraph(D) then - Append(str, "cycle "); - display_nredges := false; - elif HasIsChainDigraph(D) and IsChainDigraph(D) then - Append(str, "chain "); - display_nredges := false; - elif HasIsCompleteDigraph(D) and IsCompleteDigraph(D) then - Append(str, "complete "); - display_nredges := false; - elif HasIsCompleteBipartiteDigraph(D) and IsCompleteBipartiteDigraph(D) then - Append(str, "complete bipartite "); - displayed_bipartite := true; - elif HasIsCompleteMultipartiteDigraph(D) - and IsCompleteMultipartiteDigraph(D) then - Append(str, "complete multipartite "); - elif HasIsLatticeDigraph(D) and IsLatticeDigraph(D) then - Append(str, "lattice "); - elif HasIsJoinSemilatticeDigraph(D) and IsJoinSemilatticeDigraph(D) then - Append(str, "join semilattice "); - elif HasIsMeetSemilatticeDigraph(D) and IsMeetSemilatticeDigraph(D) then - Append(str, "meet semilattice "); - elif HasIsUndirectedTree(D) and IsUndirectedTree(D) then - Append(str, "undirected tree "); - display_nredges := false; - elif HasIsUndirectedForest(D) and IsUndirectedForest(D) then - Append(str, "undirected forest "); - elif HasIsDirectedTree(D) and IsDirectedTree(D) then - Append(str, "directed tree "); - display_nredges := false; - else - if HasIsEulerianDigraph(D) and IsEulerianDigraph(D) then - Append(str, "Eulerian "); - if HasIsHamiltonianDigraph(D) and IsHamiltonianDigraph(D) then - Append(str, "and "); - fi; - fi; - if HasIsHamiltonianDigraph(D) and IsHamiltonianDigraph(D) then - Append(str, "Hamiltonian "); - fi; - if HasIsStronglyConnectedDigraph(D) and IsStronglyConnectedDigraph(D) - and not (HasIsEulerianDigraph(D) and IsEulerianDigraph(D)) - and not (HasIsHamiltonianDigraph(D) and IsHamiltonianDigraph(D)) - and not (HasIsSymmetricDigraph(D) and IsSymmetricDigraph(D)) then - Append(str, "strongly connected "); - fi; - if HasIsBiconnectedDigraph(D) and IsBiconnectedDigraph(D) then - Append(str, "biconnected "); - elif ((HasIsSymmetricDigraph(D) and IsSymmetricDigraph(D)) - or not (HasIsStronglyConnectedDigraph(D) - and IsStronglyConnectedDigraph(D))) - and not (HasIsTournament(D) and IsTournament(D)) - and HasIsConnectedDigraph(D) and IsConnectedDigraph(D) then - Append(str, "connected "); - fi; - if HasIsBipartiteDigraph(D) and IsBipartiteDigraph(D) then - Append(str, "bipartite "); - displayed_bipartite := true; - fi; - if HasIsEdgeTransitive(D) and IsEdgeTransitive(D) and - HasIsVertexTransitive(D) and IsVertexTransitive(D) then - Append(str, "edge- and vertex-transitive "); - elif HasIsEdgeTransitive(D) and IsEdgeTransitive(D) then - Append(str, "edge-transitive "); - elif HasIsVertexTransitive(D) and IsVertexTransitive(D) then - Append(str, "vertex-transitive "); - elif HasIsRegularDigraph(D) and IsRegularDigraph(D) then - Append(str, "regular "); - elif HasIsOutRegularDigraph(D) and IsOutRegularDigraph(D) then - Append(str, "out-regular "); - elif HasIsInRegularDigraph(D) and IsInRegularDigraph(D) then - Append(str, "in-regular "); - fi; - if HasIsAcyclicDigraph(D) and IsAcyclicDigraph(D) then - Append(str, "acyclic "); - elif HasIsPartialOrderDigraph(D) and IsPartialOrderDigraph(D) then - Append(str, "partial order "); - elif HasIsEquivalenceDigraph(D) and IsEquivalenceDigraph(D) then - Append(str, "equivalence "); - elif HasIsFunctionalDigraph(D) and IsFunctionalDigraph(D) then - Append(str, "functional "); - display_nredges := false; - elif HasIsPreorderDigraph(D) and IsPreorderDigraph(D) then - Append(str, "preorder "); - else - if HasIsReflexiveDigraph(D) and IsReflexiveDigraph(D) then - Append(str, "reflexive "); - fi; - if HasIsSymmetricDigraph(D) and IsSymmetricDigraph(D) then - Append(str, "symmetric "); - elif HasIsAntisymmetricDigraph(D) and IsAntisymmetricDigraph(D) - and not (HasIsTournament(D) and IsTournament(D)) then - Append(str, "antisymmetric "); - fi; - if HasIsTransitiveDigraph(D) and IsTransitiveDigraph(D) then - Append(str, "transitive "); - fi; - fi; - fi; - fi; - - if IsMultiDigraph(D) then - Append(str, "multi"); - fi; - - if not (HasIsCycleDigraph(D) and IsCycleDigraph(D)) - and HasIsTournament(D) and IsTournament(D) and n > 1 then - Append(str, "tournament "); - display_nredges := false; - else - Append(str, "digraph "); - fi; - Append(str, "with "); - - if displayed_bipartite then - x := List(DigraphBicomponents(D), Length); - Append(str, "bicomponent sizes "); - Append(str, String(x[1])); - Append(str, " and "); - Append(str, String(x[2])); - Append(str, ">"); - return str; - fi; - - Append(str, String(n)); - if n = 1 then - Append(str, " vertex"); - else - Append(str, " vertices"); - fi; - if display_nredges then - Append(str, ", "); - Append(str, String(m)); - if m = 1 then - Append(str, " edge"); - else - Append(str, " edges"); - fi; - fi; - Append(str, ">"); - return str; -end); - -InstallMethod(PrintString, "for a digraph", [IsDigraph], String); - -InstallMethod(String, "for a digraph", -[IsDigraph], -function(D) - local n, N, i, mut, streps, outnbs_rep, lengths, strings, - out_neighbours_string, creators_streps, creators_props, props; - if IsMutableDigraph(D) then - mut := "IsMutableDigraph, "; - else - mut := ""; - fi; - if IsSymmetricDigraph(D) and not DigraphHasLoops(D) then - streps := [Graph6String, Sparse6String]; - creators_streps := ["DigraphFromGraph6String", - "DigraphFromSparse6String"]; - else - streps := [Digraph6String, DiSparse6String]; - creators_streps := ["DigraphFromDigraph6String", - "DigraphFromDiSparse6String"]; - fi; - streps := List(streps, f -> f(D)); - strings := []; - for n in [1 .. Length(streps)] do - Add(strings, Concatenation(creators_streps[n], "(", mut, "\"", - ReplacedString(streps[n], "\\", "\\\\"), "\"", ")")); - od; - - out_neighbours_string := String(OutNeighbours(D)); - # print empty lists with two spaces for consistency - # see https://github.com/gap-system/gap/pull/5418 - out_neighbours_string := ReplacedString(out_neighbours_string, "[ ]", "[ ]"); - outnbs_rep := Concatenation("Digraph(", mut, out_neighbours_string, ")"); - Add(strings, String(outnbs_rep)); - - N := DigraphNrVertices(D); - props := [x -> IsCycleDigraph(x) - and x = CycleDigraph(DigraphNrVertices(x)), - IsCompleteDigraph, - x -> IsChainDigraph(x) - and x = ChainDigraph(DigraphNrVertices(x)), - IsEmptyDigraph]; - creators_props := ["CycleDigraph", - "CompleteDigraph", - "ChainDigraph", - "EmptyDigraph"]; - for i in [1 .. Length(props)] do - if props[i](D) then - Add(strings, Concatenation(creators_props[i], "(", mut, String(N), ")")); - fi; - od; - - lengths := List(strings, Length); - return strings[Position(lengths, Minimum(lengths))]; -end); - -######################################################################## -# 7. Operators -######################################################################## - -InstallMethod(\=, "for two digraphs", [IsDigraph, IsDigraph], DIGRAPH_EQUALS); - -InstallMethod(\<, "for two digraphs", [IsDigraph, IsDigraph], DIGRAPH_LT); - -######################################################################## -# 8. Digraph by-something constructors -######################################################################## - -InstallMethod(DigraphByAdjacencyMatrixConsNC, -"for IsMutableDigraph and a homogeneous list", -[IsMutableDigraph, IsHomogeneousList], -function(_, mat) - local add_edge, n, list, i, j; - - if IsInt(mat[1][1]) then - add_edge := function(i, j) - local k; - for k in [1 .. mat[i][j]] do - Add(list[i], j); - od; - end; - else # boolean matrix - add_edge := function(i, j) - if mat[i][j] then - Add(list[i], j); - fi; - end; - fi; - - n := Length(mat); - list := EmptyPlist(n); - for i in [1 .. n] do - list[i] := []; - for j in [1 .. n] do - add_edge(i, j); - od; - od; - return DigraphNC(IsMutableDigraph, list); -end); - -InstallMethod(DigraphByAdjacencyMatrixCons, -"for IsMutableDigraph and a homogeneous list", -[IsMutableDigraph, IsHomogeneousList], -function(_, mat) - local n, i, j; - n := Length(mat); - if not IsRectangularTable(mat) or Length(mat[1]) <> n then - ErrorNoReturn("the argument must be a square matrix,"); - elif not IsBool(mat[1][1]) then - for i in [1 .. n] do - for j in [1 .. n] do - if not (IsInt(mat[i][j]) and mat[i][j] >= 0) then - ErrorNoReturn("the argument must be a matrix of ", - "non-negative integers,"); - fi; - od; - od; - fi; - return DigraphByAdjacencyMatrixConsNC(IsMutableDigraph, mat); -end); - -InstallMethod(DigraphByAdjacencyMatrixCons, -"for IsMutableDigraph and an empty list", -[IsMutableDigraph, IsList and IsEmpty], DigraphByAdjacencyMatrixConsNC); - -InstallMethod(DigraphByAdjacencyMatrixConsNC, -"for IsMutableDigraph and an empty list", -[IsMutableDigraph, IsList and IsEmpty], -{_, dummy} -> EmptyDigraph(IsMutableDigraph, 0)); - -InstallMethod(DigraphByAdjacencyMatrixCons, -"for IsImmutableDigraph and a homogeneous list", -[IsImmutableDigraph, IsHomogeneousList], -function(_, mat) - local D; - D := MakeImmutable(DigraphByAdjacencyMatrixCons(IsMutableDigraph, mat)); - if IsEmpty(mat) or IsInt(mat[1][1]) then - SetAdjacencyMatrix(D, mat); - else - Assert(1, IsBool(mat[1][1])); - SetBooleanAdjacencyMatrix(D, mat); - fi; - return D; -end); - -InstallMethod(DigraphByAdjacencyMatrix, "for a function and a homogeneous list", -[IsFunction, IsHomogeneousList], -DigraphByAdjacencyMatrixCons); - -InstallMethod(DigraphByAdjacencyMatrix, "for a homogeneous list", -[IsHomogeneousList], -mat -> DigraphByAdjacencyMatrixCons(IsImmutableDigraph, mat)); - -InstallMethod(DigraphByEdgesCons, -"for IsMutableDigraph, a list, and an integer", -[IsMutableDigraph, IsList, IsInt], -function(_, edges, n) - local pos, list, edge; - if IsEmpty(edges) then - return NullDigraph(IsMutableDigraph, n); - fi; - pos := 0; - for edge in edges do - pos := pos + 1; - if not IsList(edge) then - ErrorNoReturn("the 1st argument (list of edges) must be a list of ", - "lists, but found ", - TNAM_OBJ(edge), - " in position ", - pos); - elif Length(edge) <> 2 then - ErrorNoReturn("the 1st argument (list of edges) must be a list of lists ", - "of length 2, found ", edge, " (length ", Length(edge), - " in position ", pos, ")"); - elif not IsPosInt(edge[1]) or not IsPosInt(edge[2]) then - ErrorNoReturn("the 1st argument (list of edges) must be pairs of ", - "positive integers but found ", edge, " in position ", pos); - elif edge[1] > n or edge[2] > n then - ErrorNoReturn("the 1st argument (list of edges) must be pairs of ", - "positive integers <= ", n, " but found ", edge, - " in position ", pos); - fi; - od; - list := List([1 .. n], x -> []); - for edge in edges do - Add(list[edge[1]], edge[2]); - od; - return DigraphNC(IsMutableDigraph, list); -end); - -InstallMethod(DigraphByEdgesCons, "for IsMutableDigraph and a list", -[IsMutableDigraph, IsList], -function(_, edges) - local n; - if IsEmpty(edges) then - n := 0; - else - n := Maximum(List(edges, Maximum)); - fi; - return DigraphByEdgesCons(IsMutableDigraph, edges, n); -end); - -InstallMethod(DigraphByEdgesCons, "for an ImmutableDigraph and a list", -[IsImmutableDigraph, IsList], -function(_, edges) - local D; - D := MakeImmutable(DigraphByEdges(IsMutableDigraph, edges)); - SetDigraphEdges(D, edges); - SetDigraphNrEdges(D, Length(edges)); - return D; -end); - -InstallMethod(DigraphByEdgesCons, -"for IsImmutableDigraph, a list, and an integer", -[IsImmutableDigraph, IsList, IsInt], -function(_, edges, n) - local D; - D := MakeImmutable(DigraphByEdges(IsMutableDigraph, edges, n)); - SetDigraphEdges(D, edges); - SetDigraphNrEdges(D, Length(edges)); - return D; -end); - -InstallMethod(DigraphByEdges, "for a list and an integer", -[IsList, IsInt], -{edges, n} -> DigraphByEdgesCons(IsImmutableDigraph, edges, n)); - -InstallMethod(DigraphByEdges, "for a list", [IsList], -edges -> DigraphByEdgesCons(IsImmutableDigraph, edges)); - -InstallMethod(DigraphByEdges, "for a function, a list, and an integer", -[IsFunction, IsList, IsInt], DigraphByEdgesCons); - -InstallMethod(DigraphByEdges, "for a function and a list", -[IsFunction, IsList], DigraphByEdgesCons); - -InstallMethod(DigraphByInNeighboursCons, "for IsMutableDigraph, and a list", -[IsMutableDigraph, IsList], -function(_, list) - local n, x; - n := Length(list); # number of vertices - for x in list do - if not ForAll(x, i -> IsPosInt(i) and i <= n) then - ErrorNoReturn("the argument must be a list of lists of positive ", - "integers not exceeding the length of the argument,"); - fi; - od; - return DigraphByInNeighboursConsNC(IsMutableDigraph, list); -end); - -InstallMethod(DigraphByInNeighboursCons, "for IsImmutableDigraph and a list", -[IsImmutableDigraph, IsList], -function(_, list) - local D; - D := MakeImmutable(DigraphByInNeighboursCons(IsMutableDigraph, list)); - SetInNeighbours(D, list); - return D; -end); - -InstallMethod(DigraphByInNeighboursConsNC, "for IsMutableDigraph and a list", -[IsMutableDigraph, IsList], -{_, list} -> DigraphNC(IsMutableDigraph, DIGRAPH_IN_OUT_NBS(list))); - -InstallMethod(DigraphByInNeighboursConsNC, "for IsImmutableDigraph and a list", -[IsImmutableDigraph, IsList], -function(_, list) - local D; - D := MakeImmutable(DigraphByInNeighboursConsNC(IsMutableDigraph, list)); - SetInNeighbours(D, list); - return D; -end); - -InstallMethod(DigraphByInNeighbours, "for a list", [IsList], -list -> DigraphByInNeighboursCons(IsImmutableDigraph, list)); - -InstallMethod(DigraphByInNeighbours, "for a function and a list", -[IsFunction, IsList], -DigraphByInNeighboursCons); - -######################################################################## -# 9. Converters to/from other types -> digraph . . . -######################################################################## - -InstallMethod(AsDigraphCons, "for IsMutableDigraph and a binary relation", -[IsMutableDigraph, IsBinaryRelation], -function(_, rel) - local dom, list, i; - dom := GeneratorsOfDomain(UnderlyingDomainOfBinaryRelation(rel)); - if not IsRange(dom) or dom[1] <> 1 then - ErrorNoReturn("the argument must be a binary relation ", - "on the domain [1 .. n] for some positive integer n,"); - fi; - list := EmptyPlist(Length(dom)); - for i in dom do - list[i] := ImagesElm(rel, i); - od; - return Digraph(IsMutableDigraph, list); -end); - -InstallMethod(AsDigraphCons, "for IsImmutableDigraph and a binary relation", -[IsImmutableDigraph, IsBinaryRelation], -function(_, rel) - local D; - D := MakeImmutable(AsDigraph(IsMutableDigraph, rel)); - SetIsMultiDigraph(D, false); - if HasIsReflexiveBinaryRelation(rel) then - SetIsReflexiveDigraph(D, IsReflexiveBinaryRelation(rel)); - fi; - if HasIsSymmetricBinaryRelation(rel) then - SetIsSymmetricDigraph(D, IsSymmetricBinaryRelation(rel)); - fi; - if HasIsTransitiveBinaryRelation(rel) then - SetIsTransitiveDigraph(D, IsTransitiveBinaryRelation(rel)); - fi; - if HasIsAntisymmetricBinaryRelation(rel) then - SetIsAntisymmetricDigraph(D, IsAntisymmetricBinaryRelation(rel)); - fi; - return D; -end); - -InstallMethod(AsDigraph, "for a binary relation", [IsBinaryRelation], -rel -> AsDigraphCons(IsImmutableDigraph, rel)); - -InstallMethod(AsDigraph, "for a function and a binary relation", -[IsFunction, IsBinaryRelation], AsDigraphCons); - -InstallMethod(AsDigraphCons, -"for IsMutableDigraph, a transformation, and an integer", -[IsMutableDigraph, IsTransformation, IsInt], -function(_, f, n) - local list, x, i; - if n < 0 then - ErrorNoReturn("the 2nd argument should be a non-negative integer,"); - fi; - - list := EmptyPlist(n); - for i in [1 .. n] do - x := i ^ f; - if x > n then - return fail; - fi; - list[i] := [x]; - od; - return DigraphNC(IsMutableDigraph, list); -end); - -InstallMethod(AsDigraphCons, -"for IsImmutableDigraph, a transformation, and an integer", -[IsImmutableDigraph, IsTransformation, IsInt], -function(_, f, n) - local D; - D := AsDigraph(IsMutableDigraph, f, n); - if D <> fail then - D := MakeImmutable(D); - SetDigraphNrEdges(D, n); - SetIsMultiDigraph(D, false); - SetIsFunctionalDigraph(D, true); - fi; - return D; -end); - -InstallMethod(AsDigraph, "for a function, a transformation, and an integer", -[IsFunction, IsTransformation, IsInt], AsDigraphCons); - -InstallMethod(AsDigraph, "for a transformation and an integer", -[IsTransformation, IsInt], -{t, n} -> AsDigraphCons(IsImmutableDigraph, t, n)); - -InstallMethod(AsDigraph, "for a function and a transformation", -[IsFunction, IsTransformation], -{func, t} -> AsDigraphCons(func, t, DegreeOfTransformation(t))); - -InstallMethod(AsDigraph, "for a transformation", [IsTransformation], -t -> AsDigraphCons(IsImmutableDigraph, t, DegreeOfTransformation(t))); - -InstallMethod(AsDigraph, "for a function, a perm, and an integer", -[IsFunction, IsPerm, IsInt], -{func, p, n} -> AsDigraphCons(func, AsTransformation(p), n)); - -InstallMethod(AsDigraph, "for a perm and an integer", -[IsPerm, IsInt], -{p, n} -> AsDigraph(AsTransformation(p), n)); - -InstallMethod(AsDigraph, "for a function and a perm", -[IsFunction, IsPerm], -{func, p} -> AsDigraph(func, AsTransformation(p))); - -InstallMethod(AsDigraph, "for a perm", [IsPerm], -p -> AsDigraph(AsTransformation(p))); - -InstallMethod(AsDigraphCons, -"for IsMutableDigraph, a partial perm, and an integer", -[IsMutableDigraph, IsPartialPerm, IsInt], -function(_, f, n) - local list, x, i; - if n < 0 then - ErrorNoReturn("the 2nd argument should be a non-negative integer,"); - fi; - - list := EmptyPlist(n); - for i in [1 .. n] do - x := i ^ f; - if x > n then - return fail; - elif x <> 0 then - list[i] := [x]; - else - list[i] := []; - fi; - od; - return DigraphNC(IsMutableDigraph, list); -end); - -InstallMethod(AsDigraphCons, -"for IsImmutableDigraph, a partial perm, and an integer", -[IsImmutableDigraph, IsPartialPerm, IsInt], -function(_, f, n) - local D; - D := AsDigraph(IsMutableDigraph, f, n); - if D <> fail then - D := MakeImmutable(D); - SetIsMultiDigraph(D, false); - fi; - return D; -end); - -InstallMethod(AsDigraph, "for a function, a partial perm, and an integer", -[IsFunction, IsPartialPerm, IsInt], AsDigraphCons); - -InstallMethod(AsDigraph, "for a partial perm and an integer", -[IsPartialPerm, IsInt], -{t, n} -> AsDigraphCons(IsImmutableDigraph, t, n)); - -InstallMethod(AsDigraph, "for a function and a partial perm", -[IsFunction, IsPartialPerm], -{func, t} -> AsDigraphCons(func, t, Maximum(DegreeOfPartialPerm(t), - CodegreeOfPartialPerm(t)))); - -InstallMethod(AsDigraph, "for a partial perm", [IsPartialPerm], -t -> AsDigraphCons(IsImmutableDigraph, t, Maximum(DegreeOfPartialPerm(t), - CodegreeOfPartialPerm(t)))); - -InstallMethod(AsBinaryRelation, "for a digraph", [IsDigraphByOutNeighboursRep], -function(D) - local rel; - if DigraphHasNoVertices(D) then - ErrorNoReturn("the argument must be a digraph with at least 1 ", - "vertex,"); - elif IsMultiDigraph(D) then - ErrorNoReturn("the argument must be a digraph with no multiple edges"); - fi; - # Can translate known attributes of to the relation, e.g. symmetry - rel := BinaryRelationOnPointsNC(OutNeighbours(D)); - if HasIsReflexiveDigraph(D) then - SetIsReflexiveBinaryRelation(rel, IsReflexiveDigraph(D)); - fi; - if HasIsSymmetricDigraph(D) then - SetIsSymmetricBinaryRelation(rel, IsSymmetricDigraph(D)); - fi; - if HasIsTransitiveDigraph(D) then - SetIsTransitiveBinaryRelation(rel, IsTransitiveDigraph(D)); - fi; - if HasIsAntisymmetricDigraph(D) then - SetIsAntisymmetricBinaryRelation(rel, IsAntisymmetricDigraph(D)); - fi; - return rel; -end); - -InstallMethod(AsSemigroup, "for a function and a digraph", -[IsFunction, IsDigraph], -function(filt, D) - local red, top, im, max, n, gens, i; - - if filt <> IsPartialPermSemigroup then - TryNextMethod(); - elif not IsJoinSemilatticeDigraph(D) then - if IsMeetSemilatticeDigraph(D) then - return AsSemigroup(IsPartialPermSemigroup, - DigraphReverse(DigraphMutableCopyIfMutable(D))); - fi; - ErrorNoReturn("the 2nd argument must be digraph that is a join or ", - "meet semilattice,"); - fi; - - D := DigraphMutableCopyIfMutable(D); - red := DigraphReflexiveTransitiveReduction(D); - top := DigraphTopologicalSort(D); - # im[i] will store the image of the idempotent partial perm corresponding to - # vertex i of the argument - im := []; - im[top[1]] := []; - max := 1; - - n := DigraphNrVertices(D); - # For each vertex, the corresponding idempotent has an image - # containing all images of idempotents below it. - for i in [2 .. n] do - im[top[i]] := Union(List(OutNeighboursOfVertex(red, top[i]), j -> im[j])); - # When there is only one neighbour, we must add a point to the image to - # distinguish the two idempotent partial perms. - if Length(OutNeighboursOfVertex(red, top[i])) = 1 then - Add(im[top[i]], max); - max := max + 1; - fi; - od; - - # Determine a small generating set - gens := Filtered([1 .. n], j -> Size(InNeighboursOfVertex(red, j)) < 2); - return Semigroup(List(gens, g -> PartialPerm(im[g], im[g]))); -end); - -InstallMethod(AsMonoid, "for a function and a digraph", -[IsFunction, IsDigraph], -function(filt, D) - if not (filt = IsPartialPermMonoid or filt = IsPartialPermSemigroup) then - ErrorNoReturn("the 1st argument must be IsPartialPermMonoid or ", - "IsPartialPermSemigroup,"); - elif not IsLatticeDigraph(D) then - ErrorNoReturn("the 2nd argument must be a lattice digraph,"); - fi; - return AsSemigroup(IsPartialPermSemigroup, D); -end); - -InstallMethod(AsSemigroup, -"for a function, a digraph, and a dense list", -[IsFunction, IsDigraph, IsDenseList, IsDenseList], -function(filt, digraph, gps, homs) - local red, n, hom_table, reps, rep, top, doms, starts, degs, max, gens, img, - start, deg, x, queue, j, k, g, y, hom, edge, i, gen; - - if filt <> IsPartialPermSemigroup then - TryNextMethod(); - elif not IsJoinSemilatticeDigraph(digraph) then - if IsMeetSemilatticeDigraph(digraph) then - return AsSemigroup(IsPartialPermSemigroup, - DigraphReverse(DigraphMutableCopyIfMutable(digraph)), - gps, - homs); - else - ErrorNoReturn("the second argument must be a join semilattice ", - "digraph or a meet semilattice digraph,"); - fi; - elif not ForAll(gps, IsGroup) then - ErrorNoReturn("the third argument must be a list of groups,"); - elif not Length(gps) = DigraphNrVertices(digraph) then - ErrorNoReturn("the third argument must have length equal to the number ", - "of vertices in the second argument,"); - fi; - - digraph := DigraphMutableCopyIfMutable(digraph); - red := DigraphReflexiveTransitiveReduction(digraph); - MakeImmutable(digraph); - if not Length(homs) = DigraphNrEdges(red) or - not ForAll(homs, x -> Length(x) = 3 and - IsPosInt(x[1]) and - IsPosInt(x[2]) and - IsDigraphEdge(red, [x[1], x[2]]) and - IsGroupHomomorphism(x[3]) and - Source(x[3]) = gps[x[1]] and - Range(x[3]) = gps[x[2]]) then - ErrorNoReturn("the third argument must be a list of triples [i, j, hom] ", - "of length equal to the number of edges in the reflexive ", - "transitive reduction of the second argument, where [i, j] ", - "is an edge in the reflex transitive reduction and hom is ", - "a group homomorphism from group i to group j,"); - fi; - - n := DigraphNrVertices(digraph); - - hom_table := List([1 .. n], x -> []); - for hom in homs do - hom_table[hom[1]][hom[2]] := hom[3]; - od; - - for edge in DigraphEdges(red) do - if not IsBound(hom_table[edge[1]][edge[2]]) then - ErrorNoReturn("the fourth argument must contain a triple [i, j, hom] ", - "for each edge [i, j] in the reflexive transitive ", - "reduction of the second argument,"); - fi; - od; - - reps := []; - for i in [1 .. n] do - rep := IsomorphismPermGroup(gps[i]); - rep := rep * SmallerDegreePermutationRepresentation(Image(rep)); - Add(reps, rep); - od; - - top := DigraphTopologicalSort(digraph); - doms := []; - starts := []; - degs := List([1 .. n], i -> NrMovedPoints(Image(reps[i]))); - for i in [1 .. n] do - if degs[i] = 0 then - degs[i] := 1; - fi; - od; - max := degs[top[1]] + 1; - doms[top[1]] := [1 .. max - 1]; - starts[top[1]] := 1; - - for i in [2 .. n] do - doms[top[i]] := Union(List(OutNeighboursOfVertex(red, top[i]), - j -> doms[j])); - Append(doms[top[i]], [max .. max + degs[top[i]] - 1]); - starts[top[i]] := max; - max := max + degs[top[i]]; - od; - - gens := []; - for i in [1 .. n] do - for gen in GeneratorsOfGroup(gps[top[i]]) do - img := []; - start := starts[top[i]]; - deg := degs[top[i]]; - x := ListPerm(gen ^ reps[top[i]]); - - # make sure the partial permutation is defined on the whole domain - img{[start .. start + deg - 1]} := [1 .. deg] + start - 1; - # now the actual representation - img{[start .. start + Length(x) - 1]} := x + start - 1; - - # travel up all the paths from top[i], applying the homomorphisms - # and storing the results as permutations on the appropriate set - # of points - queue := List(OutNeighboursOfVertex(red, top[i]), y -> [top[i], y, gen]); - while Length(queue) > 0 do - j := queue[1][1]; - k := queue[1][2]; - g := queue[1][3]; - start := starts[k]; - deg := degs[k]; - Remove(queue, 1); - x := g ^ hom_table[j][k]; - Append(queue, List(OutNeighboursOfVertex(red, k), y -> [k, y, x])); - x := x ^ reps[k]; - - # Check that compositions of homomorphisms commute. - # If img[start] is bound then we have already found some composition of - # homomorphisms which takes us into gps[k], so we must ensure that this - # agrees with the composition we are currently considering. - if IsBound(img[start]) then - y := PermList(img{[start .. start + deg - 1]} - start + 1); - if x <> y then - ErrorNoReturn("the homomorphisms given must form a commutative", - " diagram,"); - fi; - fi; - x := ListPerm(x); - img{[start .. start + deg - 1]} := [1 .. deg] + start - 1; - img{[start .. start + Length(x) - 1]} := x + start - 1; - od; - img := Compacted(img); - Add(gens, PartialPerm(doms[top[i]], img)); - od; - od; - return Semigroup(gens); -end); - -######################################################################## -# 10. Random digraphs -######################################################################## - -InstallMethod(RandomDigraphCons, "for IsMutableDigraph and an integer", -[IsMutableDigraph, IsInt], -{_, n} --> RandomDigraphCons(IsMutableDigraph, n, Float(Random([0 .. n])) / n)); - -InstallMethod(RandomDigraphCons, "for IsMutableDigraph and an integer", -[IsImmutableDigraph, IsInt], -{_, n} --> RandomDigraphCons(IsImmutableDigraph, n, Float(Random([0 .. n])) / n)); - -InstallMethod(RandomDigraphCons, "for IsHamiltonianDigraph and an integer", -[IsHamiltonianDigraph, IsInt], -{_, n} --> RandomDigraphCons(IsHamiltonianDigraph, n, Float(Random([0 .. n])) / n)); - -InstallMethod(RandomDigraphCons, "for IsEulerianDigraph and an integer", -[IsEulerianDigraph, IsInt], -{_, n} --> RandomDigraphCons(IsEulerianDigraph, n, Float(Random([0 .. n])) / n)); - -InstallMethod(RandomDigraphCons, "for IsConnectedDigraph and an integer", -[IsConnectedDigraph, IsInt], -{_, n} --> RandomDigraphCons(IsConnectedDigraph, n, Float(Random([0 .. n])) / n)); - -InstallMethod(RandomDigraphCons, "for IsAcyclicDigraph and an integer", -[IsAcyclicDigraph, IsInt], -{_, n} --> RandomDigraphCons(IsAcyclicDigraph, n, Float(Random([0 .. n])) / n)); - -InstallMethod(RandomDigraphCons, "for IsSymmetricDigraph and an integer", -[IsSymmetricDigraph, IsInt], -{_, n} --> RandomDigraphCons(IsSymmetricDigraph, n, Float(Random([0 .. n])) / n)); - -InstallMethod(RandomDigraphCons, -"for IsMutableDigraph, an integer, and a rational", -[IsMutableDigraph, IsInt, IsRat], -{_, n, p} -> RandomDigraphCons(IsMutableDigraph, n, Float(p))); - -InstallMethod(RandomDigraphCons, -"for IsImmutableDigraph, an integer, and a rational", -[IsImmutableDigraph, IsInt, IsRat], -{_, n, p} -> RandomDigraphCons(IsImmutableDigraph, n, Float(p))); - -InstallMethod(RandomDigraphCons, -"for IsHamiltonianDigraph, an integer, and a rational", -[IsHamiltonianDigraph, IsInt, IsRat], -{_, n, p} -> RandomDigraphCons(IsHamiltonianDigraph, n, Float(p))); - -InstallMethod(RandomDigraphCons, -"for IsEulerianDigraph, an integer, and a rational", -[IsEulerianDigraph, IsInt, IsRat], -{_, n, p} -> RandomDigraphCons(IsEulerianDigraph, n, Float(p))); - -InstallMethod(RandomDigraphCons, -"for IsConnectedDigraph, an integer, and a rational", -[IsConnectedDigraph, IsInt, IsRat], -{_, n, p} -> RandomDigraphCons(IsConnectedDigraph, n, Float(p))); - -InstallMethod(RandomDigraphCons, -"for IsStronglyConnectedDigraph, an integer, and a rational", -[IsStronglyConnectedDigraph, IsInt, IsRat], -{filt, n, p} -> RandomDigraphCons(IsStronglyConnectedDigraph, n, Float(p))); - -InstallMethod(RandomDigraphCons, -"for IsAcyclicDigraph, an integer, and a rational", -[IsAcyclicDigraph, IsInt, IsRat], -{_, n, p} -> RandomDigraphCons(IsAcyclicDigraph, n, Float(p))); - -InstallMethod(RandomDigraphCons, -"for IsSymmetricDigraph, an integer, and a rational", -[IsSymmetricDigraph, IsInt, IsRat], -{_, n, p} -> RandomDigraphCons(IsSymmetricDigraph, n, Float(p))); - -InstallMethod(RandomDigraphCons, -"for IsMutableDigraph, a positive integer, and a float", -[IsMutableDigraph, IsPosInt, IsFloat], -function(_, n, p) - if p < 0.0 or 1.0 < p then - ErrorNoReturn("the 2nd argument

must be between 0 and 1,"); - fi; - return DigraphNC(IsMutableDigraph, RANDOM_DIGRAPH(n, Int(p * 10000))); -end); - -# This function takes an existing adjacency list after solely creating -# a Hamiltonian cycle or tree, and randomly adds edges between all -# remaining vertices in the graph. -BindGlobal("DIGRAPHS_FillOutGraph", function(n, p, adjacencyList) - local vertices, probability, i, j; - - vertices := [1 .. n]; - probability := [0 .. 99]; - - for i in vertices do - for j in vertices do - if (not (j in adjacencyList[i])) then - if Float(Random(probability) / 100) < p then - Add(adjacencyList[i], j); - fi; - fi; - od; - od; - - return adjacencyList; -end); - -InstallMethod(RandomDigraphCons, -"for IsHamiltonianDigraph, a positive integer, and a float", -[IsHamiltonianDigraph, IsPosInt, IsFloat], -function(_, n, p) - local adjacencyList, vertices, i, startVertex, hamiltonianCycle, x, j; - - adjacencyList := EmptyPlist(n); - - vertices := [1 .. n]; - - for i in vertices do - Add(adjacencyList, []); - od; - - # Edge Case - if n = 1 then - if Float(Random([0 .. 99]) / 100) < p then - Add(adjacencyList[1], 1); - fi; - return DigraphNC(adjacencyList); - fi; - - # Starting from a random vertex, we create a Hamiltonian cycle - startVertex := Remove(vertices, Random(vertices)); - hamiltonianCycle := EmptyPlist(n); - hamiltonianCycle[1] := startVertex; - - # While there are remaining n-1 vertices to be added to the Hamiltonian - # cycle - for x in [1 .. n - 1] do - # Create a random edge from the last vertex in the cycle - # to a random vertex not in the cycle - i := hamiltonianCycle[x]; - j := Remove(vertices, Random([1 .. Length(vertices)])); - Add(hamiltonianCycle, j); - Add(adjacencyList[i], j); - od; - - Add(adjacencyList[hamiltonianCycle[n]], startVertex); - - # Once we have created a Hamiltonian cycle, fill out the rest of the graph - # with random edges according to p - adjacencyList := DIGRAPHS_FillOutGraph(n, p, adjacencyList); - - return DigraphNC(adjacencyList); -end); - -InstallMethod(RandomDigraphCons, -"for IsEulerianDigraph, a positive integer, and a float", -[IsEulerianDigraph, IsPosInt, IsFloat], -function(_, n, p) - local adjacencyList, vertices, probability, startVertex, circuitVertex, i, - continueCircuit, verticesToConsider, connectedVertices, verticesToCheck; - - adjacencyList := EmptyPlist(n); - - vertices := [1 .. n]; - probability := [0 .. 99]; - - for i in vertices do - Add(adjacencyList, []); - od; - - # Edge Case - if n = 1 then - if Float(Random(probability) / 100) < p then - Add(adjacencyList[1], 1); - fi; - return DigraphNC(adjacencyList); - fi; - - # Starting from a random vertex, we create an Eulerian circuit - startVertex := Random(vertices); - circuitVertex := startVertex; - continueCircuit := true; - - # This will keep track of the vertices left to consider when deciding - # whether to extend the cycle. For example, if we want to extend from the - # current circuitVertex, we can check - verticesToConsider[circuitVertex] - - # to see which vertices it hasn't previously considered. - verticesToConsider := EmptyPlist(n); - for i in vertices do - Add(verticesToConsider, [1 .. n]); - od; - - # Eulerian graphs must be connected, so we store a list of connected - # vertices and check if a vertex isn't in the list - connectedVertices := [startVertex]; - - while continueCircuit do - while Length(verticesToConsider[circuitVertex]) > 0 do - # From the remaining vertices to check, select a random one to see - # if an edge will be added - i := Random(verticesToConsider[circuitVertex]); - Remove(verticesToConsider[circuitVertex], - Position(verticesToConsider[circuitVertex], i)); - - # Check that the edge doesn't already exist - if (not (i in adjacencyList[circuitVertex])) then - # First we guarantee that we get a connected graph by checking - # if the vertex isn't already connected - if (not (i in connectedVertices)) then - Add(adjacencyList[circuitVertex], i); - Add(connectedVertices, i); - circuitVertex := i; - break; - elif Float(Random(probability) / 100) < p then - Add(adjacencyList[circuitVertex], i); - circuitVertex := i; - break; - fi; - fi; - od; - - # If there are not more vertices to consider, we can end the circuit - if Length(verticesToConsider[circuitVertex]) = 0 then - continueCircuit := false; - fi; - od; - - # Finish the circuit by adding an edge back to the start vertex - # (if it isn't already at the start vertex) - if circuitVertex <> startVertex then - # If an edge already exists between the finish vertex and the start - # vertex, we must find another path to the start vertex to avoid - # generating a multidigraph. - while (startVertex in adjacencyList[circuitVertex]) do - # Here we consider all possible edges again, including previously - # rejected edges, to guarantee a path back to the start - verticesToCheck := [1 .. n]; - while Length(verticesToCheck) > 0 do - i := Remove(verticesToCheck, - Random([1 .. Length(verticesToCheck)])); - if (not (i in adjacencyList[circuitVertex])) then - Add(adjacencyList[circuitVertex], i); - circuitVertex := i; - break; - fi; - od; - od; - Add(adjacencyList[circuitVertex], startVertex); - fi; - - return DigraphNC(adjacencyList); -end); - -InstallMethod(RandomDigraphCons, -"for IsConnectedDigraph, a positive integer, and a float", -[IsConnectedDigraph, IsPosInt, IsFloat], -function(_, n, p) - local adjacencyList, vertices, startVertex, tree, x, i, j; - - adjacencyList := EmptyPlist(n); - - vertices := [1 .. n]; - - for i in vertices do - Add(adjacencyList, []); - od; - - # Starting from a random vertex, we first create a tree to guarantee - # connectivity - startVertex := Remove(vertices, Random(vertices)); - tree := [startVertex]; - - # While there are n-1 remaining vertices to be added to the tree - for x in [1 .. n - 1] do - # Create an edge from a random vertex in the tree, to a random vertex - # outside of it - i := Random(tree); - j := Remove(vertices, Random([1 .. Length(vertices)])); - Add(tree, j); - Add(adjacencyList[i], j); - od; - - # Once the tree has been created, we fill out the rest of the graph with - # random edges according to p - adjacencyList := DIGRAPHS_FillOutGraph(n, p, adjacencyList); - return DigraphNC(adjacencyList); -end); - -InstallMethod(RandomDigraphCons, -"for IsStronglyConnectedDigraph, a positive integer, and a float", -[IsStronglyConnectedDigraph, IsPosInt, IsFloat], -function(_, n, p) - local d, adjMatrix, stronglyConnectedComponents, - scc_a, scc_b, i, random_u, random_v; - - d := RandomDigraph(n, p); - - stronglyConnectedComponents := DigraphStronglyConnectedComponents(d); - - adjMatrix := AdjacencyMatrixMutableCopy(d); - - for i in [1 .. Size(stronglyConnectedComponents.comps) - 1] do - scc_a := stronglyConnectedComponents.comps[i]; - scc_b := stronglyConnectedComponents.comps[i + 1]; - - # add a connection from u to v - random_u := Random(scc_a); - random_v := Random(scc_b); - - adjMatrix[random_u][random_v] := 1; - od; - - # connect end scc to first scc - scc_a := stronglyConnectedComponents.comps[ - Size(stronglyConnectedComponents.comps)]; - scc_b := stronglyConnectedComponents.comps[1]; - - # add a connection from u to v - random_u := Random(scc_a); - random_v := Random(scc_b); - - adjMatrix[random_u][random_v] := 1; - - return DigraphByAdjacencyMatrix(adjMatrix); -end); - -InstallMethod(RandomDigraphCons, -"for IsAcyclicDigraph, a positive integer, and a float", -[IsAcyclicDigraph, IsPosInt, IsFloat], -function(_, n, p) - local adjacencyList, vertices, probability, i, j; - - adjacencyList := EmptyPlist(n); - - vertices := [1 .. n]; - probability := [0 .. 99]; - - for i in vertices do - Add(adjacencyList, []); - od; - - # We shuffle the vertices and treat the order of the vertices as a - # hierarchy where all vertices to the right of a vertex in the list are - # potential edges. This idea is that the edges flow downwards in the - # hierarchy, avoiding cycles. - Shuffle(vertices); - - # From position i in the list, we consider all vertices j to the right of i - for i in vertices do - for j in [i + 1 .. n] do - if Float(Random(probability) / 100) < p then - Add(adjacencyList[vertices[i]], vertices[j]); - fi; - od; - od; - - return DigraphNC(adjacencyList); -end); - -InstallMethod(RandomDigraphCons, -"for IsSymmetricDigraph, a positive integer, and a float", -[IsSymmetricDigraph, IsPosInt, IsFloat], -function(_, n, p) - local adjacencyList, vertices, probability, i, j; - - adjacencyList := EmptyPlist(n); - - vertices := [1 .. n]; - probability := [0 .. 99]; - - for i in vertices do - Add(adjacencyList, []); - od; - - for i in vertices do - for j in [i .. n] do - if Float(Random(probability) / 100) < p then - # If it's a self-loop, only add one edge otherwise we would - # have a multi-edge. - if i = j then - Add(adjacencyList[i], j); - else - Add(adjacencyList[i], j); - Add(adjacencyList[j], i); - fi; - fi; - od; - od; - - return DigraphNC(adjacencyList); -end); - -InstallMethod(RandomDigraphCons, -"for IsImmutableDigraph, a positive integer, and a float", -[IsImmutableDigraph, IsPosInt, IsFloat], -function(_, n, p) - local D; - D := MakeImmutable(RandomDigraphCons(IsMutableDigraph, n, p)); - SetIsMultiDigraph(D, false); - return D; -end); - -InstallMethod(RandomDigraph, "for a pos int", [IsPosInt], -n -> RandomDigraphCons(IsImmutableDigraph, n)); - -InstallMethod(RandomDigraph, "for a pos int and a rational", [IsPosInt, IsRat], -{n, p} -> RandomDigraphCons(IsImmutableDigraph, n, p)); - -InstallMethod(RandomDigraph, "for a pos int and a float", [IsPosInt, IsFloat], -{n, p} -> RandomDigraphCons(IsImmutableDigraph, n, p)); - -InstallMethod(RandomDigraph, "for a func and a pos int", [IsFunction, IsPosInt], -RandomDigraphCons); - -InstallMethod(RandomDigraph, "for a func, a pos int, and a rational", -[IsFunction, IsPosInt, IsRat], RandomDigraphCons); - -InstallMethod(RandomDigraph, "for a func, a pos int, and a float", -[IsFunction, IsPosInt, IsFloat], RandomDigraphCons); - -InstallMethod(RandomMultiDigraph, "for a pos int", [IsPosInt], -n -> RandomMultiDigraph(n, Random([1 .. (n * (n - 1)) / 2]))); - -InstallMethod(RandomMultiDigraph, "for two pos ints", [IsPosInt, IsPosInt], -{n, m} -> DigraphNC(RANDOM_MULTI_DIGRAPH(n, m))); - -InstallMethod(RandomTournamentCons, "for IsMutableDigraph and an integer", -[IsMutableDigraph, IsInt], -function(_, n) - local choice, nodes, list, v, w; - if n < 0 then - ErrorNoReturn("the argument must be a non-negative integer,"); - elif n = 0 then - return EmptyDigraph(IsMutableDigraph, 0); - fi; - choice := [true, false]; - nodes := [1 .. n]; - list := List(nodes, x -> []); - for v in nodes do - for w in [(v + 1) .. n] do - if Random(choice) then - Add(list[v], w); - else - Add(list[w], v); - fi; - od; - od; - return DigraphNC(IsMutableDigraph, list); -end); - -InstallMethod(RandomTournamentCons, "for IsImmutableDigraph and an integer", -[IsImmutableDigraph, IsInt], -function(_, n) - local D; - D := MakeImmutable(RandomTournamentCons(IsMutableDigraph, n)); - SetIsTournament(D, true); - SetIsMultiDigraph(D, false); - SetIsSymmetricDigraph(D, n <= 1); - SetIsEmptyDigraph(D, n <= 1); - SetDigraphHasLoops(D, false); - SetDigraphNrEdges(D, Binomial(n, 2)); - return D; -end); - -InstallMethod(RandomTournament, "for an integer", [IsInt], -n -> RandomTournamentCons(IsImmutableDigraph, n)); - -InstallMethod(RandomTournament, "for a func and an integer", -[IsFunction, IsInt], {func, n} -> RandomTournamentCons(func, n)); - -InstallMethod(RandomLatticeCons, "for IsMutableDigraph and a pos int", -[IsMutableDigraph, IsPosInt], -function(_, n) - local fam, rand_blist; - - fam := [BlistList([1 .. n], [])]; - - while Length(fam) < n do - rand_blist := List([1 .. n], x -> Random([true, false])); - UniteSet(fam, List(fam, x -> UnionBlist(x, rand_blist))); - od; - - return Digraph(IsMutableDigraph, fam, IsSubsetBlist); -end); - -InstallMethod(RandomLatticeCons, "for IsImmutableDigraph and a pos int", -[IsImmutableDigraph, IsPosInt], -function(_, n) - local D; - D := MakeImmutable(RandomLatticeCons(IsMutableDigraph, n)); - SetIsLatticeDigraph(D, true); - return D; -end); - -InstallMethod(RandomLattice, "for a pos int", [IsPosInt], -n -> RandomLatticeCons(IsImmutableDigraph, n)); - -InstallMethod(RandomLattice, "for a func and a pos int", [IsFunction, IsPosInt], -RandomLatticeCons); diff --git a/src/pkgconfig.h.in~ b/src/pkgconfig.h.in~ deleted file mode 100644 index 8ec139a7f..000000000 --- a/src/pkgconfig.h.in~ +++ /dev/null @@ -1,72 +0,0 @@ -/* src/pkgconfig.h.in. Generated from configure.ac by autoheader. */ - -/* define if building in stats mode */ -#undef ENABLE_STATS - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `bliss' library (-lbliss). */ -#undef HAVE_LIBBLISS - -/* Define to 1 if you have the `planarity' library (-lplanarity). */ -#undef HAVE_LIBPLANARITY - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if the system has the `__builtin_ctzll' built-in function */ -#undef HAVE___BUILTIN_CTZLL - -/* define if building in debug mode */ -#undef KERNEL_DEBUG - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if all of the C90 standard headers exist (not just the ones - required in a freestanding environment). This macro is provided for - backward compatibility; new code need not use it. */ -#undef STDC_HEADERS - -/* define that we should use the vendored bliss */ -#undef WITH_INCLUDED_BLISS - -/* define that we should use the vendored planarity */ -#undef WITH_INCLUDED_PLANARITY From 73afcc586b252d6fd09b4c096fc020722c1b4bce Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Thu, 25 Sep 2025 12:18:31 +0100 Subject: [PATCH 19/25] fixed typo in doc --- doc/prop.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/prop.xml b/doc/prop.xml index 4fd2d8539..38fff9e32 100644 --- a/doc/prop.xml +++ b/doc/prop.xml @@ -1596,11 +1596,11 @@ false]]> If digraph is a digraph without multiple edges, then Is2EdgeTransitive returns true if digraph is 2-edge transitive, and false - otherwise. A digraph is 2-edge transitive if its automorphism group - acts transitively on 2-edges via the action - . If digraph<\A> is a digraph with multiple edges, then Is2EdgeTransitive<\C> returns an error. + otherwise. If digraph has multiple edges, then Is2EdgeTransitive returns an error. - A 2-edge in a digraph is a triple (u, v, w) of distinct vertices + A digraph is 2-edge transitive if its automorphism group + acts transitively on 2-edges via the action + . A 2-edge in a digraph is a triple (u, v, w) of distinct vertices such that (u, v) and (v, w) are edges.

From 6c6ab19f1f2a4f4266fb747711b370f8379e4a9a Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Thu, 30 Oct 2025 11:42:52 +0000 Subject: [PATCH 20/25] Added new Is2EdgeTransitive draft without bug --- gap/prop.gd | 3 ++ gap/prop.gi | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) diff --git a/gap/prop.gd b/gap/prop.gd index 5ef95bbd0..6d40100d8 100644 --- a/gap/prop.gd +++ b/gap/prop.gd @@ -54,6 +54,9 @@ DeclareProperty("IsPermutationDigraph", IsDigraph); DeclareProperty("IsDistributiveLatticeDigraph", IsDigraph); DeclareProperty("IsModularLatticeDigraph", IsDigraph); DeclareProperty("Is2EdgeTransitive", IsDigraph); +DeclareProperty("Naive", IsDigraph); +DeclareProperty("Faster", IsDigraph); + DeclareSynonymAttr("IsLatticeDigraph", IsMeetSemilatticeDigraph and IsJoinSemilatticeDigraph); DeclareSynonymAttr("IsPreorderDigraph", diff --git a/gap/prop.gi b/gap/prop.gi index 3f4783243..1c9adecbf 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -784,3 +784,99 @@ function(D) fi; od; end); + +InstallMethod(Naive, +"Is2EdgeTransitive O(n^3)", +[IsDigraph], +function(D) + local O, G, n, u, v, w, twoEdges, numTwoEdges; + O := OutNeighbours(D); + n := Length(O); + twoEdges := []; + for u in [1..n] do + for v in O[u] do + for w in O[v] do + if u <> v and v <> w and w <> u then + Add(twoEdges, [u, v, w]); + fi; + od; + od; + od; + numTwoEdges := Length(twoEdges); + if numTwoEdges = 0 then + return true; + else + G := AutomorphismGroup(D); + return numTwoEdges * Order(Stabilizer(G, twoEdges[1], OnTuples)) = Order(G); + fi; +end +); + +InstallMethod(Faster, +"Is2EdgeTransitive O(n^2 + m)", +[IsDigraph], +function(D) + local O, I, G, n, p, q, l, c, p_0, q_0, l_0, c_0, centers, + twoEdge, numTwoEdges, i, j, u, v, w; + O := OutNeighbours(D); + I := InNeighbours(D); + n := Length(O); + p := 0; + q := 0; + l := 0; + c := 0; + centers := []; + for u in [1..n] do + p_0 := Length(I[u]); + q_0 := Length(O[u]); + if u in O[u] then + l_0 := 1; + else + l_0 := 0; + fi; + c_0 := 0; + i := 1; + j := 1; + while i <= Length(O[u]) and j <= Length(I[u]) do + if O[i] < I[j] then + i := i + 1; + elif O[i] > I[j] then + j := j + 1; + else + c_0 := c_0 + 1; + i := i + 1; + j := j + 1; + fi; + od; + if (p_0 - l_0) * (q_0 - l_0) - c_0 > 0 then + Add(centers, u); + if p = 0 then + p := p_0; + q := q_0; + l := l_0; + c := c_0; + else + if p <> p_0 or q <> q_0 or l <> l_0 or c <> c_0 then + return false; + fi; + fi; + fi; + od; + numTwoEdges := ((p-l) * (q - l) - c) * Length(centers); + if numTwoEdges = 0 then + return true; + else + v := centers[1]; + for u in I[v] do + for w in O[v] do + if u <> v and v <> w and w <> u then + twoEdge := [u, v, w]; + G := AutomorphismGroup(D); + return numTwoEdges * Order(Stabilizer(G, twoEdge, OnTuples)) = + Order(G); + fi; + od; + od; + fi; +end +); From dfa8fa9553d1f590e16b924b71010f0db9a88a2e Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Thu, 30 Oct 2025 17:51:42 +0000 Subject: [PATCH 21/25] Added DigraphMinimumCut --- doc/weights.xml | 27 ++++++++++++++ gap/weights.gd | 4 ++- gap/weights.gi | 50 +++++++++++++++++++++++++- tst/standard/weights.tst | 76 +++++++++++++++++++++++++++++++++++++++- 4 files changed, 154 insertions(+), 3 deletions(-) diff --git a/doc/weights.xml b/doc/weights.xml index 6e92ce102..177151787 100644 --- a/doc/weights.xml +++ b/doc/weights.xml @@ -272,6 +272,33 @@ gap> Sum(flow[1]); <#/GAPDoc> +<#GAPDoc Label="DigraphMinimumCut"> + + + A list of lists of integers. + + If digraph is an edge-weighted digraph with distinct vertices start and + destination, this returns a list of two lists representing the components of + a minimum start-destination cut of digraph.

+ + An s-t cut is a partition of the vertices (S, T) such that s is in S and + t is in T. The capacity of an s-t cut is the sum of the weights of every + edge whose source is in S and whose range is in T.

+ + This attribute is computed by using and the + max-cut min-flow theorem.

+ + See . + g := EdgeWeightedDigraph([[2, 2], [3], []], [[3, 2], [1], []]); + +gap> DigraphMinimumCut(g, 1, 3); +[ [ 2, 1 ], [3]] +]]> + + +<#/GAPDoc> + <#GAPDoc Label="RandomUniqueEdgeWeightedDigraph"> diff --git a/gap/weights.gd b/gap/weights.gd index 7d11bf5f7..6930da8da 100644 --- a/gap/weights.gd +++ b/gap/weights.gd @@ -35,9 +35,11 @@ DeclareGlobalFunction("DIGRAPHS_Edge_Weighted_FloydWarshall"); DeclareGlobalFunction("DIGRAPHS_Edge_Weighted_Bellman_Ford"); DeclareGlobalFunction("DIGRAPHS_Edge_Weighted_Dijkstra"); -# 5. Maximum Flow +# 5. Maximum Flow and Minimum Cut DeclareOperation("DigraphMaximumFlow", [IsDigraph and HasEdgeWeights, IsPosInt, IsPosInt]); +DeclareOperation("DigraphMinimumCut", + [IsDigraph and HasEdgeWeights, IsPosInt, IsPosInt]); # 6. Random edge weighted digraphs DeclareOperation("RandomUniqueEdgeWeightedDigraph", [IsPosInt]); diff --git a/gap/weights.gi b/gap/weights.gi index 5b246b002..9cfedf995 100644 --- a/gap/weights.gi +++ b/gap/weights.gi @@ -638,7 +638,7 @@ function(D, source) end); ############################################################################# -# 5. Maximum Flow +# 5. Maximum Flow and Minimum Cut ############################################################################# InstallMethod(DigraphMaximumFlow, "for an edge weighted digraph", @@ -772,6 +772,54 @@ function(D, start, destination) return flows; end); +InstallMethod(DigraphMinimumCut, "for an edge weighted digraph", +[IsDigraph and HasEdgeWeights, IsPosInt, IsPosInt], +function(D, s, t) + local weights, outs, vertices, flow, residuals, G, o, u, v, S, T; + + # Extract important data + weights := EdgeWeights(D); + outs := OutNeighbours(D); + vertices := DigraphVertices(D); + + # Check input + if not s in vertices then + ErrorNoReturn(" must be a vertex of ,"); + elif not t in vertices then + ErrorNoReturn(" must be a vertex of ,"); + elif s = t then + ErrorNoReturn(" and must be distinct"); + fi; + + # Find the residual edge capacities under the maximum flow + flow := DigraphMaximumFlow(D, s, t); + residuals := weights - flow; + + # Construct the digraph containing all edges with nonzero + # residual capacity + G := []; + for u in [1..Length(outs)] do + o := []; + for v in [1..Length(outs[u])] do + if residuals[u][v] > 0 then + Add(o, outs[u][v]); + fi; + od; + Add(G, o); + od; + + G := Digraph(G); + + # Find all vertices reachable from the source in this digraph + # This gives the minimal cut by the max-flow min-cut theorem + S := Filtered(vertices, x -> IsReachable(G, s, x)); + if not s in S then + Add(S, s); + fi; + T := Difference(vertices, S); + return [S, T]; +end); + ############################################################################# # 6. Random edge weighted digraphs ############################################################################# diff --git a/tst/standard/weights.tst b/tst/standard/weights.tst index 80dccaa9f..38f0308ff 100644 --- a/tst/standard/weights.tst +++ b/tst/standard/weights.tst @@ -291,7 +291,7 @@ gap> EdgeWeightedDigraphShortestPath(d, 1, 3); [ [ 1, 2, 3 ], [ 1, 1 ] ] ############################################################################# -# 5. Maximum Flow +# 5. Maximum Flow and Minimum Cut ############################################################################# # Maximum flow: empty digraphs @@ -368,6 +368,80 @@ gap> gr := EdgeWeightedDigraph([[2], [3, 6], [4], [1, 6], [1, 3], []], gap> DigraphMaximumFlow(gr, 5, 6); [ [ 10 ], [ 3, 7 ], [ 7 ], [ 0, 7 ], [ 10, 4 ], [ ] ] +# Minimum cut: empty digraphs +gap> d := EdgeWeightedDigraph([], []); + +gap> DigraphMinimumCut(d, 1, 1); +Error, must be a vertex of , + +# Minimum cut: single vertex (also empty digraphs) +gap> d := EdgeWeightedDigraph([[]], [[]]); + +gap> DigraphMinimumCut(d, 1, 1); +Error, and must be distinct + +# Minimum cut: source = dest +gap> d := EdgeWeightedDigraph([[2], []], [[5], []]); + +gap> DigraphMinimumCut(d, 1, 1); +Error, and must be distinct + +# Minimum cut: has loop +gap> d := EdgeWeightedDigraph([[1, 2], []], [[5, 10], []]); + +gap> DigraphMinimumCut(d, 1, 2); +[ [ 1 ], [ 2 ] ] + +# Minimum cut: invalid source +gap> d := EdgeWeightedDigraph([[1, 2], []], [[5, 10], []]); + +gap> DigraphMinimumCut(d, 5, 2); +Error, must be a vertex of , + +# Minimum cut: invalid sink +gap> d := EdgeWeightedDigraph([[1, 2], []], [[5, 10], []]); + +gap> DigraphMinimumCut(d, 1, 5); +Error, must be a vertex of , + +# Minimum cut: sink not reachable +gap> d := EdgeWeightedDigraph([[1], []], [[5], []]); + +gap> DigraphMinimumCut(d, 1, 2); +[ [ 1 ], [ 2 ] ] + +# Minimum cut: source has in neighbours +gap> d := EdgeWeightedDigraph([[2], [3], []], [[5], [10], []]); + +gap> DigraphMinimumCut(d, 2, 3); +[ [ 2 ], [ 1, 3 ] ] + +# Minimum cut: sink has out-neighbours +gap> d := EdgeWeightedDigraph([[2], [3], [2]], [[5], [10], [7]]); + +gap> DigraphMinimumCut(d, 2, 3); +[ [ 2 ], [ 1, 3 ] ] + +# Minimum cut: cycle +gap> d := EdgeWeightedDigraph([[2], [3], [1]], [[5], [10], [7]]); + +gap> DigraphMinimumCut(d, 1, 3); +[ [ 1 ], [ 2, 3 ] ] + +# Minimum cut: example from Wikipedia +gap> gr := EdgeWeightedDigraph([[3, 4], [], [2, 4], [2]], +> [[10, 5], [], [5, 15], [10]]);; +gap> DigraphMinimumCut(gr, 1, 2); +[ [ 1 ], [ 2, 3, 4 ] ] +gap> DigraphMinimumCut(gr, 3, 2); +[ [ 4, 3 ], [ 1, 2 ] ] + +# Minimum cut: example from Wikipedia article on Push-label maximum flow +gap> gr := EdgeWeightedDigraph([[2], [3, 6], [4], [1, 6], [1, 3], []], +> [[12], [3, 7], [10], [5, 10], [15, 4], []]);; +gap> DigraphMinimumCut(gr, 5, 6); +[ [ 1, 2, 5 ], [ 3, 4, 6 ] ] + ############################################################################# # 6. Random edge-weighted digraphs ############################################################################# From 4e4b80e97a5620f0102dc86322ac93625b056b1f Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Thu, 30 Oct 2025 18:04:24 +0000 Subject: [PATCH 22/25] Some nonsense happening in prop --- gap/prop.gi | 1 - 1 file changed, 1 deletion(-) diff --git a/gap/prop.gi b/gap/prop.gi index 0b350d2d6..3f4783243 100644 --- a/gap/prop.gi +++ b/gap/prop.gi @@ -741,7 +741,6 @@ function(D) # transtive. if Length(Centers) = 0 then -<<<<<<< HEAD return true; fi; # Find the number of 2-cycles at any center. We will have to subtract From 81e49ee9665f4900ab0847923facb3b999a1b53b Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Fri, 31 Oct 2025 10:38:20 +0000 Subject: [PATCH 23/25] renamed DigraphMinimumCut to DigraphMinimumCutSet --- doc/weights.xml | 17 +++++++------- gap/weights.gd | 2 +- gap/weights.gi | 4 ++-- tst/standard/weights.tst | 50 ++++++++++++++++++++-------------------- 4 files changed, 37 insertions(+), 36 deletions(-) diff --git a/doc/weights.xml b/doc/weights.xml index 177151787..51c049876 100644 --- a/doc/weights.xml +++ b/doc/weights.xml @@ -274,16 +274,17 @@ gap> Sum(flow[1]); <#GAPDoc Label="DigraphMinimumCut"> - + A list of lists of integers. - If digraph is an edge-weighted digraph with distinct vertices start and - destination, this returns a list of two lists representing the components of - a minimum start-destination cut of digraph.

+ If digraph is an edge-weighted digraph with distinct vertices s and + t, this returns a list of two lists representing the components of + a minimal s-t cut set of digraph.

- An s-t cut is a partition of the vertices (S, T) such that s is in S and - t is in T. The capacity of an s-t cut is the sum of the weights of every - edge whose source is in S and whose range is in T.

+ An s-t cut set is a partition of the vertices [S, T] such that s is in S and + t is in T. The capacity of an s-t cut set is the sum of the weights of every + edge whose source is in S and whose range is in T. A minimum s-t cut set is an s-t + cut set whose capacity is minimal.

This attribute is computed by using and the max-cut min-flow theorem.

@@ -292,7 +293,7 @@ gap> Sum(flow[1]); g := EdgeWeightedDigraph([[2, 2], [3], []], [[3, 2], [1], []]); -gap> DigraphMinimumCut(g, 1, 3); +gap> DigraphMinimumCutSet(g, 1, 3); [ [ 2, 1 ], [3]] ]]> diff --git a/gap/weights.gd b/gap/weights.gd index 6930da8da..520b33dd5 100644 --- a/gap/weights.gd +++ b/gap/weights.gd @@ -38,7 +38,7 @@ DeclareGlobalFunction("DIGRAPHS_Edge_Weighted_Dijkstra"); # 5. Maximum Flow and Minimum Cut DeclareOperation("DigraphMaximumFlow", [IsDigraph and HasEdgeWeights, IsPosInt, IsPosInt]); -DeclareOperation("DigraphMinimumCut", +DeclareOperation("DigraphMinimumCutSet", [IsDigraph and HasEdgeWeights, IsPosInt, IsPosInt]); # 6. Random edge weighted digraphs diff --git a/gap/weights.gi b/gap/weights.gi index 9cfedf995..93ec0ebca 100644 --- a/gap/weights.gi +++ b/gap/weights.gi @@ -772,7 +772,7 @@ function(D, start, destination) return flows; end); -InstallMethod(DigraphMinimumCut, "for an edge weighted digraph", +InstallMethod(DigraphMinimumCutSet, "for an edge weighted digraph", [IsDigraph and HasEdgeWeights, IsPosInt, IsPosInt], function(D, s, t) local weights, outs, vertices, flow, residuals, G, o, u, v, S, T; @@ -811,7 +811,7 @@ function(D, s, t) G := Digraph(G); # Find all vertices reachable from the source in this digraph - # This gives the minimal cut by the max-flow min-cut theorem + # This gives the minimal cut set by the max-flow min-cut theorem S := Filtered(vertices, x -> IsReachable(G, s, x)); if not s in S then Add(S, s); diff --git a/tst/standard/weights.tst b/tst/standard/weights.tst index 38f0308ff..4913457fe 100644 --- a/tst/standard/weights.tst +++ b/tst/standard/weights.tst @@ -368,78 +368,78 @@ gap> gr := EdgeWeightedDigraph([[2], [3, 6], [4], [1, 6], [1, 3], []], gap> DigraphMaximumFlow(gr, 5, 6); [ [ 10 ], [ 3, 7 ], [ 7 ], [ 0, 7 ], [ 10, 4 ], [ ] ] -# Minimum cut: empty digraphs +# Minimum cut set: empty digraphs gap> d := EdgeWeightedDigraph([], []); -gap> DigraphMinimumCut(d, 1, 1); +gap> DigraphMinimumCutSet(d, 1, 1); Error, must be a vertex of , -# Minimum cut: single vertex (also empty digraphs) +# Minimum cut set: single vertex (also empty digraphs) gap> d := EdgeWeightedDigraph([[]], [[]]); -gap> DigraphMinimumCut(d, 1, 1); +gap> DigraphMinimumCutSet(d, 1, 1); Error, and must be distinct -# Minimum cut: source = dest +# Minimum cut set: source = dest gap> d := EdgeWeightedDigraph([[2], []], [[5], []]); -gap> DigraphMinimumCut(d, 1, 1); +gap> DigraphMinimumCutSet(d, 1, 1); Error, and must be distinct -# Minimum cut: has loop +# Minimum cut set: has loop gap> d := EdgeWeightedDigraph([[1, 2], []], [[5, 10], []]); -gap> DigraphMinimumCut(d, 1, 2); +gap> DigraphMinimumCutSet(d, 1, 2); [ [ 1 ], [ 2 ] ] -# Minimum cut: invalid source +# Minimum cut set: invalid source gap> d := EdgeWeightedDigraph([[1, 2], []], [[5, 10], []]); -gap> DigraphMinimumCut(d, 5, 2); +gap> DigraphMinimumCutSet(d, 5, 2); Error, must be a vertex of , -# Minimum cut: invalid sink +# Minimum cut set: invalid sink gap> d := EdgeWeightedDigraph([[1, 2], []], [[5, 10], []]); -gap> DigraphMinimumCut(d, 1, 5); +gap> DigraphMinimumCutSet(d, 1, 5); Error, must be a vertex of , -# Minimum cut: sink not reachable +# Minimum cut set: sink not reachable gap> d := EdgeWeightedDigraph([[1], []], [[5], []]); -gap> DigraphMinimumCut(d, 1, 2); +gap> DigraphMinimumCutSet(d, 1, 2); [ [ 1 ], [ 2 ] ] -# Minimum cut: source has in neighbours +# Minimum cut set: source has in neighbours gap> d := EdgeWeightedDigraph([[2], [3], []], [[5], [10], []]); -gap> DigraphMinimumCut(d, 2, 3); +gap> DigraphMinimumCutSet(d, 2, 3); [ [ 2 ], [ 1, 3 ] ] -# Minimum cut: sink has out-neighbours +# Minimum cut set: sink has out-neighbours gap> d := EdgeWeightedDigraph([[2], [3], [2]], [[5], [10], [7]]); -gap> DigraphMinimumCut(d, 2, 3); +gap> DigraphMinimumCutSet(d, 2, 3); [ [ 2 ], [ 1, 3 ] ] -# Minimum cut: cycle +# Minimum cut set: cycle gap> d := EdgeWeightedDigraph([[2], [3], [1]], [[5], [10], [7]]); -gap> DigraphMinimumCut(d, 1, 3); +gap> DigraphMinimumCutSet(d, 1, 3); [ [ 1 ], [ 2, 3 ] ] -# Minimum cut: example from Wikipedia +# Minimum cut set: example from Wikipedia gap> gr := EdgeWeightedDigraph([[3, 4], [], [2, 4], [2]], > [[10, 5], [], [5, 15], [10]]);; -gap> DigraphMinimumCut(gr, 1, 2); +gap> DigraphMinimumCutSet(gr, 1, 2); [ [ 1 ], [ 2, 3, 4 ] ] -gap> DigraphMinimumCut(gr, 3, 2); +gap> DigraphMinimumCutSet(gr, 3, 2); [ [ 4, 3 ], [ 1, 2 ] ] -# Minimum cut: example from Wikipedia article on Push-label maximum flow +# Minimum cut set: example from Wikipedia article on Push-label maximum flow gap> gr := EdgeWeightedDigraph([[2], [3, 6], [4], [1, 6], [1, 3], []], > [[12], [3, 7], [10], [5, 10], [15, 4], []]);; -gap> DigraphMinimumCut(gr, 5, 6); +gap> DigraphMinimumCutSet(gr, 5, 6); [ [ 1, 2, 5 ], [ 3, 4, 6 ] ] ############################################################################# From 272d2304958ac122977814aac6b8546e99f88786 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Sat, 1 Nov 2025 10:58:56 +0000 Subject: [PATCH 24/25] lint --- gap/weights.gi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gap/weights.gi b/gap/weights.gi index 93ec0ebca..03e647451 100644 --- a/gap/weights.gi +++ b/gap/weights.gi @@ -775,7 +775,7 @@ end); InstallMethod(DigraphMinimumCutSet, "for an edge weighted digraph", [IsDigraph and HasEdgeWeights, IsPosInt, IsPosInt], function(D, s, t) - local weights, outs, vertices, flow, residuals, G, o, u, v, S, T; + local weights, outs, vertices, flow, residuals, G, o, u, v, S, T; # Extract important data weights := EdgeWeights(D); @@ -798,9 +798,9 @@ function(D, s, t) # Construct the digraph containing all edges with nonzero # residual capacity G := []; - for u in [1..Length(outs)] do + for u in [1 .. Length(outs)] do o := []; - for v in [1..Length(outs[u])] do + for v in [1 .. Length(outs[u])] do if residuals[u][v] > 0 then Add(o, outs[u][v]); fi; From 5e8e5bf26f721e92278bcff6f4d7cda5ddeb7207 Mon Sep 17 00:00:00 2001 From: Frankie Gillis Date: Wed, 19 Nov 2025 16:34:15 +0000 Subject: [PATCH 25/25] Improved function and updated doc --- doc/weights.xml | 12 +++++----- doc/z-chap5.xml | 1 + gap/weights.gd | 2 +- gap/weights.gi | 40 +++++++++++++++----------------- tst/standard/weights.tst | 50 ++++++++++++++++++++-------------------- 5 files changed, 52 insertions(+), 53 deletions(-) diff --git a/doc/weights.xml b/doc/weights.xml index deee721ac..b69369a12 100644 --- a/doc/weights.xml +++ b/doc/weights.xml @@ -279,12 +279,12 @@ gap> Sum(flow[1]); If digraph is an edge-weighted digraph with distinct vertices s and t, this returns a list of two lists representing the components of - a minimal s-t cut set of digraph.

+ a minimal s-t cut of digraph.

- An s-t cut set is a partition of the vertices [S, T] such that s is in S and - t is in T. The capacity of an s-t cut set is the sum of the weights of every - edge whose source is in S and whose range is in T. A minimum s-t cut set is an s-t - cut set whose capacity is minimal.

+ An s-t cut is a partition of the vertices \{ S, T \} such that s is in S and + t is in T. The capacity of an s-t cut is the sum of the weights of every + edge whose source is in S and whose range is in T. A minimum s-t cut is an s-t + cut whose capacity is minimal.

This attribute is computed by using and the max-cut min-flow theorem.

@@ -293,7 +293,7 @@ gap> Sum(flow[1]); g := EdgeWeightedDigraph([[2, 2], [3], []], [[3, 2], [1], []]); -gap> DigraphMinimumCutSet(g, 1, 3); +gap> DigraphMinimumCut(g, 1, 3); [ [ 2, 1 ], [3]] ]]> diff --git a/doc/z-chap5.xml b/doc/z-chap5.xml index 759876e11..64454c8d0 100644 --- a/doc/z-chap5.xml +++ b/doc/z-chap5.xml @@ -32,6 +32,7 @@ <#Include Label="EdgeWeightedDigraphShortestPaths"> <#Include Label="EdgeWeightedDigraphShortestPath"> <#Include Label="DigraphMaximumFlow"> + <#Include Label="DigraphMinimumCut"> <#Include Label="RandomUniqueEdgeWeightedDigraph"> diff --git a/gap/weights.gd b/gap/weights.gd index 520b33dd5..6930da8da 100644 --- a/gap/weights.gd +++ b/gap/weights.gd @@ -38,7 +38,7 @@ DeclareGlobalFunction("DIGRAPHS_Edge_Weighted_Dijkstra"); # 5. Maximum Flow and Minimum Cut DeclareOperation("DigraphMaximumFlow", [IsDigraph and HasEdgeWeights, IsPosInt, IsPosInt]); -DeclareOperation("DigraphMinimumCutSet", +DeclareOperation("DigraphMinimumCut", [IsDigraph and HasEdgeWeights, IsPosInt, IsPosInt]); # 6. Random edge weighted digraphs diff --git a/gap/weights.gi b/gap/weights.gi index 03e647451..8c2838e9b 100644 --- a/gap/weights.gi +++ b/gap/weights.gi @@ -772,20 +772,20 @@ function(D, start, destination) return flows; end); -InstallMethod(DigraphMinimumCutSet, "for an edge weighted digraph", +InstallMethod(DigraphMinimumCut, "for an edge weighted digraph", [IsDigraph and HasEdgeWeights, IsPosInt, IsPosInt], function(D, s, t) - local weights, outs, vertices, flow, residuals, G, o, u, v, S, T; + local weights, outs, vertices, flow, residuals, u, v, S, T, Q; # Extract important data weights := EdgeWeights(D); outs := OutNeighbours(D); vertices := DigraphVertices(D); - + # Check input - if not s in vertices then + if s < 1 or s > Length(vertices) then ErrorNoReturn(" must be a vertex of ,"); - elif not t in vertices then + elif t < 1 or t > Length(vertices) then ErrorNoReturn(" must be a vertex of ,"); elif s = t then ErrorNoReturn(" and must be distinct"); @@ -794,28 +794,26 @@ function(D, s, t) # Find the residual edge capacities under the maximum flow flow := DigraphMaximumFlow(D, s, t); residuals := weights - flow; - - # Construct the digraph containing all edges with nonzero - # residual capacity - G := []; - for u in [1 .. Length(outs)] do - o := []; + + # Carry out a BFS to find all the vertices in the residual + # network which are reachable from s. This gives the minimum + # cut by the max-flow min-cut theorem. + + S := [s]; + Q := [s]; + while not IsEmpty(Q) do + u := Q[1]; + Remove(Q, 1); for v in [1 .. Length(outs[u])] do if residuals[u][v] > 0 then - Add(o, outs[u][v]); + if not outs[u][v] in S then + Add(Q, outs[u][v]); + Add(S, outs[u][v]); + fi; fi; od; - Add(G, o); od; - G := Digraph(G); - - # Find all vertices reachable from the source in this digraph - # This gives the minimal cut set by the max-flow min-cut theorem - S := Filtered(vertices, x -> IsReachable(G, s, x)); - if not s in S then - Add(S, s); - fi; T := Difference(vertices, S); return [S, T]; end); diff --git a/tst/standard/weights.tst b/tst/standard/weights.tst index 9020925df..3e1a20bc1 100644 --- a/tst/standard/weights.tst +++ b/tst/standard/weights.tst @@ -368,78 +368,78 @@ gap> gr := EdgeWeightedDigraph([[2], [3, 6], [4], [1, 6], [1, 3], []], gap> DigraphMaximumFlow(gr, 5, 6); [ [ 10 ], [ 3, 7 ], [ 7 ], [ 0, 7 ], [ 10, 4 ], [ ] ] -# Minimum cut set: empty digraphs +# Minimum cut: empty digraphs gap> d := EdgeWeightedDigraph([], []); -gap> DigraphMinimumCutSet(d, 1, 1); +gap> DigraphMinimumCut(d, 1, 1); Error, must be a vertex of , -# Minimum cut set: single vertex (also empty digraphs) +# Minimum cut: single vertex (also empty digraphs) gap> d := EdgeWeightedDigraph([[]], [[]]); -gap> DigraphMinimumCutSet(d, 1, 1); +gap> DigraphMinimumCut(d, 1, 1); Error, and must be distinct -# Minimum cut set: source = dest +# Minimum cut: source = dest gap> d := EdgeWeightedDigraph([[2], []], [[5], []]); -gap> DigraphMinimumCutSet(d, 1, 1); +gap> DigraphMinimumCut(d, 1, 1); Error, and must be distinct -# Minimum cut set: has loop +# Minimum cut: has loop gap> d := EdgeWeightedDigraph([[1, 2], []], [[5, 10], []]); -gap> DigraphMinimumCutSet(d, 1, 2); +gap> DigraphMinimumCut(d, 1, 2); [ [ 1 ], [ 2 ] ] -# Minimum cut set: invalid source +# Minimum cut: invalid source gap> d := EdgeWeightedDigraph([[1, 2], []], [[5, 10], []]); -gap> DigraphMinimumCutSet(d, 5, 2); +gap> DigraphMinimumCut(d, 5, 2); Error, must be a vertex of , -# Minimum cut set: invalid sink +# Minimum cut: invalid sink gap> d := EdgeWeightedDigraph([[1, 2], []], [[5, 10], []]); -gap> DigraphMinimumCutSet(d, 1, 5); +gap> DigraphMinimumCut(d, 1, 5); Error, must be a vertex of , -# Minimum cut set: sink not reachable +# Minimum cut: sink not reachable gap> d := EdgeWeightedDigraph([[1], []], [[5], []]); -gap> DigraphMinimumCutSet(d, 1, 2); +gap> DigraphMinimumCut(d, 1, 2); [ [ 1 ], [ 2 ] ] -# Minimum cut set: source has in neighbours +# Minimum cut: source has in neighbours gap> d := EdgeWeightedDigraph([[2], [3], []], [[5], [10], []]); -gap> DigraphMinimumCutSet(d, 2, 3); +gap> DigraphMinimumCut(d, 2, 3); [ [ 2 ], [ 1, 3 ] ] -# Minimum cut set: sink has out-neighbours +# Minimum cut: sink has out-neighbours gap> d := EdgeWeightedDigraph([[2], [3], [2]], [[5], [10], [7]]); -gap> DigraphMinimumCutSet(d, 2, 3); +gap> DigraphMinimumCut(d, 2, 3); [ [ 2 ], [ 1, 3 ] ] -# Minimum cut set: cycle +# Minimum cut: cycle gap> d := EdgeWeightedDigraph([[2], [3], [1]], [[5], [10], [7]]); -gap> DigraphMinimumCutSet(d, 1, 3); +gap> DigraphMinimumCut(d, 1, 3); [ [ 1 ], [ 2, 3 ] ] -# Minimum cut set: example from Wikipedia +# Minimum cut: example from Wikipedia gap> gr := EdgeWeightedDigraph([[3, 4], [], [2, 4], [2]], > [[10, 5], [], [5, 15], [10]]);; -gap> DigraphMinimumCutSet(gr, 1, 2); +gap> DigraphMinimumCut(gr, 1, 2); [ [ 1 ], [ 2, 3, 4 ] ] -gap> DigraphMinimumCutSet(gr, 3, 2); +gap> DigraphMinimumCut(gr, 3, 2); [ [ 4, 3 ], [ 1, 2 ] ] -# Minimum cut set: example from Wikipedia article on Push-label maximum flow +# Minimum cut: example from Wikipedia article on Push-label maximum flow gap> gr := EdgeWeightedDigraph([[2], [3, 6], [4], [1, 6], [1, 3], []], > [[12], [3, 7], [10], [5, 10], [15, 4], []]);; -gap> DigraphMinimumCutSet(gr, 5, 6); +gap> DigraphMinimumCut(gr, 5, 6); [ [ 1, 2, 5 ], [ 3, 4, 6 ] ] #############################################################################