summaryrefslogtreecommitdiffstats
path: root/toolchain/musl/Makefile
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-11-23 20:02:29 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-11-23 20:02:29 +0000
commitcfcc935fa2f110fdf4824c67d3cd67f34d91f7a8 (patch)
treebc44c7e2aea0c387867ce3601e782b02a940d79e /toolchain/musl/Makefile
parent4cf1359d5dc38debc89834d895f9a3951044bf90 (diff)
[buildroot] add preliminary support for musl
Musl is an alternative C-library, see http://www.musl-libc.org for more infos. Signed-off-by: Florian Fainelli <florian@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34314 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'toolchain/musl/Makefile')
-rw-r--r--toolchain/musl/Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/toolchain/musl/Makefile b/toolchain/musl/Makefile
new file mode 100644
index 000000000..79ea175a4
--- /dev/null
+++ b/toolchain/musl/Makefile
@@ -0,0 +1,38 @@
+PATH_PREFIX=.
+
+include ./common.mk
+
+HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
+HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.musl_installed
+
+HOST_BUILD_PARALLEL:=1
+
+define Host/SetToolchainInfo
+ $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
+ $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.musl-libc.org/,' $(TOOLCHAIN_DIR)/info.mk
+ $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
+ $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk
+endef
+
+define Host/Compile
+ $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
+endef
+
+define Host/Install
+ $(call Host/SetToolchainInfo)
+ $(MAKE) -C $(HOST_BUILD_DIR) DESTDIR="$(TOOLCHAIN_DIR)/" install
+ ( cd $(TOOLCHAIN_DIR) ; \
+ for d in lib usr/lib ; do \
+ for f in libc.so libpthread.so libgcc_s.so ; do \
+ if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \
+ $(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \
+ fi \
+ done \
+ done \
+ )
+ rm -f \
+ $(TOOLCHAIN_DIR)/lib/libresolv*.so* \
+ $(TOOLCHAIN_DIR)/lib/libnsl*.so*
+endef
+
+$(eval $(call HostBuild))