Skip to content

Commit eb1c7a6

Browse files
author
nbd
committed
build: add a config option for choosing the prefered standard c++ library 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
1 parent 4c137de commit eb1c7a6

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

Config.in

+15
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,21 @@ menu "Global build settings"
395395
Note that this will make the system libraries incompatible with most of the packages
396396
that are not selected during the build process
397397

398+
choice
399+
prompt "Preferred standard C++ library"
400+
default USE_LIBSTDCXX if USE_EGLIBC
401+
default USE_UCLIBCXX
402+
help
403+
Select the preferred standard C++ library for all packages that support this.
404+
405+
config USE_UCLIBCXX
406+
bool "uClibc++"
407+
408+
config USE_LIBSTDCXX
409+
bool "libstdc++"
410+
411+
endchoice
412+
398413
endmenu
399414

400415
menuconfig DEVEL

include/package.mk

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# See /LICENSE for more information.
66
#
77

8+
__package_mk:=1
9+
810
all: $(if $(DUMP),dumpinfo,compile)
911

1012
PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))

include/uclibc++.mk

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ifndef DUMP
2+
ifdef __package_mk
3+
$(error uclibc++.mk must be included before package.mk)
4+
endif
5+
endif
6+
7+
PKG_PREPARED_DEPENDS += CONFIG_USE_UCLIBCXX
8+
CXX_DEPENDS = +USE_UCLIBCXX:uclibcxx +USE_LIBSTDCXX:libstdcpp
9+
10+
ifneq ($(CONFIG_USE_UCLIBCXX),)
11+
TARGET_CXX="g++-uc"
12+
endif

0 commit comments

Comments
 (0)