source: rtems-source-builder/source-builder/defaults.mc @ 6444d58

4.104.95
Last change on this file since 6444d58 was 6444d58, checked in by Chris Johns <chrisj@…>, on Jul 20, 2015 at 3:49:42 AM

Canandian Cross Compiling and RTEMS 3rd party package building Fixes.

The change fixes installing for RTEMS 3rd Party packages where the
RSB considered them Canadian Cross Compiling (Cxc). Fixing the
Cxc issue broke real Cxc builds. The change corrects the issue of
macros being changed in the Cxc and the prep data not being udpated.
The configuration is loaded again after the updated macros. The
macros are also copied and restored to ensure a clean stable base.

The change also introduces --rtems-tools and --rtems-bsp to align
the command line with the waf configure process or RTEMS application.

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