Update scripts/Build*.sh to build the libraries listed in the current README - #5
Update scripts/Build*.sh to build the libraries listed in the current README#5nkaminski wants to merge 3 commits into
Conversation
…he current README This changeset updates the scripts/BuildLibsRelease.sh script to build the libraries listed in the current version of the readme as well as introduces the following minor changes / improvements * MACOSX_DEPLOYMENT_TARGET defaults to 11.0 but can be overwritten if predefined in the environment * Automatic CPU core count detection - build will use all CPUs on the host by default * Automatic build host architecture detection using uname -p * Test for Homebrew as well as installation directories under /opt pre-run * xLights source directory defaults to ./xLights, but can be overdidden by defining XL_DIR
91ac62b to
b3fbeb4
Compare
DanInProgress
left a comment
There was a problem hiding this comment.
Just a few suggestions, not sure if this is intended to be built on mac os or built elsewhere and then copied? probably good enough if it will only ever be run on mac os
| sudo chgrp -R staff /opt/local* | ||
| sudo chmod -R g+w /opt/local* | ||
| # System dependency checks... | ||
| if [ ! -d /opt/local/lib ] || [ ! -d /opt/local/libdbg ] || [ ! -d /opt/local/bin ] || [ ! -d /opt/local/bin ] ; then |
There was a problem hiding this comment.
if you're restricting to bash, more reliable to use [[ instead of test
There was a problem hiding this comment.
Fair, can refactor.
| sudo chmod -R g+w /opt/local* | ||
| # System dependency checks... | ||
| if [ ! -d /opt/local/lib ] || [ ! -d /opt/local/libdbg ] || [ ! -d /opt/local/bin ] || [ ! -d /opt/local/bin ] ; then | ||
| echo "/opt/local/bin, /opt/local/lib, /opt/local/libdbg and /opt/local/include must exist and be writable!" |
There was a problem hiding this comment.
mild recommend for using printf over echo
here are some sample helpers that will do what you might expect
https://gist.github.com/DanInProgress/e444b7815745da4c1117f78dc9ebb2d3
| export CFLAGS="-g -O3 -flto=thin -Wall -fno-stack-protector -fno-common ${XL_TARGETS} ${OSX_VERSION_MIN}" | ||
| make -j4 all CFLAGS="$CFLAGS" MYLDFLAGS="$CFLAGS" | ||
| export CFLAGS="-g -O3 -flto=thin -Wall -fno-stack-protector -fno-common ${XL_TARGETS} ${OSX_VERSION_MIN} " | ||
| make -j $NUM_CPUS all CFLAGS="$CFLAGS" MYLDFLAGS="$CFLAGS" |
There was a problem hiding this comment.
with the large number of builds, it might be more legible debuggable to any of:
- split this into multiple shells scripts that can succeed or fail individually
- use make with per-target exported flags to update the dependent builds and track their success
- shelling out will also help with env/workdir management and isolation
edit to add context from other comment
you can subshell out without a separate script using ( ... ), but beware changes in set -e behavior due to the compound command with either {...} or (...)
There was a problem hiding this comment.
I would be in favor of this however this would be a functional change from the steps in the readme. Would be interested as to other's thoughts here.
|
Thank you @DanInProgress for the review - a second pair of eyes is always a favorable thing for less trivial changes. With regards to the build host, this will always be built on a macOS machine. |
This changeset updates the scripts/Build*.sh scripts to build the libraries listed in the current version of the readme as well as introduces the following minor changes / improvements.
This was largely driven by my intention to perform a local debug build of xLights on macOS in order to further debug xLightsSequencer/xLights#5015