2 # Copyright (C) 2006 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
14 PKG_SOURCE
:=uClibc-
$(PKG_VERSION
)$(PKG_EXTRAVERSION
).
tar.bz2
15 PKG_SOURCE_URL
:=http
://www.uclibc.org
/downloads
16 PKG_MD5SUM
:=959f25286e317f0d9e2103445c5a14c2
19 PKG_BUILD_DIR
:=$(TOOLCHAIN_BUILD_DIR
)/uClibc-
$(PKG_VERSION
)$(PKG_EXTRAVERSION
)
21 include $(INCLUDE_DIR
)/host-build.mk
23 UCLIBC_TARGET_ARCH
:=$(shell echo
$(ARCH
) | sed
-e s
'/-.*//' \
25 -e
's/sparc.*/sparc/' \
27 -e
's/avr32.*/avr32/g' \
29 -e
's/ppc/powerpc/g' \
30 -e
's/v850.*/v850/g' \
32 -e
's/sh[234].*/sh/' \
34 -e
's/mipsel.*/mips/' \
39 $(call Build
/Prepare
/Default
)
40 if
[ -e config
/$(ARCH
).
$(BOARD
) ]; then \
41 $(CP
) config
/$(ARCH
).
$(BOARD
) $(PKG_BUILD_DIR
)/.config
; \
43 $(CP
) config
/$(ARCH
) $(PKG_BUILD_DIR
)/.config
; \
45 $(SED
) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_HEADERS_DIR)\",g' \
46 $(PKG_BUILD_DIR
)/.config
47 ifeq ($(CONFIG_LARGEFILE
),y
)
48 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' $(PKG_BUILD_DIR
)/.config
50 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' $(PKG_BUILD_DIR
)/.config
52 $(SED
) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(PKG_BUILD_DIR
)/.config
53 ifeq ($(CONFIG_SOFT_FLOAT
),y
)
54 $(SED
) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(PKG_BUILD_DIR
)/.config
56 ifeq ($(CONFIG_C99_MATH
),y
)
57 $(SED
) 's,.*DO_C99_MATH.*,DO_C99_MATH=y,g' $(PKG_BUILD_DIR
)/.config
59 mkdir
-p
$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/usr
/include
60 mkdir
-p
$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/usr
/lib
61 mkdir
-p
$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/lib
62 PATH
=$(TARGET_PATH
) $(MAKE
) -C
$(PKG_BUILD_DIR
) \
63 PREFIX
=$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/ \
65 RUNTIME_PREFIX
=$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/ \
67 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
71 define Build
/Configure
75 $(SED
) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(PKG_BUILD_DIR
)/Rules.mak
76 PATH
=$(TARGET_PATH
) $(MAKE
) -C
$(PKG_BUILD_DIR
) \
81 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
86 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
87 PREFIX
=$(STAGING_DIR
)/ \
91 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
92 PREFIX
=$(STAGING_DIR
)/ \
96 echo
$(PKG_VERSION
) > $(STAGING_DIR
)/uclibc_version
97 echo
$(PKG_VERSION
)$(PKG_EXTRAVERSION
) > $(STAGING_DIR
)/uclibc_extra_version
101 rm -rf
$(PKG_BUILD_DIR
) $(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
104 $(eval
$(call HostBuild
))