summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/pascal/config.info4
-rw-r--r--misc/pascal/insn16/prun/pexec.c9
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;