diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-01-06 20:46:45 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-01-06 20:46:45 +0000 |
commit | 8ec4834055be4c002b810bbbaea773586f3eeeeb (patch) | |
tree | ba7521ddf88771a17123b71d0197c66c14ac6e09 /misc | |
parent | 1b7bc5aeea327d47e6f4403121b243e34674c7c5 (diff) | |
download | nuttx-8ec4834055be4c002b810bbbaea773586f3eeeeb.tar.gz nuttx-8ec4834055be4c002b810bbbaea773586f3eeeeb.tar.bz2 nuttx-8ec4834055be4c002b810bbbaea773586f3eeeeb.zip |
Add configuration for toolchains without libm
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@517 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/pascal/config.info | 4 | ||||
-rw-r--r-- | misc/pascal/insn16/prun/pexec.c | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/misc/pascal/config.info b/misc/pascal/config.info index 8832061eb..b7ae3a05c 100755 --- a/misc/pascal/config.info +++ b/misc/pascal/config.info @@ -58,3 +58,7 @@ CONFIGS="$CONFIGS CONFIG_INSN32:n" # Register model selection CONFIG_REGM_INFO="Processor module supports a register machine" CONFIGS="$CONFIGS CONFIG_REGM:n" + +# Availability of libma.a +CONFIG_HAVE_LIBM_INFO="Host toolchain supports libm.a" +CONFIGS="$CONFIGS CONFIG_HAVE_LIBM:y" diff --git a/misc/pascal/insn16/prun/pexec.c b/misc/pascal/insn16/prun/pexec.c index 8249d55c6..b9d688e5a 100644 --- a/misc/pascal/insn16/prun/pexec.c +++ b/misc/pascal/insn16/prun/pexec.c @@ -41,7 +41,6 @@ #include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#include <math.h>
#include "keywords.h"
#include "pdefs.h"
@@ -53,6 +52,10 @@ #include "paslib.h"
#include "pexec.h"
+#ifdef CONFIG_HAVE_LIBM
+#include <math.h>
+#endif
+
/****************************************************************************
* Definitions
****************************************************************************/
@@ -1037,6 +1040,7 @@ static uint16 pexec_execfp(struct pexec_s *st, ubyte fpop) PUSH(st, result.hw[2]);
PUSH(st, result.hw[3]);
break;
+#ifdef CONFIG_HAVE_LIBM
case fpABS :
pexec_getfparguments(st, fpop, &arg1, NULL);
result.f = fabs(arg1.f);
@@ -1045,6 +1049,7 @@ static uint16 pexec_execfp(struct pexec_s *st, ubyte fpop) PUSH(st, result.hw[2]);
PUSH(st, result.hw[3]);
break;
+#endif
case fpSQR :
pexec_getfparguments(st, fpop, &arg1, NULL);
result.f = arg1.f * arg1.f;
@@ -1053,6 +1058,7 @@ static uint16 pexec_execfp(struct pexec_s *st, ubyte fpop) PUSH(st, result.hw[2]);
PUSH(st, result.hw[3]);
break;
+#ifdef CONFIG_HAVE_LIBM
case fpSQRT :
pexec_getfparguments(st, fpop, &arg1, NULL);
result.f = sqrt(arg1.f);
@@ -1101,6 +1107,7 @@ static uint16 pexec_execfp(struct pexec_s *st, ubyte fpop) PUSH(st, result.hw[2]);
PUSH(st, result.hw[3]);
break;
+#endif
default :
return eBADFPOPCODE;
|