source: rtems-source-builder/source-builder/defaults.mc @ 2a6acc7

4.104.114.95
Last change on this file since 2a6acc7 was 2a6acc7, checked in by Chris Johns <chrisj@…>, on 05/04/14 at 06:22:46

config: Fix the host and build options for Canadian cross builds.

The ARM on 4.9.0 with clang fails and needs an extra option and
this is only valid building the build cross compiler. This change
fxies the host and build flags so they only apply where needed.

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