summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2019-10-27 08:17:23 +1100
committerChris Johns <chrisj@rtems.org>2019-10-27 08:17:23 +1100
commit9b5017f898bc90df702c8654ccd75733d2250114 (patch)
tree9ab411d73b064b08d3401719298c88c50efb9365
parent5/bsps: Add Xilinx Zynq ZC706 BSP. (diff)
downloadrtems-source-builder-9b5017f898bc90df702c8654ccd75733d2250114.tar.bz2
sb/config: Add support for line continuation.
- Add line continuation support so empty macros can be used at the end of configure command lines, ie RTEMS kernel. The config parser removes empty lines and wihout this support a trailing line continuation character joins a configure command line to next command. - Fix freetype's gmake support for non-GNU operating systems.
-rw-r--r--source-builder/config/freetype-1.cfg6
-rw-r--r--source-builder/sb/config.py16
2 files changed, 19 insertions, 3 deletions
diff --git a/source-builder/config/freetype-1.cfg b/source-builder/config/freetype-1.cfg
index ec03feb..95892dd 100644
--- a/source-builder/config/freetype-1.cfg
+++ b/source-builder/config/freetype-1.cfg
@@ -41,8 +41,12 @@ URL: http://www.freetype.org/
%{host_build_flags}
%ifos freebsd
- GNUMAKE=%{__make} \
+ GNUMAKE=%{__make}
+ %else
+ GNUMAKE=
%endif
+
+ GNUMAKE=${GNUMAKE} \
../${source_dir_freetype}/configure \
--host=%{_host} \
--prefix=%{_prefix} \
diff --git a/source-builder/sb/config.py b/source-builder/sb/config.py
index 58316db..d4c58aa 100644
--- a/source-builder/sb/config.py
+++ b/source-builder/sb/config.py
@@ -1056,20 +1056,32 @@ class file:
line = line[0:-1]
b = line.find('#')
if b >= 0:
- line = line[1:b]
+ line = line[1:b] + ('\\' if line[-1] == '\\' else '')
return line.strip()
+ def _clean_and_pack(line, last_line):
+ leading_ws = ' ' if len(line) > 0 and line[0].isspace() else ''
+ line = _clean(line)
+ if len(last_line) > 0:
+ line = last_line + leading_ws + line
+ return line
+
#
# Need to add code to count matching '{' and '}' and if they
# do not match get the next line and add to the string until
# they match. This closes an opening '{' that is on another
# line.
#
+ ll = ''
for l in config:
self.lc += 1
- l = _clean(l)
+ l = _clean_and_pack(l, ll)
if len(l) == 0:
continue
+ if l[-1] == '\\':
+ ll = l[0:-1]
+ continue
+ ll = ''
if isvalid:
indicator = '>'
else: