+if [ -f build-expat/.success ]; then
+ printf "Skipping Expat as it is already built\n"
+elif [ $SKIPGDB -eq 1 ]; then
+ printf "Skipping Expat as requested by command line (skip GDB)\n"
+else
+printf "Building Expat ${EXPAT_VERSION} ... "
+(
+ cd build-expat
+ export PATH=$PATH:$DESTDIR$TARGETDIR/bin
+ rm -f .failed
+ CFLAGS="$HOSTCFLAGS" ../${EXPAT_DIR}/configure --disable-shared \
+ --prefix=$TARGETDIR --target=${TARGETARCH} || touch .failed
+ $MAKE || touch .failed
+ $MAKE install DESTDIR=$DESTDIR || touch .failed
+ if [ ! -f .failed ]; then touch .success; fi
+) &> build-expat/crossgcc-build.log
+test -r build-expat/.failed && printf "${RED}failed${NC}\n" || \
+ printf "${green}ok${NC}\n"
+test -r build-expat/.failed && exit 1
+fi
+
+
+if [ -f build-python/.success ]; then
+ printf "Skipping Python as it is already built\n"
+elif [ $SKIPGDB -eq 1 ]; then
+ printf "Skipping Python as requested by command line (skip GDB)\n"
+else
+printf "Building Python ${PYTHON_VERSION} ... "
+(
+ cd build-python
+ export PATH=$PATH:$DESTDIR$TARGETDIR/bin
+ rm -f .failed
+ CFLAGS="$HOSTCFLAGS" ../${PYTHON_DIR}/configure --prefix=$TARGETDIR \
+ --target=${TARGETARCH} || touch .failed
+ $MAKE $JOBS || touch .failed
+ $MAKE install DESTDIR=$DESTDIR || touch .failed
+ if [ ! -f .failed ]; then touch .success; fi
+) &> build-gdb/crossgcc-build.log
+test -r build-python/.failed && printf "${RED}failed${NC}\n" || \
+ printf "${green}ok${NC}\n"
+test -r build-python/.failed && exit 1
+fi
+
+