diff --git a/autobuild.xml b/autobuild.xml index 836a85e4644bd9bd2e3d0a542b7a0f5d9e490457..043a3b3843865cc84450bf01f904d46dceb1d401 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -88,9 +88,7 @@ <key>manifest</key> <array> <string>lib/debug/*.so*</string> - <string>lib/debug/*.a</string> <string>lib/release/*.so*</string> - <string>lib/release/*.a</string> </array> <key>name</key> <string>linux</string> diff --git a/build-cmd.sh b/build-cmd.sh old mode 100644 new mode 100755 index 54cc5aabf435d95e578427bb2324da84d7a6aa1e..d432c900b5de13296128d6c9b90b1a15e67972be --- a/build-cmd.sh +++ b/build-cmd.sh @@ -48,13 +48,6 @@ pushd "$EPOXY_SOURCE_DIR" windows*) load_vsvars - if [ "$AUTOBUILD_ADDRSIZE" = 32 ] - then - archflags="" - else - archflags="/arch:AVX" - fi - meson "_build_debug" --prefix="$(cygpath -w ${stage})" --libdir="$(cygpath -w ${stage})/lib/debug" --bindir="$(cygpath -w ${stage})/lib/debug" \ --buildtype debug --debug @@ -75,6 +68,67 @@ pushd "$EPOXY_SOURCE_DIR" "darwin") ;; linux*) + # Linux build environment at Linden comes pre-polluted with stuff that can + # seriously damage 3rd-party builds. Environmental garbage you can expect + # includes: + # + # DISTCC_POTENTIAL_HOSTS arch root CXXFLAGS + # DISTCC_LOCATION top branch CC + # DISTCC_HOSTS build_name suffix CXX + # LSDISTCC_ARGS repo prefix CFLAGS + # cxx_version AUTOBUILD SIGN CPPFLAGS + # + # So, clear out bits that shouldn't affect our configure-directed build + # but which do nonetheless. + # + unset DISTCC_HOSTS CC CXX CFLAGS CPPFLAGS CXXFLAGS + + # Default target per autobuild build --address-size + opts="${TARGET_OPTS:--m$AUTOBUILD_ADDRSIZE}" + DEBUG_COMMON_FLAGS="$opts -Og -g -fPIC -DPIC" + RELEASE_COMMON_FLAGS="$opts -O3 -g -fPIC -DPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2" + DEBUG_CFLAGS="$DEBUG_COMMON_FLAGS" + RELEASE_CFLAGS="$RELEASE_COMMON_FLAGS" + DEBUG_CXXFLAGS="$DEBUG_COMMON_FLAGS -std=c++17" + RELEASE_CXXFLAGS="$RELEASE_COMMON_FLAGS -std=c++17" + DEBUG_CPPFLAGS="-DPIC" + RELEASE_CPPFLAGS="-DPIC" + DEBUG_LDFLAGS="$opts" + RELEASE_LDFLAGS="$opts" + + # Handle any deliberate platform targeting + if [ -z "${TARGET_CPPFLAGS:-}" ]; then + # Remove sysroot contamination from build environment + unset CPPFLAGS + else + # Incorporate special pre-processing flags + export CPPFLAGS="$TARGET_CPPFLAGS" + fi + + CFLAGS="$DEBUG_CFLAGS" \ + CXXFLAGS="$DEBUG_CXXFLAGS" \ + CPPFLAGS="${CPPFLAGS:-} ${DEBUG_CPPFLAGS}" \ + LDFLAGS="$DEBUG_LDFLAGS" \ + meson "_build_debug" --prefix="${stage}" --libdir="${stage}/lib/debug" --bindir="${stage}/lib/debug" \ + --optimization g --debug + + pushd "_build_debug" + ninja + ninja install + popd + + + CFLAGS="$RELEASE_CFLAGS" \ + CXXFLAGS="$RELEASE_CXXFLAGS" \ + CPPFLAGS="${CPPFLAGS:-} ${RELEASE_CPPFLAGS}" \ + LDFLAGS="$RELEASE_LDFLAGS" \ + meson "_build_release" --prefix="${stage}" --libdir="${stage}/lib/release" --bindir="${stage}/lib/release" \ + --optimization 3 --debug -Db_lto=true + + pushd "_build_release" + ninja + ninja install + popd ;; esac mkdir -p "$stage/LICENSES"