Files
milsko/configure
NishiOwO 0cb5e1160f m4
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@634 b9cfdab3-6d41-4d17-bbe4-086880011989
2025-11-07 21:47:50 +00:00

119 lines
2.7 KiB
Bash
Executable File

#!/bin/sh
# $Id$
M4=m4
FLAGS=""
target=""
feat_classic_theme=false
feat_cross=false
feat_stb_image=true
feat_stb_truetype=false
feat_freetype2=true
feat_opengl=false
feat_vulkan=false
feat_vulkan_string_helper=true
for i in $@; do
case "$i" in
--help|-h)
echo "Configuration utility for Milsko Toolkit"
echo ""
echo "Usage: $0 [options]"
echo ""
echo "Options:"
echo " -h --help Display this help and exit"
echo " --cross Indicate cross-compilation"
echo ""
echo "Features:"
echo " --enable-stb-image Build and use stb_image instead of libjpeg/libpng"
echo " --enable-stb-truetype Build stb_truetype"
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"
echo " --without-FEATURE Do not use FEATURE"
exit 0
;;
--cross)
feat_cross=true
;;
--target=*)
target="`echo $i | cut -d= -f2`"
;;
--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
fi
;;
*=*)
eval $i
;;
esac
done
if $feat_cross; then
FLAGS="$FLAGS -Dcross_build"
fi
if [ ! "x$target" = "x" ]; then
FLAGS="$FLAGS -Dtarget=$target"
fi
if [ ! "x$CC" = "x" ]; then
FLAGS="$FLAGS -Dcc=$CC"
fi
if $feat_vulkan_string_helper; then
FLAGS="$FLAGS -Duse_vulkan_string_helper"
fi
if $feat_stb_image; then
FLAGS="$FLAGS -Duse_stb_image"
fi
if $feat_stb_truetype; then
FLAGS="$FLAGS -Duse_stb_truetype"
fi
if $feat_freetype2; then
FLAGS="$FLAGS -Duse_freetype2"
fi
if $feat_opengl; then
FLAGS="$FLAGS -Dbuild_opengl"
fi
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
echo "(M4 exited with non-zero status)"
rm -f Makefile
exit 1
fi
echo "Features:"
echo " stb_image : $feat_stb_image"
echo " stb_truetype : $feat_stb_truetype"
echo " FreeType2 : $feat_freetype2"
echo " OpenGL : $feat_opengl"
echo " Vulkan : $feat_vulkan"
if $feat_vulkan; then
echo " Vulkan String Helper: $feat_vulkan_string_helper"
fi
echo " Classic theme : $feat_classic_theme"