Add libsupc++ to sim/cxxtest configuration

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5296 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-11-02 00:22:52 +00:00
parent e162e760f7
commit cf2148e3f5
5 changed files with 109 additions and 86 deletions
+13 -13
View File
@@ -100,18 +100,18 @@ $(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@) $(call COMPILE, $<, $@)
libarch$(LIBEXT): $(OBJS) libarch$(LIBEXT): $(OBJS)
@( for obj in $(OBJS) ; do \ $(Q) ( for obj in $(OBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \ $(call ARCHIVE, $@, $${obj}); \
done ; ) done ; )
board/libboard$(LIBEXT): board/libboard$(LIBEXT):
@$(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES)
nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT) nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT)
@echo "LD: nuttx" $(Q) echo "LD: nuttx"
@$(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX)$(EXEEXT) $(HEAD_OBJ) $(EXTRA_OBJS) \ $(Q) $(LD) --entry=__start $(LDFLAGS) $(LIBPATHS) -o $(NUTTX)$(EXEEXT) $(HEAD_OBJ) $(EXTRA_OBJS) \
--start-group $(LDLIBS) -lboard $(EXTRA_LIBS) $(LIBGCC) --end-group --start-group $(LDLIBS) -lboard $(EXTRA_LIBS) $(LIBGCC) --end-group
@$(NM) $(NUTTX)$(EXEEXT) | \ $(Q) $(NM) $(NUTTX)$(EXEEXT) | \
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
sort > $(TOPDIR)/System.map sort > $(TOPDIR)/System.map
@@ -121,7 +121,7 @@ nuttx: $(HEAD_OBJ) board/libboard$(LIBEXT)
export_head: board/libboard$(LIBEXT) $(HEAD_OBJ) export_head: board/libboard$(LIBEXT) $(HEAD_OBJ)
ifneq ($(HEAD_OBJ),) ifneq ($(HEAD_OBJ),)
@if [ -d "$(EXPORT_DIR)/startup" ]; then \ $(Q) if [ -d "$(EXPORT_DIR)/startup" ]; then \
cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \ cp -f $(HEAD_OBJ) "$(EXPORT_DIR)/startup"; \
else \ else \
echo "$(EXPORT_DIR)/startup does not exist"; \ echo "$(EXPORT_DIR)/startup does not exist"; \
@@ -132,26 +132,26 @@ endif
# Dependencies # Dependencies
.depend: Makefile chip/Make.defs $(SRCS) .depend: Makefile chip/Make.defs $(SRCS)
@if [ -e board/Makefile ]; then \ $(Q) if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \ $(MAKE) -C board TOPDIR="$(TOPDIR)" depend ; \
fi fi
@$(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \ $(Q) $(MKDEP) --dep-path chip --dep-path common --dep-path $(ARCH_SUBDIR) \
$(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@ $(Q) touch $@
depend: .depend depend: .depend
clean: clean:
@if [ -e board/Makefile ]; then \ $(Q) if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \
fi fi
@rm -f libarch$(LIBEXT) *~ .*.swp $(Q) rm -f libarch$(LIBEXT) *~ .*.swp
$(call CLEAN) $(call CLEAN)
distclean: clean distclean: clean
@if [ -e board/Makefile ]; then \ $(Q) if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \
fi fi
@rm -f Make.dep .depend $(Q) rm -f Make.dep .depend
-include Make.dep -include Make.dep
+28 -23
View File
@@ -100,12 +100,17 @@ ifeq ($(CONFIG_SIM_TOUCHSCREEN),y)
endif endif
endif endif
EXTRA_LIBS ?=
ifeq ($(CONFIG_FS_FAT),y) ifeq ($(CONFIG_FS_FAT),y)
STDLIBS += -lz STDLIBS += -lz
endif endif
STDLIBS += -lc STDLIBS += -lc
LIBGCC := "${shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name}"
GCC_LIBDIR := ${shell dirname $(LIBGCC)}
# Determine which objects are required in the link. The # Determine which objects are required in the link. The
# up_head object normally draws in all that is needed, but # up_head object normally draws in all that is needed, but
# there are a fews that must be included because they # there are a fews that must be included because they
@@ -129,7 +134,7 @@ LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
# Add the board-specific library and directory # Add the board-specific library and directory
LDPATHS += -L board LDPATHS += -L board -L $(GCC_LIBDIR)
LDLIBS += -lboard LDLIBS += -lboard
# Make targets begin here # Make targets begin here
@@ -145,13 +150,13 @@ $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@) $(call COMPILE, $<, $@)
$(HOSTOBJS): %$(OBJEXT): %.c $(HOSTOBJS): %$(OBJEXT): %.c
@echo "CC: $<" $(Q) echo "CC: $<"
@$(CC) -c $(HOSTCFLAGS) $< -o $@ $(Q) $(CC) -c $(HOSTCFLAGS) $< -o $@
# The architecture-specific library # The architecture-specific library
libarch$(LIBEXT): $(NUTTXOBJS) libarch$(LIBEXT): $(NUTTXOBJS)
@( for obj in $(NUTTXOBJS) ; do \ $(Q) ( for obj in $(NUTTXOBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \ $(call ARCHIVE, $@, $${obj}); \
done ; ) done ; )
@@ -160,35 +165,35 @@ libarch$(LIBEXT): $(NUTTXOBJS)
# that are not hardware-related. # that are not hardware-related.
board/libboard$(LIBEXT): board/libboard$(LIBEXT):
@$(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES)
# A partially linked object containing only NuttX code (no interface to host OS) # A partially linked object containing only NuttX code (no interface to host OS)
# Change the names of most symbols that conflict with libc symbols. # Change the names of most symbols that conflict with libc symbols.
GNU: GNU:
@mkdir ./GNU $(Q) mkdir ./GNU
GNU/Linux-names.dat: GNU nuttx-names.dat GNU/Linux-names.dat: GNU nuttx-names.dat
@cp nuttx-names.dat $@ $(Q) cp nuttx-names.dat $@
Cygwin-names.dat: nuttx-names.dat Cygwin-names.dat: nuttx-names.dat
@cat $^ | sed -e "s/^/_/g" >$@ $(Q) cat $^ | sed -e "s/^/_/g" >$@
nuttx.rel : libarch$(LIBEXT) board/libboard$(LIBEXT) $(HOSTOS)-names.dat $(LINKOBJS) nuttx.rel : libarch$(LIBEXT) board/libboard$(LIBEXT) $(HOSTOS)-names.dat $(LINKOBJS)
@echo "LD: nuttx.rel" $(Q) echo "LD: nuttx.rel"
@$(LD) -r $(LDLINKFLAGS) $(LDPATHS) -o $@ $(REQUIREDOBJS) --start-group $(LDLIBS) $(EXTRA_LIBS) --end-group $(Q) $(LD) -r $(LDLINKFLAGS) $(LDPATHS) -o $@ $(REQUIREDOBJS) --start-group $(LDLIBS) $(EXTRA_LIBS) --end-group
@$(OBJCOPY) --redefine-syms=$(HOSTOS)-names.dat $@ $(Q) $(OBJCOPY) --redefine-syms=$(HOSTOS)-names.dat $@
# Generate the final NuttX binary by linking the host-specific objects with the NuttX # Generate the final NuttX binary by linking the host-specific objects with the NuttX
# specific objects (with munged names) # specific objects (with munged names)
nuttx$(EXEEXT): cleanrel nuttx.rel $(HOSTOBJS) nuttx$(EXEEXT): cleanrel nuttx.rel $(HOSTOBJS)
@echo "LD: nuttx$(EXEEXT)" $(Q) echo "LD: nuttx$(EXEEXT)"
@$(CC) $(CCLINKFLAGS) $(LDPATHS) -o $(TOPDIR)/$@ nuttx.rel $(HOSTOBJS) $(DRVLIB) $(STDLIBS) $(Q) $(CC) $(CCLINKFLAGS) $(LDPATHS) -o $(TOPDIR)/$@ nuttx.rel $(HOSTOBJS) $(DRVLIB) $(STDLIBS)
@$(NM) $(TOPDIR)/$@ | \ $(Q) $(NM) $(TOPDIR)/$@ | \
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
sort > $(TOPDIR)/System.map sort > $(TOPDIR)/System.map
@rm -f nuttx.rel $(Q) rm -f nuttx.rel
# This is part of the top-level export target # This is part of the top-level export target
@@ -200,26 +205,26 @@ export_head: board/libboard$(LIBEXT) up_head.o $(HOSTOBJS)
# Dependencies # Dependencies
.depend: Makefile $(SRCS) .depend: Makefile $(SRCS)
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep $(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@ $(Q) touch $@
depend: .depend depend: .depend
cleanrel: cleanrel:
@rm -f nuttx.rel GNU/Linux-names.dat Cygwin-names.dat $(Q) rm -f nuttx.rel GNU/Linux-names.dat Cygwin-names.dat
clean: cleanrel clean: cleanrel
@if [ -e board/Makefile ]; then \ $(Q) if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \ $(MAKE) -C board TOPDIR="$(TOPDIR)" clean ; \
fi fi
@rm -f nuttx.rel libarch$(LIBEXT) *~ .*.swp $(Q) rm -f nuttx.rel libarch$(LIBEXT) *~ .*.swp
$(call CLEAN) $(call CLEAN)
distclean: clean distclean: clean
@if [ -e board/Makefile ]; then \ $(Q) if [ -e board/Makefile ]; then \
$(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \ $(MAKE) -C board TOPDIR="$(TOPDIR)" distclean ; \
fi fi
@rm -f Make.dep .depend $(Q) rm -f Make.dep .depend
@rm -rf GNU $(Q) rm -rf GNU
-include Make.dep -include Make.dep
+2
View File
@@ -101,6 +101,8 @@ ifeq ($(CONFIG_SIM_M32),y)
LDFLAGS += -m32 LDFLAGS += -m32
endif endif
EXTRA_LIBS = -lsupc++
MKDEP = $(TOPDIR)/tools/mkdeps.sh MKDEP = $(TOPDIR)/tools/mkdeps.sh
HOSTCC = gcc HOSTCC = gcc
+9
View File
@@ -276,12 +276,21 @@ CONFIG_ARCH_LOWPUTC=y
CONFIG_LIB_SENDFILE_BUFSIZE=512 CONFIG_LIB_SENDFILE_BUFSIZE=512
# CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_ROMGETC is not set
# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set
#
# Basic CXX Support
#
CONFIG_HAVE_CXX=y CONFIG_HAVE_CXX=y
# CONFIG_HAVE_CXXINITIALIZE is not set # CONFIG_HAVE_CXXINITIALIZE is not set
# CONFIG_CXX_NEWLONG is not set # CONFIG_CXX_NEWLONG is not set
#
# uClibc++ Standard C++ Library
#
CONFIG_UCLIBCXX=y CONFIG_UCLIBCXX=y
CONFIG_UCLIBCXX_EXCEPTION=y CONFIG_UCLIBCXX_EXCEPTION=y
CONFIG_UCLIBCXX_IOSTREAM_BUFSIZE=32 CONFIG_UCLIBCXX_IOSTREAM_BUFSIZE=32
CONFIG_UCLIBCXX_HAVE_LIBSUPCXX=y
# #
# Application Configuration # Application Configuration
+9 -2
View File
@@ -3,6 +3,8 @@
# see misc/tools/kconfig-language.txt. # see misc/tools/kconfig-language.txt.
# #
comment "Basic CXX Support"
config HAVE_CXX config HAVE_CXX
bool "Have C++ compiler" bool "Have C++ compiler"
default n default n
@@ -12,8 +14,6 @@ config HAVE_CXX
if HAVE_CXX if HAVE_CXX
comment "Basic CXX Support"
config HAVE_CXXINITIALIZE config HAVE_CXXINITIALIZE
bool "Have C++ initialization" bool "Have C++ initialization"
default n default n
@@ -50,5 +50,12 @@ config UCLIBCXX_IOSTREAM_BUFSIZE
int "IO Stream Buffer Size" int "IO Stream Buffer Size"
default 32 default 32
config UCLIBCXX_HAVE_LIBSUPCXX
bool "Have libsupc++ (required)"
default y
---help---
Select if your toolchain provides libsupc++. This option is required
at present because the built-in libsupc++ support is incomplete.
endif endif
endif endif