Enable compilation of libc++ same way as uClibc++

This commit is contained in:
Alan Carvalho de Assis 2017-03-08 16:46:26 -06:00 committed by Gregory Nutt
parent 45ccf0cb79
commit f50072bd6b
2 changed files with 39 additions and 5 deletions

View File

@ -38,6 +38,36 @@ config CXX_NEWLONG
C++ library routines because the NuttX size_t might not have C++ library routines because the NuttX size_t might not have
the same underlying type as your toolchain's size_t. the same underlying type as your toolchain's size_t.
comment "LLVM C++ Library (libcxx)"
config LIBCXX
bool "Build LLVM libcxx (must be installed)"
default n
---help---
If you have installed libcxx into the NuttX source try, then it can
be built by selecting this option. See the README.txt file in the
libcxx packet for information on installing libcxx.
if LIBCXX
config LIBCXX_EXCEPTION
bool "Enable Exception Suppport"
default y
config LIBCXX_IOSTREAM_BUFSIZE
int "IO Stream Buffer Size"
default 32
config LIBCXX_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
comment "uClibc++ Standard C++ Library" comment "uClibc++ Standard C++ Library"
config UCLIBCXX config UCLIBCXX

View File

@ -41,18 +41,18 @@ ASRCS =
CSRCS = CSRCS =
CXXSRCS = libxx_cxapurevirtual.cxx libxx_eabi_atexit.cxx libxx_cxa_atexit.cxx CXXSRCS = libxx_cxapurevirtual.cxx libxx_eabi_atexit.cxx libxx_cxa_atexit.cxx
ifeq ($(CONFIG_UCLIBCXX_EXCEPTION),y) ifneq (,$(findstring y,$(CONFIG_UCLIBCXX_EXCEPTION) $(CONFIG_LIBCXX_EXCEPTION)))
CXXSRCS += libxx__gnu_unwind_find_exidx.cxx CXXSRCS += libxx__gnu_unwind_find_exidx.cxx
endif endif
# Some of the libxx/ files are not need if uClibc++ is installed because # Some of the libxx/ files are not need if uClibc++ or libcxx is installed
# uClibx++ replaces them # because uClibx++ or libcxx will replaces them
ifneq ($(CONFIG_UCLIBCXX),y) ifeq (,$(findstring y,$(CONFIG_UCLIBCXX) $(CONFIG_LIBCXX)))
CXXSRCS += libxx_delete.cxx libxx_deletea.cxx libxx_new.cxx libxx_newa.cxx CXXSRCS += libxx_delete.cxx libxx_deletea.cxx libxx_new.cxx libxx_newa.cxx
CXXSRCS += libxx_stdthrow.cxx libxx_cxa_guard.cxx CXXSRCS += libxx_stdthrow.cxx libxx_cxa_guard.cxx
else else
ifneq ($(UCLIBCXX_EXCEPTION),y) ifeq (,$(findstring y,$(CONFIG_UCLIBCXX_EXCEPTION) $(CONFIG_LIBCXX_EXCEPTION)))
CXXSRCS += libxx_stdthrow.cxx CXXSRCS += libxx_stdthrow.cxx
endif endif
endif endif
@ -76,6 +76,10 @@ ifeq ($(CONFIG_UCLIBCXX),y)
include uClibc++/Make.defs include uClibc++/Make.defs
endif endif
ifeq ($(CONFIG_LIBCXX),y)
include libcxx/Make.defs
endif
# Object Files # Object Files
AOBJS = $(ASRCS:.S=$(OBJEXT)) AOBJS = $(ASRCS:.S=$(OBJEXT))