configure updates, new 'tiny config' option
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
IoI_xD 2026-03-31 16:54:01 -07:00
commit a00d4ba144
4 changed files with 32 additions and 12 deletions

27
configure vendored
View file

@ -15,7 +15,7 @@ our $cc = defined($ENV{CC}) ? $ENV{CC} : "*host*gcc";
our $ar = defined($ENV{AR}) ? $ENV{AR} : "*host*ar";
our $incdir = "-I include";
our $incdir2 = "";
our $cflags = "-fPIC -D_MILSKO";
our $cflags = "-fPIC -D_MILSKO -fvisibility=hidden";
our $libdir = "";
our $ldflags = "";
our $math = "-lm";
@ -46,18 +46,12 @@ param_set("vulkan-string-helper", 1);
param_set("shared", 1);
param_set("static", 1);
param_set("examples", 1);
if($target eq "Linux") {
param_set("x11", 1);
}
if($target eq "Linux") {
param_set("wayland", 1);
}
if($target ne "Darwin") {
param_set("freetype2", 1);
}
my %features = (
"classic-theme" => "use classic theme",
"stb-image" => "use stb_image, instead use libjpeg/libpng",
@ -77,7 +71,7 @@ my @features_keys = (
"1opengl", "2xrender",
"1vulkan", "2vulkan-string-helper",
"1shared", "1static",
"1wayland"
"1wayland",
);
foreach my $l (@ARGV) {
@ -96,9 +90,15 @@ foreach my $l (@ARGV) {
elsif ($l =~ /^--host=(.+)$/) {
$host = $1 . "-";
}
elsif ($l =~ /^--cflags=(.+)$/) {
add_cflags($1);
}
elsif ($l eq "--cross") {
$cross = 1;
}
elsif ($l eq "--tiny") {
param_set("tiny",1);
}
elsif (($l eq "-h") or ($l eq "--help")) {
print("Milsko Toolkit Configuration Utility\n");
print("\n");
@ -109,6 +109,8 @@ foreach my $l (@ARGV) {
print(" --prefix=PREFIX Installation prefix\n");
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(" --cross Indicate cross compilation\n");
print("\n");
print("Features:\n");
@ -134,6 +136,13 @@ foreach my $l (@ARGV) {
}
}
if($target eq "Linux") {
param_set("x11", 1);
if(!param_get("tiny")){
param_set("wayland", 1);
}
}
if (-f "./pl/ostype/${target}.pl") {
require("./pl/ostype/${target}.pl");
}

View file

@ -1,8 +1,7 @@
/*!
* @file Mw/LowLevel/Wayland.h
* @brief Work in progress Wayland Backend
* @brief Wayland Backend
* @warning This is used internally.
* @warning This is disabled by default.
*/
#ifndef __MW_LOWLEVEL_WAYLAND_H__
#define __MW_LOWLEVEL_WAYLAND_H__

View file

@ -61,6 +61,12 @@
#define MWDECL extern __declspec(dllexport)
#elif defined(_WIN32)
#define MWDECL extern __declspec(dllimport)
#elif defined(__has_attribute)
#if __has_attribute(visibility)
#define MWDECL extern __attribute__((visibility("default")))
#else
#define MWDECL extern
#endif
#else
#define MWDECL extern
#endif

View file

@ -1,7 +1,9 @@
new_object("src/*.c");
my $gl_libs = "";
if (param_get("tiny")) {
add_cflags("-Oz");
}
if (param_get("classic-theme")) {
add_cflags("-DUSE_CLASSIC_THEME");
}
@ -62,6 +64,10 @@ if (grep(/^cocoa$/, @backends)) {
if (param_get("stb-image")) {
add_cflags("-DUSE_STB_IMAGE");
if(param_get("tiny")) {
add_cflags("-DSTB_IMAGE_STATIC");
add_cflags("-DSTB_IMAGE_IMPLEMENTATION");
}
}
else {
new_object("external/libjpeg/src/*.c");