svn commit: trunk/busybox: editors miscutils shell/ash_test/ash-sta etc...

vda at busybox.net vda at busybox.net
Mon Oct 20 08:43:10 UTC 2008


Author: vda
Date: 2008-10-20 01:43:10 -0700 (Mon, 20 Oct 2008)
New Revision: 23733

Log:
dc: conditionalize parts which require libm



Modified:
   trunk/busybox/editors/Config.in
   trunk/busybox/miscutils/Config.in
   trunk/busybox/miscutils/dc.c
   trunk/busybox/shell/ash_test/ash-standalone/noexec_gets_no_env.right
   trunk/busybox/shell/ash_test/ash-standalone/noexec_gets_no_env.tests


Changeset:
Modified: trunk/busybox/editors/Config.in
===================================================================
--- trunk/busybox/editors/Config.in	2008-10-20 08:15:51 UTC (rev 23732)
+++ trunk/busybox/editors/Config.in	2008-10-20 08:43:10 UTC (rev 23733)
@@ -14,7 +14,7 @@
 
 config FEATURE_AWK_MATH
 	bool "Enable math functions (requires libm)"
-	default y
+	default n
 	depends on AWK
 	help
 	  Enable math functions of the Awk programming language.

Modified: trunk/busybox/miscutils/Config.in
===================================================================
--- trunk/busybox/miscutils/Config.in	2008-10-20 08:15:51 UTC (rev 23732)
+++ trunk/busybox/miscutils/Config.in	2008-10-20 08:43:10 UTC (rev 23733)
@@ -138,6 +138,14 @@
 	  Dc is a reverse-polish desk calculator which supports unlimited
 	  precision arithmetic.
 
+config FEATURE_DC_LIBM
+	bool "Enable power and exp functions (requires libm)"
+	default n
+	depends on DC
+	help
+	  Enable power and exp functions.
+	  NOTE: This will require libm to be present for linking.
+
 config DEVFSD
 	bool "devfsd (obsolete)"
 	default n

Modified: trunk/busybox/miscutils/dc.c
===================================================================
--- trunk/busybox/miscutils/dc.c	2008-10-20 08:15:51 UTC (rev 23732)
+++ trunk/busybox/miscutils/dc.c	2008-10-20 08:43:10 UTC (rev 23733)
@@ -53,12 +53,14 @@
 	push(pop() * pop());
 }
 
+#if ENABLE_FEATURE_DC_LIBM
 static void power(void)
 {
 	double topower = pop();
 
 	push(pow(pop(), topower));
 }
+#endif
 
 static void divide(void)
 {
@@ -137,9 +139,11 @@
 	{"mul", mul},
 	{"/",   divide},
 	{"div", divide},
+#if ENABLE_FEATURE_DC_LIBM
 	{"**",  power},
 	{"exp", power},
 	{"pow", power},
+#endif
 	{"%",   mod},
 	{"mod", mod},
 	{"and", and},

Modified: trunk/busybox/shell/ash_test/ash-standalone/noexec_gets_no_env.right
===================================================================
--- trunk/busybox/shell/ash_test/ash-standalone/noexec_gets_no_env.right	2008-10-20 08:15:51 UTC (rev 23732)
+++ trunk/busybox/shell/ash_test/ash-standalone/noexec_gets_no_env.right	2008-10-20 08:43:10 UTC (rev 23733)
@@ -1,2 +1,4 @@
 VAR7=VAL
 0
+VAR8=VAL
+0

Modified: trunk/busybox/shell/ash_test/ash-standalone/noexec_gets_no_env.tests
===================================================================
--- trunk/busybox/shell/ash_test/ash-standalone/noexec_gets_no_env.tests	2008-10-20 08:15:51 UTC (rev 23732)
+++ trunk/busybox/shell/ash_test/ash-standalone/noexec_gets_no_env.tests	2008-10-20 08:43:10 UTC (rev 23733)
@@ -1,3 +1,5 @@
 export VAR7=VAL
 env | grep ^VAR7=
 echo $?
+VAR8=VAL env | grep ^VAR8=
+echo $?




More information about the busybox-cvs mailing list