From 47e79813d95d7b91324f7a89b27c393872320eb0 Mon Sep 17 00:00:00 2001 From: Yatis Date: Sat, 24 Oct 2020 21:48:45 +0200 Subject: [PATCH] Update configure script * add early "-h" and "--help" handling * replace "--support-" flags by "--support=,,..." * rename libraries name: * "libfxlibc-casio-abi-fx9860g" -> "libfxlibc-fx9860g" * "libfxlibc-casio-abi-fxcg5" -> "libfxlibc-fxcg50" Update the README.md --- README.md | 26 ++++++++++------- configure | 65 +++++++++++++++++++++++++++---------------- make/Makefile.default | 2 +- 3 files changed, 58 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 453ea4c..cf1a97c 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ system. ## Dependencies Fx C library depends on a suitable GCC toolchain in the PATH. You can absolutely -not build gint with your system compiler! +not build `fxlibc` with your system compiler! * The tutorial on Planète Casio builds an sh-elf that works everywhere. * For fx-9860G II, `sh3eb-elf` is strongly advised. @@ -35,14 +35,14 @@ the wiki) #### Configuration and support The Fx C library supports these ABI: -* `casio-abi-fx9860g` for the support of Casio ABI used by fx9860g-like devices. -* `casio-abi-fxcg50` for the support of Casio ABI used by the fxcg50 device. -* `vhex-kernel` for the support of Vhex kernel ABI. +* `fx9860g` for the support of Casio ABI used by fx9860g-like devices. +* `fxcg50` for the support of Casio ABI used by the fxcg50 device. +* `vhex` for the support of Vhex kernel ABI. * (nothing) compile only standing functions. The Fx C library support these format: * `static` generate static libraries. -* `shared` generate shared libraries (Only for the Vhex kernel). +* `dynamic` generate dynamic libraries (Only for the Vhex kernel). Note that the shared feature is not currently implemented because of non-support of the shared library generation by the GCC compiler for SuperH @@ -50,13 +50,13 @@ architecture. A workaround can be used but it requires a static library to do the dynamic symbols resolving (Thanks Kristaba). For more information about library build configuration, you can use the -`../configure --help` command. +`./configure --help` command. #### Building Create a build directory and configure in it: ``` % mkdir build && cd build -% ../configure +% ../configure --static --support=vhex,fx9860g,fxcg50 ``` Then build the source and install the library files to the selected directory. @@ -95,10 +95,10 @@ To use Fx C library as your runtime environment, the bare minimum is: * You must add `fxlibc/` instead of each include file (for example, if you want to include `stdio.h` you mush use `#include `. * Link with: - * `-lfxlibc` for standalone feature - * `-lfxlibc-casio-abi-fx9860g` for Casio ABI support for monochrome devices - * `-lfxlibc-casio-abi-fxcg50` for Casio ABI support for primz devices + * `-lfxlibc-fx9860g` for Casio ABI support for monochrome devices + * `-lfxlibc-fxcg50` for Casio ABI support for primz devices * `-lfxlibc-vhex` for Vhex kernel support. + * `-lfxlibc` for standalone features --- @@ -106,3 +106,9 @@ To use Fx C library as your runtime environment, the bare minimum is: This work is licensed under a CC0 1.0 Universal License. To view a copy of this license, visit: https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt Or see the LICENSE file. + +--- + +### Special thanks to +* Lephenixnoir - For all <3 +* Kristaba - For the idea with the shared libraries workaround ! diff --git a/configure b/configure index f27e49a..bfa4898 100755 --- a/configure +++ b/configure @@ -1,9 +1,5 @@ #! /bin/bash -# -# -= TODO =- -# * check if the wanted lib exist (check lib verion too)! -# * option to list all installed libraries with their versions -# * each ABI options define one specific libs (fxlibc-common, fxlibc-vhex, fxlibc-fx9860g, fxlibc-fxcg50) +# Fx C standard library configuration script # output file confile='fxlibc.cfg' @@ -18,7 +14,6 @@ makefile='Makefile.default' # configuration debug=false -valgrind=false # ABI support support_vhex_kernel=false @@ -52,20 +47,24 @@ Build options: --prefix=PREFIX Install prefix (PREFIX/lib and PREFIX/include are used) ABI support: - --support-vhex - Enable the Vhex kernel support - --support-casio-fx9860, - --support-casio-fxcg50 - Enable the support of the Casio' ABI (used by malloc, free, ...) + --support=,, ... + Support all ABI if supported by the library. - fx9860 covers all fx-9860G II-like monochromes models that support add-ins - or can be flashed with an OS that does. This includes SH3 and SH4 machines. + target-list: + * vhex + Enable the Vhex kernel support + * fx9860g, fxcg50 + Enable the support of the Casio' ABI - fxcg50 covers just the fx-CG 50; there is some unofficial compatibility with - fx-CG 10/20. All of these are SH4-only. + fx9860 covers all fx-9860G II-like monochromes models that support + addins or can be flashed with an OS that does. This includes SH3 and + SH4 machines. -The 'ABI support' is used to allow some part of the code, in particular the 'unistd' -part, I/O management and additionals feature. (like process, fs, ...). + fxcg50 covers just the fx-CG 50; there is some unofficial compatibility + with fx-CG 10/20. All of these are SH4-only. + +The 'ABI support' is used to allow some part of the code, in particular the +'unistd' part, I/O management and additionals feature. (like process, fs, ...). Format: --static Generate static libraries (default) @@ -89,6 +88,13 @@ EOF exit 0 } +#--- +# Check early help options +#--- +if [[ $# -lt 1 ]] || [[ "$1" = "-h" ]] || [[ "$1" = "--help" ]]; then + help +fi + #--- # Check mandatory build location @@ -125,12 +131,23 @@ for arg; do case "$arg" in cflags=${arg#*=};; # ABI support - --support-vhex) - support_vhex_kernel=true;; - --support-casio-abi-fx9860) - support_casio_abi_fx9860=true;; - --support-casio-abi-fxcg50) - support_casio_abi_fxcg50=true;; + --support=*) + IFS=',' read -ra target_abi <<< "${arg#*=}" + for abi in "${target_abi[@]}"; do case "$abi" in + all) + support_vhex_kernel=true + support_casio_abi_fx9860=true + support_casio_abi_fxcg50=true;; + vhex) + support_vhex_kernel=true;; + fx9860g) + support_casio_abi_fx9860=true;; + fxcg50) + support_casio_abi_fxcg50=true;; + *) + echo "error: unreconized target '$abi', giving up." >&2 + exit 1 + esac; done;; # format options --static) @@ -168,11 +185,11 @@ then prefix=$inst fi - # TODO # TODO: check if the wanted lib exist (check lib verion too)! # TODO + #--- # Dump appropriate Makefile # @note: diff --git a/make/Makefile.default b/make/Makefile.default index eb993b4..eaee5f7 100644 --- a/make/Makefile.default +++ b/make/Makefile.default @@ -35,7 +35,7 @@ #--- MAJOR := 0 MINOR := 3 -PATCH := 0 +PATCH := 1 EXTRAVERSION :=