From fe19c848bea743436e383fa1f5fd8e901e4490ca Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Thu, 15 Nov 2018 12:01:25 -0500 Subject: [PATCH] Abstract out the architecture in build_wxwidgets script --- mac/scripts/build_wxwidgets | 59 +++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/mac/scripts/build_wxwidgets b/mac/scripts/build_wxwidgets index 99886f280..f4d19aafa 100755 --- a/mac/scripts/build_wxwidgets +++ b/mac/scripts/build_wxwidgets @@ -23,25 +23,6 @@ fi max=${min/./}0 ver="-DMAC_OS_X_VERSION_MAX_ALLOWED=${max} -mmacosx-version-min=${min}" -arch='-arch i386' - -std='' -stdlib='-stdlib=libstdc++' -if [ ${max} -gt 1060 ] -then - std='-std=c++1z' - stdlib='-stdlib=libc++' -fi - -export CPPFLAGS="${ver}" -export CFLAGS1="$arch ${ver} -isysroot $sdk" -export CXXFLAGS1="$arch ${ver} -isysroot $sdk ${std} ${stdlib}" -export LDFLAGS1="$arch ${ver} -syslibroot,$sdk ${std} ${stdlib}" - -# Make sure our flags are included -export CC="gcc $CFLAGS1" -export CXX="g++ $CXXFLAGS1" -export LD="g++ $LDFLAGS1" # Build a specific configuration function bld @@ -51,7 +32,10 @@ function bld pushd "${1}" shift - ../configure --enable-macosx-arch=i386 \ + arch_option="--enable-macosx-arch=${1}" + shift + + ../configure ${arch_option} \ --with-expat=builtin \ --with-zlib=builtin \ --with-regex=builtin \ @@ -74,10 +58,33 @@ function inst popd } -# Build all configurations -bld bld_debug --enable-debug=yes --enable-shared=yes --with-flavour=debug -bld bld_release --enable-debug=no --enable-shared=yes --with-flavour=release +for architecture in 'i386'; do { + std='' + stdlib='-stdlib=libstdc++' + if [ ${max} -gt 1060 ] + then + std='-std=c++1z' + stdlib='-stdlib=libc++' + fi -# Install all configurations -inst bld_debug -inst bld_release + arch="-arch ${architecture}" + export CPPFLAGS="${ver}" + export CFLAGS1="${arch} ${ver} -isysroot $sdk" + export CXXFLAGS1="${arch} ${ver} -isysroot $sdk ${std} ${stdlib}" + export LDFLAGS1="${arch} ${ver} -syslibroot,$sdk ${std} ${stdlib}" + + # Make sure our flags are included + export CC="gcc $CFLAGS1" + export CXX="g++ $CXXFLAGS1" + export LD="g++ $LDFLAGS1" + + # Build all configurations + debug_dir="bld_debug_${architecture}" + release_dir="bld_release_${architecture}" + bld ${debug_dir} ${architecture} --enable-debug=yes --enable-shared=yes --with-flavour=debug + bld ${release_dir} ${architecture} --enable-debug=no --enable-shared=yes --with-flavour=release + + # Install all configurations + inst ${debug_dir} + inst ${release_dir} +}; done # loop over architectures