Lines Matching +full:host +full:- +full:gcc
2 # Copyright (c) 2017-2021 Petr Vorel <pvorel@suse.cz>
5 set -e
7 CFLAGS="${CFLAGS:--Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=re…
8 CC="${CC:-gcc}"
10 DEFAULT_PREFIX="$HOME/ltp-install"
14 CONFIGURE_OPTS_IN_TREE="--with-open-posix-testsuite --with-realtime-testsuite $CONFIGURE_OPT_EXTRA"
15 # TODO: open posix testsuite is currently broken in out-tree-build. Enable it once it's fixed.
16 CONFIGURE_OPTS_OUT_TREE="--with-realtime-testsuite $CONFIGURE_OPT_EXTRA"
19 BUILD_DIR="$SRC_DIR/../ltp-build"
21 MAKE_OPTS="-j$(getconf _NPROCESSORS_ONLN)"
22 MAKE_OPTS_OUT_TREE="$MAKE_OPTS -C $BUILD_DIR -f $SRC_DIR/Makefile top_srcdir=$SRC_DIR top_builddir=…
45 run_configure ./configure $CONFIGURE_OPTS_IN_TREE --prefix=$prefix $@
50 mkdir -p $BUILD_DIR
59 local arch="$(uname -m)"
62 echo "===== 32-bit ${tree}-tree build into $prefix ====="
64 if [ -z "$PKG_CONFIG_LIBDIR" ]; then
66 echo "ERROR: auto-detection not supported platform $arch, export PKG_CONFIG_LIBDIR!"
70 for dir in /usr/lib/i386-linux-gnu/pkgconfig \
72 if [ -d "$dir" ]; then
77 if [ -z "$PKG_CONFIG_LIBDIR" ]; then
82 CFLAGS="-m32 $CFLAGS" LDFLAGS="-m32 $LDFLAGS"
92 echo "===== native ${tree}-tree build into $prefix ====="
100 local host=$(basename "${CC%-gcc}")
102 if [ "$host" = "gcc" ]; then
107 echo "===== cross-compile ${host} ${1}-tree build into $prefix ====="
108 eval configure_${tree}_tree "--host=$host"
148 $0 [ -c CC ] [ -i ] [ -o TREE ] [ -p DIR ] [-r RUN ] [ -t TYPE ]
149 $0 -h
152 -h Print this help
153 -c CC Define compiler (\$CC variable), needed only for configure step
154 -i Run 'make install', needed only for install step
155 -o TREE Specify build tree, default: $DEFAULT_TREE
156 -p DIR Change installation directory. For in-tree build is this value passed
157 to --prefix option of configure script. For out-of-tree build is this
161 Default for in-tree build: '$DEFAULT_PREFIX'
162 Default for out-of-tree build: '$DEFAULT_PREFIX/opt/ltp'
163 -r RUN Run only certain step (usable for CI), default: all
164 -t TYPE Specify build type, default: $DEFAULT_BUILD, only for configure step
167 in in-tree build
168 out out-of-tree build
171 32 32-bit build (PKG_CONFIG_LIBDIR auto-detection for x86_64)
172 cross cross-compile build (requires set compiler via -c switch)
179 test run only 'make test' (not supported for cross-compile build)
180 test-c run only 'make test-c' (not supported for cross-compile build)
181 test-shell run only 'make test-shell' (not supported for cross-compile build)
185 in-tree: $CONFIGURE_OPTS_IN_TREE
186 out-of-tree $CONFIGURE_OPTS_OUT_TREE
209 autotools|configure|build|test|test-c|test-shell|install) run="$OPTARG";;
222 if [ -z "$run" -o "$run" = "autotools" ]; then
226 if [ -z "$run" -o "$run" = "configure" ]; then
230 if [ -z "$run" -o "$run" = "build" ]; then
235 if [ -z "$run" -o "$run" = "test" -o "$run" = "test-c" -o "$run" = "test-shell" ]; then
237 echo "cross-compile build, skipping running tests" >&2
243 if [ -z "$run" -o "$run" = "install" ]; then
247 echo "make install skipped, use -i to run it"