1 #############################################################
3 # uClibc (the C library)
5 #############################################################
6 ifneq ($(strip $(USE_UCLIBC_SNAPSHOT
)),)
7 # Be aware that this changes daily....
8 UCLIBC_DIR
:=$(BUILD_DIR
)/uClibc
9 UCLIBC_SOURCE
:=uClibc-
$(strip $(USE_UCLIBC_SNAPSHOT
)).
tar.bz2
10 UCLIBC_SITE
:=http
://www.uclibc.org
/downloads
/snapshots
12 UCLIBC_DIR
:=$(BUILD_DIR
)/uClibc-0.9
.26
13 UCLIBC_SOURCE
:=uClibc-0.9
.26.
tar.bz2
14 UCLIBC_SITE
:=http
://www.uclibc.org
/downloads
17 UCLIBC_TARGET_ARCH
:=$(shell echo
$(ARCH
) | sed
-e s
'/-.*//' \
19 -e
's/sparc.*/sparc/' \
22 -e
's/ppc/powerpc/g' \
23 -e
's/v850.*/v850/g' \
27 -e
's/mipsel.*/mips/' \
32 $(DL_DIR
)/$(UCLIBC_SOURCE
):
33 $(WGET
) -P
$(DL_DIR
) $(UCLIBC_SITE
)/$(UCLIBC_SOURCE
)
35 $(UCLIBC_DIR
)/.unpacked
: $(DL_DIR
)/$(UCLIBC_SOURCE
)
36 ifeq ($(SOFT_FLOAT
),true
)
37 # Make sure we have a soft float specs file for this arch
38 if
[ ! -f
$(SOURCE_DIR
)/specs-
$(ARCH
)-soft-float
] ; then \
39 echo soft float configured but no specs file for this arch
; \
43 bzcat
$(DL_DIR
)/$(UCLIBC_SOURCE
) |
tar -C
$(BUILD_DIR
) -xvf
-
44 #(cd $(BUILD_DIR) ; ln -s $(DL_DIR)/uClibc)
46 #(cd $(DL_DIR)/uClibc && tar cf - .) | (cd $(UCLIBC_DIR) && tar xvfp - )
47 ifeq ($(strip $(USE_UCLIBC_LDSO_0_9_24
)),true
)
48 $(SOURCE_DIR
)/patch-kernel.sh
$(UCLIBC_DIR
) $(SOURCE_DIR
) uClibc-ldso-0.9
.24.patch
50 touch
$(UCLIBC_DIR
)/.unpacked
52 $(UCLIBC_DIR
)/.configured
: $(UCLIBC_DIR
)/.unpacked
$(LINUX_DIR
)/.configured
53 $(SED
) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(UCLIBC_DIR
)/Rules.mak
54 ifeq ($(ENABLE_LOCALE
),true
)
55 cp
$(SOURCE_DIR
)/uClibc.config-locale
$(UCLIBC_DIR
)/.config
57 cp
$(SOURCE_DIR
)/uClibc.config
$(UCLIBC_DIR
)/.config
59 $(SED
) 's,^.*TARGET_$(UCLIBC_TARGET_ARCH).*,TARGET_$(UCLIBC_TARGET_ARCH)=y,g' \
61 $(SED
) 's,^TARGET_ARCH.*,TARGET_ARCH=\"$(UCLIBC_TARGET_ARCH)\",g' $(UCLIBC_DIR
)/.config
62 $(SED
) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_DIR)\",g' \
64 $(SED
) 's,^RUNTIME_PREFIX=.*,RUNTIME_PREFIX=\"/\",g' \
66 $(SED
) 's,^DEVEL_PREFIX=.*,DEVEL_PREFIX=\"/usr/\",g' \
68 $(SED
) 's,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX=\"/lib\",g' \
70 ifeq ($(strip $(BUILD_WITH_LARGEFILE
)),true
)
71 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' $(UCLIBC_DIR
)/.config
73 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' $(UCLIBC_DIR
)/.config
75 $(SED
) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(UCLIBC_DIR
)/.config
76 ifeq ($(strip $(SOFT_FLOAT
)),true
)
77 $(SED
) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(UCLIBC_DIR
)/.config
79 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/usr
/include
80 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/usr
/lib
81 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/lib
82 $(MAKE
) -C
$(UCLIBC_DIR
) \
83 PREFIX
=$(TOOL_BUILD_DIR
)/uClibc_dev
/ \
85 RUNTIME_PREFIX
=$(TOOL_BUILD_DIR
)/uClibc_dev
/ \
88 touch
$(UCLIBC_DIR
)/.configured
90 $(UCLIBC_DIR
)/lib
/libc.a
: $(UCLIBC_DIR
)/.configured
$(LIBFLOAT_TARGET
)
91 $(MAKE
) -C
$(UCLIBC_DIR
) \
93 DEVEL_PREFIX
=$(REAL_GNU_TARGET_NAME
)/ \
97 ifeq ($(strip $(USE_UCLIBC_LDSO_0_9_24
)),true
)
98 #rm -rf $(UCLIBC_DIR)/ld-uClibc* $(UCLIBC_DIR)/libdl*
99 $(MAKE
) -C
$(UCLIBC_DIR
)/ldso-0.9
.24 \
101 DEVEL_PREFIX
=$(REAL_GNU_TARGET_NAME
)/ \
107 $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
/libc.a
: $(UCLIBC_DIR
)/lib
/libc.a
108 $(MAKE
) -C
$(UCLIBC_DIR
) \
109 PREFIX
=$(STAGING_DIR
)/ \
110 DEVEL_PREFIX
=$(REAL_GNU_TARGET_NAME
)/ \
111 RUNTIME_PREFIX
=$(REAL_GNU_TARGET_NAME
)/ \
113 $(MAKE
) -C
$(UCLIBC_DIR
) \
114 PREFIX
=$(STAGING_DIR
)/ \
115 DEVEL_PREFIX
=$(REAL_GNU_TARGET_NAME
)/ \
116 RUNTIME_PREFIX
=$(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/ \
118 $(MAKE
) -C
$(UCLIBC_DIR
) \
119 PREFIX
=$(STAGING_DIR
) \
122 # Clean up the host compiled utils...
123 $(MAKE
) -C
$(UCLIBC_DIR
)/utils
clean
125 ifneq ($(TARGET_DIR
),)
126 $(TARGET_DIR
)/lib
/libc.so
.0: $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
/libc.a
127 $(MAKE
) -C
$(UCLIBC_DIR
) \
128 PREFIX
=$(TARGET_DIR
) \
133 $(TARGET_DIR
)/usr
/bin
/ldd
: $(TARGET_DIR
)/lib
/libc.so
.0
134 $(MAKE
) -C
$(UCLIBC_DIR
) $(TARGET_CONFIGURE_OPTS
) \
135 PREFIX
=$(TARGET_DIR
) utils install_utils
137 UCLIBC_TARGETS
=$(TARGET_DIR
)/lib
/libc.so
.0 $(TARGET_DIR
)/usr
/bin
/ldd
140 uclibc-configured
: $(UCLIBC_DIR
)/.configured
142 uclibc
: $(STAGING_DIR
)/bin
/$(REAL_GNU_TARGET_NAME
)-gcc
$(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
/libc.a \
145 uclibc-source
: $(DL_DIR
)/$(UCLIBC_SOURCE
)
147 uclibc-configured-source
: uclibc-source
150 -$(MAKE
) -C
$(UCLIBC_DIR
) clean
151 rm -f
$(UCLIBC_DIR
)/.config
159 #############################################################
161 # uClibc for the target just needs its header files
162 # and whatnot installed.
164 #############################################################
166 $(TARGET_DIR
)/usr
/lib
/libc.a
: $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
/libc.a
167 $(MAKE
) -C
$(UCLIBC_DIR
) \
168 PREFIX
=$(TARGET_DIR
) \
173 ifeq ($(GCC_2_95_TOOLCHAIN
),true
)
174 uclibc_target
: gcc2_95 uclibc
$(TARGET_DIR
)/usr
/lib
/libc.a
176 uclibc_target
: gcc3_3 uclibc
$(TARGET_DIR
)/usr
/lib
/libc.a
180 rm -f
$(TARGET_DIR
)/include
182 uclibc_target-dirclean
:
183 rm -f
$(TARGET_DIR
)/include