summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-04-19 13:05:39 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-04-19 13:05:39 +0000
commit05bb03bca1ec249685d0af3665b2121e12fd8db4 (patch)
treea530c8bb5ce62e0a018b7d9856291fa9404c0033
parent396da79a6d002bc1e27a0f903094d6866d0d0b96 (diff)
downloadpx4-nuttx-05bb03bca1ec249685d0af3665b2121e12fd8db4.tar.gz
px4-nuttx-05bb03bca1ec249685d0af3665b2121e12fd8db4.tar.bz2
px4-nuttx-05bb03bca1ec249685d0af3665b2121e12fd8db4.zip
Add C++ HelloWorld example
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1706 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/ChangeLog1
-rw-r--r--nuttx/Documentation/NuttX.html8
-rw-r--r--nuttx/configs/mx1ads/ostest/Make.defs23
-rw-r--r--nuttx/examples/README.txt17
-rw-r--r--nuttx/include/nuttx/fs.h4
5 files changed, 44 insertions, 9 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index b583b9db6..2bda8e7bd 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -693,3 +693,4 @@
* eZ8Encore!: Add an I2C driver.
* Add support for the Freescale i.MX1/L architecture and a configuration for
the Freescale MX1ADS development board.
+ * examples/helloxx: Added a simple C++ hello world example
diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html
index bb5c3eac7..0edf2ebd1 100644
--- a/nuttx/Documentation/NuttX.html
+++ b/nuttx/Documentation/NuttX.html
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
- <p>Last Updated: April 12, 2009</p>
+ <p>Last Updated: April 19, 2009</p>
</td>
</tr>
</table>
@@ -1387,12 +1387,18 @@ nuttx-0.4.5 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
* eZ8Encore!: Add an I2C driver.
* Add support for the Freescale i.MX1/L architecture and a configuration for
the Freescale MX1ADS development board.
+ * examples/helloxx: Added a simple C++ hello world example
pascal-0.1.3 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
buildroot-0.1.4 2009-xx-xx &lt;spudmonkey@racsa.co.cr&gt;
* Add support for a blackfin toolchain using GCC 4.2.4 and binutils 2.19
+ * GCC 4.2.4 no longer attempts to build libstdc++. Now we can build g++!
+ * The ARM GCC-4.2.4 configuration was changed so that it now builds g++.
+ * Removed building of initial and final GCC. that is not necessary because
+ we do not build a libc. Now it builds almost twice as fast.
+ * Removed logic to build the target GCC. That is never used.
</pre></ul>
diff --git a/nuttx/configs/mx1ads/ostest/Make.defs b/nuttx/configs/mx1ads/ostest/Make.defs
index 134035c50..f0fa33366 100644
--- a/nuttx/configs/mx1ads/ostest/Make.defs
+++ b/nuttx/configs/mx1ads/ostest/Make.defs
@@ -37,6 +37,7 @@ include ${TOPDIR}/.config
CROSSDEV = arm-elf-
CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E
LD = $(CROSSDEV)ld
AR = $(CROSSDEV)ar rcs
@@ -47,6 +48,11 @@ OBJDUMP = $(CROSSDEV)objdump
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
+ARCHCFLAGS = -fno-builtin
+ARCHCXXFLAGS = -fno-builtin -fno-exceptions
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
+
ifeq ("${CONFIG_DEBUG}","y")
ARCHOPTIMIZATION = -g
else
@@ -55,17 +61,19 @@ else
endif
ifeq ($(ARCHCCMAJOR),4)
- ARCHCPUFLAGS = -mtune=arm9tdmi -march=armv4t -msoft-float -fno-builtin
+ ARCHCPUFLAGS = -mtune=arm9tdmi -march=armv4t -msoft-float
else
- ARCHCPUFLAGS = -mapcs-32 -mtune=arm9tdmi -march=armv4t -msoft-float -fno-builtin
+ ARCHCPUFLAGS = -mapcs-32 -mtune=arm9tdmi -march=armv4t -msoft-float
endif
-ARCHPICFLAGS = -fpic
-ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
ARCHDEFINES =
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+
+ARCHPICFLAGS = -fpic
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
+CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
@@ -88,6 +96,11 @@ define COMPILE
@$(CC) -c $(CFLAGS) $1 -o $2
endef
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
define ASSEMBLE
@echo "AS: $1"
@$(CC) -c $(AFLAGS) $1 -o $2
diff --git a/nuttx/examples/README.txt b/nuttx/examples/README.txt
index faa378bb2..81b4f2d73 100644
--- a/nuttx/examples/README.txt
+++ b/nuttx/examples/README.txt
@@ -21,7 +21,7 @@ examples/dhcpd
cd examples/dhcpd
make -f Makefile.host
- Kernel configuratin settings:
+ NuttX configuration settings:
CONFIG_EXAMPLE_DHCPD_NOMAC - (May be defined to use software assigned MAC)
CONFIG_EXAMPLE_DHCPD_IPADDR - Target IP address
@@ -39,6 +39,21 @@ examples/hello
than examples/null with a single printf statement. Again useful only
for bringing up new NuttX architectures.
+ NuttX configuration settings:
+
+ CONFIG_EXAMPLE_HELLOXX_NOSTATICCONST - Set if system does not support
+ static constructors.
+ CONFIG_EXAMPLE_HELLOXX_NOSTACKCONST - Set if the systgem does not
+ support constructionof objects on the stack.
+
+examples/helloxx
+^^^^^^^^^^^^^^^^
+
+ This is C++ version of the "Hello, World!!" example. It is intended
+ only to verify that the C++ compiler is function, that basic C++
+ library suupport is available, and that class are instantiated
+ correctly.
+
examples/mount
^^^^^^^^^^^^^^
diff --git a/nuttx/include/nuttx/fs.h b/nuttx/include/nuttx/fs.h
index 3d2370688..1326921df 100644
--- a/nuttx/include/nuttx/fs.h
+++ b/nuttx/include/nuttx/fs.h
@@ -314,13 +314,13 @@ EXTERN void weak_function fs_initialize(void);
EXTERN STATUS register_driver(const char *path,
const struct file_operations *fops,
- mode_t mode, void *private);
+ mode_t mode, void *priv);
/* fs_registerdriver.c ******************************************************/
EXTERN STATUS register_blockdriver(const char *path,
const struct block_operations *bops,
- mode_t mode, void *private);
+ mode_t mode, void *priv);
/* fs_unregisterdriver.c ****************************************************/