;;;; numbers.setup -*- Scheme -*- ;; The -std=c99 option is needed to avoid surprising FP behaviour in ;; bignum->flonum on x86, due to extended FP register usage. Go ;; figure. (GCC's -fexcess-precision=standard, which also works, is ;; not portable to other compilers, and older GCCs don't support it) ;; (compile -C -std=c99 -C -D_POSIX_SOURCE -s -O3 numbers.scm -j numbers) ;; Okay, that sounded better than it turned out to be in practice: ;; There seems to be no combination of feature test macros that ;; enable strlcat in the BSDs while enabling setjmp in Linux. (define maybe-precision-fix (if (try-compile "" cflags: "-c -fexcess-precision=standard") '(-C -fexcess-precision=standard) '())) (compile ,@maybe-precision-fix -s -O3 numbers.scm -j numbers) (compile -s -O3 numbers.import.scm) (install-extension 'numbers `("numbers.so" "numbers.import.so" "numbers-syntax.scm" ;; The types database uses syntax unsupported by 4.7.0 ,@(if #f '("numbers.types") '())) `((version "4.3")))