diff --git a/setup/env.sh b/setup/env.sh index 8b8cd22..a6dd05e 100644 --- a/setup/env.sh +++ b/setup/env.sh @@ -3,7 +3,11 @@ # --------------------------------------------------------------------------------------------------------------------- # OS setup -if [ "${MACOS}" -eq 1 ]; then +if [ "${LINUX}" -eq 1 ]; then + CMAKE_SYSTEM_NAME="Linux" + PAWPAW_TARGET="linux" + +elif [ "${MACOS}" -eq 1 ]; then CMAKE_SYSTEM_NAME="Darwin" if [ "${MACOS_OLD}" -eq 1 ]; then PAWPAW_TARGET="macos-old" @@ -19,10 +23,6 @@ elif [ "${WIN32}" -eq 1 ]; then PAWPAW_TARGET="win32" fi -elif [ "${LINUX}" -eq 1 ]; then - CMAKE_SYSTEM_NAME="Linux" - PAWPAW_TARGET="linux" - else echo "Unknown target '${target}'" exit 4 @@ -111,9 +111,12 @@ TARGET_PKG_CONFIG_PATH="${PAWPAW_PREFIX}/lib/pkgconfig" # --------------------------------------------------------------------------------------------------------------------- # other -# "-j 2" MAKE_ARGS="" +if which nproc > /dev/null; then + MAKE_ARGS+="-j $(nproc)" +fi + if [ "${CROSS_COMPILING}" -eq 1 ]; then MAKE_ARGS="${MAKE_ARGS} CROSS_COMPILING=true" fi diff --git a/setup/functions.sh b/setup/functions.sh index e45d297..018d0b6 100644 --- a/setup/functions.sh +++ b/setup/functions.sh @@ -153,7 +153,7 @@ function build_autoconf() { if [ ! -f "${pkgdir}/.stamp_installed" ]; then pushd "${pkgdir}" - make ${MAKE_ARGS} install + make ${MAKE_ARGS} install -j 1 touch .stamp_installed popd fi @@ -186,7 +186,7 @@ function build_conf() { if [ ! -f "${pkgdir}/.stamp_installed" ]; then pushd "${pkgdir}" - make ${MAKE_ARGS} install + make ${MAKE_ARGS} -j 1 install touch .stamp_installed popd fi @@ -224,7 +224,7 @@ function build_cmake() { if [ ! -f "${pkgdir}/.stamp_installed" ]; then pushd "${pkgdir}/build" - make ${MAKE_ARGS} install + make ${MAKE_ARGS} -j 1 install touch ../.stamp_installed popd fi @@ -252,7 +252,7 @@ function build_make() { if [ ! -f "${pkgdir}/.stamp_installed" ]; then pushd "${pkgdir}" - make PREFIX="${PAWPAW_PREFIX}" PKG_CONFIG="${TARGET_PKG_CONFIG}" ${MAKE_ARGS} install + make PREFIX="${PAWPAW_PREFIX}" PKG_CONFIG="${TARGET_PKG_CONFIG}" ${MAKE_ARGS} -j 1 install touch .stamp_installed popd fi @@ -297,6 +297,39 @@ function build_meson() { _postbuild } +function build_qmake() { + local name="${1}" + local version="${2}" + local extraconfrules="${3}" + + local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}" + + _prebuild "${name}" "${pkgdir}" + + if [ ! -f "${pkgdir}/.stamp_configured" ]; then + pushd "${pkgdir}" + qmake ${extraconfrules} + touch .stamp_configured + popd + fi + + if [ ! -f "${pkgdir}/.stamp_built" ]; then + pushd "${pkgdir}" + make ${MAKE_ARGS} + touch .stamp_built + popd + fi + + if [ ! -f "${pkgdir}/.stamp_installed" ]; then + pushd "${pkgdir}" + make ${MAKE_ARGS} -j 1 install + touch .stamp_installed + popd + fi + + _postbuild +} + function build_waf() { local name="${1}" local version="${2}" @@ -370,7 +403,7 @@ function build_host_autoconf() { if [ ! -f "${pkgdir}/.stamp_installed" ]; then pushd "${pkgdir}" - make install + make ${MAKE_ARGS} install -j 1 touch .stamp_installed popd fi