openwrtv3/package/libs/uclibc++/Makefile
John Crispin c10d97484a Add more license tags with SPDX identifiers
Note, that licensing stuff is a nightmare: many packages does not clearly
state their licenses, and often multiple source files are simply copied
together - each with different licensing information in the file headers.

I tried hard to ensure, that the license information extracted into the OpenWRT's
makefiles fit the "spirit" of the packages, e.g. such small packages which
come without a dedicated source archive "inherites" the OpenWRT's own license
in my opinion.

However, I can not garantee that I always picked the correct information
and/or did not miss license information.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

SVN-Revision: 43155
2014-11-03 08:01:08 +00:00

96 lines
2.6 KiB
Makefile

#
# Copyright (C) 2006-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=uclibc++
PKG_VERSION:=0.2.4
PKG_RELEASE:=1
PKG_SOURCE:=uClibc++-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://cxx.uclibc.org/src/
PKG_MD5SUM:=394c119363dd8b469fb898442a6764b8
PKG_BUILD_DIR:=$(BUILD_DIR)/uClibc++-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/uclibcxx
NAME:=uclibc++
SECTION:=libs
CATEGORY:=Libraries
TITLE:=C++ library for embedded systems
URL:=http://cxx.uclibc.org/src/
endef
UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
-e 's/i.86/i386/' \
-e 's/sparc.*/sparc/' \
-e 's/m68k.*/m68k/' \
-e 's/ppc/powerpc/g' \
-e 's/v850.*/v850/g' \
-e 's/sh64/sh/' \
-e 's/sh[234].*/sh/' \
-e 's/mips.*/mips/' \
-e 's/mipsel.*/mips/' \
-e 's/cris.*/cris/' \
)
TARGET_CFLAGS += $(FPIC)
ifneq ($(CONFIG_CCACHE),)
TARGET_CXX=$(TARGET_CXX_NOCACHE)
endif
MAKE_FLAGS:= \
TOPDIR="$(PKG_BUILD_DIR)/" \
$(TARGET_CONFIGURE_OPTS) \
CPU_CFLAGS="$(TARGET_CFLAGS)" \
CROSS="$(TARGET_CROSS)" \
CP="$(CP)" \
GEN_LIBS="-lc $(LIBGCC_S)" \
check_as_needed=
# check_as_needed overrides dependency on libgcc_s
define Build/Configure
if [ -f ./files/config.$(UCLIBC_TARGET_ARCH) ]; then \
cp ./files/config.$(UCLIBC_TARGET_ARCH) $(PKG_BUILD_DIR)/.config; \
else \
cp ./files/config.default $(PKG_BUILD_DIR)/.config; \
fi
endef
define Build/InstallDev
$(INSTALL_DIR) $(2)/bin $(1)/usr/include/uClibc++ $(1)/usr/lib
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/g++-uc $(TOOLCHAIN_DIR)/bin/
$(CP) $(PKG_INSTALL_DIR)/include/* $(1)/usr/include/uClibc++/
$(CP) $(PKG_INSTALL_DIR)/lib/libuClibc++*.{a,so}* $(1)/usr/lib/
$(SED) 's|-I/include/|-I$(STAGING_DIR)/usr/include/uClibc++/|g' $(TOOLCHAIN_DIR)/bin/g++-uc
$(SED) 's|-L/lib/|-L$(STAGING_DIR)/usr/lib/|g' $(TOOLCHAIN_DIR)/bin/g++-uc
# add another wrapper which links against both uClibc++ and libstdc++
$(INSTALL_BIN) $(TOOLCHAIN_DIR)/bin/g++-uc $(TOOLCHAIN_DIR)/bin/g++-uc+std
$(SED) 's|^WRAPPER_INCLUDEDIR=.*||g' $(TOOLCHAIN_DIR)/bin/g++-uc+std
$(SED) 's|-luClibc++|-Wl,-Bdynamic,-luClibc++,-Bstatic,-lstdc++,-Bdynamic|g' $(TOOLCHAIN_DIR)/bin/g++-uc+std
$(SED) 's|-nostdinc++||g' $(TOOLCHAIN_DIR)/bin/g++-uc+std
endef
define Package/uclibcxx/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/lib/libuClibc++.so.* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/lib/libuClibc++-*.so $(1)/usr/lib/
endef
$(eval $(call BuildPackage,uclibcxx))