From 73c6f84c96ba20d2fd2ecfdfe9f0288dfda7130e Mon Sep 17 00:00:00 2001 From: Pork Chop Date: Sat, 2 Mar 2024 17:27:33 +1100 Subject: [PATCH 1/2] Fix linux build --- build-cmd.sh | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/build-cmd.sh b/build-cmd.sh index f729298..5ea5030 100644 --- a/build-cmd.sh +++ b/build-cmd.sh @@ -171,12 +171,6 @@ pushd "$PNG_SOURCE_DIR" # # unset DISTCC_HOSTS CC CXX CFLAGS CPPFLAGS CXXFLAGS - # Prefer gcc-4.6 if available. - if [[ -x /usr/bin/gcc-4.6 && -x /usr/bin/g++-4.6 ]]; then - export CC=/usr/bin/gcc-4.6 - export CXX=/usr/bin/g++-4.6 - fi - # Default target per AUTOBUILD_ADDRSIZE opts="${TARGET_OPTS:--m$AUTOBUILD_ADDRSIZE $LL_BUILD_RELEASE}" @@ -209,20 +203,23 @@ pushd "$PNG_SOURCE_DIR" # * Builds all bin/* targets with static libraries. # build the release version and link against the release zlib + CFLAGS="$opts" \ CXXFLAGS="$opts" \ CPPFLAGS="${CPPFLAGS:-} -I$stage/packages/include/zlib" \ LDFLAGS="-L$stage/packages/lib/release" \ + + #LL_BUILD_RELEASE contains a c++ standard flag which are meaningful to the c++ + #compiler only (g++), when introduced into CFLAGS it causes gcc (the C compiler) + #to spam a load of noise.. Strip out any C++ std cruft from CFLAGS (squelches the noise) + CFLAGS=$(echo "$CFLAGS" | sed 's/-std=c++[0-9][0-9]*//') + ./configure --prefix="$stage" --libdir="$stage/lib/release" \ --includedir="$stage/include" --enable-shared=no --with-pic + make make install - # conditionally run unit tests - if [ "${DISABLE_UNIT_TESTS:-0}" = "0" ]; then - make test - fi - # clean the build artifacts make distclean ;; From 8acba6fb6ff7ed4f86d607a9b5b0ee1b623a84a7 Mon Sep 17 00:00:00 2001 From: Pork Chop <111226857+yaynstuff@users.noreply.github.com> Date: Fri, 15 Mar 2024 00:43:14 +1100 Subject: [PATCH 2/2] Update build-cmd.sh --- build-cmd.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/build-cmd.sh b/build-cmd.sh index 5ea5030..0fec518 100644 --- a/build-cmd.sh +++ b/build-cmd.sh @@ -28,6 +28,8 @@ source_environment_tempfile="$stage/source_environment.sh" "$autobuild" source_environment > "$source_environment_tempfile" . "$source_environment_tempfile" +source "$(dirname "$AUTOBUILD_VARIABLES_FILE")/functions" + [ -f "$stage"/packages/include/zlib-ng/zlib.h ] || \ { echo "Run 'autobuild install' first." 1>&2 ; exit 1; } @@ -122,7 +124,7 @@ pushd "$PNG_SOURCE_DIR" done # See "linux" section for goals/challenges here... - + CFLAGS="$(remove_cxxstd $opts)" \ CFLAGS="$opts" \ CXXFLAGS="$opts" \ CPPFLAGS="${CPPFLAGS:-} -I$stage/packages/include/zlib" \ @@ -203,17 +205,11 @@ pushd "$PNG_SOURCE_DIR" # * Builds all bin/* targets with static libraries. # build the release version and link against the release zlib - + CFLAGS="$(remove_cxxstd $opts)" \ CFLAGS="$opts" \ CXXFLAGS="$opts" \ CPPFLAGS="${CPPFLAGS:-} -I$stage/packages/include/zlib" \ LDFLAGS="-L$stage/packages/lib/release" \ - - #LL_BUILD_RELEASE contains a c++ standard flag which are meaningful to the c++ - #compiler only (g++), when introduced into CFLAGS it causes gcc (the C compiler) - #to spam a load of noise.. Strip out any C++ std cruft from CFLAGS (squelches the noise) - CFLAGS=$(echo "$CFLAGS" | sed 's/-std=c++[0-9][0-9]*//') - ./configure --prefix="$stage" --libdir="$stage/lib/release" \ --includedir="$stage/include" --enable-shared=no --with-pic