diff --git a/cook.sh b/cook.sh index 6cd0bf228..bad288a48 100755 --- a/cook.sh +++ b/cook.sh @@ -10,6 +10,7 @@ export CARGO=(env RUSTFLAGS="$PREFIX_RUSTFLAGS" xargo) export CARGOBUILD=rustc export CARGOFLAGS= export DEBUG= +export EXAMPLES= export PREPARE_COPY=1 if [ ! "$(uname -s)" = "Redox" ] @@ -355,6 +356,7 @@ function op { op $1 unstage mkdir -p stage stage="$(realpath stage)" + source="$(realpath source)" pushd build > /dev/null skip=0 if [ "$(type -t recipe_stage)" = "function" ] @@ -372,15 +374,15 @@ function op { fi bins="$(find target/$TARGET/$build/ -maxdepth 1 -type f ! -name '*.*')" - if [ -z "$bins" ] + if [ -z "$bins" ] || [ "$EXAMPLES" == 1 ] then example=true - bins="$(find target/$TARGET/$build/examples/ -maxdepth 1 -type f ! -name '*.*' ! -name '*-*' \ + bins="$bins $(find target/$TARGET/$build/examples/ -maxdepth 1 -type f ! -name '*.*' ! -name '*-*' \ 2> /dev/null || true)" fi if [ -n "$bins" ] then - if [ -n "$example" ] + if [ -n "$example" ] && [ "$EXAMPLES" != 1 ] then echo "$(tput bold)Note$(tput sgr0): No binaries detected, using example binaries" fi @@ -398,7 +400,7 @@ function op { echo "$(tput bold)Warning$(tput sgr0): Recipe does not have any binaries" >&2 fi - docgen ../source ../stage/ref + docgen "$source" "$stage/ref" fi popd > /dev/null ;; diff --git a/recipes/netsurf/recipe.sh b/recipes/netsurf/recipe.sh index 0bfc582b2..898ac433e 100644 --- a/recipes/netsurf/recipe.sh +++ b/recipes/netsurf/recipe.sh @@ -17,7 +17,7 @@ function recipe_build { sysroot="$(realpath ../sysroot)" export TARGET="framebuffer" export CFLAGS="-I$sysroot/include -I${PWD}/inst-${TARGET}/include" - export LDFLAGS="-L$sysroot/lib -L${PWD}/inst-${TARGET}/lib -Wl,--allow-multiple-definition -Wl,-Bstatic" + export LDFLAGS="-L$sysroot/lib -L${PWD}/inst-${TARGET}/lib -static -Wl,--allow-multiple-definition -Wl,-Bstatic" # nghttp2 is not linked for some reason export LDFLAGS="${LDFLAGS} -lcurl -lnghttp2" make V=1 -j"$(nproc)" diff --git a/recipes/nghttp2/recipe.sh b/recipes/nghttp2/recipe.sh index f077220c8..7b1325c4f 100644 --- a/recipes/nghttp2/recipe.sh +++ b/recipes/nghttp2/recipe.sh @@ -12,6 +12,8 @@ function recipe_update { } function recipe_build { + export CFLAGS="-static" + ./configure \ --build="${BUILD}" \ --host="${HOST}" \ diff --git a/recipes/xz/recipe.sh b/recipes/xz/recipe.sh index d5ca281d1..8e483f20b 100644 --- a/recipes/xz/recipe.sh +++ b/recipes/xz/recipe.sh @@ -12,14 +12,23 @@ function recipe_update { } function recipe_build { - # Workaround of - # xzdec: hidden symbol `main' in xzdec-xzdec.o is referenced by DSO - export CFLAGS="-fvisibility=default" + export CFLAGS="-static" ./autogen.sh chmod +w build-aux/config.sub wget -O build-aux/config.sub http://git.savannah.gnu.org/cgit/config.git/plain/config.sub - ./configure --build=${BUILD} --host=${HOST} --prefix=/ --enable-threads=no + ./configure \ + --build=${BUILD} \ + --host=${HOST} \ + --prefix=/ \ + --disable-lzmadec \ + --disable-lzmainfo \ + --disable-xz \ + --disable-xzdec \ + --enable-shared=no \ + --enable-static=yes \ + --enable-threads=no \ + --with-pic=no make -j"$(nproc)" skip=1 }