summaryrefslogtreecommitdiff
path: root/apps/interpreters/bas
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-03 09:11:25 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-03 09:11:25 -0600
commit83acc8b8a304ea02e954b033c706767e0f28a02e (patch)
tree6f6790ba4aeb1256858111d9f623a441aeb8563e /apps/interpreters/bas
parentb617ac1c3e500d248fa7afd583ddbf1660aeb567 (diff)
downloadnuttx-83acc8b8a304ea02e954b033c706767e0f28a02e.tar.gz
nuttx-83acc8b8a304ea02e954b033c706767e0f28a02e.tar.bz2
nuttx-83acc8b8a304ea02e954b033c706767e0f28a02e.zip
BAS: Remove config.h and INSTALL files. Add config options to Kconfig
Diffstat (limited to 'apps/interpreters/bas')
-rw-r--r--apps/interpreters/bas/INSTALL183
-rw-r--r--apps/interpreters/bas/Kconfig13
-rw-r--r--apps/interpreters/bas/auto.c2
-rw-r--r--apps/interpreters/bas/bas.c11
-rw-r--r--apps/interpreters/bas/config.h28
-rw-r--r--apps/interpreters/bas/fs.c9
-rw-r--r--apps/interpreters/bas/global.c1
-rw-r--r--apps/interpreters/bas/main.c4
-rw-r--r--apps/interpreters/bas/program.c2
-rw-r--r--apps/interpreters/bas/statement.c2
-rw-r--r--apps/interpreters/bas/str.c2
-rw-r--r--apps/interpreters/bas/token.c2
-rw-r--r--apps/interpreters/bas/value.c20
-rw-r--r--apps/interpreters/bas/value.h2
-rw-r--r--apps/interpreters/bas/var.c2
15 files changed, 33 insertions, 250 deletions
diff --git a/apps/interpreters/bas/INSTALL b/apps/interpreters/bas/INSTALL
deleted file mode 100644
index 50dbe439d..000000000
--- a/apps/interpreters/bas/INSTALL
+++ /dev/null
@@ -1,183 +0,0 @@
-Basic Installation
-==================
-
- These are generic installation instructions.
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, a file
-`config.cache' that saves the results of its tests to speed up
-reconfiguring, and a file `config.log' containing compiler output
-(useful mainly for debugging `configure').
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If at some point `config.cache'
-contains results you don't want to keep, you may remove or edit it.
-
- The file `configure.in' is used to create `configure' by a program
-called `autoconf'. You only need `configure.in' if you want to change
-it or regenerate `configure' using a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
-
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package.
-
- 4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
- source code directory by typing `make clean'. To also remove the
- files that `configure' created (so you can compile the package for
- a different kind of computer), type `make distclean'. There is
- also a `make maintainer-clean' target, but that is intended mainly
- for the package's developers. If you use it, you may have to get
- all sorts of other programs in order to regenerate files that came
- with the distribution.
-
-Compilers and Options
-=====================
-
- Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. You can give `configure'
-initial values for variables by setting them in the environment. Using
-a Bourne-compatible shell, you can do that on the command line like
-this:
- CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
-
-Or on systems that have the `env' program, you can do it like this:
- env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
-
-Compiling For Multiple Architectures
-====================================
-
- You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
- If you have to use a `make' that does not supports the `VPATH'
-variable, you have to compile the package for one architecture at a time
-in the source code directory. After you have installed the package for
-one architecture, use `make distclean' before reconfiguring for another
-architecture.
-
-Installation Names
-==================
-
- By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
- In addition, if you use an unusual directory layout you can give
-options like `--bindir=PATH' to specify different values for particular
-kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
- Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
- There may be some features `configure' can not figure out
-automatically, but needs to determine by the type of host the package
-will run on. Usually `configure' can figure that out, but if it prints
-a message saying it can not guess the host type, give it the
-`--host=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name with three fields:
- CPU-COMPANY-SYSTEM
-
-See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the host type.
-
- If you are building compiler tools for cross-compiling, you can also
-use the `--target=TYPE' option to select the type of system they will
-produce code for and the `--build=TYPE' option to select the type of
-system on which you are compiling the package.
-
-Sharing Defaults
-================
-
- If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Operation Controls
-==================
-
- `configure' recognizes the following options to control how it
-operates.
-
-`--cache-file=FILE'
- Use and save the results of the tests in FILE instead of
- `./config.cache'. Set FILE to `/dev/null' to disable caching, for
- debugging `configure'.
-
-`--help'
- Print a summary of the options to `configure', and exit.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made. To
- suppress all normal output, redirect it to `/dev/null' (any error
- messages will still be shown).
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`--version'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`configure' also accepts some other, not widely useful, options.
-
diff --git a/apps/interpreters/bas/Kconfig b/apps/interpreters/bas/Kconfig
index 19f82dde1..b19e44d73 100644
--- a/apps/interpreters/bas/Kconfig
+++ b/apps/interpreters/bas/Kconfig
@@ -35,5 +35,18 @@ config INTERPRETERS_BAS
if INTERPRETERS_BAS
+config INTERPRETER_BAS_VERSION
+ string "Version number"
+ default "2.4"
+
+config INTERPRETER_BAS_USE_LR0
+ bool "LR0 parser"
+ default n
+ ---help---
+ Select if you want LR0 parser.
+
+config INTERPRETER_BAS_USE_SELECT
+ bool "Use select()"
+ default n
endif
diff --git a/apps/interpreters/bas/auto.c b/apps/interpreters/bas/auto.c
index d49570ad2..b79b858d4 100644
--- a/apps/interpreters/bas/auto.c
+++ b/apps/interpreters/bas/auto.c
@@ -61,7 +61,7 @@
* Included Files
****************************************************************************/
-#include "config.h"
+#include <nuttx/config.h>
#include <assert.h>
#include <ctype.h>
diff --git a/apps/interpreters/bas/bas.c b/apps/interpreters/bas/bas.c
index c60c127d1..7b1ed5093 100644
--- a/apps/interpreters/bas/bas.c
+++ b/apps/interpreters/bas/bas.c
@@ -2,7 +2,7 @@
* Included Files
****************************************************************************/
-#include "config.h"
+#include <nuttx/config.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -19,8 +19,6 @@
#include <time.h>
#include <unistd.h>
-#include "getopt.h"
-
#include "auto.h"
#include "bas.h"
#include "error.h"
@@ -475,7 +473,7 @@ static struct Value *func(struct Value *value)
return value;
}
-#ifdef USE_LR0
+#ifdef CONFIG_INTERPRETER_BAS_USE_LR0
/* Grammar with LR(0) sets */
/*
@@ -1920,10 +1918,9 @@ void bas_interpreter(void)
{
if (FS_istty(STDCHANNEL))
{
- // FS_putChars(STDCHANNEL,"bas " VERSION "\n"); //acassis: fix it
+ FS_putChars(STDCHANNEL, "bas " CONFIG_INTERPRETER_BAS_VERSION "\n");
FS_putChars(STDCHANNEL, "Copyright 1999-2014 Michael Haardt.\n");
- FS_putChars(STDCHANNEL,
- _("This is free software with ABSOLUTELY NO WARRANTY.\n"));
+ FS_putChars(STDCHANNEL, "This is free software with ABSOLUTELY NO WARRANTY.\n");
}
new();
while (1)
diff --git a/apps/interpreters/bas/config.h b/apps/interpreters/bas/config.h
deleted file mode 100644
index 3de84427f..000000000
--- a/apps/interpreters/bas/config.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* config.h. Generated from config.h.in by configure. */
-/* The version string */
-#define VERSION "2.4"
-
-/* The package name. */
-#define PACKAGE "bas"
-
-/* Is there a tgmath.h? */
-/* #undef HAVE_TGMATH_H */
-
-/* Define this as 1 if your system has lrint(). */
-/* #undef HAVE_LRINT */
-
-/* Define this as 1 if your system has nanosleep(). */
-#define HAVE_NANOSLEEP 1
-
-/* What does tputs return? */
-/* #undef TPUTS_RETURNS_VOID */
-
-/* Define as 1 if you want LR0 parser. */
-/* #undef USE_LR0 */
-
-/* Define either for large file support, if your OS needs them. */
-/* #undef _FILE_OFFSET_BITS */
-/* #undef _LARGE_FILES */
-
-/* Define if timeouts do not work in your termios (broken termios). */
-/* #undef USE_SELECT */
diff --git a/apps/interpreters/bas/fs.c b/apps/interpreters/bas/fs.c
index 2471e167c..12958240a 100644
--- a/apps/interpreters/bas/fs.c
+++ b/apps/interpreters/bas/fs.c
@@ -62,7 +62,6 @@
****************************************************************************/
#include <nuttx/config.h>
-#include "config.h"
#include <sys/time.h>
#include <sys/types.h>
@@ -1381,7 +1380,7 @@ int FS_inkeyChar(int dev, int ms)
struct FileStream *f;
char c;
ssize_t len;
-#ifdef USE_SELECT
+#ifdef CONFIG_INTERPRETER_BAS_USE_SELECT
fd_set just_infd;
struct timeval timeout;
#endif
@@ -1397,7 +1396,7 @@ int FS_inkeyChar(int dev, int ms)
return f->inBuf[f->inSize++];
}
-#ifdef USE_SELECT
+#ifdef CONFIG_INTERPRETER_BAS_USE_SELECT
FD_ZERO(&just_infd);
FD_SET(f->infd, &just_infd);
timeout.tv_sec = ms / 1000;
@@ -1445,16 +1444,12 @@ int FS_inkeyChar(int dev, int ms)
void FS_sleep(double s)
{
-#ifdef HAVE_NANOSLEEP
struct timespec p;
p.tv_sec = floor(s);
p.tv_nsec = 1000000000 * (s - floor(s));
nanosleep(&p, (struct timespec *)0);
-#else
- sleep((int)s);
-#endif
}
int FS_eof(int chn)
diff --git a/apps/interpreters/bas/global.c b/apps/interpreters/bas/global.c
index cf017393a..7a3dd00e2 100644
--- a/apps/interpreters/bas/global.c
+++ b/apps/interpreters/bas/global.c
@@ -1,7 +1,6 @@
/* Global variables and functions. */
#include <nuttx/config.h>
-#include "config.h"
#include <assert.h>
#include <ctype.h>
diff --git a/apps/interpreters/bas/main.c b/apps/interpreters/bas/main.c
index 9f9f6c388..cb6cb3155 100644
--- a/apps/interpreters/bas/main.c
+++ b/apps/interpreters/bas/main.c
@@ -60,7 +60,7 @@
* Included Files
****************************************************************************/
-#include "config.h"
+#include <nuttx/config.h>
#include <unistd.h>
#include <errno.h>
@@ -119,7 +119,7 @@ int bas_main(int argc, char *argv[])
break;
case 'V':
- printf("bas %s\n", VERSION);
+ printf("bas %s\n", CONFIG_INTERPRETER_BAS_VERSION);
exit(0);
break;
diff --git a/apps/interpreters/bas/program.c b/apps/interpreters/bas/program.c
index a39aee406..c8948bff6 100644
--- a/apps/interpreters/bas/program.c
+++ b/apps/interpreters/bas/program.c
@@ -61,7 +61,7 @@
* Included Files
****************************************************************************/
-#include "config.h"
+#include <nuttx/config.h>
#include <assert.h>
#include <errno.h>
diff --git a/apps/interpreters/bas/statement.c b/apps/interpreters/bas/statement.c
index 532adcbc2..fc11768a9 100644
--- a/apps/interpreters/bas/statement.c
+++ b/apps/interpreters/bas/statement.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include <nuttx/config.h>
#include "statement.h"
diff --git a/apps/interpreters/bas/str.c b/apps/interpreters/bas/str.c
index 0bd07558d..058a233df 100644
--- a/apps/interpreters/bas/str.c
+++ b/apps/interpreters/bas/str.c
@@ -61,7 +61,7 @@
* Included Files
****************************************************************************/
-#include "config.h"
+#include <nuttx/config.h>
#include <assert.h>
#include <ctype.h>
diff --git a/apps/interpreters/bas/token.c b/apps/interpreters/bas/token.c
index 881c60ed3..b1cb0a54c 100644
--- a/apps/interpreters/bas/token.c
+++ b/apps/interpreters/bas/token.c
@@ -1387,7 +1387,7 @@ char *yytext;
/* Tokens and token sequence arrays. */
#line 3 "token.l"
/* #includes */ /*{{{C}}}*//*{{{*/
-#include "config.h"
+#include <nuttx/config.h>
#include <assert.h>
#include <ctype.h>
diff --git a/apps/interpreters/bas/value.c b/apps/interpreters/bas/value.c
index e4e31656b..7f7258a3b 100644
--- a/apps/interpreters/bas/value.c
+++ b/apps/interpreters/bas/value.c
@@ -60,7 +60,7 @@
* Included Files
****************************************************************************/
-#include "config.h"
+#include <nuttx/config.h>
#include <assert.h>
#include <ctype.h>
@@ -83,12 +83,6 @@
#define _(String) String
/****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
-
-extern long int lrint(double x);
-
-/****************************************************************************
* Private Data
****************************************************************************/
@@ -116,13 +110,6 @@ const enum ValueType Value_commonType[V_VOID + 1][V_VOID + 1] =
{ 0, V_ERROR, V_ERROR, V_ERROR, V_ERROR, V_ERROR, V_ERROR }
};
-#ifndef HAVE_LRINT
-long int lrint(double d)
-{
- return d;
-}
-#endif
-
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -2103,3 +2090,8 @@ struct Value *Value_nullValue(enum ValueType type)
return (struct Value *)0;
}
+
+long int lrint(double d)
+{
+ return d;
+}
diff --git a/apps/interpreters/bas/value.h b/apps/interpreters/bas/value.h
index dbcaaff2d..77df977f8 100644
--- a/apps/interpreters/bas/value.h
+++ b/apps/interpreters/bas/value.h
@@ -46,9 +46,7 @@ extern const enum ValueType Value_commonType[V_VOID+1][V_VOID+1];
(this)->type=0;
-#ifndef HAVE_LRINT
extern long int lrint(double d);
-#endif
extern double Value_trunc(double d);
extern double Value_round(double d);
extern long int Value_toi(double d, int *overflow);
diff --git a/apps/interpreters/bas/var.c b/apps/interpreters/bas/var.c
index a103b663f..0a8271b2b 100644
--- a/apps/interpreters/bas/var.c
+++ b/apps/interpreters/bas/var.c
@@ -2,7 +2,7 @@
* Included Files
****************************************************************************/
-#include "config.h"
+#include <nuttx/config.h>
#include <assert.h>
#include <math.h>