diff --git a/Config.in b/Config.in
index ddf02614b3222145f59c6c7565bf7e29615cf66e..5f61905c92998c5fa6c7926150cb21748875aca9 100644
--- a/Config.in
+++ b/Config.in
@@ -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
diff --git a/include/package.mk b/include/package.mk
index e955c207aeeae8aaeb62f500d33441113632c8a8..abffa0c64cc3ef23b83e369165d861fa8237a6fd 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -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))
diff --git a/include/uclibc++.mk b/include/uclibc++.mk
new file mode 100644
index 0000000000000000000000000000000000000000..817484377fcee9c0f55f5238e57a4e62bc791848
--- /dev/null
+++ b/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