source: rtems-source-builder/source-builder/defaults.mc @ f07504d

Last change on this file since f07504d was f07504d, checked in by Sebastian Huber <sebastian.huber@…>, on Jan 23, 2019 at 12:41:30 PM

Use HTTPS instead of FTP

FTP is an outdated protocol and blocked by some firewalls.

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