Skip to content

Commit

Permalink
build: add a config option for choosing the prefered standard c++ lib…
Browse files Browse the repository at this point in the history
…rary and add uclibc++.mk to make this easy to handle in packages

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32369 3c298f89-4303-0410-b956-a3cf2f4a3e73
  • Loading branch information
nbd committed Jun 14, 2012
1 parent 4c137de commit eb1c7a6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Config.in
Expand Up @@ -395,6 +395,21 @@ menu "Global build settings"
Note that this will make the system libraries incompatible with most of the packages
that are not selected during the build process

choice
prompt "Preferred standard C++ library"
default USE_LIBSTDCXX if USE_EGLIBC
default USE_UCLIBCXX
help
Select the preferred standard C++ library for all packages that support this.

config USE_UCLIBCXX
bool "uClibc++"

config USE_LIBSTDCXX
bool "libstdc++"

endchoice

endmenu

menuconfig DEVEL
Expand Down
2 changes: 2 additions & 0 deletions include/package.mk
Expand Up @@ -5,6 +5,8 @@
# See /LICENSE for more information.
#

__package_mk:=1

all: $(if $(DUMP),dumpinfo,compile)

PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
Expand Down
12 changes: 12 additions & 0 deletions include/uclibc++.mk
@@ -0,0 +1,12 @@
ifndef DUMP
ifdef __package_mk
$(error uclibc++.mk must be included before package.mk)
endif
endif

PKG_PREPARED_DEPENDS += CONFIG_USE_UCLIBCXX
CXX_DEPENDS = +USE_UCLIBCXX:uclibcxx +USE_LIBSTDCXX:libstdcpp

ifneq ($(CONFIG_USE_UCLIBCXX),)
TARGET_CXX="g++-uc"
endif

0 comments on commit eb1c7a6

Please sign in to comment.