aboutsummaryrefslogtreecommitdiff
path: root/devel/gprbuild
diff options
context:
space:
mode:
authorJohn Marino <marino@FreeBSD.org>2014-05-16 09:06:13 +0000
committerJohn Marino <marino@FreeBSD.org>2014-05-16 09:06:13 +0000
commite960f790739ae6b4f8bf38e8b57aabcff45ec728 (patch)
tree8a2a8c2af974c7e15801f3e413f4a3a8492612ec /devel/gprbuild
parentbb2f11734136f17178a56746fea19dd4fb5a0a18 (diff)
Notes
Diffstat (limited to 'devel/gprbuild')
-rw-r--r--devel/gprbuild/Makefile19
-rw-r--r--devel/gprbuild/distinfo4
-rw-r--r--devel/gprbuild/files/patch-Makefile.in2
-rw-r--r--devel/gprbuild/files/patch-gprbuild.gpr2
-rw-r--r--devel/gprbuild/files/patch-share_gprconfig_compilers.xml4
-rw-r--r--devel/gprbuild/files/patch-share_gprconfig_gnat.xml2
-rw-r--r--devel/gprbuild/files/patch-share_gprconfig_linker.xml17
-rw-r--r--devel/gprbuild/files/patch-share_gprconfig_targetset.xml21
-rw-r--r--devel/gprbuild/files/patch-src_gpr__version.adb2
-rw-r--r--devel/gprbuild/files/patch-src_gprbuild-compilation-protocol.adb33
-rw-r--r--devel/gprbuild/files/patch-src_gprbuild-main.adb14
-rw-r--r--devel/gprbuild/files/patch-src_gprinstall-install.adb14
-rw-r--r--devel/gprbuild/files/patch-src_gprlib.adb15
-rw-r--r--devel/gprbuild/files/patch-src_gprslave.adb25
-rw-r--r--devel/gprbuild/files/patch-src_rewrite__data.ada288
-rw-r--r--devel/gprbuild/pkg-plist1
16 files changed, 421 insertions, 42 deletions
diff --git a/devel/gprbuild/Makefile b/devel/gprbuild/Makefile
index 499d9de72afb..0c6a20c6815c 100644
--- a/devel/gprbuild/Makefile
+++ b/devel/gprbuild/Makefile
@@ -3,23 +3,20 @@
PORTNAME= gprbuild
PORTVERSION= ${SNAPSHOT}
-PORTREVISION= 3
CATEGORIES= devel
MASTER_SITES= http://downloads.dragonlace.net/src/
DISTNAME= gprbuild-gpl-${YEAR}-src
-EXTRACT_SUFX= .tgz
MAINTAINER= marino@FreeBSD.org
COMMENT= Adacore multi-language software build tool
LICENSE= GPLv3
-BUILD_DEPENDS+= xmlada>=3.2:${PORTSDIR}/textproc/xmlada \
- gnat_util>=2013:${PORTSDIR}/lang/gnat_util
+BUILD_DEPENDS+= xmlada>=4.4:${PORTSDIR}/textproc/xmlada \
+ gnat_util>=20140422:${PORTSDIR}/lang/gnat_util
-WRKSRC= ${WRKDIR}/gprbuild-${YEAR}-src
-YEAR= 2013
-SNAPSHOT= 20130416
+YEAR= 2014
+SNAPSHOT= 20140417
GNU_CONFIGURE= yes
USES= ada gmake
MAKE_ARGS+= BUILD=production
@@ -33,13 +30,17 @@ OPTIONS_DEFINE= DOCS EXAMPLES
do-build:
# Recreate the do-build target without -j parameter
-# It interferes with PROCESSORS configure argument
+# It interferes with PROCESSORS make argument
@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET})
post-patch:
@${REINPLACE_CMD} -e "s,@AUXPREFIX@,${PREFIX}/gcc-aux," \
- ${WRKSRC}/share/gprconfig/compilers.xml
+ ${WRKSRC}/share/gprconfig/compilers.xml
+ # Try_Help is part of GNAT Pro, but it's not in GCC 4.9 yet
+ # It's not strictly needed. Before it just repeated usage.
+ # There are other messages; just suppress Try_Help on 4 files
+ ${REINPLACE_CMD} -e '/Try_Help;/d' ${WRKSRC}/src/*-main.adb
post-install:
.if !${PORT_OPTIONS:MDOCS}
diff --git a/devel/gprbuild/distinfo b/devel/gprbuild/distinfo
index 0458b89c6921..29289939f8b8 100644
--- a/devel/gprbuild/distinfo
+++ b/devel/gprbuild/distinfo
@@ -1,2 +1,2 @@
-SHA256 (gprbuild-gpl-2013-src.tgz) = 7492347462d0a11a3672397a991ce3741347def3a468f850a91a54dfd4349144
-SIZE (gprbuild-gpl-2013-src.tgz) = 2291685
+SHA256 (gprbuild-gpl-2014-src.tar.gz) = 3c8986ff5f83cc0d3ee69f6e71d9f69a7eb1a7e2656493c829b18fb55c4ad5ac
+SIZE (gprbuild-gpl-2014-src.tar.gz) = 2384695
diff --git a/devel/gprbuild/files/patch-Makefile.in b/devel/gprbuild/files/patch-Makefile.in
index 1ed0dc172e9e..a0074b597d7d 100644
--- a/devel/gprbuild/files/patch-Makefile.in
+++ b/devel/gprbuild/files/patch-Makefile.in
@@ -1,4 +1,4 @@
---- Makefile.in.orig 2013-03-04 17:43:09.000000000 +0000
+--- Makefile.in.orig 2013-12-21 15:45:27.000000000 +0000
+++ Makefile.in
@@ -64,7 +64,7 @@ ADA_GEN_SUBDIR=gnat
diff --git a/devel/gprbuild/files/patch-gprbuild.gpr b/devel/gprbuild/files/patch-gprbuild.gpr
index 1b25ec3d5231..e6e52c3df465 100644
--- a/devel/gprbuild/files/patch-gprbuild.gpr
+++ b/devel/gprbuild/files/patch-gprbuild.gpr
@@ -1,4 +1,4 @@
---- gprbuild.gpr.orig 2013-04-16 14:36:04.000000000 +0000
+--- gprbuild.gpr.orig 2014-04-17 09:50:17.000000000 +0000
+++ gprbuild.gpr
@@ -1,4 +1,5 @@
with "xmlada";
diff --git a/devel/gprbuild/files/patch-share_gprconfig_compilers.xml b/devel/gprbuild/files/patch-share_gprconfig_compilers.xml
index 2e492859d1b1..482b985f84b4 100644
--- a/devel/gprbuild/files/patch-share_gprconfig_compilers.xml
+++ b/devel/gprbuild/files/patch-share_gprconfig_compilers.xml
@@ -1,6 +1,6 @@
---- share/gprconfig/compilers.xml.orig 2013-01-09 18:09:30.000000000 +0000
+--- share/gprconfig/compilers.xml.orig 2014-03-21 10:41:06.000000000 +0000
+++ share/gprconfig/compilers.xml
-@@ -456,16 +456,15 @@
+@@ -657,16 +657,15 @@
</version>
<languages>Ada</languages>
<variable name="gcc_version">
diff --git a/devel/gprbuild/files/patch-share_gprconfig_gnat.xml b/devel/gprbuild/files/patch-share_gprconfig_gnat.xml
index 5f58e8d284aa..9c6ab709ef9f 100644
--- a/devel/gprbuild/files/patch-share_gprconfig_gnat.xml
+++ b/devel/gprbuild/files/patch-share_gprconfig_gnat.xml
@@ -1,4 +1,4 @@
---- share/gprconfig/gnat.xml.orig 2013-01-16 21:07:55.000000000 +0000
+--- share/gprconfig/gnat.xml.orig 2013-09-16 15:29:28.000000000 +0000
+++ share/gprconfig/gnat.xml
@@ -63,7 +63,7 @@
</config>
diff --git a/devel/gprbuild/files/patch-share_gprconfig_linker.xml b/devel/gprbuild/files/patch-share_gprconfig_linker.xml
index 679b8d83a9d4..8aadd165f0cd 100644
--- a/devel/gprbuild/files/patch-share_gprconfig_linker.xml
+++ b/devel/gprbuild/files/patch-share_gprconfig_linker.xml
@@ -1,6 +1,6 @@
---- share/gprconfig/linker.xml.orig 2013-01-25 17:01:24.000000000 +0000
+--- share/gprconfig/linker.xml.orig 2014-02-13 04:59:56.000000000 +0000
+++ share/gprconfig/linker.xml
-@@ -519,11 +519,14 @@
+@@ -599,11 +599,14 @@
</config>
</configuration>
@@ -16,7 +16,7 @@
<target name="^.*irix.*$" />
</targets>
<config>
-@@ -557,10 +560,13 @@
+@@ -675,10 +678,13 @@
</config>
</configuration>
@@ -31,27 +31,20 @@
</targets>
<config>
for Run_Path_Option use ("-Wl,-rpath,");
-@@ -888,6 +894,9 @@
+@@ -1181,6 +1187,12 @@
<target name="^.*mingw.*$" />
<target name="^.*linux.*$" />
<target name="^.*freebsd.*$" />
+ <target name="^.*dragonfly.*$" />
+ <target name="^.*openbsd.*$" />
+ <target name="^.*netbsd.*$" />
- </targets>
- <compilers negate="true">
- <compiler language="C++" />
-@@ -929,6 +938,9 @@
- <target name="^.*mingw.*$" />
- <target name="^.*linux.*$" />
- <target name="^.*freebsd.*$" />
+ <target name="^.*dragonfly.*$" />
+ <target name="^.*openbsd.*$" />
+ <target name="^.*netbsd.*$" />
</targets>
<compilers negate="true">
<compiler language="C++" />
-@@ -970,6 +982,9 @@
+@@ -1265,6 +1277,9 @@
<target name="^.*mingw.*$" />
<target name="^.*linux.*$" />
<target name="^.*freebsd.*$" />
diff --git a/devel/gprbuild/files/patch-share_gprconfig_targetset.xml b/devel/gprbuild/files/patch-share_gprconfig_targetset.xml
index 93a51dc92f02..09c951db10c5 100644
--- a/devel/gprbuild/files/patch-share_gprconfig_targetset.xml
+++ b/devel/gprbuild/files/patch-share_gprconfig_targetset.xml
@@ -1,6 +1,6 @@
---- share/gprconfig/targetset.xml.orig 2012-12-19 17:55:05.000000000 +0000
+--- share/gprconfig/targetset.xml.orig 2014-02-13 04:59:56.000000000 +0000
+++ share/gprconfig/targetset.xml
-@@ -52,8 +52,8 @@
+@@ -66,8 +66,8 @@
<!-- x86-solaris -->
<targetset>
@@ -11,9 +11,12 @@
</targetset>
<!-- x86-windows (mingw) -->
-@@ -144,10 +144,32 @@
+@@ -156,19 +156,34 @@
+ <target>pent.*-cygwin.*</target>
+ </targetset>
- <!-- Freebsd -->
+- <!-- x86 Freebsd -->
++ <!-- Freebsd -->
<targetset>
- <target>x86-freebsd</target>
<target>i.86-.*freebsd.*</target>
@@ -21,12 +24,16 @@
+ <target>x86_64-.*-freebsd.*</target>
</targetset>
+- <!-- x86_64 Freebsd -->
+ <!-- DragonFlyBSD -->
-+ <targetset>
+ <targetset>
+- <target>x86_64-freebsd</target>
+- <target>x86_64-.*freebsd.*</target>
+- <target>amd64-.*freebsd.*</target>
+ <target>i.86-.*-dragonfly.*</target>
+ <target>x86_64-.*-dragonfly.*</target>
-+ </targetset>
-+
+ </targetset>
+
+ <!-- NetBSD -->
+ <targetset>
+ <target>i.86-.*-netbsd.*</target>
diff --git a/devel/gprbuild/files/patch-src_gpr__version.adb b/devel/gprbuild/files/patch-src_gpr__version.adb
index 12c40eca665d..19a78b60b368 100644
--- a/devel/gprbuild/files/patch-src_gpr__version.adb
+++ b/devel/gprbuild/files/patch-src_gpr__version.adb
@@ -1,4 +1,4 @@
---- src/gpr_version.adb.orig 2013-04-16 14:36:02.000000000 +0000
+--- src/gpr_version.adb.orig 2014-04-17 09:50:17.000000000 +0000
+++ src/gpr_version.adb
@@ -65,14 +65,7 @@ package body GPR_Version is
end if;
diff --git a/devel/gprbuild/files/patch-src_gprbuild-compilation-protocol.adb b/devel/gprbuild/files/patch-src_gprbuild-compilation-protocol.adb
new file mode 100644
index 000000000000..bcfcbaba19f4
--- /dev/null
+++ b/devel/gprbuild/files/patch-src_gprbuild-compilation-protocol.adb
@@ -0,0 +1,33 @@
+The GNAT.Rewrite_Data package in not in FSF GNAT yet. Use the local 2013
+version which does not have the Link method. This essentially changes
+this file back to the GPRBuild 2013 version, so it should be ok.
+
+--- src/gprbuild-compilation-protocol.adb.orig 2014-04-17 09:50:17.000000000 +0000
++++ src/gprbuild-compilation-protocol.adb
+@@ -24,7 +24,7 @@ with Ada.Streams.Stream_IO;
+ with Ada.Strings.Fixed; use Ada.Strings.Fixed;
+ with Ada.Strings.Maps.Constants; use Ada.Strings.Maps;
+
+-with GNAT.Rewrite_Data;
++with Rewrite_Data;
+ with GNAT.String_Split; use GNAT.String_Split;
+
+ with Gnatvsn; use Gnatvsn;
+@@ -180,8 +180,6 @@ package body Gprbuild.Compilation.Protoc
+ end Output;
+
+ begin
+- Rewrite_Data.Link (Rewriter, Rewriter_CD'Unchecked_Access);
+-
+ if Dir /= "" and then not Exists (Dir) then
+ Create_Directory (Dir);
+ end if;
+@@ -666,8 +664,6 @@ package body Gprbuild.Compilation.Protoc
+ end Output;
+
+ begin
+- Rewrite_Data.Link (Rewriter, Rewriter_CD'Unchecked_Access);
+-
+ if Exists (Path_Name) then
+ Open (File, In_File, Path_Name);
+
diff --git a/devel/gprbuild/files/patch-src_gprbuild-main.adb b/devel/gprbuild/files/patch-src_gprbuild-main.adb
new file mode 100644
index 000000000000..3a1c2157656a
--- /dev/null
+++ b/devel/gprbuild/files/patch-src_gprbuild-main.adb
@@ -0,0 +1,14 @@
+It seems GNAT Pro makeutl.adb renamed an argument which hasn't trickled
+back to FSF GCC yet.
+
+--- src/gprbuild-main.adb.orig 2014-04-17 09:50:17.000000000 +0000
++++ src/gprbuild-main.adb
+@@ -2099,7 +2099,7 @@ begin
+
+ Do_Compute_Builder_Switches
+ (Project_Tree => Project_Tree,
+- Env => Root_Environment,
++ Root_Environment => Root_Environment,
+ Main_Project => Main_Project);
+
+ Queue.Initialize (Opt.One_Compilation_Per_Obj_Dir);
diff --git a/devel/gprbuild/files/patch-src_gprinstall-install.adb b/devel/gprbuild/files/patch-src_gprinstall-install.adb
new file mode 100644
index 000000000000..17b83db4e984
--- /dev/null
+++ b/devel/gprbuild/files/patch-src_gprinstall-install.adb
@@ -0,0 +1,14 @@
+FSF GNAT 4.9 doesn't have the mode setting capability in Set_Executable
+procedure. At least GPRBuild 2012 didn't use it.
+
+--- src/gprinstall-install.adb.orig 2014-04-17 09:50:17.000000000 +0000
++++ src/gprinstall-install.adb
+@@ -723,7 +723,7 @@ package body Gprinstall.Install is
+
+ if Executable then
+ Set_Executable
+- (Dest_Filename, Mode => S_Owner + S_Group + S_Others);
++ (Dest_Filename);
+ end if;
+
+ -- Add file to manifest
diff --git a/devel/gprbuild/files/patch-src_gprlib.adb b/devel/gprbuild/files/patch-src_gprlib.adb
index b2a2fe87d126..ca278977c848 100644
--- a/devel/gprbuild/files/patch-src_gprlib.adb
+++ b/devel/gprbuild/files/patch-src_gprlib.adb
@@ -1,6 +1,9 @@
---- src/gprlib.adb.orig 2013-04-16 14:36:02.000000000 +0000
+The brain-dead handling of Rpath continues in GPRBuild 2014
+Bring in the GPRBuild 2012/2013 fix again
+
+--- src/gprlib.adb.orig 2014-04-17 09:50:17.000000000 +0000
+++ src/gprlib.adb
-@@ -390,6 +390,11 @@ procedure Gprlib is
+@@ -408,6 +408,11 @@ procedure Gprlib is
Separate_Run_Path_Options : Boolean := False;
@@ -12,7 +15,7 @@
Rpath : String_List_Access := null;
-- Allocated only if Path Option is supported
-@@ -1009,7 +1014,12 @@ begin
+@@ -1040,7 +1045,12 @@ begin
Use_GNAT_Lib := False;
end if;
@@ -24,9 +27,9 @@
+ (new String'(Line (1 .. Last)));
+ end if;
- when Library_Path =>
- Osint.Fail ("library path should not be specified");
-@@ -2127,7 +2137,7 @@ begin
+ when Gprexch.Library_Rpath_Options =>
+ Library_Rpath_Options_Table.Append
+@@ -2166,7 +2176,7 @@ begin
Library_Switches_Table.Append
(new String'("-L" & Imported_Library_Directories.Table (J).all));
diff --git a/devel/gprbuild/files/patch-src_gprslave.adb b/devel/gprbuild/files/patch-src_gprslave.adb
new file mode 100644
index 000000000000..1907e7091221
--- /dev/null
+++ b/devel/gprbuild/files/patch-src_gprslave.adb
@@ -0,0 +1,25 @@
+Set_File_Last_Modify_Time_Stamp has been added to GNAT.OS_Lib on GNAT Pro
+but that hasn't made it to gcc 4.9 yet. For the moment, just disable the
+set file timestamp functionality that it serves here.
+
+--- src/gprslave.adb.orig 2014-04-17 09:50:17.000000000 +0000
++++ src/gprslave.adb
+@@ -1261,17 +1261,8 @@ procedure Gprslave is
+ procedure Set_Stamp
+ (Path_Name : String; Time_Stamp : Time_Stamp_Type)
+ is
+- TS : constant String := String (Time_Stamp);
+ begin
+- Set_File_Last_Modify_Time_Stamp
+- (Path_Name,
+- GM_Time_Of
+- (Year => Year_Type'Value (TS (1 .. 4)),
+- Month => Month_Type'Value (TS (5 .. 6)),
+- Day => Day_Type'Value (TS (7 .. 8)),
+- Hour => Hour_Type'Value (TS (9 .. 10)),
+- Minute => Minute_Type'Value (TS (11 .. 12)),
+- Second => Second_Type'Value (TS (13 .. 14))));
++ pragma Unreferenced (Path_Name, Time_Stamp);
+ end Set_Stamp;
+
+ ------------------
diff --git a/devel/gprbuild/files/patch-src_rewrite__data.ada b/devel/gprbuild/files/patch-src_rewrite__data.ada
new file mode 100644
index 000000000000..81f0eda649cb
--- /dev/null
+++ b/devel/gprbuild/files/patch-src_rewrite__data.ada
@@ -0,0 +1,288 @@
+This functionality was part of GPRBuild 2013, but it has since moved to
+GNAT itself. Unfortunately, that's only happened for GNAT Pro so GCC 4.9
+doesn't have this GNAT.Rewrite_Data. Moveover, the GNAT Pro version has
+been extended since 2013.
+
+Bring in the GNAT 2013 local Rewrite_Data package to build GPRBuild 2014.
+
+--- src/rewrite_data.ads.orig 2014-05-16 07:42:27.000000000 +0000
++++ src/rewrite_data.ads
+@@ -0,0 +1,86 @@
++------------------------------------------------------------------------------
++-- GNAT COMPILER COMPONENTS --
++-- --
++-- R E W R I T E _ D A T A --
++-- --
++-- S p e c --
++-- --
++-- Copyright (C) 2012, Free Software Foundation, Inc. --
++-- --
++-- This is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. This software is distributed in the hope that it will be useful, --
++-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
++-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public --
++-- License for more details. You should have received a copy of the GNU --
++-- General Public License distributed with this software; see file --
++-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
++-- of the license. --
++------------------------------------------------------------------------------
++
++with Ada.Streams; use Ada.Streams;
++
++package Rewrite_Data is
++
++ type Buffer
++ (Size, Size_Pattern, Size_Value : Stream_Element_Offset) is
++ limited private;
++
++ function Create
++ (Pattern, Value : String;
++ Size : Stream_Element_Offset := 1_024) return Buffer;
++ -- Create and return a buffer
++
++ procedure Write
++ (B : in out Buffer;
++ Data : Stream_Element_Array;
++ Output : not null access procedure (Data : Stream_Element_Array));
++ -- Write Data into the buffer, call Output for any prepared data
++
++ function Size (B : Buffer) return Natural;
++ -- Returns the current size of the buffer (count of Stream_Array_Element)
++
++ procedure Flush
++ (B : in out Buffer;
++ Output : not null access procedure (Data : Stream_Element_Array));
++ -- Call Output for all remaining data in the buffer. The buffer is
++ -- reset and ready for another use after this call.
++
++ procedure Reset (B : in out Buffer);
++ pragma Inline (Reset);
++ -- Clear all data in buffer, B is ready for another use. Note that this is
++ -- not needed after a Flush.
++
++ procedure Rewrite
++ (B : in out Buffer;
++ Input : not null access procedure
++ (Buffer : out Stream_Element_Array;
++ Last : out Stream_Element_Offset);
++ Output : not null access procedure (Data : Stream_Element_Array));
++ -- Read data from Input, rewrite them and then call Output
++
++private
++
++ type Buffer
++ (Size, Size_Pattern, Size_Value : Stream_Element_Offset) is
++ limited record
++ -- Fully prepared/rewritten data waiting to be output
++ Buffer : Stream_Element_Array (1 .. Size);
++
++ -- Current data checked, this buffer contains every piece of data
++ -- starting with the pattern. It means that at any point:
++ -- Current (1 .. Pos_C) = Pattern (1 .. Pos_C)
++ Current : Stream_Element_Array (1 .. Size_Pattern);
++
++ -- The pattern to look for
++ Pattern : Stream_Element_Array (1 .. Size_Pattern);
++
++ -- The value the pattern is replaced by
++ Value : Stream_Element_Array (1 .. Size_Value);
++
++ Pos_C : Stream_Element_Offset; -- last valid element in Current
++ Pos_B : Stream_Element_Offset; -- last valid element in Buffer
++ end record;
++
++end Rewrite_Data;
+--- src/rewrite_data.adb.orig 2014-05-16 07:42:21.000000000 +0000
++++ src/rewrite_data.adb
+@@ -0,0 +1,189 @@
++------------------------------------------------------------------------------
++-- GNAT COMPILER COMPONENTS --
++-- --
++-- R E W R I T E _ D A T A --
++-- --
++-- B o d y --
++-- --
++-- Copyright (C) 2012, Free Software Foundation, Inc. --
++-- --
++-- This is free software; you can redistribute it and/or modify it under --
++-- terms of the GNU General Public License as published by the Free Soft- --
++-- ware Foundation; either version 3, or (at your option) any later ver- --
++-- sion. This software is distributed in the hope that it will be useful, --
++-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
++-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public --
++-- License for more details. You should have received a copy of the GNU --
++-- General Public License distributed with this software; see file --
++-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
++-- of the license. --
++------------------------------------------------------------------------------
++
++with Ada.Unchecked_Conversion;
++
++package body Rewrite_Data is
++
++ use Ada;
++
++ subtype SEO is Stream_Element_Offset;
++
++ ------------
++ -- Create --
++ ------------
++
++ function Create
++ (Pattern, Value : String;
++ Size : Stream_Element_Offset := 1_024) return Buffer
++ is
++
++ subtype SP is String (1 .. Pattern'Length);
++ subtype SEAP is Stream_Element_Array (1 .. Pattern'Length);
++
++ subtype SV is String (1 .. Value'Length);
++ subtype SEAV is Stream_Element_Array (1 .. Value'Length);
++
++ function To_SEAP is new Unchecked_Conversion (SP, SEAP);
++ function To_SEAV is new Unchecked_Conversion (SV, SEAV);
++
++ begin
++ return B : Buffer
++ (SEO'Max (Size, SEO (Pattern'Length)), -- can't be smaller than pattern
++ SEO (Pattern'Length),
++ SEO (Value'Length))
++ do
++ B.Pattern := To_SEAP (Pattern);
++ B.Value := To_SEAV (Value);
++ B.Pos_C := 0;
++ B.Pos_B := 0;
++ end return;
++ end Create;
++
++ -----------
++ -- Flush --
++ -----------
++
++ procedure Flush
++ (B : in out Buffer;
++ Output : not null access procedure (Data : Stream_Element_Array)) is
++ begin
++ if B.Pos_B > 0 then
++ Output (B.Buffer (1 .. B.Pos_B));
++ end if;
++
++ if B.Pos_C > 0 then
++ Output (B.Current (1 .. B.Pos_C));
++ end if;
++
++ Reset (B);
++ end Flush;
++
++ -----------
++ -- Reset --
++ -----------
++
++ procedure Reset (B : in out Buffer) is
++ begin
++ B.Pos_B := 0;
++ B.Pos_C := 0;
++ end Reset;
++
++ -------------
++ -- Rewrite --
++ -------------
++
++ procedure Rewrite
++ (B : in out Buffer;
++ Input : not null access procedure
++ (Buffer : out Stream_Element_Array;
++ Last : out Stream_Element_Offset);
++ Output : not null access procedure (Data : Stream_Element_Array))
++ is
++ Buffer : Stream_Element_Array (1 .. B.Size);
++ Last : Stream_Element_Offset;
++ begin
++ Rewrite_All : loop
++ Input (Buffer, Last);
++ exit Rewrite_All when Last = 0;
++ Write (B, Buffer (1 .. Last), Output);
++ end loop Rewrite_All;
++
++ Flush (B, Output);
++ end Rewrite;
++
++ ----------
++ -- Size --
++ ----------
++
++ function Size (B : Buffer) return Natural is
++ begin
++ return Natural (B.Pos_B + B.Pos_C);
++ end Size;
++
++ -----------
++ -- Write --
++ -----------
++
++ procedure Write
++ (B : in out Buffer;
++ Data : Stream_Element_Array;
++ Output : not null access procedure (Data : Stream_Element_Array))
++ is
++
++ procedure Need_Space (Size : Stream_Element_Offset);
++ pragma Inline (Need_Space);
++
++ ----------------
++ -- Need_Space --
++ ----------------
++
++ procedure Need_Space (Size : Stream_Element_Offset) is
++ begin
++ if B.Pos_B + Size > B.Size then
++ Output (B.Buffer (1 .. B.Pos_B));
++ B.Pos_B := 0;
++ end if;
++ end Need_Space;
++
++ begin
++ if B.Size_Pattern = 0 then
++ Output (Data);
++
++ else
++ for K in Data'Range loop
++ if Data (K) = B.Pattern (B.Pos_C + 1) then
++ -- Store possible start of a macth
++ B.Pos_C := B.Pos_C + 1;
++ B.Current (B.Pos_C) := Data (K);
++
++ else
++ -- Not part of pattern, if a start of a match was found,
++ -- remove it.
++
++ if B.Pos_C /= 0 then
++ Need_Space (B.Pos_C);
++
++ B.Buffer (B.Pos_B + 1 .. B.Pos_B + B.Pos_C) :=
++ B.Current (1 .. B.Pos_C);
++ B.Pos_B := B.Pos_B + B.Pos_C;
++ B.Pos_C := 0;
++ end if;
++
++ Need_Space (1);
++ B.Pos_B := B.Pos_B + 1;
++ B.Buffer (B.Pos_B) := Data (K);
++ end if;
++
++ if B.Pos_C = B.Size_Pattern then
++ -- The pattern is found
++
++ Need_Space (B.Size_Value);
++
++ B.Buffer (B.Pos_B + 1 .. B.Pos_B + B.Size_Value) := B.Value;
++ B.Pos_C := 0;
++ B.Pos_B := B.Pos_B + B.Size_Value;
++ end if;
++ end loop;
++ end if;
++ end Write;
++
++end Rewrite_Data;
diff --git a/devel/gprbuild/pkg-plist b/devel/gprbuild/pkg-plist
index 60415c18bb85..ee7dcf039c72 100644
--- a/devel/gprbuild/pkg-plist
+++ b/devel/gprbuild/pkg-plist
@@ -8,6 +8,7 @@ libexec/gprbuild/gprlib
share/gpr/_default.gpr
share/gprconfig/asm.xml
share/gprconfig/c.xml
+share/gprconfig/clean.xml
share/gprconfig/compilers.xml
share/gprconfig/cpp.xml
share/gprconfig/cross.xml