public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree
@ 2018-01-30  7:43 Petr Vorel
  2018-01-30  7:43 ` [LTP] [RFC PATCH 1/2] build.sh: Allow to choose in-tree or out-tree for all build types Petr Vorel
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Petr Vorel @ 2018-01-30  7:43 UTC (permalink / raw)
  To: ltp

Hi,

this brings to travis to have also cross-compile out-of-tree builds + I
changed some builds to be out-of-tree (not sure if it's useful).

Kind regards,
Petr

Petr Vorel (2):
  build.sh: Allow to choose in-tree or out-tree for all build types
  travis: Update params for build.sh + change builds

 .travis.yml | 42 ++++++++++++++++++++++-----------------
 build.sh    | 65 ++++++++++++++++++++++++++++++++++++++-----------------------
 2 files changed, 65 insertions(+), 42 deletions(-)

-- 
2.16.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [RFC PATCH 1/2] build.sh: Allow to choose in-tree or out-tree for all build types
  2018-01-30  7:43 [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree Petr Vorel
@ 2018-01-30  7:43 ` Petr Vorel
  2018-01-30  7:43 ` [LTP] [RFC PATCH 2/2] travis: Update params for build.sh + change builds Petr Vorel
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2018-01-30  7:43 UTC (permalink / raw)
  To: ltp

where build types are: native, 32-bit and cross-compile.
Added new option -o TREE, removed 'out' parameter from -t.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 build.sh | 65 ++++++++++++++++++++++++++++++++++++++++------------------------
 1 file changed, 41 insertions(+), 24 deletions(-)

diff --git a/build.sh b/build.sh
index 6dd7ddf93..4e8357982 100755
--- a/build.sh
+++ b/build.sh
@@ -10,7 +10,8 @@
 set -e
 
 DEFAULT_PREFIX="$HOME/ltp-install"
-DEFAULT_BUILD="build_native"
+DEFAULT_BUILD="native"
+DEFAULT_TREE="in"
 CONFIGURE_OPTS_IN_TREE="--with-open-posix-testsuite --with-realtime-testsuite"
 # TODO: open posix testsuite is currently broken in out-tree-build. Enable it once it's fixed.
 CONFIGURE_OPTS_OUT_TREE="--with-realtime-testsuite"
@@ -19,14 +20,14 @@ CC=
 
 build_32()
 {
-	echo "===== 32-bit in-tree build into $PREFIX ====="
-	build_in_tree CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32"
+	echo "===== 32-bit ${1}-tree build into $PREFIX ====="
+	build $1 CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32"
 }
 
 build_native()
 {
-	echo "===== native in-tree build into $PREFIX ====="
-	build_in_tree
+	echo "===== native ${1}-tree build into $PREFIX ====="
+	build $1
 }
 
 build_cross()
@@ -35,8 +36,23 @@ build_cross()
 	[ -n "$host" ] || \
 		{ echo "Missing CC variable, pass it with -c option." >&2; exit 1; }
 
-	echo "===== cross-compile ${host} in-tree build into $PREFIX ====="
-	build_in_tree "--host=$host" CROSS_COMPILE="${host}-"
+	echo "===== cross-compile ${host} ${1}-tree build into $PREFIX ====="
+	build $1 "--host=$host" CROSS_COMPILE="${host}-"
+}
+
+build()
+{
+	local tree="$1"
+	shift
+
+	echo "=== autotools ==="
+	make autotools
+
+	if [ "$tree" = "in" ]; then
+		build_in_tree $@
+	else
+		build_out_tree $@
+	fi
 }
 
 build_out_tree()
@@ -45,24 +61,19 @@ build_out_tree()
 	local build="$tree/../ltp-build"
 	local make_opts="$MAKE_OPTS -C $build -f $tree/Makefile top_srcdir=$tree top_builddir=$build"
 
-	echo "===== native out-of-tree build into $PREFIX ====="
 	mkdir -p $build
-
-	echo "=== autotools ==="
-	make autotools
-
 	cd $build
-	run_configure $tree/configure $CONFIGURE_OPTS_OUT_TREE CC="$CC"
+	run_configure $tree/configure $CONFIGURE_OPTS_OUT_TREE CC="$CC" $@
 
+	echo "=== build ==="
 	make $make_opts
+
+	echo "=== install ==="
 	make $make_opts DESTDIR="$PREFIX" SKIP_IDCHECK=1 install
 }
 
 build_in_tree()
 {
-	echo "=== autotools ==="
-	make autotools
-
 	run_configure ./configure $CONFIGURE_OPTS_IN_TREE CC="$CC" --prefix=$PREFIX $@
 
 	echo "=== build ==="
@@ -92,12 +103,13 @@ usage()
 {
 	cat << EOF
 Usage:
-$0 [ -c CC ] [ -p DIR ] [ -t TYPE ]
+$0 [ -c CC ] [ -o TREE ] [ -p DIR ] [ -t TYPE ]
 $0 -h
 
 Options:
 -h       Print this help
 -c CC    Define compiler (\$CC variable)
+-o TREE  Specify build tree, default: $DEFAULT_TREE
 -p DIR   Change installation directory. For in-tree build is this value passed
          to --prefix option of configure script. For out-of-tree build is this
          value passed to DESTDIR variable (i.e. sysroot) of make install
@@ -107,27 +119,32 @@ Options:
          Default for out-of-tree build: '$DEFAULT_PREFIX/opt/ltp'
 -t TYPE  Specify build type, default: $DEFAULT_BUILD
 
+BUILD TREE:
+in       in-tree build
+out      out-of-tree build
+
 BUILD TYPES:
 32       32-bit in-tree build
 cross    cross-compile in-tree build (requires set compiler via -c switch)
 native   native in-tree build
-out      out-of-tree build
 EOF
 }
 
 PREFIX="$DEFAULT_PREFIX"
 build="$DEFAULT_BUILD"
+tree="$DEFAULT_TREE"
 
-while getopts "c:hp:t:" opt; do
+while getopts "c:ho:p:t:" opt; do
 	case "$opt" in
 	c) CC="$OPTARG";;
 	h) usage; exit 0;;
+	o) case "$OPTARG" in
+		in|out) tree="$OPTARG";;
+		*) echo "Wrong build tree '$OPTARG'" >&2; usage; exit 1;;
+		esac;;
 	p) PREFIX="$OPTARG";;
 	t) case "$OPTARG" in
-		32) build="build_32";;
-		cross) build="build_cross";;
-		native) build="build_native";;
-		out) build="build_out_tree";;
+		32|cross|native) build="$OPTARG";;
 		*) echo "Wrong build type '$OPTARG'" >&2; usage; exit 1;;
 		esac;;
 	?) usage; exit 1;;
@@ -135,4 +152,4 @@ while getopts "c:hp:t:" opt; do
 done
 
 cd `dirname $0`
-$build
+eval build_$build $tree
-- 
2.16.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [RFC PATCH 2/2] travis: Update params for build.sh + change builds
  2018-01-30  7:43 [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree Petr Vorel
  2018-01-30  7:43 ` [LTP] [RFC PATCH 1/2] build.sh: Allow to choose in-tree or out-tree for all build types Petr Vorel
