- oot)
- echo "Out of tree build"
- BUILD_PATH=$WORKSPACE/oot
- mkdir -p "$BUILD_PATH"
- cd "$BUILD_PATH"
- MAKE=$MAKE BISON="$BISON" YACC="$YACC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CPPFLAGS="$CPPFLAGS" "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
- ;;
-
- dist)
- echo "Distribution tarball in-tree build"
-
- # Initial configure and generate tarball
- MAKE=$MAKE BISON="$BISON" YACC="$YACC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CPPFLAGS="$CPPFLAGS" "$SRCDIR/configure" $CONF_OPTS --enable-build-man-pages
- $MAKE dist
-
- BUILD_PATH="$(mktemp -d)"
- cp ./*.tar.* "$BUILD_PATH/"
- cd "$BUILD_PATH"
-
- # Ignore level 1 of tar
- $TAR xvf ./*.tar.* --strip 1
-
- # Build in extracted source tree
- MAKE=$MAKE BISON="$BISON" YACC="$YACC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CPPFLAGS="$CPPFLAGS" "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
- ;;
-
- oot-dist)
- echo "Distribution tarball out of tree build"
- BUILD_PATH="$(mktemp -d)"
- cd "$BUILD_PATH"
-
- # Initial configure and generate tarball
- MAKE=$MAKE BISON="$BISON" YACC="$YACC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CPPFLAGS="$CPPFLAGS" "$SRCDIR/configure" $CONF_OPTS --enable-build-man-pages
- $MAKE dist
-
- NEWSRC_PATH="$(mktemp -d)"
- cp ./*.tar.* "$NEWSRC_PATH/"
- cd "$NEWSRC_PATH"
-
- # Ignore level 1 of tar
- $TAR xvf ./*.tar.* --strip 1
-
- BUILD_PATH="$(mktemp -d)"
- cd "$BUILD_PATH"
-
- # Build oot from extracted sources
- MAKE=$MAKE BISON="$BISON" YACC="$YACC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CPPFLAGS="$CPPFLAGS" "$NEWSRC_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
- ;;
-
- *)
- echo "Standard tree build"
- MAKE=$MAKE BISON="$BISON" YACC="$YACC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CPPFLAGS="$CPPFLAGS" "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
- ;;
+oot)
+ print_header "Build: Out of tree"
+
+ # Create and enter a temporary build directory
+ builddir=$(mktemp -d)
+ cd "$builddir"
+
+ "$SRCDIR/configure" "${CONF_OPTS[@]}" || failed_configure
+ ;;
+
+dist)
+ print_header "Build: Distribution in-tree"
+
+ # Run configure and generate the tar file
+ # in the source directory
+
+ ./configure "${DIST_CONF_OPTS[@]}" || failed_configure
+ $MAKE dist
+
+ # Create and enter a temporary build directory
+ builddir=$(mktemp -d)
+ cd "$builddir"
+
+ # Extract the distribution tar in the build directory,
+ # ignore the first directory level
+ $TAR xvf "$SRCDIR"/*.tar.* --strip 1
+
+ # Build in extracted source tree
+ ./configure "${CONF_OPTS[@]}" || failed_configure
+ ;;
+
+oot-dist)
+ print_header "Build: Distribution Out of tree"
+
+ # Create and enter a temporary build directory
+ builddir=$(mktemp -d)
+ cd "$builddir"
+
+ # Run configure out of tree and generate the tar file
+ "$SRCDIR/configure" "${DIST_CONF_OPTS[@]}" || failed_configure
+ $MAKE dist
+
+ dist_srcdir="$(mktemp -d)"
+ cd "$dist_srcdir"
+
+ # Extract the distribution tar in the new source directory,
+ # ignore the first directory level
+ $TAR xvf "$builddir"/*.tar.* --strip 1
+
+ # Create and enter a second temporary build directory
+ builddir="$(mktemp -d)"
+ cd "$builddir"
+
+ # Run configure from the extracted distribution tar,
+ # out of the source tree
+ "$dist_srcdir/configure" "${CONF_OPTS[@]}" || failed_configure
+ ;;
+
+*)
+ print_header "Build: Standard In-tree"
+ ./configure "${CONF_OPTS[@]}" || failed_configure
+ ;;