diff -uNr a/vtools/manifest b/vtools/manifest --- a/vtools/manifest fda2f695d7a689f09b2bca11b4baef63236a2e786db9ff81c91da47a0ccef55a10951fe4eb7f48a02394aa78f49c35e9cb20a6b892e78153451787f8cd4219f6 +++ b/vtools/manifest c93d8fe6648187f6a90d9ceebdd6ea70f201bfeb8d71abb94769820e95b00a13ba2511920e59c4bb04b163d7f589e3ba380f221ad29642a0adfed96eb849b2ed @@ -13,3 +13,4 @@ 615541 bvt vtools_small_fixes Fix vdiff gprbuild and remove useless variable from ksum. 615544 bvt vtools_add_vsh Add shell v-presser implementation. 615638 bvt vtools_add_vsh_utils Add utilities required by v-presser. +617378 bvt vtools_vsh_utils_one_binary Merge all v.sh Ada utilities into one. diff -uNr a/vtools/src/vflow.adb b/vtools/src/vflow.adb --- a/vtools/src/vflow.adb f5e2f12ccf90384a05790422cf8909d988991ca0f1c5b711557e3b44b3987628ce8f8968b82618545bb6353466eaf6bf9e21bdcdec28cbba7572c0ef0fec89b1 +++ b/vtools/src/vflow.adb 400069490b8212c36d75f27a9935f5017ad6bdb49c9f520293082a4dcc4a1e902fe3733cf34c4356c8a0c315905b8534236ad9b1557a32ec501742693f644514 @@ -27,9 +27,13 @@ VH_Low : Vpatch_Hunks := (others => Hunk_Index'First); VH_High: Vpatch_Hunks := (others => Hunk_Index'First); + type Vpatch_Set is array (Vpatch_Index'Range) of Boolean; + type Vpatch_List is array (Vpatch_Index'Range) of Vpatch_Index; type Vpatch_Relationship is array (Vpatch_Index'Range, Vpatch_Index'Range) of Boolean; + Vpatch_Dependencies: Vpatch_Relationship := (others => (others => False)); Vpatch_Conflicts : Vpatch_Relationship := (others => (others => False)); + Vpatch_Order : Vpatch_List := (others => 0); function Get_Hunk return Hunk is H: Hunk; @@ -39,21 +43,28 @@ Get(H.Out_File); Get(H.In_Hash); Get(H.Out_Hash); - H.State := Unsatisfied; + if H.In_Hash = Empty_Hash then + H.State := Satisfied; + else + H.State := Unsatisfied; + end if; return H; end Get_Hunk; procedure Read_Hunks is - I: Natural := All_Hunks'First; + N: Natural := 0; begin Read_Loop: - loop + for I in All_Hunks'Range loop exit Read_Loop when End_Of_File; All_Hunks(I) := Get_Hunk; - I := I + 1; - end loop Read_Loop; + N := N + 1; + end loop Read_Loop; + if N /= All_Hunks'Last then + raise Constraint_Error with "Insufficient number of hunks provided."; + end if; end Read_Hunks; - + procedure Init_Vpatch_Hunk_Bounds is begin for I in All_Hunks'Range loop @@ -190,59 +201,189 @@ Output_Hunks(VH_Low(J)..VH_High(J)); begin Finished := Try_Connect(Hunks_In, Hunks_Out); - exit when Finished; end; else Finished := Check_Genesis(Hunks_In); - exit when Finished; end if; + exit when Finished; end loop; -- Looped through all vpatches, there are hunks without matched inputs: if not Finished then - -- Check if the remaining hunks are file creations: + raise Constraint_Error with "Unsatisfied hunks."; + end if; + end; + end loop; + end Solve; + + function Sort return Boolean is + Free_Vpatches : Vpatch_Set := (others => True); + N_Selected : Natural := 0; + Finished : Boolean := False; + Has_Loops : Boolean := False; + begin + while not Finished loop + Finished := True; + for I in Free_Vpatches'Range loop + if Free_Vpatches(I) then declare - OK : Boolean := True; + All_Satisfied : Boolean := True; begin - for I in Hunks_In'Range loop - if Hunks_In(I).In_Hash = Empty_Hash and - Hunks_In(I).State = Unsatisfied then - Hunks_In(I).State := Satisfied; + + -- Check if all dependencies are already in the press order + for J in Vpatch_Dependencies'Range(2) loop + if Vpatch_Dependencies(I,J) then + All_Satisfied := All_Satisfied and not Free_Vpatches(J); end if; - OK := OK and (Hunks_In(I).State = Satisfied); end loop; - if not OK then - raise Constraint_Error with "Unsatisfied hunks."; + + -- All dependencies present, can add this vpatch: + if All_Satisfied then + Free_Vpatches(I) := False; + Vpatch_Order(N_Selected) := I; + N_Selected := N_Selected + 1; + Finished := False; end if; end; end if; - end; + end loop; end loop; - end Solve; + + -- Check if there are still free vpatches (there is a loop): + for I in Free_Vpatches'Range loop + if Free_Vpatches(I) then + Put_Line("L " & Integer'Image(I)); + Has_Loops := True; + end if; + end loop; + return not Has_Loops; + end Sort; - procedure Produce_Output is + procedure Print_Relationship(C: Character; R: Vpatch_Relationship) is begin - Put_Line("v " & Integer'Image(Num_Vpatches)); - for I in Vpatch_Dependencies'Range(1) loop - for J in Vpatch_Dependencies'Range(2) loop - if Vpatch_Dependencies(I,J) then - Put_Line("d " & Integer'Image(I) & " " & Integer'Image(J)); + for I in R'Range(1) loop + for J in R'Range(2) loop + if R(I,J) then + Put_Line(C & " " & Integer'Image(I) & " " & Integer'Image(J)); end if; end loop; end loop; - for I in Vpatch_Conflicts'Range(1) loop - for J in Vpatch_Conflicts'Range(2) loop - if Vpatch_Conflicts(I,J) then - Put_Line("c " & Integer'Image(I) & " " & Integer'Image(J)); - end if; + end Print_Relationship; + + procedure Simplify_Inner is + Vpatch_TC_Indirect: Vpatch_Relationship := (others => (others => False)); + begin + -- Fill Vpatch_TC_Indirect + for I in Vpatch_Order'Range loop + declare + N : Vpatch_Index := Vpatch_Order(I); + begin + for J in Vpatch_Dependencies'Range(2) loop + if Vpatch_Dependencies(N,J) then + for K in Vpatch_Dependencies'Range(2) loop + Vpatch_TC_Indirect(N,K) := Vpatch_TC_Indirect(N,K) or + Vpatch_Dependencies(J,K) or + Vpatch_TC_Indirect(J,K); + end loop; + end if; + end loop; + end; + end loop; + + -- Output Vpatch_TC_Indirect + Print_Relationship('I', Vpatch_TC_Indirect); + + -- Remove redundant connections from Vpatch_Dependencies + for I in Vpatch_Dependencies'Range(1) loop + for J in Vpatch_TC_Indirect'Range(2) loop + Vpatch_Dependencies(I,J) := Vpatch_Dependencies(I,J) and + not Vpatch_TC_Indirect(I,J); end loop; end loop; - end Produce_Output; - + + -- Output filtered out Vpatch_Dependencies + Print_Relationship('d', Vpatch_Dependencies); + end Simplify_Inner; + + procedure Print_Selected is + Selected_Vpatches: Vpatch_Set := (others => False); + + procedure Read_Selection is + C: Character; + I: Vpatch_Index; + begin + Read_Loop: + loop + exit Read_Loop when End_Of_File; + Get(C); + if C = 's' then + Get(I); + Selected_Vpatches(I) := True; + elsif C = 'S' then + for J in Selected_Vpatches'Range loop + Selected_Vpatches(J) := True; + end loop; + end if; + end loop Read_Loop; + end Read_Selection; + + procedure Add_Dependencies is + Finish : Boolean := False; + begin + while not Finish loop + Finish := True; + for I in Selected_Vpatches'Range loop + if Selected_Vpatches(I) then + for J in Vpatch_Dependencies'Range(2) loop + if Vpatch_Dependencies(I,J) and not Selected_Vpatches(J) then + Finish := False; + Selected_Vpatches(J) := True; + end if; + end loop; + end if; + end loop; + end loop; + end Add_Dependencies; + + procedure Print_Flow_Or_Conflicts is + Has_Conflicts : Boolean := False; + begin + for I in Vpatch_Conflicts'Range(1) loop + for J in Vpatch_Conflicts'Range(2) loop + if Selected_Vpatches(I) and Selected_Vpatches(J) + and Vpatch_Conflicts(I,J) then + Put_Line("C " & Integer'Image(I)); + Put_Line("C " & Integer'Image(J)); + Has_Conflicts := True; + end if; + end loop; + end loop; + + if Has_Conflicts then + return; + end if; + + for I in Vpatch_Order'Range loop + if Selected_Vpatches(Vpatch_Order(I)) then + Put_Line("P " & Integer'Image(Vpatch_Order(I))); + end if; + end loop; + end Print_Flow_Or_Conflicts; + + begin + Read_Selection; + Add_Dependencies; + Print_Flow_Or_Conflicts; + end Print_Selected; + begin Read_Hunks; Init_Vpatch_Hunk_Bounds; Populate_Conflicts; Solve; - Produce_Output; + + if Sort then + Simplify_Inner; + Print_Selected; + end if; end Vflow; diff -uNr a/vtools/src/vsimplify.adb b/vtools/src/vsimplify.adb --- a/vtools/src/vsimplify.adb 9500518e8785191de23f54fe3b7fc69da03bc65473022a04e91764ab5cfe5092df794a2a6d3d429e65c000d9731c80bb802e32d40c4b770a2aa04484cea1a046 +++ b/vtools/src/vsimplify.adb false @@ -1,109 +0,0 @@ -with Ada.Text_IO; use Ada.Text_IO; -with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; - -procedure Vsimplify is - - Command : Character; - Num_Vpatches : Integer; - - procedure Simplify(Num_Vpatches : Integer) is - subtype Vpatch_Index is Natural range 0..Num_Vpatches - 1; - type Vpatch_Set is array (Vpatch_Index'Range) of Boolean; - type Vpatch_List is array (Vpatch_Index'Range) of Vpatch_Index; - type Vpatch_Relationship is array (Vpatch_Index'Range, Vpatch_Index'Range) of Boolean; - - Vpatch_Dependencies: Vpatch_Relationship := (others => (others => False)); - Vpatch_TC_Indirect : Vpatch_Relationship := (others => (others => False)); - Vpatch_Order : Vpatch_List := (others => 0); - Free_Vpatches : Vpatch_Set := (others => False); - N_Selected : Natural := 0; - - procedure Read_Commands is - I: Vpatch_Index; - J: Vpatch_Index; - begin - Read_Loop: - loop - exit Read_Loop when End_Of_File; - Get(Command); - if Command = 'd' then - Get(I); - Get(J); - Vpatch_Dependencies(I,J) := True; - elsif Command = 'C' then - -- Ignore conflicts in this tool, but consume the command - Get(I); - elsif Command = 'L' then - raise Constraint_Error with "Cannot simplify loops"; - elsif Command = 'P' then - Get(I); - Vpatch_Order(N_Selected) := I; - N_Selected := N_Selected + 1; - end if; - end loop Read_Loop; - - if N_Selected - 1 /= Vpatch_Order'Last then - raise Constraint_Error with "Not all vpatches present in the press order"; - end if; - - end Read_Commands; - - procedure Simplify_Inner is - begin - -- Fill Vpatch_TC_Indirect - for I in Vpatch_Order'Range loop - declare - N : Vpatch_Index := Vpatch_Order(I); - begin - for J in Vpatch_Dependencies'Range(2) loop - if Vpatch_Dependencies(N,J) then - for K in Vpatch_Dependencies'Range(2) loop - Vpatch_TC_Indirect(N,K) := Vpatch_TC_Indirect(N,K) or - Vpatch_Dependencies(J,K) or - Vpatch_TC_Indirect(J,K); - end loop; - end if; - end loop; - end; - end loop; - - -- Output Vpatch_TC_Indirect - for I in Vpatch_TC_Indirect'Range(1) loop - for J in Vpatch_TC_Indirect'Range(2) loop - if Vpatch_TC_Indirect(I,J) then - Put_Line("I " & Integer'Image(I) & " " & Integer'Image(J)); - end if; - end loop; - end loop; - - -- Remove redundant connections from Vpatch_Dependencies - for I in Vpatch_Dependencies'Range(1) loop - for J in Vpatch_TC_Indirect'Range(2) loop - Vpatch_Dependencies(I,J) := Vpatch_Dependencies(I,J) and - not Vpatch_TC_Indirect(I,J); - end loop; - end loop; - - -- Output filtered out Vpatch_Dependencies - for I in Vpatch_Dependencies'Range(1) loop - for J in Vpatch_TC_Indirect'Range(2) loop - if Vpatch_Dependencies(I,J) then - Put_Line("d " & Integer'Image(I) & " " & Integer'Image(J)); - end if; - end loop; - end loop; - end Simplify_Inner; - - begin - Read_Commands; - Simplify_Inner; - end Simplify; - -begin - Get(Command); - if Command /= 'v' then - raise Constraint_Error with "Expected 'v' command."; - end if; - Get(Num_Vpatches); - Simplify(Num_Vpatches); -end Vsimplify; diff -uNr a/vtools/src/vtoposort.adb b/vtools/src/vtoposort.adb --- a/vtools/src/vtoposort.adb 214030a75aac2bf72eed4688f78cae7b4c507e727e5fca2d49234778421a4bdb8c5c7c850f5379946244ac6919541154b256a4cbe8e05c53c253b0d0ea466eec +++ b/vtools/src/vtoposort.adb false @@ -1,142 +0,0 @@ -with Ada.Text_IO; use Ada.Text_IO; -with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; - -procedure Vtoposort is - - Command : Character; - Num_Vpatches : Integer; - - procedure Toposort(Num_Vpatches : Integer) is - subtype Vpatch_Index is Natural range 0..Num_Vpatches - 1; - type Vpatch_Set is array (Vpatch_Index'Range) of Boolean; - type Vpatch_List is array (Vpatch_Index'Range) of Vpatch_Index; - type Vpatch_Relationship is array - (Vpatch_Index'Range, Vpatch_Index'Range) of Boolean; - - Vpatch_Dependencies: Vpatch_Relationship := (others => (others => False)); - Vpatch_Conflicts : Vpatch_Relationship := (others => (others => False)); - Free_Vpatches : Vpatch_Set := (others => False); - - procedure Read_Commands is - I: Vpatch_Index; - J: Vpatch_Index; - begin - Read_Loop: - loop - exit Read_Loop when End_Of_File; - Get(Command); - if Command = 'd' then - Get(I); - Get(J); - Vpatch_Dependencies(I,J) := True; - elsif Command = 'c' then - Get(I); - Get(J); - Vpatch_Conflicts(I,J) := True; - elsif Command = 's' then - Get(I); - Free_Vpatches(I) := True; - else - raise Constraint_Error with "Unknown Command"; - end if; - end loop Read_Loop; - end Read_Commands; - - procedure Add_Dependencies is - Finish : Boolean := False; - begin - while not Finish loop - Finish := True; - for I in Free_Vpatches'Range loop - if Free_Vpatches(I) then - for J in Vpatch_Dependencies'Range(2) loop - if Vpatch_Dependencies(I,J) and not Free_Vpatches(J) then - Finish := False; - Free_Vpatches(J) := True; - end if; - end loop; - end if; - end loop; - end loop; - end Add_Dependencies; - - procedure Report_Conflicts is - begin - for I in Free_Vpatches'Range loop - if Free_Vpatches(I) then - for J in Vpatch_Conflicts'Range(2) loop - if Vpatch_Conflicts(I,J) and Free_Vpatches(J) then - Put_Line("C " & Integer'Image(I)); - Put_Line("C " & Integer'Image(J)); - end if; - end loop; - end if; - end loop; - end Report_Conflicts; - - procedure Sort is - Added_Vpatches : Vpatch_Set := (others => False); - Vpatch_Order : Vpatch_List := (others => 0); - N_Selected : Natural := 0; - Finished : Boolean := False; - Has_Loops : Boolean := False; - begin - while not Finished loop - Finished := True; - for I in Free_Vpatches'Range loop - if Free_Vpatches(I) then - declare - All_Satisfied : Boolean := True; - begin - - -- Check if all dependencies are already in the press order - for J in Vpatch_Dependencies'Range(2) loop - if Vpatch_Dependencies(I,J) then - All_Satisfied := All_Satisfied and Added_Vpatches(J); - end if; - end loop; - - -- All dependencies present, can add this vpatch: - if All_Satisfied then - Free_Vpatches(I) := False; - Added_Vpatches(I) := True; - Vpatch_Order(N_Selected) := I; - N_Selected := N_Selected + 1; - Finished := False; - end if; - end; - end if; - end loop; - end loop; - - -- Check if there are still free vpatches (there is a loop): - for I in Free_Vpatches'Range loop - if Free_Vpatches(I) then - Put_Line("L " & Integer'Image(I)); - Has_Loops := True; - end if; - end loop; - - -- Print vpatches in press order: - if not Has_Loops then - for I in Vpatch_Order'First..N_Selected - 1 loop - Put_Line("P " & Integer'Image(Vpatch_Order(I))); - end loop; - end if; - end Sort; - - begin - Read_Commands; - Add_Dependencies; - Report_Conflicts; - Sort; - end Toposort; - -begin - Get(Command); - if Command /= 'v' then - raise Constraint_Error with "Expected 'v' command."; - end if; - Get(Num_Vpatches); - Toposort(Num_Vpatches); -end Vtoposort; diff -uNr a/vtools/v.sh b/vtools/v.sh --- a/vtools/v.sh 24defb473835e2980044a9bb526d2133f3056f62109b3a8136cb168019889f3c94bb721362cffcdb6df2ac52bbc6c111a680d9ba22b759ea676e7ddff7082fa1 +++ b/vtools/v.sh 4f93f505f530e9342269287c9d0be9356ec8a596f3bceb2b9fd2cbb6db1dc15ab3603b2f13b1a9e37d01df7483a5f1c581beb38ff66f7b443bacd413aa546ef6 @@ -4,10 +4,8 @@ vgpgdir="" vpatches="" -flow="" filtered="" selfile="" -simplified="" topo="" usage() { @@ -34,10 +32,8 @@ loadwot() { vgpgdir="$(mktemp -d v-gpg-XXXXXX)" vpatches="$vgpgdir/vpatches.txt" - flow="$vgpgdir/flow.txt" filtered="$vgpgdir/filtered.txt" selfile="$vgpgdir/selected.txt" - simplified="$vgpgdir/simplified.txt" topo="$vgpgdir/topo.txt" checkdir wot @@ -130,30 +126,34 @@ filterall | internall >"$filtered" selected="" if [ "$*" == "-" ]; then - selected=$(awk '{print $2}' < "$vpatches") + echo "S" >"$selfile" else - selected="$(echo $* | tr ' ' '\n' | vpatchnos)" + echo $* | tr ' ' '\n' | vpatchnos | sed -e 's/^/s /g' - >"$selfile" fi - vflow $(wc -l <"$filtered") $(wc -l <"$vpatches") <"$filtered" >"$flow" - echo "$selected" | sed -e 's/^/s /g' - | sort | uniq >"$selfile" - cat "$flow" "$selfile" | vtoposort > "$topo" + cat "$filtered" "$selfile" | \ + vflow $(wc -l <"$filtered") $(wc -l <"$vpatches") >"$topo" } vpatchflowerr() { - ret=$(head -n1 "$topo" | awk '{print $1}') - if [ "$ret" = "C" ]; then - printf "\nConflicting leaves selected:\n" - awk '$1 == "C" {print $2}' < "$topo" | vpatchnames | sort | uniq - cleanup - elif [ $ret == "L" ]; then - echo "\nLoop among vpatches:" - awk '{print $2}' < "$topo" | vpatchnames - cleanup - elif [ "$ret" != "P" ]; then - echo "Unknown error. Investigate in $vgpgdir:" - cat "$topo" - exit 0 # no cleanup - fi + awk 'BEGIN {err=0; ok=0;} +err == 0 && $1 == "C" {err=1; ech=$1;} +err == 0 && $1 == "L" {err=2; ech=$1;} +err == 0 && $1 == "P" {ok=1;} +END {if (err != 0) exit err; if (ok != 1) exit 3; exit 0;}' <"$topo" + exitcode="$?" + if [ "$exitcode" -eq "1" ]; then + printf "\nConflicting leaves selected:\n" + awk '$1 == "C" {print $2}' < "$topo" | vpatchnames | sort | uniq + cleanup + elif [ "$exitcode" -eq "2" ]; then + printf "\nConflicting leaves selected:\n" + awk '{print $2}' < "$topo" | vpatchnames + cleanup + elif [ "$exitcode" -eq "3" ]; then + echo "Unknown error. Investigate in $vgpgdir:" + cat "$topo" + exit 0 # no cleanup + fi } [ -z "$1" ] && usage @@ -180,7 +180,6 @@ shift vpatchflow - - cat "$flow" "$topo" | vsimplify > "$simplified" cat >"$dotfile" < \""a[$2]"\""} -' "$vpatches" - <"$simplified" >>"$dotfile" +' "$vpatches" - <"$topo" >>"$dotfile" echo "}" >> "$dotfile" dot -Tsvg $dotfile -o $svgfile # dot -Tcmapx $dotfile -o $svgfile.html-map @@ -202,11 +201,10 @@ vpatchflow - vno=$(awk -v V="$vpatch" '$1==V {print $2}' < "$vpatches") - cat "$flow" "$topo" | vsimplify > "$simplified" - awk -v S="$simplified" -v T="$topo" -v N="$vno" ' -FILENAME==S && ($1 == "I" || $1 == "d" ) && $2 == N {a[$3]=1} -FILENAME==T && ($1 == "P") {if ($2 in a) {print $2}} -' "$simplified" "$topo" | vpatchnames + awk -v N="$vno" ' +($1 == "I" || $1 == "d" ) && $2 == N {a[$3]=1} +($1 == "P") {if ($2 in a) {print $2}} +' "$topo" | vpatchnames cleanup fi @@ -217,11 +215,10 @@ vpatchflow - vno=$(awk -v V="$vpatch" '$1==V {print $2}' < "$vpatches") - cat "$flow" "$topo" | vsimplify > "$simplified" - awk -v S="$simplified" -v T="$topo" -v N="$vno" ' -FILENAME==S && ($1 == "I" || $1 == "d" ) && $3 == N {a[$2]=1} -FILENAME==T && ($1 == "P") {if ($2 in a) {print $2}} -' "$simplified" "$topo" | vpatchnames + awk -v N="$vno" ' +($1 == "I" || $1 == "d" ) && $3 == N {a[$2]=1} +($1 == "P") {if ($2 in a) {print $2}} +' "$topo" | vpatchnames cleanup fi @@ -258,7 +255,7 @@ vpatchflow $* vpatchflowerr - awk '{print $2}' < "$topo" | vpatchnames | while read i; do + awk '$1 == "P" {print $2}' < "$topo" | vpatchnames | while read i; do i=$(readlink -f $i) cd "$dir" vpatch <"$i" >/dev/null @@ -267,4 +264,6 @@ cleanup fi +echo "Unknown command: $1" + cleanup diff -uNr a/vtools/vdiff.gpr b/vtools/vdiff.gpr --- a/vtools/vdiff.gpr 0406532e11310fe740c484d7c5b82e84c6f59d782eb2a695a773d509f61c5a57a3992c82b4ac5ed5f11bc4ab300ecc689988faa5f3c7d383f3b96639ce04ce85 +++ b/vtools/vdiff.gpr f015aa9dc6512c23101090d560ff44aff8603f91e83c96a26c74bc257f7124b7a2e7d8ad3447af407cd01e416a48b83a12c248115af2a91bffea6b36edeed723 @@ -4,8 +4,7 @@ for Object_Dir use "obj"; for Exec_Dir use "."; for Main use ("diff.c"); - for Excluded_Source_Files use ("vpatch.adb", "ksum.adb", "vflow.adb", - "vtoposort.adb", "vsimplify.adb"); + for Excluded_Source_Files use ("vpatch.adb", "ksum.adb", "vflow.adb"); package Builder is for Executable ("diff.c") use "vdiff"; end Builder; diff -uNr a/vtools/vsimplify.gpr b/vtools/vsimplify.gpr --- a/vtools/vsimplify.gpr c87b11449cf3c22505b950ab9482b91bcd2d3f590caf7c37705127dbb6e742f1a4c2ea6a2ad07b4ab45b7b22046a06832df3910548261393f2d3e999206d7c3c +++ b/vtools/vsimplify.gpr false @@ -1,21 +0,0 @@ -project Vsimplify is - for Languages use ("Ada"); - for Source_Dirs use ("src"); - for Object_Dir use "obj"; - for Exec_Dir use "."; - for Main use ("vsimplify.adb"); - - type Mode_Type is ("debug", "release"); - Mode : Mode_Type := external ("mode", "debug"); - - package Compiler is - case Mode is - when "debug" => - for Switches ("Ada") - use ("-O0", "-ggdb3"); - when "release" => - for Switches ("Ada") - use ("-O2"); - end case; - end Compiler; -end Vsimplify; diff -uNr a/vtools/vtoposort.gpr b/vtools/vtoposort.gpr --- a/vtools/vtoposort.gpr 257ecf6bf76e5db7b4bb9c4bce74e4b78674b557ff12b7064635d019f955f192599f84e8efac38b967c011e34590576738b949a6908557b021b139a6f11de379 +++ b/vtools/vtoposort.gpr false @@ -1,21 +0,0 @@ -project Vtoposort is - for Languages use ("Ada"); - for Source_Dirs use ("src"); - for Object_Dir use "obj"; - for Exec_Dir use "."; - for Main use ("vtoposort.adb"); - - type Mode_Type is ("debug", "release"); - Mode : Mode_Type := external ("mode", "debug"); - - package Compiler is - case Mode is - when "debug" => - for Switches ("Ada") - use ("-O0", "-ggdb3"); - when "release" => - for Switches ("Ada") - use ("-O2"); - end case; - end Compiler; -end Vtoposort;