2 # Copyright (C) 2006-2009 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/target.mk
11 PKG_VERSION
:=$(call qstrip
,$(CONFIG_UCLIBC_VERSION
))
12 ifeq ($(CONFIG_UCLIBC_VERSION_NPTL
),y
)
13 PKG_SOURCE_URL
:=git
://git.busybox.net
/uClibc
15 PKG_SOURCE_VERSION
:=ef18cfe8ebab25f5ef92e81956f50e2dc57df602
16 PKG_SOURCE_SUBDIR
:=$(PKG_NAME
)-$(PKG_VERSION
)
17 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_SOURCE_VERSION
).
tar.gz
18 LIBC_SO_VERSION
:=0.9.30-git
20 PKG_SOURCE_URL
:=http
://www.uclibc.org
/downloads
21 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
22 LIBC_SO_VERSION
:=$(PKG_VERSION
)
24 PATCH_DIR
:=.
/patches-
$(PKG_VERSION
)
25 CONFIG_DIR
:=.
/config-
$(PKG_VERSION
)
27 PKG_MD5SUM_0.9
.30.1 = 1a4b84e5536ad8170563ffa88c34679c
28 PKG_MD5SUM_0.9
.30.2 = e759ec855500082ac3e671dd6cacfdb0
29 PKG_MD5SUM_0.9
.30.3 = 73a4bf4a0fa508b01a7a3143574e3d21
30 PKG_MD5SUM
=$(PKG_MD5SUM_
$(PKG_VERSION
))
32 HOST_BUILD_DIR
:=$(BUILD_DIR_TOOLCHAIN
)/$(PKG_NAME
)-$(PKG_VERSION
)
34 include $(INCLUDE_DIR
)/toolchain-build.mk
36 HOST_STAMP_BUILT
:=$(TOOLCHAIN_DIR
)/stamp
/.uclibc_installed
37 HOST_STAMP_INSTALLED
:=$(TOOLCHAIN_DIR
)/stamp
/.uclibc-utils_installed
39 UCLIBC_TARGET_ARCH
:=$(shell echo
$(ARCH
) | sed
-e s
'/-.*//' \
41 -e
's/sparc.*/sparc/' \
43 -e
's/avr32.*/avr32/g' \
45 -e
's/ppc/powerpc/g' \
46 -e
's/v850.*/v850/g' \
48 -e
's/sh[234].*/sh/' \
50 -e
's/mipsel.*/mips/' \
55 define Host
/SetToolchainInfo
56 $(SED
) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR
)/info.mk
57 $(SED
) 's,^\(LIBC_URL\)=.*,\1=http://www.uclibc.org/,' $(TOOLCHAIN_DIR
)/info.mk
58 $(SED
) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR
)/info.mk
59 $(SED
) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR
)/info.mk
62 GEN_CONFIG
=$(SCRIPT_DIR
)/kconfig.pl
-n \
63 $(if
$(wildcard $(CONFIG_DIR
)/common
),'+' $(CONFIG_DIR
)/common
) \
64 $(if
$(CONFIG_UCLIBC_ENABLE_DEBUG
),$(if
$(wildcard $(CONFIG_DIR
)/debug
),'+' $(CONFIG_DIR
)/debug
)) \
65 $(CONFIG_DIR
)/$(ARCH
)$(if
$(wildcard $(CONFIG_DIR
)/$(ARCH
).
$(BOARD
)),.
$(BOARD
))
68 $(call Host
/SetToolchainInfo
)
69 $(call Host
/Prepare
/Default
)
70 ln
-snf
$(PKG_NAME
)-$(PKG_VERSION
) $(BUILD_DIR_TOOLCHAIN
)/$(PKG_NAME
)
71 $(GEN_CONFIG
) > $(HOST_BUILD_DIR
)/.config
72 $(SED
) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include\",g' \
73 -e
's,^.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n,y),g' \
74 -e
's,^.*UCLIBC_HAS_SOFT_FLOAT.*,UCLIBC_HAS_SOFT_FLOAT=$(if $(CONFIG_SOFT_FLOAT),y,n),g' \
75 -e
's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=$(if $(CONFIG_LARGEFILE),y,n),g' \
76 -e
's,^.*CONFIG_ARM_EABI.*,CONFIG_ARM_EABI=$(if $(CONFIG_EABI_SUPPORT),y,n),g' \
77 -e
's,^.*CONFIG_ARM_OABI.*,CONFIG_ARM_OABI=$(if $(CONFIG_EABI_SUPPORT),n,y),g' \
78 -e
's,^.*UCLIBC_HAS_SHADOW.*,UCLIBC_HAS_SHADOW=$(if $(CONFIG_SHADOW_PASSWORDS),y,n),g' \
79 $(HOST_BUILD_DIR
)/.config
80 $(MAKE
) -C
$(HOST_BUILD_DIR
) oldconfig KBUILD_HAVE_NLS
= HOSTCFLAGS
="-DKBUILD_NO_NLS"
81 $(MAKE
) -C
$(HOST_BUILD_DIR
)/extra
/config conf KBUILD_HAVE_NLS
= HOSTCFLAGS
="-DKBUILD_NO_NLS"
82 PATH
='$(TARGET_PATH)' $(MAKE
) -C
$(HOST_BUILD_DIR
) \
83 PREFIX
="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \
85 RUNTIME_PREFIX
="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \
88 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
89 ARCH
="$(CONFIG_ARCH)" \
97 UCLIBC_MAKE
= PATH
='$(TARGET_PATH)' $(MAKE
) -C
$(HOST_BUILD_DIR
) \
98 $(TARGET_CONFIGURE_OPTS
) \
102 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
103 ARCH
="$(CONFIG_ARCH)" \
104 LIBGCC
="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))" \
108 $(SED
) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR
)/Rules.mak
109 $(UCLIBC_MAKE
) PREFIX
= all
110 $(UCLIBC_MAKE
) PREFIX
="$(TOOLCHAIN_DIR)/" install_runtime install_dev
111 ln
-sf ..
/..
/lib
/libc.so
.0 $(TOOLCHAIN_DIR
)/usr
/lib
/libc.so
112 $(CP
) $(HOST_BUILD_DIR
)/libc
/libc_so.a
$(TOOLCHAIN_DIR
)/usr
/lib
/
113 $(CP
) $(HOST_BUILD_DIR
)/libpthread
/*/libpthread_so.a
$(TOOLCHAIN_DIR
)/usr
/lib
/
114 ( cd
$(TOOLCHAIN_DIR
) ; \
115 for d in lib usr
/lib
; do \
116 for f in libc.so libpthread.so libgcc_s.so
; do \
117 if
[ -f
$$$$d/$$$$f -a
! -L
$$$$d/$$$$f ] ; then \
118 $(SED
) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \
126 $(UCLIBC_MAKE
) PREFIX
= utils
127 $(INSTALL_DIR
) $(TOOLCHAIN_DIR
)/bin
128 $(INSTALL_DIR
) $(TOOLCHAIN_DIR
)/usr
/bin
130 $(HOST_BUILD_DIR
)/utils
/ldd \
131 $(TOOLCHAIN_DIR
)/usr
/bin
/
132 $(INSTALL_DIR
) $(TOOLCHAIN_DIR
)/sbin
134 $(HOST_BUILD_DIR
)/utils
/ldconfig \
135 $(TOOLCHAIN_DIR
)/sbin
/
141 $(BUILD_DIR_TOOLCHAIN
)/$(PKG_NAME
) \
142 $(BUILD_DIR_TOOLCHAIN
)/$(LIBC
)-dev
145 $(eval
$(call HostBuild
))