diff --git a/doc/TINYCONFIG.md b/doc/TINYCONFIG.md index 7ab60b5..024edf6 100644 --- a/doc/TINYCONFIG.md +++ b/doc/TINYCONFIG.md @@ -5,4 +5,5 @@ Milsko's configure script supports the `--tiny` option for building the tiniest - Add `-Oz` to the cflags - (clang only) add `-flto=thin` to the cflags and linker flags - Build stb-image with `STB_IMAGE_STATIC` (this is why you get warnings with stb_image when you use it) -- Disable the Wayland backend +- (Linux) Disable the Wayland backend +- (Linux) Disable dbus integration diff --git a/pl/ostype/Linux.pl b/pl/ostype/Linux.pl index 278cbfe..75159d5 100644 --- a/pl/ostype/Linux.pl +++ b/pl/ostype/Linux.pl @@ -1,6 +1,6 @@ my @enabled_backends = (); -if (param_get("wayland")) { +if (param_get("wayland") && not(param_get("tiny"))) { push(@enabled_backends, "wayland"); } if (param_get("x11")) { diff --git a/pl/rules.pl b/pl/rules.pl index e669ae8..348a576 100644 --- a/pl/rules.pl +++ b/pl/rules.pl @@ -4,9 +4,15 @@ my $gl_libs = ""; if (param_get("tiny")) { add_cflags("-Oz"); if (defined($ENV{CC}) && grep(/^clang$/, $ENV{CC})) { - add_libs("-flto=thin"); - add_cflags("-flto=thin"); + add_libs("-flto=full"); + add_cflags("-flto=full"); } + add_cflags("-fdata-sections -ffunction-sections"); + add_libs("-Wl,--gc-sections"); + + # these don't actually disable either, they're here for the final output. + param_set("wayland", 0); + param_set("dbus", 0); } if (param_get("classic-theme")) { add_cflags("-DUSE_CLASSIC_THEME"); @@ -60,7 +66,7 @@ if (grep(/^wayland$/, @backends)) { $gl_libs = "-lGL -lGLU"; } -if (not(param_get("dbus"))) { +if (not(param_get("dbus")) && not(param_get("tiny"))) { $cflags =~ s/( |^)-DUSE_DBUS( |$)/ /; }