@ 2018-01-30  7:43 ` Petr Vorel
  2018-01-30  7:46 ` [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree Petr Vorel
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2018-01-30  7:43 UTC (permalink / raw)
  To: ltp

Add powerpc64le cross-compile build.
Some builds set to be out-of-tree or minimal.

We now have 10 builds, some combination of:
5x native + 2x 32-bit + 3x cross-compile
5x in-tree + 5x out-of-tree
7x full dependencies + 3x minimal dependencies

Using compilers:
gcc 4.9, 5, 6, 7,
clang 3.9, 4, 5
gcc (cross-compile): 3x 4.8.4
cross-compile archs: arm, aarch64, powerpc64le

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 .travis.yml | 42 ++++++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index d89c4353b..9658ffba9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,9 +1,15 @@
 language: c
 
+# BUILD="native": native builds
+# BUILD="32": 32-bit builds
+# BUILD="cross": cross compile build
+# TREE="out": out-of-tree build
+# NO INSTALL_PACKAGES variable: build with minimal dependencies
+
 matrix:
     include:
 
-        # normal native in-tree builds
+        ### native builds ###
         - os: linux
           env: BUILD="native" INSTALL_PACKAGES="$BUILD"
           compiler: gcc-5
@@ -13,7 +19,7 @@ matrix:
                   packages: ['gcc-5']
 
         - os: linux
-          env: BUILD="native" INSTALL_PACKAGES="$BUILD"
+          env: BUILD="native" TREE="out" INSTALL_PACKAGES="$BUILD"
           compiler: gcc-7
           addons:
               apt:
@@ -21,7 +27,7 @@ matrix:
                   packages: ['gcc-7']
 
         - os: linux
-          env: BUILD="native" INSTALL_PACKAGES="$BUILD"
+          env: BUILD="native" TREE="out"
           compiler: clang-4.0
           addons:
               apt:
@@ -36,7 +42,6 @@ matrix:
                   sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
                   packages: ['clang-5.0']
 
-        # minimal build (some headers and libraries are missing)
         - os: linux
           env: BUILD="native"
           compiler: clang-3.9
@@ -45,7 +50,7 @@ matrix:
                   sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-3.9']
                   packages: ['clang-3.9']
 
-        # 32-bit in-tree cross-compile builds
+        ### 32-bit builds ###
         - os: linux
           env: BUILD="32" INSTALL_PACKAGES="$BUILD"
           compiler: gcc-4.9
@@ -55,23 +60,14 @@ matrix:
                   packages: ['gcc-4.9', 'gcc-4.9-multilib', 'linux-libc-dev:i386']
 
         - os: linux
-          env: BUILD="32" INSTALL_PACKAGES="$BUILD"
+          env: BUILD="32" TREE="out" INSTALL_PACKAGES="$BUILD"
           compiler: gcc-6
           addons:
               apt:
                   sources: ['ubuntu-toolchain-r-test']
                   packages: ['gcc-6', 'gcc-6-multilib', 'linux-libc-dev:i386']
 
-        # out-of-tree build
-        - os: linux
-          env: BUILD="out" INSTALL_PACKAGES="native"
-          compiler: gcc-7
-          addons:
-              apt:
-                  sources: ['ubuntu-toolchain-r-test']
-                  packages: ['gcc-7']
-
-        # cross-compile ARM builds
+        ### cross-compile builds ###
         - os: linux
           env: BUILD="cross" INSTALL_PACKAGES="$BUILD"
           compiler: arm-linux-gnueabihf-gcc
@@ -80,12 +76,19 @@ matrix:
                   packages: ['gcc-arm-linux-gnueabihf', 'libc6-dev-armhf-cross']
 
         - os: linux
-          env: BUILD="cross" INSTALL_PACKAGES="$BUILD"
+          env: BUILD="cross" TREE="out" INSTALL_PACKAGES="$BUILD"
           compiler: aarch64-linux-gnu-gcc
           addons:
               apt:
                   packages: ['gcc-aarch64-linux-gnu', 'libc6-dev-arm64-cross']
 
+        - os: linux
+          env: BUILD="cross" TREE="out"
+          compiler: powerpc64le-linux-gnu-gcc
+          addons:
+              apt:
+                  packages: ['gcc-powerpc64le-linux-gnu', 'libc6-dev-ppc64el-cross']
+
 notifications:
     email:
         secure: "b/xcA/K5OyQvPPnd0PRahTH5LJu8lgz8goGHvhXpHo+ZPsPgTDXNFo5cX9fSOkMuFKeoW8iGl0wOgK2+ptc8mbYDw277K4RFIHRHeV/KIoE1EzjQnEFiL8J0oHCAvDj12o0AXeriTyY9gICXKbR31Br6Zh5eKViDJe2OAGeHeDU="
@@ -101,5 +104,8 @@ before_install:
     - if [ "$INSTALL_PACKAGES" = "32" ]; then
           sudo apt install -qq $(cat .travis.packages_i386)
       ; fi
+    - if [ ! "$TREE" ]; then
+          TREE="in"
+      ; fi
 
-script: ./build.sh -t $BUILD -c $CC
+script: ./build.sh -o $TREE -t $BUILD -c $CC
-- 
2.16.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree
  2018-01-30  7:43 [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree Petr Vorel
  2018-01-30  7:43 ` [LTP] [RFC PATCH 1/2] build.sh: Allow to choose in-tree or out-tree for all build types Petr Vorel
  2018-01-30  7:43 ` [LTP] [RFC PATCH 2/2] travis: Update params for build.sh + change builds Petr Vorel
@ 2018-01-30  7:46 ` Petr Vorel
  2018-02-08  7:36 ` Petr Vorel
  2018-02-27  9:16 ` Petr Vorel
  4 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2018-01-30  7:46 UTC (permalink / raw)
  To: ltp

Hi,

> this brings to travis to have also cross-compile out-of-tree builds + I
> changed some builds to be out-of-tree (not sure if it's useful).

You can see it on
https://travis-ci.org/pevik/ltp/builds/334654099

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree
  2018-01-30  7:43 [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree Petr Vorel
                   ` (2 preceding siblings ...)
  2018-01-30  7:46 ` [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree Petr Vorel
@ 2018-02-08  7:36 ` Petr Vorel
  2018-02-27  9:16 ` Petr Vorel
  4 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2018-02-08  7:36 UTC (permalink / raw)
  To: ltp

Hi,

> this brings to travis to have also cross-compile out-of-tree builds + I
> changed some builds to be out-of-tree (not sure if it's useful).

> Kind regards,
> Petr

> Petr Vorel (2):
>   build.sh: Allow to choose in-tree or out-tree for all build types
>   travis: Update params for build.sh + change builds

>  .travis.yml | 42 ++++++++++++++++++++++-----------------
>  build.sh    | 65 ++++++++++++++++++++++++++++++++++++++-----------------------
>  2 files changed, 65 insertions(+), 42 deletions(-)

> You can see it on
> https://travis-ci.org/pevik/ltp/builds/334654099
Ping, please.


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree
  2018-01-30  7:43 [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree Petr Vorel
                   ` (3 preceding siblings ...)
  2018-02-08  7:36 ` Petr Vorel
@ 2018-02-27  9:16 ` Petr Vorel
  4 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2018-02-27  9:16 UTC (permalink / raw)
  To: ltp

Hi,

> this brings to travis to have also cross-compile out-of-tree builds + I
> changed some builds to be out-of-tree (not sure if it's useful).

> Kind regards,
> Petr

> Petr Vorel (2):
>   build.sh: Allow to choose in-tree or out-tree for all build types
>   travis: Update params for build.sh + change builds

>  .travis.yml | 42 ++++++++++++++++++++++-----------------
>  build.sh    | 65 ++++++++++++++++++++++++++++++++++++++-----------------------
>  2 files changed, 65 insertions(+), 42 deletions(-)

Pushed.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-02-27  9:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-30  7:43 [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree Petr Vorel
2018-01-30  7:43 ` [LTP] [RFC PATCH 1/2] build.sh: Allow to choose in-tree or out-tree for all build types Petr Vorel
2018-01-30  7:43 ` [LTP] [RFC PATCH 2/2] travis: Update params for build.sh + change builds Petr Vorel
2018-01-30  7:46 ` [LTP] [RFC PATCH 0/2] travis: out-of-tree cross-compile + some builds in-tree => out-of-tree Petr Vorel
2018-02-08  7:36 ` Petr Vorel
2018-02-27  9:16 ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox