Update configure script

* add early "-h" and "--help" handling
* replace "--support-<ABI_NAME>" flags by "--support=<target>,<target>,..."
* rename libraries name:
	* "libfxlibc-casio-abi-fx9860g" -> "libfxlibc-fx9860g"
	* "libfxlibc-casio-abi-fxcg5" -> "libfxlibc-fxcg50"

Update the README.md
This commit is contained in:
Yatis 2020-10-24 21:48:45 +02:00
parent e9984365eb
commit 47e79813d9
3 changed files with 58 additions and 35 deletions

View File

@ -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 <fxlibc/stdio.h>`.
* 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 !

65
configure vendored
View File

@ -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=<target>,<target>, ...
Support all <target> 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:

View File

@ -35,7 +35,7 @@
#---
MAJOR := 0
MINOR := 3
PATCH := 0
PATCH := 1
EXTRAVERSION :=