From b3fbeb466916231d6c947a9cd847dd392dda1283 Mon Sep 17 00:00:00 2001 From: Nash Kaminski Date: Mon, 2 Dec 2024 22:42:38 -0600 Subject: [PATCH 1/3] Update scripts/BuildLibsRelease.sh to build the libraries listed in the 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 --- README.macOS | 4 +- scripts/BuildLibsRelease.sh | 251 +++++++++++++++++++++++++----------- 2 files changed, 180 insertions(+), 75 deletions(-) diff --git a/README.macOS b/README.macOS index 2221369..612c27d 100644 --- a/README.macOS +++ b/README.macOS @@ -277,9 +277,9 @@ make -j 12 ; make find . -name "*.a" -exec cp {} /opt/local/libdbg/ \; -libxslwriter: +libxslxwriter: git clone https://github.com/jmcnamara/libxlsxwriter.git -cd libxlswriter +cd libxlsxwriter git checkout v1.1.9 cd cmake export CXXFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN} " diff --git a/scripts/BuildLibsRelease.sh b/scripts/BuildLibsRelease.sh index 7ee6ace..6a79f82 100755 --- a/scripts/BuildLibsRelease.sh +++ b/scripts/BuildLibsRelease.sh @@ -1,57 +1,81 @@ -sudo mkdir -p /opt/local/lib -sudo mkdir -p /opt/local/bin +#!/bin/bash -e -#setup permissions on /opt/local -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 + echo "/opt/local/bin, /opt/local/lib, /opt/local/libdbg and /opt/local/include must exist and be writable!" + exit 1 +fi +if ! command -v brew > /dev/null ; then + echo 'Some libraries require Homebrew Tools, to install Homebrew:' + echo '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"' + exit 1 +fi -export MACOSX_DEPLOYMENT_TARGET=10.14 +export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-11.0} export OSX_VERSION_MIN="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" -export ARM64_TARGETS="-target arm64-apple-macos10.14 -arch arm64" -export X86_64_TARGETS="-target x86_64-apple-macos10.14 -arch x86_64" +export ARM64_TARGETS="-target arm64-apple-macos11.0 -arch arm64" +export X86_64_TARGETS="-target x86_64-apple-macos11.0 -arch x86_64" + +# Absolute path to directory containing the xLights source tree +# Default assumes that xlights is cloned in your cwd +export XL_DIR="${XL_DIR:-$(realpath ./xlights)}" + +# Core count of the build host +export NUM_CPUS="${NUM_CPUS:-$(sysctl -n hw.ncpu)}" +echo "Building with $NUM_CPUS cores" #need ONE of these lines export XL_TARGETS="${X86_64_TARGETS} ${ARM64_TARGETS}" # export XL_TARGETS="${X86_64_TARGETS}" # export XL_TARGETS="${ARM64_TARGETS}" -# need ONE of these -# export BUILD_HOST=x86_64 -export BUILD_HOST=arm +export BUILD_HOST="$(uname -p)" +echo "Build host architecture is $BUILD_HOST" -#Note: Some libraries require Homebrew Tools, to install Homebrew: -/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - -#Autotools and LibTool are required from Homebrew: +set -x +# install dependencies from homebrew brew install automake libtool cmake nasm echo "libzstd" -git clone https://github.com/facebook/zstd -cd zstd -git checkout v1.5.2 +if [ ! -d "zstd" ]; then git clone https://github.com/facebook/zstd ; fi +pushd zstd +git checkout v1.5.6 export CFLAGS="-g -flto=thin ${OSX_VERSION_MIN} ${XL_TARGETS}" export LDFLAGS="-flto=thin ${OSX_VERSION_MIN} ${XL_TARGETS} " make clean -make -j 8 HAVE_LZMA=0 HAVE_LZ4=0 lib-mt +make -j ${NUM_CPUS} HAVE_LZMA=0 HAVE_LZ4=0 lib-mt cp lib/libzstd.a /opt/local/lib +export CFLAGS="-g ${OSX_VERSION_MIN} ${XL_TARGETS}" +export LDFLAGS=" ${OSX_VERSION_MIN} ${XL_TARGETS}" +make clean +make -j ${NUM_CPUS} HAVE_LZMA=0 HAVE_LZ4=0 lib-mt +cp lib/libzstd.a /opt/local/libdbg unset CFLAGS unset LDFLAGS +popd echo "log4cpp" -#Download latest src release (current 1.1.3) -wget https://nchc.dl.sourceforge.net/project/log4cpp/log4cpp-1.1.x%20%28new%29/log4cpp-1.1/log4cpp-1.1.3.tar.gz +# Download latest src release (current 1.1.3) +if [ -d "log4cpp" ] ; then rm -r log4cpp ; fi +curl -LO https://nchc.dl.sourceforge.net/project/log4cpp/log4cpp-1.1.x%20%28new%29/log4cpp-1.1/log4cpp-1.1.3.tar.gz tar -xzf log4cpp-1.1.3.tar.gz -cd log4cpp -patch -p1 < ~/working/xLights/macOS/patches/log4cpp.patch -export CXXFLAGS="-g -O2 -flto=thin ${OSX_VERSION_MIN} ${XL_TARGETS} -std=c++11 -stdlib=libc++ -fvisibility-inlines-hidden" +pushd log4cpp +patch -p1 < "${XL_DIR}/macOS/patches/log4cpp.patch" +export CXXFLAGS="-g -O2 -flto=thin ${OSX_VERSION_MIN} ${XL_TARGETS} -std=c++11 -stdlib=libc++ -fvisibility-inlines-hidden " export LDFLAGS="-flto=thin ${XL_TARGETS} " ./configure --prefix=/opt/local -host ${BUILD_HOST} make clean -make -j 8 +make -j ${NUM_CPUS} cp src/.libs/liblog4cpp.a /opt/local/lib +export CXXFLAGS="-g ${OSX_VERSION_MIN} ${XL_TARGETS} -std=c++11 -stdlib=libc++ -fvisibility-inlines-hidden " +export LDFLAGS="${XL_TARGETS} " +./configure --prefix=/opt/local -host ${BUILD_HOST} +make clean +make -j ${NUM_CPUS} +cp src/.libs/liblog4cpp.a /opt/local/libdbg unset CXXFLAGS unset LDFLAGS - +popd echo "liquidfun" # requires cmake to be installed, most likely need to have @@ -59,55 +83,75 @@ echo "liquidfun" # aternatively, install CMAKE for OSX from https://cmake.org/download/ # and add the full path to cmake to PATH # PATH=$PATH:/Applications/CMake.app/Contents/bin/ -git clone https://github.com/google/liquidfun -cd liquidfun/liquidfun/Box2D +if [ ! -d "liquidfun" ] ; then git clone https://github.com/google/liquidfun ; fi +pushd liquidfun/liquidfun/Box2D git status --ignored -s | colrm 1 2 | xargs rm -rf export CXX=clang++ -export CXXFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN}" +export CXXFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN} " cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBOX2D_BUILD_EXAMPLES=OFF +echo "CXX_FLAGS += -Wno-unused-but-set-variable -Wno-error " >> ./Box2D/CMakeFiles/Box2D.dir/flags.make make clean -make -j 8 +make -j $NUM_CPUS cp ./Box2D/Release/libliquidfun.a /opt/local/lib +git status --ignored -s | colrm 1 2 | xargs rm -rf +export CXXFLAGS="-g ${XL_TARGETS} ${OSX_VERSION_MIN} " +cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBOX2D_BUILD_EXAMPLES=OFF +echo "CXX_FLAGS += -Wno-unused-but-set-variable -Wno-error " >> ./Box2D/CMakeFiles/Box2D.dir/flags.make +make clean +make -j $NUM_CPUS +cp ./Box2D/Release/libliquidfun.a /opt/local/libdbg unset CXXFLAGS unset CXX +popd - -echo "SDL2" #currently using 2.0.22 -git clone https://github.com/libsdl-org/SDL -cd SDL +echo "SDL2" currently using 2.30.9 +if [ ! -d "SDL" ] ; then git clone https://github.com/libsdl-org/SDL ; fi +pushd SDL +git fetch -v git reset --hard -git checkout release-2.0.22 -export CXXFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN}" -export CFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN}" -export LDFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN}" -./configure --disable-shared --enable-static --disable-render-metal --disable-video-metal --disable-video-dummy --disable-video-opengl --disable-video-opengles --disable-video-opengles2 --disable-video-vulkan --disable-haptic --disable-joystick +git checkout release-2.30.9 +export CXXFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN} " +export CFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN} " +export LDFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN} " +./configure --disable-shared --enable-static --disable-render-metal --disable-video-metal --disable-video-dummy --disable-video-x11 --disable-video-opengles --disable-video-opengles2 --disable-video-vulkan --disable-haptic --disable-joystick --prefix=/opt/local make clean -make -j 8 +make -j $NUM_CPUS cp ./build/.libs/libSDL2.a /opt/local/lib +export CXXFLAGS="-g ${XL_TARGETS} ${OSX_VERSION_MIN} " +export CFLAGS="-g ${XL_TARGETS} ${OSX_VERSION_MIN} " +export LDFLAGS="-g ${XL_TARGETS} ${OSX_VERSION_MIN} " +./configure --disable-shared --enable-static --disable-render-metal --disable-video-metal --disable-video-dummy --disable-video-x11 --disable-video-opengles --disable-video-opengles2 --disable-video-vulkan --disable-haptic --disable-joystick --prefix=/opt/local +make clean +make -j $NUM_CPUS +cp ./build/.libs/libSDL2.a /opt/local/libdbg unset CXXFLAGS unset CFLAGS unset LDFLAGS +popd - -echo "ffmpeg" #currently using 6.0 +echo "ffmpeg" # currently using 6.1.2 # Note: requires nasm to be install. Easiest option is via "brew install nasm" -git clone https://git.ffmpeg.org/ffmpeg.git -cd ffmpeg -git checkout n6.0 -make clean +if [ ! -d "ffmpeg" ] ; then git clone https://git.ffmpeg.org/ffmpeg.git ; fi +pushd ffmpeg +git fetch -v +git checkout n6.1.2 +make clean || true # can exit nonzero +rm -rf x86_64 +git status --ignored -s | colrm 1 2 | xargs rm -rf ./configure --disable-inline-asm --enable-static --disable-shared --disable-securetransport --extra-cflags="${OSX_VERSION_MIN}" --disable-indev=lavfi --disable-libx264 --disable-lzma --enable-gpl --enable-opengl --disable-programs --arch=x86_64 -sed -i -e "s/^CFLAGS=/CFLAGS=-g ${X86_64_TARGETS} ${OSX_VERSION_MIN} /" ffbuild/config.mak -sed -i -e "s/^CXXFLAGS=/CXXFLAGS=-g ${X86_64_TARGETS} ${OSX_VERSION_MIN} /" ffbuild/config.mak +sed -i -e "s/^CFLAGS=/CFLAGS=-g ${X86_64_TARGETS} ${OSX_VERSION_MIN} -DGL_SILENCE_DEPRECATION=1 -Wno-incompatible-function-pointer-types /" ffbuild/config.mak +sed -i -e "s/^CXXFLAGS=/CXXFLAGS=-g ${X86_64_TARGETS} ${OSX_VERSION_MIN} -DGL_SILENCE_DEPRECATION=1 /" ffbuild/config.mak sed -i -e "s/^LDFLAGS=/LDFLAGS=-g ${X86_64_TARGETS} ${OSX_VERSION_MIN} /" ffbuild/config.mak -make -j 16 +make -j $NUM_CPUS ; make mkdir ./x86_64 -find . -name "*.a" -exec cp {} ./x86_64 \; -make clean -./configure --disable-inline-asm --enable-static --disable-shared --disable-securetransport --extra-cflags="${OSX_VERSION_MIN}" --disable-indev=lavfi --disable-libx264 --disable-lzma --enable-gpl --enable-opengl --disable-programs --arch=arm64 -sed -i -e "s/^CFLAGS=/CFLAGS=-g ${ARM64_TARGETS} ${OSX_VERSION_MIN} /" ffbuild/config.mak -sed -i -e "s/^CXXFLAGS=/CXXFLAGS=-g ${ARM64_TARGETS} ${OSX_VERSION_MIN} /" ffbuild/config.mak +find . -name "*.a" -exec cp -f {} ./x86_64 \; +make clean || true # can exit nonzero +git status --ignored -s | colrm 1 2 | grep -v x86_64 | xargs rm -rf +./configure --enable-static --disable-shared --disable-securetransport --extra-cflags="${OSX_VERSION_MIN}" --disable-indev=lavfi --disable-libx264 --disable-lzma --enable-gpl --enable-opengl --disable-programs --arch=arm64 +sed -i -e "s/^CFLAGS=/CFLAGS=-g ${ARM64_TARGETS} ${OSX_VERSION_MIN} -DGL_SILENCE_DEPRECATION=1 -Wno-incompatible-function-pointer-types /" ffbuild/config.mak +sed -i -e "s/^CXXFLAGS=/CXXFLAGS=-g ${ARM64_TARGETS} ${OSX_VERSION_MIN} -DGL_SILENCE_DEPRECATION=1 /" ffbuild/config.mak sed -i -e "s/^LDFLAGS=/LDFLAGS=-g ${ARM64_TARGETS} ${OSX_VERSION_MIN} /" ffbuild/config.mak -make -j 16 +make -j $NUM_CPUS ; make lipo -create -output /opt/local/lib/libavutil.a ./libavutil/libavutil.a ./x86_64/libavutil.a lipo -create -output /opt/local/lib/libavfilter.a ./libavfilter/libavfilter.a ./x86_64/libavfilter.a lipo -create -output /opt/local/lib/libavcodec.a ./libavcodec/libavcodec.a ./x86_64/libavcodec.a @@ -116,41 +160,102 @@ lipo -create -output /opt/local/lib/libavformat.a ./libavformat/libavformat.a ./ lipo -create -output /opt/local/lib/libavdevice.a ./libavdevice/libavdevice.a ./x86_64/libavdevice.a lipo -create -output /opt/local/lib/libswresample.a ./libswresample/libswresample.a ./x86_64/libswresample.a lipo -create -output /opt/local/lib/libswscale.a ./libswscale/libswscale.a ./x86_64/libswscale.a +make clean || true # can exit nonzero +git status --ignored -s | colrm 1 2 | xargs rm -rf +./configure --disable-asm --disable-x86asm --enable-static --disable-shared --disable-securetransport --extra-cflags="${OSX_VERSION_MIN}" --disable-indev=lavfi --disable-libx264 --disable-lzma --enable-gpl --enable-opengl --disable-programs --disable-optimizations +sed -i -e "s/^CFLAGS=/CFLAGS=-g ${XL_TARGETS} ${OSX_VERSION_MIN} -DGL_SILENCE_DEPRECATION=1 -Wno-incompatible-function-pointer-types /" ffbuild/config.mak +sed -i -e "s/^CXXFLAGS=/CXXFLAGS=-g ${XL_TARGETS} ${OSX_VERSION_MIN} -DGL_SILENCE_DEPRECATION=1 /" ffbuild/config.mak +sed -i -e "s/^LDFLAGS=/LDFLAGS=-g ${XL_TARGETS} ${OSX_VERSION_MIN} /" ffbuild/config.mak +make -j $NUM_CPUS ; make +find . -name "*.a" -exec cp {} /opt/local/libdbg/ \; +popd -echo "libxslwriter" -git clone https://github.com/jmcnamara/libxlsxwriter.git -cd libxlsxwriter/cmake -export CXXFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN}" -export CFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN}" -export LDFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN}" +echo "libxslxwriter" +if [ ! -d "libxlsxwriter" ] ; then git clone https://github.com/jmcnamara/libxlsxwriter.git ; fi +pushd libxlsxwriter +git checkout v1.1.9 +cd cmake +export CXXFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN} " +export CFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN} " +export LDFLAGS="-g -O3 -flto=thin ${XL_TARGETS} ${OSX_VERSION_MIN} " cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" .. make cp libxlsxwriter.a /opt/local/lib/ git status --ignored -s | colrm 1 3 | xargs rm -rf +export CXXFLAGS="-g ${XL_TARGETS} ${OSX_VERSION_MIN} " +export CFLAGS="-g ${XL_TARGETS} ${OSX_VERSION_MIN} " +export LDFLAGS="-g ${XL_TARGETS} ${OSX_VERSION_MIN} " +cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" .. +make +cp libxlsxwriter.a /opt/local/libdbg/ +cp -a ../include/* /opt/local/include make clean git status --ignored -s | colrm 1 3 | xargs rm -rf +unset CXXFLAGS +unset CFLAGS +unset LDFLAGS +popd -echo "liblua" #(currently using v5.4.4) -git clone https://github.com/lua/lua -cd lua -git checkout v5.4.4 + +echo "liblua" # currently using v5.4.7 +if [ ! -d "liblua" ] ; then git clone https://github.com/lua/lua ; fi +pushd lua +git fetch -v +git checkout v5.4.7 make clean -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" cp liblua.a /opt/local/lib cp lua.h luaconf.h lualib.h lauxlib.h /opt/local/include +make clean +export CFLAGS="-g ${XL_TARGETS} ${OSX_VERSION_MIN} " +make -j $NUM_CPUS all CFLAGS="$CFLAGS" MYLDFLAGS="$CFLAGS" +cp liblua.a /opt/local/libdbg unset CFLAGS +popd -echo "libhidapi" #(currently using 0.11.2) -git clone https://github.com/libusb/hidapi -cd hidapi -git checkout hidapi-0.11.2 -export CFLAGS="-g -O3 -flto=thin -Wall -fno-stack-protector -fno-common ${XL_TARGETS} ${OSX_VERSION_MIN}" +echo "libhidapi" # currently using 0.14.0 +if [ ! -d "hidapi" ] ; then git clone https://github.com/libusb/hidapi ; fi +pushd hidapi +git fetch -v +git checkout hidapi-0.14.0 +export CFLAGS="-g -O3 -flto=thin -Wall -fno-stack-protector -fno-common ${XL_TARGETS} ${OSX_VERSION_MIN} " ./bootstrap ./configure --prefix=/opt/local make clean make cp ./mac/.libs/libhidapi.a /opt/local/lib make clean +export CFLAGS="-g -Wall -fno-stack-protector -fno-common ${XL_TARGETS} ${OSX_VERSION_MIN} " +./configure --prefix=/opt/local +make +rm -f /opt/local/libdbg/libhidapi* +cp ./mac/.libs/libhidapi.a /opt/local/libdbg +make clean +unset CFLAGS +popd -echo "done" +echo "libwebp" # currently using v1.4.0 +if [ ! -d "libwebp" ] ; then git clone https://chromium.googlesource.com/webm/libwebp ; fi +pushd libwebp +git fetch -v +git checkout v1.4.0 +./autogen.sh +export CFLAGS="-g -O3 -flto=thin -Wall -fno-stack-protector -fno-common ${XL_TARGETS} ${OSX_VERSION_MIN} " +./configure --prefix=/opt/local --disable-shared +make clean +make -j $NUM_CPUS +cp ./src/.libs/libwebp.a /opt/local/lib +cp ./src/demux/.libs/libwebpdemux.a /opt/local/lib +cp ./sharpyuv/.libs/libsharpyuv.a /opt/local/lib +make clean +export CFLAGS="-g -Wall -fno-stack-protector -fno-common ${XL_TARGETS} ${OSX_VERSION_MIN} " +./configure --prefix=/opt/local --disable-shared +make -j $NUM_CPUS +cp ./src/.libs/libwebp.a /opt/local/libdbg +cp ./src/demux/.libs/libwebpdemux.a /opt/local/libdbg +cp ./sharpyuv/.libs/libsharpyuv.a /opt/local/libdbg +unset CFLAGS +popd +echo "Libraries built" +ls -ltR /opt/local From a46fe2b7023be6ad23e14b344de0c32de08a18fb Mon Sep 17 00:00:00 2001 From: Nash Kaminski Date: Mon, 2 Dec 2024 23:40:12 -0600 Subject: [PATCH 2/3] Refactor build scripts for wxWidgets to operate per the README as well --- scripts/BuildWxWidgetsDebug.sh | 45 ++++++++++++++++++++++++++++++++ scripts/BuildWxWidgetsRelease.sh | 44 +++++++++++++++++++++++++++++++ scripts/BuildWxWigetsDebug.sh | 36 ------------------------- 3 files changed, 89 insertions(+), 36 deletions(-) create mode 100755 scripts/BuildWxWidgetsDebug.sh create mode 100755 scripts/BuildWxWidgetsRelease.sh delete mode 100755 scripts/BuildWxWigetsDebug.sh diff --git a/scripts/BuildWxWidgetsDebug.sh b/scripts/BuildWxWidgetsDebug.sh new file mode 100755 index 0000000..d01e4a9 --- /dev/null +++ b/scripts/BuildWxWidgetsDebug.sh @@ -0,0 +1,45 @@ +#!/bin/bash -e +# System dependency checks... +if [ ! -d /opt/local ] || [ ! -d /opt/local/libdbg ] || [ ! -d /opt/local/bin ] ; then + echo "/opt/local/lib, /opt/local/libdbg and /opt/local/include must exist and be writable!" + exit 1 +fi + +if [ ! -e "wx-config.in" ] ; then + # We are not inside of the wxWidgets source tree + echo "Changing Dir to ../../../wxWidgets" + cd ../../.. + echo "$PWD" + cd wxWidgets +fi + +export NUM_CPUS="${NUM_CPUS:-$(sysctl -n hw.ncpu)}" +export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-11.0} +export BINARY_PLATFORMS="x86_64,arm64" +export CXXFLAGS="" +export OBJCXXFLAGS="" +export CPPFLAGS="-g" +export LDFLAGS="" +export CXX=clang++ +export CXXCPP="clang++ -E" +export CC=clang +export CPP="clang -E" +export CFLAGS="-g" +set -x # prints all executed commands from now on +mkdir -p build +cd build +../configure --prefix=/opt/local --libdir=/opt/local/libdbg \ + --enable-debug --enable-debug_info --disable-optimise --enable-universal_binary=${BINARY_PLATFORMS} \ + --with-osx_cocoa --with-macosx-version-min=${MACOSX_DEPLOYMENT_TARGET} --disable-dependency-tracking \ + --disable-compat30 --enable-mimetype --enable-aui --with-opengl \ + --enable-webview --enable-webviewwebkit --disable-mdi --disable-mdidoc --disable-loggui \ + --disable-xrc --disable-stc --disable-ribbon --disable-htmlhelp --disable-mediactrl \ + --with-cxx=17 --enable-cxx11 --enable-std_containers --enable-std_string_conv_in_wxstring \ + --without-liblzma --with-expat=builtin --with-zlib=builtin --with-libjpeg=builtin --without-libtiff \ + --disable-sys-libs \ + --enable-backtrace --enable-exceptions +make -j $NUM_CPUS +rm -rf /opt/local/libdbg/libwx*.dylib +make install + +echo "Done" diff --git a/scripts/BuildWxWidgetsRelease.sh b/scripts/BuildWxWidgetsRelease.sh new file mode 100755 index 0000000..5ae85ee --- /dev/null +++ b/scripts/BuildWxWidgetsRelease.sh @@ -0,0 +1,44 @@ +#!/bin/bash -e +# System dependency checks... +if [ ! -d /opt/local ] || [ ! -d /opt/local/libdbg ] || [ ! -d /opt/local/bin ] ; then + echo "/opt/local/lib, /opt/local/libdbg and /opt/local/include must exist and be writable!" + exit 1 +fi + +if [ ! -e "wx-config.in" ] ; then + # We are not inside of the wxWidgets source tree + echo "Changing Dir to ../../../wxWidgets" + cd ../../.. + echo "$PWD" + cd wxWidgets +fi + +export NUM_CPUS="${NUM_CPUS:-$(sysctl -n hw.ncpu)}" +export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-11.0} +export BINARY_PLATFORMS="x86_64,arm64" +export CXXFLAGS="" +export OBJCXXFLAGS="" +export CPPFLAGS="-g -flto=thin" +export LDFLAGS="-g -flto=thin" +export CXX=clang++ +export CXXCPP="clang++ -E" +export CC=clang +export CPP="clang -E" +export CFLAGS="-g" +set -x # prints all executed commands from now on +mkdir -p build +cd build +../configure --disable-debug_flag --enable-debug_info --enable-optimise --prefix=/opt/local --enable-universal_binary=${BINARY_PLATFORMS} \ + --with-osx_cocoa --with-macosx-version-min=${MACOSX_DEPLOYMENT_TARGET} --disable-dependency-tracking \ + --disable-compat30 --enable-mimetype --enable-aui --with-opengl \ + --enable-webview --enable-webviewwebkit --disable-mdi --disable-mdidoc --disable-loggui \ + --disable-xrc --disable-stc --disable-ribbon --disable-htmlhelp --disable-mediactrl \ + --with-cxx=17 --enable-cxx11 --enable-std_containers --enable-std_string_conv_in_wxstring \ + --without-liblzma --with-expat=builtin --with-zlib=builtin --with-libjpeg=builtin --without-libtiff \ + --disable-sys-libs \ + --enable-backtrace --enable-exceptions --disable-shared +make -j $NUM_CPUS +rm -rf /opt/local/lib/libwx*.dylib +make install + +echo "Done" diff --git a/scripts/BuildWxWigetsDebug.sh b/scripts/BuildWxWigetsDebug.sh deleted file mode 100755 index 32d1355..0000000 --- a/scripts/BuildWxWigetsDebug.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -echo "Changing Dir..." -cd ../../.. -echo "$PWD" -cd wxWidgets/build/ - -echo "Configure..." -echo "$PWD" - -export BINARY_PLATFORMS="x86_64,arm64" -export CXXFLAGS="" -export OBJCXXFLAGS="" -export CPPFLAGS="-g" -export LDFLAGS="" -export CXX=clang++ -export CXXCPP="clang++ -E" -export CC=clang -export CPP="clang -E" -export CFLAGS="-g" -../configure --prefix=/opt/local --libdir=/opt/local/libdbg \ - --enable-debug --enable-debug_info --disable-optimise --enable-universal_binary=${BINARY_PLATFORMS} \ - --with-osx_cocoa --with-macosx-version-min=10.14 --disable-dependency-tracking \ - --disable-compat30 --enable-mimetype --enable-aui --with-opengl \ - --enable-webview --enable-webviewwebkit --disable-mdi --disable-mdidoc --disable-loggui \ - --disable-xrc --disable-stc --disable-ribbon --disable-htmlhelp --disable-mediactrl \ - --with-cxx=17 --enable-cxx11 --enable-std_containers --enable-std_string --enable-std_string_conv_in_wxstring \ - --without-liblzma --with-expat=builtin --with-zlib=builtin --with-libjpeg=builtin --without-libtiff \ - --disable-sys-libs \ - --enable-backtrace --enable-exceptions -echo "Make..." -make -j 8 -rm -rf /opt/local/libdbg/libwx*.dylib -echo "Install..." -make install -echo "Done" \ No newline at end of file From 7d61a28a6d08e74439caf6684744186844867435 Mon Sep 17 00:00:00 2001 From: Nash Kaminski Date: Mon, 2 Dec 2024 23:41:58 -0600 Subject: [PATCH 3/3] Release build need not test for libdbg --- scripts/BuildWxWidgetsRelease.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/BuildWxWidgetsRelease.sh b/scripts/BuildWxWidgetsRelease.sh index 5ae85ee..ad564de 100755 --- a/scripts/BuildWxWidgetsRelease.sh +++ b/scripts/BuildWxWidgetsRelease.sh @@ -1,7 +1,7 @@ #!/bin/bash -e # System dependency checks... -if [ ! -d /opt/local ] || [ ! -d /opt/local/libdbg ] || [ ! -d /opt/local/bin ] ; then - echo "/opt/local/lib, /opt/local/libdbg and /opt/local/include must exist and be writable!" +if [ ! -d /opt/local ] || [ ! -d /opt/local/bin ] ; then + echo "/opt/local/lib and /opt/local/include must exist and be writable!" exit 1 fi