resizing works partly
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit

This commit is contained in:
Nishi 2026-09-26 17:41:38 +09:00
commit e2da02f2c9
7 changed files with 171 additions and 71 deletions

120
configure vendored
View file

@ -4,7 +4,7 @@ $target =~ s/\r?\n$//;
# MSYS with MinGW gives us some other shit idk
if (index($target, "MINGW") != -1) {
$target = "Windows";
$target = "Windows";
}
foreach my $l (@ARGV) {
@ -16,11 +16,11 @@ foreach my $l (@ARGV) {
}
our $prefix = "/usr/local";
our $cc = defined($ENV{CC}) ? $ENV{CC} : "*host*gcc";
our $cxx = defined($ENV{CXX}) ? $ENV{CXX} : "*host*g++";
our $ar = defined($ENV{AR}) ? $ENV{AR} : "*host*ar";
our $cc = defined($ENV{CC}) ? $ENV{CC} : "*host*gcc";
our $cxx = defined($ENV{CXX}) ? $ENV{CXX} : "*host*g++";
our $ar = defined($ENV{AR}) ? $ENV{AR} : "*host*ar";
our $incdir = "-I include";
our $incdir2 = "";
our $incdir2 = "";
our $cflags = "-fPIC -D_MILSKO -D_MILSKO_BUILD -fvisibility=hidden";
our $libdir = "";
our $ldflags = "";
@ -68,46 +68,54 @@ my %features = (
"static" => "build static library",
"wayland" => "enable wayland backend",
"gnustep" => "use gnustep",
"dbus" => "use DBus on supported platform",
"allow-sloppy-focus" => "prevent the x11 backend from using XSetInputFocus to enforce click-to-focus",
"dbus" => "use DBus on supported platform",
"allow-sloppy-focus" =>
"prevent the x11 backend from using XSetInputFocus to enforce click-to-focus",
"direct3d9" => "(Windows only) build Direct3D9 widget"
);
my @features_keys = (
"1classic-theme", "1stb-image",
"1stb-truetype", "1freetype2", "1gdi-text",
"1opengl", "2xrender",
"1vulkan", "2vulkan-string-helper",
"1shared", "1static",
"1wayland", "1gnustep",
"1dbus", "1direct3d9"
"1classic-theme", "1stb-image",
"1stb-truetype", "1freetype2",
"1gdi-text", "1opengl",
"2xrender", "1vulkan",
"2vulkan-string-helper", "1shared",
"1static", "1wayland",
"1gnustep", "1dbus",
"1direct3d9"
);
sub def_platform {
if($target eq "Windows") {
param_set("freetype2", 0);
param_set("stb-truetype", 0);
param_set("direct3d9", 1);
} elsif($target ne "Darwin" and $target ne "ClassicMacOS" and $target ne "Haiku") {
param_set("freetype2", 1);
param_set("stb-truetype", 0);
} else {
param_set("freetype2", 0);
param_set("stb-truetype", 1);
}
if($target eq "Linux" || $target eq "FreeBSD") {
param_set("x11", 1);
if ($target eq "Windows") {
param_set("freetype2", 0);
param_set("stb-truetype", 0);
param_set("direct3d9", 1);
}
elsif ( $target ne "Darwin"
and $target ne "ClassicMacOS"
and $target ne "Haiku")
{
param_set("freetype2", 1);
param_set("stb-truetype", 0);
}
else {
param_set("freetype2", 0);
param_set("stb-truetype", 1);
}
if ($target eq "Linux" || $target eq "FreeBSD") {
param_set("x11", 1);
param_set("xrender", 1);
if(!param_get("tiny")){
if (!param_get("tiny")) {
param_set("wayland", 1);
}
param_set("dbus", 1);
}
if($target eq "NetBSD" || $target eq "OpenBSD") {
if ($target eq "NetBSD" || $target eq "OpenBSD") {
param_set("x11", 1);
}
if($target eq "Windows") {
if ($target eq "Windows") {
param_set("gdi-text", 1);
} else {
}
else {
param_set("gdi-text", 0);
}
}
@ -120,7 +128,6 @@ foreach my $l (@ARGV) {
def_platform();
foreach my $l (@ARGV) {
if ($l =~ /^--with-([^=]+)=(.+)$/) {
param_set($1, $2);
@ -141,7 +148,7 @@ foreach my $l (@ARGV) {
$cross = 1;
}
elsif ($l eq "--tiny") {
param_set("tiny",1);
param_set("tiny", 1);
}
elsif (($l eq "-h") or ($l eq "--help")) {
print("Milsko Toolkit Configuration Utility\n");
@ -154,7 +161,9 @@ foreach my $l (@ARGV) {
print(" --host=TARGET Host for compiler/archiver\n");
print(" --target=TARGET Specify target\n");
print(" --cflags=CFLAGS Add cflags\n");
print(" --tiny Build smallest possible library\n");
print(
" --tiny Build smallest possible library\n"
);
print(" --cross Indicate cross compilation\n");
print("\n");
print("Features:\n");
@ -211,9 +220,9 @@ foreach my $e (param_list()) {
}
print("Enabled: " . join(" ", @l) . "\n");
$cc =~ s/\*host\*/$host/;
$cc =~ s/\*host\*/$host/;
$cxx =~ s/\*host\*/$host/;
$ar =~ s/\*host\*/$host/;
$ar =~ s/\*host\*/$host/;
open(OUT, ">", "Makefile");
print(OUT "PREFIX = ${prefix}\n");
@ -261,9 +270,9 @@ print(OUT "\n");
print(OUT "\n");
if (param_get("shared")) {
my $linker = "CC";
if (grep(/^haiku$/, @backends)) {
$linker = "CXX";
}
if (grep(/^haiku$/, @backends)) {
$linker = "CXX";
}
print( OUT "src/${library_prefix}Mw${library_suffix}: "
. join(" ", @library_targets)
. "\n");
@ -279,18 +288,18 @@ if (param_get("static")) {
}
foreach my $l (@library_targets) {
my $warn = "-Wall -Wextra -Wno-sign-compare -Wno-unused-value";
my $s = $l;
my $warn = "-Wall -Wextra -Wno-sign-compare -Wno-unused-value";
my $s = $l;
my $compiler = "CC";
my $o = $object_suffix;
my $o = $object_suffix;
$o =~ s/\./\\\./g;
if ($l =~ /cocoa/) {
$s =~ s/$o$/.m/;
}
elsif ($l =~ /haiku/) {
$s =~ s/$o$/.cc/;
$compiler = "CXX";
$s =~ s/$o$/.cc/;
$compiler = "CXX";
}
else {
$s =~ s/$o$/.c/;
@ -321,13 +330,12 @@ if (param_get("examples")) {
if (param_get("shared")) {
print(OUT
"${l}: ${s}${object_suffix} src/${library_prefix}Mw${library_suffix}\n"
);
} else {
print(OUT
"${l}: ${s}${object_suffix} src/${library_prefix}Mw.a\n"
"${l}: ${s}${object_suffix} src/${library_prefix}Mw${library_suffix}\n"
);
}
else {
print(OUT "${l}: ${s}${object_suffix} src/${library_prefix}Mw.a\n");
}
if (grep(/^cocoa$/, @backends)) {
print(OUT
" \$(CC) -L./src \$\(LIBDIR) -o ${l} ${s}${object_suffix} -lMw ${math} ${libs}\n"
@ -339,11 +347,15 @@ if (param_get("examples")) {
);
}
if($target eq "ClassicMacOS") {
print(OUT
" ".$ENV{RETRO68_TOOLCHAIN_PATH}."/bin/MakePEF ${l} -o ${s}.pef\n");
print(OUT
" Rez -I ".$ENV{RETRO68_TOOLCHAIN_PATH}."/RIncludes ".$ENV{RETRO68_TOOLCHAIN_PATH}."/RIncludes/Retro68APPL.r -DCFRAG_NAME=\"example\" --data ${l}.pef --cc ${l}.dsk -t APPL\n"
if ($target eq "ClassicMacOS") {
print( OUT " "
. $ENV{RETRO68_TOOLCHAIN_PATH}
. "/bin/MakePEF ${l} -o ${s}.pef\n");
print( OUT " Rez -I "
. $ENV{RETRO68_TOOLCHAIN_PATH}
. "/RIncludes "
. $ENV{RETRO68_TOOLCHAIN_PATH}
. "/RIncludes/Retro68APPL.r -DCFRAG_NAME=\"example\" --data ${l}.pef --cc ${l}.dsk -t APPL\n"
);
}