From 05bb03bca1ec249685d0af3665b2121e12fd8db4 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 19 Apr 2009 13:05:39 +0000 Subject: Add C++ HelloWorld example git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1706 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 1 + nuttx/Documentation/NuttX.html | 8 +++++++- nuttx/configs/mx1ads/ostest/Make.defs | 23 ++++++++++++++++++----- nuttx/examples/README.txt | 17 ++++++++++++++++- nuttx/include/nuttx/fs.h | 4 ++-- 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 @@

NuttX RTOS

-

Last Updated: April 12, 2009

+

Last Updated: April 19, 2009

@@ -1387,12 +1387,18 @@ nuttx-0.4.5 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> * 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 <spudmonkey@racsa.co.cr> buildroot-0.1.4 2009-xx-xx <spudmonkey@racsa.co.cr> * 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. 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 ****************************************************/ -- cgit v1.2.3