From 1ad10395dc17a4257d26e8a854cb98e7107ceff5 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Mon, 11 Jul 2016 10:48:59 +0200 Subject: Added function to write responsefiles. The arguments are written in the responsefile separated by whitespace. If the argument itself contains a whitespace it is quoted. Bug 18308 --- lib/Responsefile.mli | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lib/Responsefile.mli (limited to 'lib/Responsefile.mli') diff --git a/lib/Responsefile.mli b/lib/Responsefile.mli new file mode 100644 index 00000000..2522b7c5 --- /dev/null +++ b/lib/Responsefile.mli @@ -0,0 +1,24 @@ +(* *********************************************************************) +(* *) +(* The Compcert verified compiler *) +(* *) +(* Xavier Leroy, INRIA Paris-Rocquencourt *) +(* Bernhard Schommer, AbsInt Angewandte Informatik GmbH *) +(* *) +(* Copyright Institut National de Recherche en Informatique et en *) +(* Automatique. All rights reserved. This file is distributed *) +(* under the terms of the GNU General Public License as published by *) +(* the Free Software Foundation, either version 2 of the License, or *) +(* (at your option) any later version. This file is also distributed *) +(* under the terms of the INRIA Non-Commercial License Agreement. *) +(* *) +(* *********************************************************************) + + +val expand_responsefiles: string array -> string array + (** Expand responsefile arguments contained in the array and return the full + set of arguments. *) + +val write_responsefile: out_channel -> string array -> unit + (** Write the arguments on the out_channel. All arguments that contain + whitespaces are quoted. *) -- cgit From a6bde8ba057ff057e311781fd91b4a9ab441731c Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Mon, 11 Jul 2016 12:21:47 +0200 Subject: Really added the function. Bug 18308 --- lib/Responsefile.mli | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Responsefile.mli') diff --git a/lib/Responsefile.mli b/lib/Responsefile.mli index 2522b7c5..95c74bda 100644 --- a/lib/Responsefile.mli +++ b/lib/Responsefile.mli @@ -19,6 +19,6 @@ val expand_responsefiles: string array -> string array (** Expand responsefile arguments contained in the array and return the full set of arguments. *) -val write_responsefile: out_channel -> string array -> unit - (** Write the arguments on the out_channel. All arguments that contain - whitespaces are quoted. *) +val write_responsefile: out_channel -> string array -> int -> unit + (** Write the arguments starting at the given index as repsonsefile on the given + out_channel. All arguments that contain whitespaces are quoted. *) -- cgit From efa462bd1655c6b2c8f064e214762650092257e8 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 12 Jul 2016 13:18:42 +0200 Subject: Added heuristic for passing arg via responsefiles. Since gnu make and other tools under windows seem to have a limit of around 8000 bytes per command line the arguments should be passed via responsefiles instead. Bug 18308 --- lib/Responsefile.mli | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lib/Responsefile.mli') diff --git a/lib/Responsefile.mli b/lib/Responsefile.mli index 95c74bda..b55dac16 100644 --- a/lib/Responsefile.mli +++ b/lib/Responsefile.mli @@ -18,7 +18,3 @@ val expand_responsefiles: string array -> string array (** Expand responsefile arguments contained in the array and return the full set of arguments. *) - -val write_responsefile: out_channel -> string array -> int -> unit - (** Write the arguments starting at the given index as repsonsefile on the given - out_channel. All arguments that contain whitespaces are quoted. *) -- cgit From f22c32dcda0e8b546e85e8ad95d0ad655e365d38 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Wed, 20 Jul 2016 13:20:19 +0200 Subject: Added simplified reader and printer for gnu @files The functions expandargv and writeargv resemble the functions from the libiberity that are used by the gnu tools. Additionaly a new configuration is added in order to determine which kind of response files are supported for calls to other tools. Bug 18308 --- lib/Responsefile.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Responsefile.mli') diff --git a/lib/Responsefile.mli b/lib/Responsefile.mli index b55dac16..ec82c32e 100644 --- a/lib/Responsefile.mli +++ b/lib/Responsefile.mli @@ -15,6 +15,6 @@ (* *********************************************************************) -val expand_responsefiles: string array -> string array +val expandargv: string array -> string array (** Expand responsefile arguments contained in the array and return the full set of arguments. *) -- cgit From 5309f16159e4decd81330622dcdd6eb4b25819a1 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 16 Aug 2016 10:35:17 +0200 Subject: Moved quoting functions in Responsefile Also corrected some typos and corrected exception handling for expandargv. Bug 18308 --- lib/Responsefile.mli | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/Responsefile.mli') diff --git a/lib/Responsefile.mli b/lib/Responsefile.mli index ec82c32e..ada5a15d 100644 --- a/lib/Responsefile.mli +++ b/lib/Responsefile.mli @@ -18,3 +18,14 @@ val expandargv: string array -> string array (** Expand responsefile arguments contained in the array and return the full set of arguments. *) + +exception Error of string + (** Raised by [expandargv] in case of an error *) + +val gnu_quote : string -> string + (** [gnu_quote arg] returns [arg] quoted compatible with the gnu tool chain + quoting conventions. *) + +val diab_quote : string -> string + (** [diab_quote arg] returns [arg] quoted compatible with the diab tool chain + quoting conventions. *) -- cgit