Fork of the OpenLibm math library with fx-9860G and fx-CG 50 support.
Find a file
Lephenixnoir 65aaba96e1
install: trim the set of installed headers (and libm.a)
This is because all of these headers are included in direct style with
no subfolder so we need them to be in a quite public `include/` folder.
The Makefile installs in `include/openlibm/` but this only works with
extra `-I` flags that are quite annoying to enforce.

With this change, the only OpenLibm headers that are installed are named
`openlibm_*.h`, which is sufficient in terms of namespacing.

Also add a symlink libm.a -> libopenlibm.a.
2022-08-19 16:02:05 +02:00
.github Update FUNDING.yml 2020-02-06 05:11:46 -05:00
aarch64 Make fenv methods static on additional platforms. 2021-02-01 13:48:31 +01:00
amd64 Revert "Export fenv functions on all platforms (#213)" 2020-11-16 09:17:49 +01:00
arm Remove unused Symbol.map files. 2015-02-01 19:41:55 +05:30
bsdsrc add missing weak references for long double functions 2021-05-20 23:30:25 +02:00
docs Update list of libm libraries 2020-08-29 11:25:56 -04:00
i387 Fix invalid assembly directive caught by clang 2016-08-21 18:45:29 -04:00
include fenv: avoid internal includes in user-facing headers 2022-08-19 16:02:05 +02:00
ld80 Fix undefined reference to __fpgetprec on i386 2016-06-23 23:32:31 -04:00
ld128 Fix compilation on AArch64 2017-10-21 09:58:16 -04:00
mips Using cdefs-compat.h and stdint.h instead <sys/types.h> 2018-06-04 09:38:27 +00:00
powerpc Make fenv methods static on additional platforms. 2021-02-01 13:48:31 +01:00
s390 s390(x) port 2018-11-07 12:11:15 +01:00
sh3eb fenv: provide environment primitives 2021-05-21 14:21:51 +02:00
src add missing weak references for long double functions 2021-05-20 23:30:25 +02:00
test Fix #211 2021-02-06 18:10:09 -05:00
wasm32 wasm32 support (#192) 2019-04-14 15:11:03 -07:00
.gitignore add support for quick build with GiteaPC 2021-01-25 17:57:54 +01:00
.mailmap Add mailmap 2012-08-24 20:53:18 +05:30
.travis.yml travis: Add mips, mipsel, mips64el build. 2018-06-04 10:02:35 +00:00
appveyor.yml Update appveyor.yml 2018-06-18 16:10:52 -04:00
giteapc.make install: trim the set of installed headers (and libm.a) 2022-08-19 16:02:05 +02:00
LICENSE.md Update references to JuliaLang to point to JuliaMath (#182) 2018-06-18 14:48:23 -07:00
Make.inc make: do not compile the static archive with -fPIC 2021-05-21 14:22:02 +02:00
Makefile install: trim the set of installed headers (and libm.a) 2022-08-19 16:02:05 +02:00
openlibm.pc.in Update references to JuliaLang to point to JuliaMath (#182) 2018-06-18 14:48:23 -07:00
README-OpenLibm.md sh3eb: move older README 2020-10-24 14:02:38 +02:00
README.md README: update make command due to toolchain changes 2021-05-20 23:30:25 +02:00

Soft-FP sh3eb port of OpenLibm

This is a fork of OpenLibm with support for the sh3eb architecture, intended for add-in programming on fx-9860G and fx-CG 50.

Installing with GiteaPC

This library can be installed automatically with GiteaPC.

% giteapc install Lephenixnoir/OpenLibm

Building manually

You will need a GCC toolchain built with --target=sh3eb-elf, such as the sh-elf-gcc commonly used on Planète Casio.

First locate the compiler's install directory. This is normally the lib/gcc/sh3eb-elf/<version>/ folder inside the install path of the compiler.

% PREFIX=$(sh-elf-gcc --print-search-dirs | grep install | sed 's/install: //')

You can then build and install the static libopenlibm.a archive and the headers.

% make USEGCC=1 TOOLPREFIX=sh-elf- AR=sh-elf-ar CC=sh-elf-gcc libdir="$PREFIX" includedir="$PREFIX/include" install-static install-headers

Using in a Makefile-based add-in

Link with -lopenlibm as you would do with -lm. Since OpenLibm headers reference themselves by file name (#include <openlibm_complex.h>) even though they are installed in a subfolder, you need a -I flag:

CFLAGS += -I $(shell sh-elf-gcc -print-file-name=include/openlibm)
LDFLAGS += -lopenlibm

Using in a CMake-based add-in

When using CMake with the fxSDK, add the include folder and library like this.

target_include_directories(<TARGET> PRIVATE "${FXSDK_COMPILER_INSTALL}/include/openlibm")
target_link_libraries(<TARGET> -lopenlibm)

README and Licensing

See the original README file in README-OpenLibm.md. OpenLibm contains code covered by various licenses, see LICENSE.md.