Skip to content

Commit

Permalink
Merge pull request #4 from yaynstuff/master
Browse files Browse the repository at this point in the history
Fix linux build
  • Loading branch information
nat-goodspeed authored Mar 14, 2024
2 parents c026eea + 8acba6f commit b8e0679
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions build-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down Expand Up @@ -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" \
Expand Down Expand Up @@ -171,12 +173,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}"

Expand Down Expand Up @@ -209,20 +205,17 @@ 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" \
./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
;;
Expand Down

0 comments on commit b8e0679

Please sign in to comment.