From 7ee95874bf6809eabcfaa2afba2d3efa415e23cd Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Fri, 7 Nov 2025 18:09:59 +0000 Subject: [PATCH] add classic theme flag git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@625 b9cfdab3-6d41-4d17-bbe4-086880011989 --- README.txt | 43 +++------------------------------------- configure | 19 +++++++++--------- m4/options/classic.m4 | 2 ++ m4/toplevel/options.m4 | 1 + tools/readme.pl | 45 +++--------------------------------------- 5 files changed, 19 insertions(+), 91 deletions(-) create mode 100644 m4/options/classic.m4 diff --git a/README.txt b/README.txt index 1a3868e..f69b636 100644 --- a/README.txt +++ b/README.txt @@ -61,46 +61,9 @@ D. MinGW-w64/GCC/Clang 1) Determine if you need Vulkan and/or OpenGL. -2) Run `make'. +2) Run `./configure'. + For help, run `./configure --help'. - - Makefile settings - - This section exists for people who chose D. - - TARGET - Target environment, chosen by Makefile in - default settings. - - GCC - Prefix for GCC toolchains. This does not - matter if you set CC manually. - - CC - C compiler. - - DEBUG - Debug build or not, 0 in default settings. - - VULKAN - Build Vulkan widget or not. - - OPENGL - Build OpenGL widget or not. - - USE_STB_IMAGE - Use stb_image or not. - - USE_STB_TRUETYPE - Use stb_truetype or not. - - USE_FREETYPE2 - Use FreeType2 or not. - - PREFIX - Installation destination directory. - - - Makefile targets - - This section exists for people who chose D. - - lib - Builds Milsko library - - examples - Builds examples - - all - Builds lib and examples - - install - Installs Milsko to PREFIX +3) Run `make'. -- Nishi (nishi@nishi.boats) diff --git a/configure b/configure index 5dfc60f..e3ede76 100755 --- a/configure +++ b/configure @@ -4,6 +4,7 @@ FLAGS="" target="" +feat_classic_theme=false feat_cross=false feat_stb_image=true feat_stb_truetype=false @@ -29,6 +30,7 @@ for i in $@; do echo " --enable-freetype2 Use FreeType2" echo " --enable-opengl Build OpenGL widget" echo " --enable-vulkan Build Vulkan widget" + echo " --enable-classic-theme Use classic theme" echo " --disable-FEATURE Do not use FEATURE" echo "" echo " --without-vulkan-string-helper Do not use Vulkan string helper" @@ -41,15 +43,9 @@ for i in $@; do --target=*) target="`echo $i | cut -d= -f2`" ;; - --enable-*|--disable-*) - if [ "`echo $i | cut -d- -f3`" = "enable" ]; then - eval feat_`echo $i | cut -d- -f4- | tr - _`=true - else - eval feat_`echo $i | cut -d- -f4- | tr - _`=false - fi - ;; - --with-*|--without-*) - if [ "`echo $i | cut -d- -f3`" = "with" ]; then + --enable-*|--disable-*|--with-*|--without-*) + opt="`echo $i | cut -d- -f3`" + if [ "$opt" = "enable" -o "$opt" = "with" ]; then eval feat_`echo $i | cut -d- -f4- | tr - _`=true else eval feat_`echo $i | cut -d- -f4- | tr - _`=false @@ -97,6 +93,10 @@ if $feat_vulkan; then FLAGS="$FLAGS -Dbuild_vulkan" fi +if $feat_classic_theme; then + FLAGS="$FLAGS -Duse_classic_theme" +fi + echo "Generating Makefile... " if ! m4 $FLAGS Makefile.m4 > Makefile; then @@ -114,3 +114,4 @@ echo " Vulkan : $feat_vulkan" if $feat_vulkan; then echo " Vulkan String Helper: $feat_vulkan_string_helper" fi +echo " Classic theme : $feat_classic_theme" diff --git a/m4/options/classic.m4 b/m4/options/classic.m4 new file mode 100644 index 0000000..f5ad23e --- /dev/null +++ b/m4/options/classic.m4 @@ -0,0 +1,2 @@ +dnl $Id$ +ifdef([use_classic_theme],[add_cflag([-DMW_CLASSIC_THEME])])dnl diff --git a/m4/toplevel/options.m4 b/m4/toplevel/options.m4 index 114931d..999f304 100644 --- a/m4/toplevel/options.m4 +++ b/m4/toplevel/options.m4 @@ -2,6 +2,7 @@ dnl $Id$ include(m4/options/backend.m4)dnl include(m4/options/opengl.m4)dnl include(m4/options/vulkan.m4)dnl +include(m4/options/classic.m4)dnl dnl ifdef([use_stb_image],[add_cflag([-DUSE_STB_IMAGE])],[new_object([external/libz/src/*.c])dnl new_object([external/libjpeg/src/*.c])dnl diff --git a/tools/readme.pl b/tools/readme.pl index 3829bcb..1e3e8d2 100755 --- a/tools/readme.pl +++ b/tools/readme.pl @@ -107,49 +107,10 @@ l("1) Run `wmake -f WatMakefile'."); h("D. MinGW-w64/GCC/Clang"); l("1) Determine if you need Vulkan and/or OpenGL."); l(""); -l("2) Run `make'."); +l("2) Run `./configure'."); +l(" For help, run `./configure --help'."); l(""); - -l(""); -c("Makefile settings"); -l(""); -c("This section exists for people who chose D.", 60); -l(""); -c("TARGET - Target environment, chosen by Makefile in", 60); -c(" default settings.", 60); -l(""); -c("GCC - Prefix for GCC toolchains. This does not", 60); -c(" matter if you set CC manually.", 60); -l(""); -c("CC - C compiler.", 60); -l(""); -c("DEBUG - Debug build or not, 0 in default settings.", 60); -l(""); -c("VULKAN - Build Vulkan widget or not.", 60); -l(""); -c("OPENGL - Build OpenGL widget or not.", 60); -l(""); -c("USE_STB_IMAGE - Use stb_image or not.", 60); -l(""); -c("USE_STB_TRUETYPE - Use stb_truetype or not.", 60); -l(""); -c("USE_FREETYPE2 - Use FreeType2 or not.", 60); -l(""); -c("PREFIX - Installation destination directory.", 60); -l(""); - -l(""); -c("Makefile targets"); -l(""); -c("This section exists for people who chose D.", 60); -l(""); -c("lib - Builds Milsko library", 60); -l(""); -c("examples - Builds examples", 60); -l(""); -c("all - Builds lib and examples", 60); -l(""); -c("install - Installs Milsko to PREFIX", 60); +l("3) Run `make'."); l(""); l(" -- Nishi (nishi\@nishi.boats)");