1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #!/bin/bash
- [ "x${DEBUG+set}" = 'xset' ] && set -v
- set -u -e
- if [ -z ${NPROC+x} ]; then
- cores="$(nproc)"
- else
- case ${NPROC} in
- ''|*[!0-9]*)
- printf "value '%s' for NPROC is invalid. non-numeric. Exiting.\n" "${NPROC}"
- exit 1
- ;;
- esac
- cores="${NPROC}"
- fi
- printf "Building bucts\n"
- cd "bucts/"
- buildtype="unknown"
- if (( $# != 1 )); then
- buildtype="dynamic"
- else
- buildtype="static"
- fi
- if [ "${buildtype}" = "static" ]; then
- patch "Makefile" < "../resources/bucts/patch/staticlink.diff"
- fi
- make clean
- make -j${cores}
- if [ "${buildtype}" = "static" ]; then
- patch "Makefile" -R < "../resources/bucts/patch/staticlink.diff"
- fi
- cd "../"
- printf "\n\n"
|