source: rtems-source-builder/source-builder/defaults.mc @ 47d703fd

4.104.95
Last change on this file since 47d703fd was 47d703fd, checked in by Chris Johns <chrisj@…>, on 12/03/15 at 11:22:17

sb. Add VERSION support for releasing the RSB.

Add support to release the RSB by adding the VERSION file. The file
is a single line with the version.

Fix the reports to include the version. Update the INI file
support to include the details of the build.

Show the GIT or released version when the command starts.

Closes #2480.

  • Property mode set to 100644
File size: 16.0 KB
Line 
1#
2# RTEMS Tools Project (http://www.rtems.org/)
3# Copyright 2010-2013 Chris Johns (chrisj@rtems.org)
4# All rights reserved.
5#
6# This file is part of the RTEMS Tools package in 'rtems-tools'.
7#
8# Permission to use, copy, modify, and/or distribute this software for any
9# purpose with or without fee is hereby granted, provided that the above
10# copyright notice and this permission notice appear in all copies.
11#
12# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19
20#
21# All paths in defaults must be Unix format. Do not store any Windows format
22# paths in the defaults.
23#
24# Every entry must describe the type of checking a host must pass.
25#
26# Records:
27#  key: type, attribute, value
28#   type     : none, dir, exe, triplet
29#   attribute: none, required, optional
30#   value    : 'single line', '''multi line'''
31#
32
33#
34# Global defaults
35#
36[global]
37
38# Nothing
39nil:                 none,    none,     ''
40
41# Set to invalid values.
42_bset:               none,    none,     ''
43name:                none,    none,     ''
44version:             none,    none,     ''
45release:             none,    none,     ''
46buildname:           none,    none,     '%{name}'
47
48# The default is not release.
49is_rsb_release:      none,    none,     '0'
50
51# GNU triples needed to build packages
52_host:               triplet, required, ''
53_build:              triplet, required, ''
54_target:             none,    optional, ''
55
56# The user
57_uid:                none,    convert,  '%(%{__id_u} -n)'
58
59# Default flags that can be overridded to supply specific host or build
60# flags and include paths to the tools. The host is the final platform
61# the tools will run on and build is the host building the tools.
62host_cflags:         none,    convert,  '-O2 -pipe'
63host_cxxflags:       none,    convert,  '-O2 -pipe'
64host_includes:       none,    convert,  ''
65build_cflags:        none,    convert,  '-O2 -pipe'
66build_cxxflags:      none,    convert,  '-O2 -pipe'
67build_includes:      none,    convert,  ''
68
69# Extra path a platform can override.
70_extra_path:         none,    none,     '%{_sbdir}'
71_ld_library_path:    none,    none,     'LD_LIBRARY_PATH'
72
73# Paths
74_host_platform:      none,    none,     '%{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}'
75_host_cc:            none,    none,     'gcc'
76_host_cxx:           none,    none,     'g++'
77_arch:               none,    none,     '%{_host_arch}'
78_topdir:             dir,     required, '%{_cwd}'
79_configdir:          dir,     optional, '%{_topdir}/config:%{_sbdir}/config:%{_sbtop}/bare/config'
80_tardir:             dir,     optional, '%{_topdir}/tar'
81_sourcedir:          dir,     optional, '%{_topdir}/sources'
82_patchdir:           dir,     optional, '%{_topdir}/patches:%{_sbdir}/patches'
83_builddir:           dir,     optional, '%{_topdir}/build/%{buildname}'
84_buildcxcdir:        dir,     optional, '%{_topdir}/build/%{buildname}-cxc'
85_buildxcdir:         dir,     optional, '%{_topdir}/build/%{buildname}-xc'
86_docdir:             dir,     none,     '%{_defaultdocdir}'
87_tmppath:            dir,     none,     '%{_topdir}/build/tmp'
88_tmproot:            dir,     none,     '%{_tmppath}/sb-%{_uid}/%{_bset}'
89_tmpcxcroot:         dir,     none,     '%{_tmppath}/sb-%{_uid}-cxc/%{_bset}'
90buildroot:           dir,     none,     '%{_tmppath}/%{buildname}-%{_uid}'
91buildcxcroot:        dir,     none,     '%{_tmppath}/%{buildname}-%{_uid}-cxc'
92buildxcroot:         dir,     none,     '%{_tmppath}/%{buildname}-%{_uid}-xx'
93_datadir:            dir,     none,     '%{_prefix}/share'
94_defaultdocdir:      dir,     none,     '%{_prefix}/share/doc'
95_exeext:             none,    none,     ''
96_exec_prefix:        dir,     none,     '%{_prefix}'
97_bindir:             dir,     none,     '%{_exec_prefix}/bin'
98_sbindir:            dir,     none,     '%{_exec_prefix}/sbin'
99_libexecdir:         dir,     none,     '%{_exec_prefix}/libexec'
100_datarootdir:        dir,     none,     '%{_prefix}/share'
101_datadir:            dir,     none,     '%{_datarootdir}'
102_sysconfdir:         dir,     none,     '%{_prefix}/etc'
103_sharedstatedir:     dir,     none,     '%{_prefix}/com'
104_localstatedir:      dir,     none,     '%{prefix}/var'
105_includedir:         dir,     none,     '%{_prefix}/include'
106_lib:                dir,     none,     'lib'
107_libdir:             dir,     none,     '%{_exec_prefix}/%{_lib}'
108_libexecdir:         dir,     none,     '%{_exec_prefix}/libexec'
109_mandir:             dir,     none,     '%{_datarootdir}/man'
110_infodir:            dir,     none,     '%{_datarootdir}/info'
111_localedir:          dir,     none,     '%{_datarootdir}/locale'
112_localedir:          dir,     none,     '%{_datadir}/locale'
113_localstatedir:      dir,     none,     '%{_prefix}/var'
114_pathprepend:        none,    none,     ''
115_pathpostpend:       none,    none,     ''
116_prefix:             dir,     none,     '%{_usr}'
117_usr:                dir,     none,     '/usr/local'
118_usrsrc:             dir,     none,     '%{_usr}/src'
119_var:                dir,     none,     '/usr/local/var'
120_varrun:             dir,     none,     '%{_var}/run'
121
122# Defaults, override in platform specific modules.
123___setup_shell:      exe,     required, '/bin/sh'
124__aclocal:           exe,     optional, 'aclocal'
125__ar:                exe,     required, 'ar'
126__arch_install_post: exe,     none,     '%{nil}'
127__as:                exe,     required, 'as'
128__autoconf:          exe,     optional, 'autoconf'
129__autoheader:        exe,     optional, 'autoheader'
130__automake:          exe,     optional, 'automake'
131__autoreconf:        exe,     optional, 'autoreconf'
132__awk:               exe,     required, 'awk'
133__bash:              exe,     optional, '/bin/bash'
134__bison:             exe,     required, '/usr/bin/bison'
135__bzip2:             exe,     required, '/usr/bin/bzip2'
136__cat:               exe,     required, '/bin/cat'
137__cc:                exe,     required, '/usr/bin/gcc'
138__chgrp:             exe,     required, '/usr/bin/chgrp'
139__chmod:             exe,     required, '/bin/chmod'
140__chown:             exe,     required, '/usr/sbin/chown'
141__cp:                exe,     required, '/bin/cp'
142__cpp:               exe,     none,     '%{__cc} -E'
143__cvs:               exe,     required, '/usr/bin/cvs'
144__cvs_z:             none,    none,     '%{__cvs} -z 9'
145__cxx:               exe,     required, '/usr/bin/g++'
146__flex:              exe,     required, '/usr/bin/flex'
147__git:               exe,     required, '/usr/bin/git'
148__grep:              exe,     required, '/usr/bin/grep'
149__gzip:              exe,     required, '/usr/bin/gzip'
150__id:                exe,     required, '/usr/bin/id'
151__id_u:              exe,     none,     '%{__id} -u'
152__install:           exe,     required, '/usr/bin/install'
153__install_info:      exe,     optional, '/usr/bin/install-info'
154__ld:                exe,     required, '/usr/bin/ld'
155__ldconfig:          exe,     required, '/sbin/ldconfig'
156__ln_s:              exe,     none,     'ln -s'
157__make:              exe,     required, 'make'
158__makeinfo:          exe,     required, '/usr/bin/makeinfo'
159__mkdir:             exe,     required, '/bin/mkdir'
160__mkdir_p:           exe,     none,     '/bin/mkdir -p'
161__mv:                exe,     required, '/bin/mv'
162__nm:                exe,     required, '/usr/bin/nm'
163__objcopy:           exe,     optional, '/usr/bin/objcopy'
164__objdump:           exe,     optional, '/usr/bin/objdump'
165__patch_bin:         exe,     required, '/usr/bin/patch'
166__patch_opts:        none,    none,     '%{nil}'
167__patch:             exe,     none,     '%{__patch_bin} %{__patch_opts}'
168__perl:              exe,     optional, 'perl'
169__svn:               exe,     optional, '/usr/bin/svn'
170__ranlib:            exe,     required, 'ranlib'
171__rm:                exe,     required, '/bin/rm'
172__rmfile:            exe,     none,     '%{__rm} -f'
173__rmdir:             exe,     none,     '%{__rm} -rf'
174__sed:               exe,     required, '/usr/bin/sed'
175__setup_post:        exe,     none,     '%{__chmod} -R a+rX,g-w,o-w .'
176__sh:                exe,     required, '/bin/sh'
177__tar:               exe,     required, '/usr/bin/tar'
178__tar_extract:       exe,     none,     '%{__tar} -xvvf'
179__touch:             exe,     required, '/usr/bin/touch'
180__unzip:             exe,     required, '/usr/bin/unzip'
181__xz:                exe,     required, '/usr/bin/xz'
182
183# Shell Build Settings.
184___build_args:       none,    none,     '-e'
185___build_cmd:        none,    none,     '%{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_remsudo:%{_remsudo} }%{?_remchroot:%{_remchroot} %{_remroot} }%{___build_shell} %{___build_args}'
186___build_post:       none,    none,     'exit 0'
187
188# Prebuild set up script.
189___build_pre:        none,    none,     '''# ___build_pre in as set up in defaults.py
190# Save the original path away.
191export SB_ORIG_PATH=${PATH}
192# Directories
193%{?_prefix:SB_PREFIX="%{_prefix}"}
194%{?_prefix:SB_PREFIX_CLEAN=$(echo "%{_prefix}" | %{__sed} -e 's/^\///')}
195SB_SOURCE_DIR="%{_sourcedir}"
196SB_BUILD_DIR="%{_builddir}"
197# host == build, use build; host != build , host uses host and build uses build
198SB_HOST_CFLAGS="%{host_cflags} %{host_includes}"
199SB_HOST_CXXFLAGS="%{host_cxxflags} %{host_includes}"
200SB_HOST_LDFLAGS="%{?host_ldflags:%{host_ldflags}}%{?_tmproot:-L%{_tmproot}/${SB_PREFIX_CLEAN}/lib}"
201SB_BUILD_CFLAGS="%{build_cflags} %{?_tmproot:-I%{_tmproot}/${SB_PREFIX_CLEAN}/include}"
202SB_BUILD_CXXFLAGS="%{build_cxxflags} %{?_tmproot:-I%{_tmproot}/${SB_PREFIX_CLEAN}/include}"
203SB_BUILD_LDFLAGS="%{?build_ldflags:%{build_ldflags}}%{?_tmproot:-L%{_tmproot}/${SB_PREFIX_CLEAN}/lib}"
204SB_CFLAGS="${SB_BUILD_CFLAGS} %{build_includes}"
205SB_CXXFLAGS="${SB_BUILD_CXXFLAGS} %{build_includes}"
206SB_ARCH="%{_arch}"
207SB_OS="%{_os}"
208export SB_SOURCE_DIR SB_BUILD_DIR SB_ARCH SB_OS
209export SB_HOST_CFLAGS SB_HOST_CXXFLAGS SB_HOST_LDFLAGS
210export SB_BUILD_CFLAGS SB_BUILD_CXXFLAGS SB_BUILD_LDFLAGS
211export SB_CFLAGS SB_CXXFLAGS
212# Documentation
213SB_DOC_DIR="%{_docdir}"
214export SB_DOC_DIR
215# Packages
216SB_PACKAGE_NAME="%{name}"
217SB_PACKAGE_BUILDNAME="%{buildname}"
218SB_PACKAGE_VERSION="%{version}"
219SB_PACKAGE_RELEASE="%{release}"
220export SB_PACKAGE_NAME SB_PACKAGE_VERSION SB_PACKAGE_RELEASE
221# Build directories
222export SB_PREFIX
223%{?_builddir:SB_BUILD_DIR="%{_builddir}"}
224%{?buildroot:SB_BUILD_ROOT="%{buildroot}"}
225%{?buildroot:%{?_prefix:SB_BUILD_ROOT_BINDIR="%{buildroot}/${SB_PREFIX_CLEAN}/bin"}}
226export SB_BUILD_ROOT SB_BUILD_DIR SB_BUILD_ROOT_BINDIR
227%{?_buildcxcdir:SB_BUILD_CXC_DIR="%{_buildcxcdir}"}
228%{?buildcxcroot:SB_BUILD_CXC_ROOT="%{buildcxcroot}"}
229%{?buildcxcroot:%{?_prefix:SB_BUILD_CXC_ROOT_BINDIR="%{buildcxcroot}/${SB_PREFIX_CLEAN}/bin"}}
230export SB_BUILD_CXC_ROOT SB_BUILD_CXC_DIR SB_BUILD_CXC_ROOT_BINDIR
231%{?_tmproot:SB_TMPROOT="%{_tmproot}"}
232%{?_tmproot:%{?_prefix:SB_TMPPREFIX="%{_tmproot}/${SB_PREFIX_CLEAN}"}}
233%{?_tmproot:%{?_prefix:SB_TMPBINDIR="%{_tmproot}/${SB_PREFIX_CLEAN}/bin"}}
234export SB_TMPROOT SB_TMPPREFIX SB_TMPBINDIR
235%{?_tmpcxcroot:SB_TMPCXCROOT="%{_tmproot}"}
236%{?_tmpcxcroot:%{?_prefix:SB_TMPCXCPREFIX="%{_tmpcxcroot}/${SB_PREFIX_CLEAN}"}}
237%{?_tmpcxcroot:%{?_prefix:SB_TMPCXCBINDIR="%{_tmpcxcroot}/${SB_PREFIX_CLEAN}/bin"}}
238export SB_TMPCXCROOT SB_TMPCXCPREFIX SB_TMPCXCBINDIR
239# Extra path support
240%{?_extra_path:SB_EXTRAPATH="%{_extra_path}"}
241# The compiler flags
242%{?_targetcflags:CFLAGS_FOR_TARGET="%{_targetcflags}"}
243%{?_targetcxxflags:CXXFLAGS_FOR_TARGET="%{_targetcxxflags}"}
244export CFLAGS_FOR_TARGET
245export CXXFLAGS_FOR_TARGET
246# Set up the path. Put the CXC path first.
247if test -n "${SB_TMPBINDIR}" ; then
248 PATH="${SB_TMPBINDIR}:$PATH"
249fi
250if test -n "${SB_TMPCXCBINDIR}" ; then
251 PATH="${SB_TMPCXCBINDIR}:$PATH"
252fi
253if test -n "${SB_EXTRAPATH}" ; then
254 PATH="${SB_EXTRAPATH}:$PATH"
255fi
256%{?_pathprepend:PATH="%{_pathprepend}:$PATH"}
257%{?_pathpostpend:PATH="$PATH:%{_pathpostpend}"}
258export PATH
259# Default environment set up.
260LANG=C
261export LANG
262unset DISPLAY || :
263umask 022
264cd "%{_builddir}"'''
265
266___build_shell:      none,    none,     '%{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}'
267
268___build_template:   none,    none,     '''#!%{___build_shell}
269%{___build_pre}
270%{nil}'''
271
272# Configure command
273configure:           none,    none,     '''
274CFLAGS="${CFLAGS:-${SB_CFLAGS}" ; export CFLAGS ;
275CXXFLAGS="${CXXFLAGS:-${SB_CFLAGS}}" ; export CXXFLAGS ;
276FFLAGS="${FFLAGS:-${SB_CFLAGS}}" ; export FFLAGS ;
277./configure --build=%{_build} --host=%{_host} \
278      --target=%{_target_platform} \
279      --program-prefix=%{?_program_prefix} \
280      --prefix=%{_prefix} \
281      --exec-prefix=%{_exec_prefix} \
282      --bindir=%{_bindir} \
283      --sbindir=%{_sbindir} \
284      --sysconfdir=%{_sysconfdir} \
285      --datadir=%{_datadir} \
286      --includedir=%{_includedir} \
287      --libdir=%{_libdir} \
288      --libexecdir=%{_libexecdir} \
289      --localstatedir=%{_localstatedir} \
290      --sharedstatedir=%{_sharedstatedir} \
291      --mandir=%{_mandir} \
292      --infodir=%{_infodir}'''
293
294# Build script support.
295build_directory:     none,    none,     '''
296if test "%{_build}" != "%{_host}" ; then
297  if test -z "%{_target}" ; then
298    build_dir="build-xc"
299  else
300    build_dir="build-cxc"
301  fi
302else
303  build_dir="build"
304fi'''
305
306# Host/build flags.
307host_build_flags:    none,    none,     '''
308# Host and build flags, Cross build if host and build are different and
309# Cxc build if target is deifned and also different.
310# Note, gcc is not ready to be compiled with -std=gnu99 (this needs to be checked).
311if test "%{_build}" != "%{_host}" ; then
312  # Cross build
313  CC=$(echo "%{_host}-%{_host_cc}" | sed -e 's,-std=gnu99 ,,')
314  CXX=$(echo "%{_host}-%{_host_cxx}" | sed -e 's,-std=gnu99 ,,')
315  CFLAGS="${SB_HOST_CFLAGS}"
316  CXXFLAGS="${SB_HOST_CXXFLAGS}"
317  LDFLAGS="${SB_HOST_LDFLAGS}"
318  # Host
319  CFLAGS_FOR_HOST="${SB_HOST_CFLAGS}"
320  CXXFLAGS_FOR_HOST="${SB_HOST_CXXFLAGS}"
321  LDFLAGS_FOR_HOST="${SB_HOST_LDFLAGS}"
322  CXXFLAGS_FOR_HOST="${SB_HOST_CFLAGS}"
323  CC_FOR_HOST=$(echo "%{_host_cc} ${SB_HOST_CFLAGS}" | sed -e 's,-std=gnu99 ,,')
324  CXX_FOR_HOST=$(echo "%{_host_cxx} ${SB_HOST_CXXFLAGS}" | sed -e 's,-std=gnu99 ,,')
325  # Build
326  CFLAGS_FOR_BUILD="${SB_BUILD_CFLAGS}"
327  CXXFLAGS_FOR_BUILD="${SB_BUILD_CXXFLAGS}"
328  LDFLAGS_FOR_BUILD="${SB_BUILD_LDFLAGS}"
329  CXXFLAGS_FOR_BUILD="${SB_BUILD_CFLAGS}"
330  CC_FOR_BUILD=$(echo "%{__cc} ${SB_BUILD_CFLAGS}" | sed -e 's,-std=gnu99 ,,')
331  CXX_FOR_BUILD=$(echo "%{__cxx} ${SB_BUILD_CXXFLAGS}" | sed -e 's,-std=gnu99 ,,')
332else
333  LDFLAGS="${SB_BUILD_LDFLAGS}"
334  CC=$(echo "%{__cc} ${SB_BUILD_CFLAGS}" | sed -e 's,-std=gnu99 ,,')
335  CXX=$(echo "%{__cxx} ${SB_BUILD_CXXFLAGS}" | sed -e 's,-std=gnu99 ,,')
336  CC_FOR_BUILD=${CC}
337  CXX_FOR_BUILD=${CXX}
338fi
339export CC CXX CFLAGS CXXFLAGS LDFLAGS
340export CC_FOR_HOST CXX_FOR_HOST CFLAGS_FOR_HOST CXXFLAGS_FOR_HOST LDFLAGS_FOR_HOST
341export CC_FOR_BUILD CXX_FOR_BUILD CFLAGS_FOR_BUILD CXXFLAGS_FOR_BUILD LDFLAGS_FOR_BUILD'''
342
343# Build/build flags.
344build_build_flags:    none,    none,     '''
345# Build and build flags means force build == host
346# gcc is not ready to be compiled with -std=gnu99
347LDFLAGS="${SB_HOST_LDFLAGS}"
348CC=$(echo "%{__cc} ${SB_CFLAGS}" | sed -e 's,-std=gnu99 ,,')
349CXX=$(echo "%{__cxx} ${SB_CXXFLAGS}" | sed -e 's,-std=gnu99 ,,')
350CC_FOR_BUILD=${CC}
351CXX_FOR_BUILD=${CXX}
352export CC CXX CC_FOR_BUILD CXX_FOR_BUILD CFLAGS LDFLAGS'''
353
354# Default package settings
355_forced_static:     none,         none, '-Xlinker -Bstatic ${LIBS_STATIC} -Xlinker -Bdynamic'
356__xz:                exe,     required, '/usr/bin/xz'
357
358# Mail Support
359_mail_smtp_host:   none,         none, 'localhost'
360_mail_tools_to:    none,         none, 'rtems-tooltestresults@rtems.org'
361
362# Newlib ICONV encodings
363_newlib_iconv_encodings: none,      none, '''big5,cp775,cp850,cp852,cp855,\
364cp866,euc_jp,euc_kr,euc_tw,iso_8859_1,iso_8859_10,iso_8859_11,\
365iso_8859_13,iso_8859_14,iso_8859_15,iso_8859_2,iso_8859_3,\
366iso_8859_4,iso_8859_5,iso_8859_6,iso_8859_7,iso_8859_8,iso_8859_9,\
367iso_ir_111,koi8_r,koi8_ru,koi8_u,koi8_uni,ucs_2,ucs_2_internal,\
368ucs_2be,ucs_2le,ucs_4,ucs_4_internal,ucs_4be,ucs_4le,us_ascii,\
369utf_16,utf_16be,utf_16le,utf_8,win_1250,win_1251,win_1252,\
370win_1253,win_1254,win_1255,win_1256,win_1257,win_1258'''
Note: See TracBrowser for help on using the repository browser.