From 1b29c1e173b66f9f7832b1ca4d7be8aa40cf996c Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 7 Sep 2025 20:53:28 -0600 Subject: [PATCH] Clean up compiler flags --- recipes/demos/cairodemo/recipe.toml | 2 -- recipes/dev/cmake/recipe.toml | 2 -- recipes/dev/git/recipe.toml | 2 -- recipes/emulators/dosbox/recipe.toml | 4 ++-- recipes/emulators/flycast/recipe.toml | 4 ++-- recipes/emulators/rvvm/recipe.toml | 2 +- recipes/games/eduke32/recipe.toml | 7 +------ recipes/games/gigalomania/recipe.toml | 2 -- recipes/games/sopwith/recipe.toml | 3 +-- recipes/libs/liborbital/recipe.toml | 2 +- recipes/libs/sdl-gfx/recipe.toml | 3 --- recipes/libs/sdl1-ttf/recipe.toml | 3 +-- recipes/libs/sdl2/recipe.toml | 2 +- recipes/tools/schismtracker/recipe.toml | 3 +-- recipes/tui/mdp/recipe.toml | 3 +-- recipes/video/sdl-player/recipe.toml | 2 -- recipes/web/netsurf/recipe.toml | 4 ++-- recipes/wip/libs/other/boost/recipe.toml | 4 ---- recipes/wip/libs/other/freeglut/recipe.toml | 5 ----- recipes/wip/x11/xterm/recipe.toml | 2 +- src/bin/cook.rs | 3 +-- 21 files changed, 16 insertions(+), 48 deletions(-) diff --git a/recipes/demos/cairodemo/recipe.toml b/recipes/demos/cairodemo/recipe.toml index c4f58aac..6538f035 100755 --- a/recipes/demos/cairodemo/recipe.toml +++ b/recipes/demos/cairodemo/recipe.toml @@ -13,8 +13,6 @@ dependencies = [ ] template = "custom" script = """ -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include" "${CXX}" \ $("${PKG_CONFIG}" --cflags cairo) \ "${COOKBOOK_RECIPE}/cairodemo.c" \ diff --git a/recipes/dev/cmake/recipe.toml b/recipes/dev/cmake/recipe.toml index b888557b..1cc84615 100644 --- a/recipes/dev/cmake/recipe.toml +++ b/recipes/dev/cmake/recipe.toml @@ -22,8 +22,6 @@ dependencies = [ script = """ DYNAMIC_INIT -export LDFLAGS="-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib $LDFLAGS" - COOKBOOK_CMAKE_FLAGS+=( -DBUILD_TESTING=Off -DCMAKE_USE_SYSTEM_BZIP2=On diff --git a/recipes/dev/git/recipe.toml b/recipes/dev/git/recipe.toml index 616f7a81..52d5b70c 100644 --- a/recipes/dev/git/recipe.toml +++ b/recipes/dev/git/recipe.toml @@ -28,8 +28,6 @@ MAKEFLAGS=( BLK_SHA1=1 V=1 ) -export LDFLAGS="-L${COOKBOOK_SYSROOT}/usr/lib" -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/usr/include" export CURL_CONFIG="${COOKBOOK_SYSROOT}/usr/bin/curl-config" ./configure \ --host="${GNU_TARGET}" \ diff --git a/recipes/emulators/dosbox/recipe.toml b/recipes/emulators/dosbox/recipe.toml index c25c5043..61e31fc9 100644 --- a/recipes/emulators/dosbox/recipe.toml +++ b/recipes/emulators/dosbox/recipe.toml @@ -15,8 +15,8 @@ dependencies = [ template = "custom" script = """ DYNAMIC_INIT -export CFLAGS="-I${COOKBOOK_SYSROOT}/include/SDL" -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include/SDL" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/SDL" +export CPPFLAGS="${CPPFLAGS} -I${COOKBOOK_SYSROOT}/include/SDL" export LDFLAGS+=" -lorbital" COOKBOOK_CONFIGURE_FLAGS+=( --disable-opengl diff --git a/recipes/emulators/flycast/recipe.toml b/recipes/emulators/flycast/recipe.toml index 65e439c7..0c90a430 100644 --- a/recipes/emulators/flycast/recipe.toml +++ b/recipes/emulators/flycast/recipe.toml @@ -16,8 +16,8 @@ dependencies = [ ] script = """ DYNAMIC_INIT -export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/usr/include -I${COOKBOOK_SYSROOT}/usr/include/SDL2" -export CXXFLAGS="${CXXFLAGS} -D_GLIBCXX_USE_C99_MATH_TR1=1 -I${COOKBOOK_SYSROOT}/usr/include -I${COOKBOOK_SYSROOT}/usr/include/SDL2" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/usr/include/SDL2" +export CXXFLAGS="${CXXFLAGS} -D_GLIBCXX_USE_C99_MATH_TR1=1 -I${COOKBOOK_SYSROOT}/usr/include/SDL2" #TODO: don't use this export SDL_LIBS="-lSDL2 -lorbital $("${TARGET}-pkg-config" --libs osmesa) -lstdc++" #TODO: don't add curl diff --git a/recipes/emulators/rvvm/recipe.toml b/recipes/emulators/rvvm/recipe.toml index d355186e..c98185fb 100644 --- a/recipes/emulators/rvvm/recipe.toml +++ b/recipes/emulators/rvvm/recipe.toml @@ -17,7 +17,7 @@ export BUILDDIR="${COOKBOOK_BUILD}" export DESTDIR="${COOKBOOK_STAGE}" # Redox currently doesn't support dynamic library loading -export LDFLAGS="$(pkg-config --libs sdl)" +export LDFLAGS="${LDFLAGS} $(pkg-config --libs sdl)" # Networking is currently broken on Redox (missing setsockopt?) export USE_NET=0 diff --git a/recipes/games/eduke32/recipe.toml b/recipes/games/eduke32/recipe.toml index 79cd4a57..2cc38c16 100644 --- a/recipes/games/eduke32/recipe.toml +++ b/recipes/games/eduke32/recipe.toml @@ -19,14 +19,9 @@ DYNAMIC_INIT # Copy source to build directory rsync -av --delete "${COOKBOOK_SOURCE}/" ./ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/SDL" export SDLCONFIG="${COOKBOOK_SYSROOT}/bin/sdl-config --prefix=${COOKBOOK_SYSROOT}" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" -if [ "${COOKBOOK_DYNAMIC}" != "1" ]; then - LDFLAGS+=" -static" -fi - PLATFORM=REDOX "${COOKBOOK_MAKE}" -j"$($NPROC)" mkdir -pv "${COOKBOOK_STAGE}/usr/games" diff --git a/recipes/games/gigalomania/recipe.toml b/recipes/games/gigalomania/recipe.toml index a39f84fe..5a000cba 100644 --- a/recipes/games/gigalomania/recipe.toml +++ b/recipes/games/gigalomania/recipe.toml @@ -21,8 +21,6 @@ DYNAMIC_INIT rsync -av --delete "${COOKBOOK_SOURCE}/" ./ export CPPHOST="${TARGET}-g++" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include" "${REDOX_MAKE}" all -j"$(${NPROC})" diff --git a/recipes/games/sopwith/recipe.toml b/recipes/games/sopwith/recipe.toml index 60bdad06..219c5c33 100644 --- a/recipes/games/sopwith/recipe.toml +++ b/recipes/games/sopwith/recipe.toml @@ -10,8 +10,7 @@ dependencies = [ "libiconv", ] script = """ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib -static" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/SDL" export LIBS="-lSDL -lorbital" # TODO: Uses sdl-config instead of pkg-config # For some reason, cook_configure breaks spectacularly on this diff --git a/recipes/libs/liborbital/recipe.toml b/recipes/libs/liborbital/recipe.toml index 0276ea61..a3e0c5fe 100644 --- a/recipes/libs/liborbital/recipe.toml +++ b/recipes/libs/liborbital/recipe.toml @@ -4,7 +4,7 @@ git = "https://gitlab.redox-os.org/redox-os/liborbital.git" [build] template = "custom" script = """ -DYNAMIC_INIT +DYNAMIC_STATIC_INIT rsync -av --delete "${COOKBOOK_SOURCE}/" ./ "${COOKBOOK_CARGO}" build --release "${COOKBOOK_MAKE}" install HOST="${TARGET}" DESTDIR="${COOKBOOK_STAGE}" diff --git a/recipes/libs/sdl-gfx/recipe.toml b/recipes/libs/sdl-gfx/recipe.toml index 1ba2b354..540b8d15 100644 --- a/recipes/libs/sdl-gfx/recipe.toml +++ b/recipes/libs/sdl-gfx/recipe.toml @@ -14,9 +14,6 @@ dependencies = [ "libiconv", ] script = """ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" - COOKBOOK_CONFIGURE_FLAGS=( --prefix=/ --build="$(gcc -dumpmachine)" diff --git a/recipes/libs/sdl1-ttf/recipe.toml b/recipes/libs/sdl1-ttf/recipe.toml index 7c335b02..4d0280e6 100644 --- a/recipes/libs/sdl1-ttf/recipe.toml +++ b/recipes/libs/sdl1-ttf/recipe.toml @@ -16,8 +16,7 @@ dependencies = [ "zlib", ] script = """ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/freetype2" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/freetype2" COOKBOOK_CONFIGURE_FLAGS=( --prefix=/ diff --git a/recipes/libs/sdl2/recipe.toml b/recipes/libs/sdl2/recipe.toml index 9cc943ac..bef94c0a 100644 --- a/recipes/libs/sdl2/recipe.toml +++ b/recipes/libs/sdl2/recipe.toml @@ -12,7 +12,7 @@ dependencies = [ ] script = """ DYNAMIC_INIT -export LDFLAGS="$LDFLAGS -lorbital -lOSMesa -lstdc++" +export LDFLAGS="${LDFLAGS} -lorbital -lOSMesa -lstdc++" COOKBOOK_CONFIGURE_FLAGS+=( --disable-pulseaudio --disable-video-x11 diff --git a/recipes/tools/schismtracker/recipe.toml b/recipes/tools/schismtracker/recipe.toml index aea391ea..7d08b5ad 100644 --- a/recipes/tools/schismtracker/recipe.toml +++ b/recipes/tools/schismtracker/recipe.toml @@ -14,8 +14,7 @@ dependencies = [ "libiconv", ] script = """ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib -static" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/SDL" export SDL_CONFIG="${COOKBOOK_SYSROOT}/bin/sdl-config" COOKBOOK_CONFIGURE_FLAGS=( diff --git a/recipes/tui/mdp/recipe.toml b/recipes/tui/mdp/recipe.toml index a78e477f..ca3be43a 100644 --- a/recipes/tui/mdp/recipe.toml +++ b/recipes/tui/mdp/recipe.toml @@ -10,8 +10,7 @@ dependencies = [ script = """ rsync -av --delete --exclude='.git' "${COOKBOOK_SOURCE}/" ./ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/ncursesw" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/ncursesw" "${COOKBOOK_MAKE}" -j"$(${NPROC})" diff --git a/recipes/video/sdl-player/recipe.toml b/recipes/video/sdl-player/recipe.toml index 5f8ee857..b870523b 100644 --- a/recipes/video/sdl-player/recipe.toml +++ b/recipes/video/sdl-player/recipe.toml @@ -11,8 +11,6 @@ dependencies = [ ] script = """ rsync -av --delete --exclude='.git' "${COOKBOOK_SOURCE}/" ./ -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib -static" "${COOKBOOK_MAKE}" -j"$(${NPROC})" mkdir -pv "${COOKBOOK_STAGE}/bin" diff --git a/recipes/web/netsurf/recipe.toml b/recipes/web/netsurf/recipe.toml index 5501fa54..fabdc032 100644 --- a/recipes/web/netsurf/recipe.toml +++ b/recipes/web/netsurf/recipe.toml @@ -27,8 +27,8 @@ DYNAMIC_INIT rsync -av --delete "${COOKBOOK_SOURCE}/" ./ export TARGET="framebuffer" -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${PWD}/inst-${TARGET}/include" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib -L${PWD}/inst-${TARGET}/lib -Wl,--allow-multiple-definition -Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib" +export CFLAGS="${CFLAGS} -I${PWD}/inst-${TARGET}/include" +export LDFLAGS="${LDFLAGS} -L${COOKBOOK_SYSROOT}/lib -L${PWD}/inst-${TARGET}/lib -Wl,--allow-multiple-definition -Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib" # nghttp2 is not linked for some reason export LDFLAGS="${LDFLAGS} -lcurl -lnghttp2" diff --git a/recipes/wip/libs/other/boost/recipe.toml b/recipes/wip/libs/other/boost/recipe.toml index 8664e721..d4903267 100644 --- a/recipes/wip/libs/other/boost/recipe.toml +++ b/recipes/wip/libs/other/boost/recipe.toml @@ -16,10 +16,6 @@ dependencies = [ # "zstd", ] script = """ -export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include" -export CPPFLAGS="${CPPFLAGS} ${CFLAGS}" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib --static" - BOOST_ROOT="${COOKBOOK_STAGE}/usr" mkdir -p "${BOOST_ROOT}" diff --git a/recipes/wip/libs/other/freeglut/recipe.toml b/recipes/wip/libs/other/freeglut/recipe.toml index f2b576ad..dbb525b9 100644 --- a/recipes/wip/libs/other/freeglut/recipe.toml +++ b/recipes/wip/libs/other/freeglut/recipe.toml @@ -9,11 +9,6 @@ dependencies = [ ] template = "custom" script = """ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include" -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include" -export CXXFLAGS="-I${COOKBOOK_SYSROOT}/include" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" - cat > redox.cmake <