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

4.104.114.9
Last change on this file since c4fefde was c4fefde, checked in by Chris Johns <chrisj@…>, on Feb 10, 2014 at 11:18:35 PM

sb: Add pkg-config support.

Add a pkg-config look alike command so packages that use pkg-config can
build if pkg-config is not present on a host.

Add support to query package config from configuration scripts.

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