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 $(SOURCE_DIR
)/patch-kernel.sh
$(UCLIBC_DIR
) $(SOURCE_DIR
) uClibc-ftruncate.patch
51 touch
$(UCLIBC_DIR
)/.unpacked
53 $(UCLIBC_DIR
)/.configured
: $(UCLIBC_DIR
)/.unpacked
$(LINUX_DIR
)/.configured
54 $(SED
) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(UCLIBC_DIR
)/Rules.mak
55 ifeq ($(ENABLE_LOCALE
),true
)
56 cp
$(SOURCE_DIR
)/uClibc.config-locale
$(UCLIBC_DIR
)/.config
58 cp
$(SOURCE_DIR
)/uClibc.config
$(UCLIBC_DIR
)/.config
60 $(SED
) 's,^.*TARGET_$(UCLIBC_TARGET_ARCH).*,TARGET_$(UCLIBC_TARGET_ARCH)=y,g' \
62 $(SED
) 's,^TARGET_ARCH.*,TARGET_ARCH=\"$(UCLIBC_TARGET_ARCH)\",g' $(UCLIBC_DIR
)/.config
63 $(SED
) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_DIR)\",g' \
65 $(SED
) 's,^RUNTIME_PREFIX=.*,RUNTIME_PREFIX=\"/\",g' \
67 $(SED
) 's,^DEVEL_PREFIX=.*,DEVEL_PREFIX=\"/usr/\",g' \
69 $(SED
) 's,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX=\"/lib\",g' \
71 ifeq ($(strip $(BUILD_WITH_LARGEFILE
)),true
)
72 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' $(UCLIBC_DIR
)/.config
74 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' $(UCLIBC_DIR
)/.config
76 $(SED
) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(UCLIBC_DIR
)/.config
77 ifeq ($(strip $(SOFT_FLOAT
)),true
)
78 $(SED
) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(UCLIBC_DIR
)/.config
80 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/usr
/include
81 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/usr
/lib
82 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/lib
83 $(MAKE
) -C
$(UCLIBC_DIR
) \
84 PREFIX
=$(TOOL_BUILD_DIR
)/uClibc_dev
/ \
86 RUNTIME_PREFIX
=$(TOOL_BUILD_DIR
)/uClibc_dev
/ \
89 touch
$(UCLIBC_DIR
)/.configured
91 $(UCLIBC_DIR
)/lib
/libc.a
: $(UCLIBC_DIR
)/.configured
$(LIBFLOAT_TARGET
)
92 $(MAKE
) -C
$(UCLIBC_DIR
) \
94 DEVEL_PREFIX
=$(REAL_GNU_TARGET_NAME
)/ \
98 ifeq ($(strip $(USE_UCLIBC_LDSO_0_9_24
)),true
)
99 #rm -rf $(UCLIBC_DIR)/ld-uClibc* $(UCLIBC_DIR)/libdl*
100 $(MAKE
) -C
$(UCLIBC_DIR
)/ldso-0.9
.24 \
102 DEVEL_PREFIX
=$(REAL_GNU_TARGET_NAME
)/ \
108 $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
/libc.a
: $(UCLIBC_DIR
)/lib
/libc.a
109 $(MAKE
) -C
$(UCLIBC_DIR
) \
110 PREFIX
=$(STAGING_DIR
)/ \
111 DEVEL_PREFIX
=$(REAL_GNU_TARGET_NAME
)/ \
112 RUNTIME_PREFIX
=$(REAL_GNU_TARGET_NAME
)/ \
114 $(MAKE
) -C
$(UCLIBC_DIR
) \
115 PREFIX
=$(STAGING_DIR
)/ \
116 DEVEL_PREFIX
=$(REAL_GNU_TARGET_NAME
)/ \
117 RUNTIME_PREFIX
=$(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/ \
119 $(MAKE
) -C
$(UCLIBC_DIR
) \
120 PREFIX
=$(STAGING_DIR
) \
123 # Clean up the host compiled utils...
124 $(MAKE
) -C
$(UCLIBC_DIR
)/utils
clean
126 ifneq ($(TARGET_DIR
),)
127 $(TARGET_DIR
)/lib
/libc.so
.0: $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
/libc.a
128 $(MAKE
) -C
$(UCLIBC_DIR
) \
129 PREFIX
=$(TARGET_DIR
) \
134 $(TARGET_DIR
)/usr
/bin
/ldd
: $(TARGET_DIR
)/lib
/libc.so
.0
135 $(MAKE
) -C
$(UCLIBC_DIR
) $(TARGET_CONFIGURE_OPTS
) \
136 PREFIX
=$(TARGET_DIR
) utils install_utils
138 UCLIBC_TARGETS
=$(TARGET_DIR
)/lib
/libc.so
.0 $(TARGET_DIR
)/usr
/bin
/ldd
141 uclibc-configured
: $(UCLIBC_DIR
)/.configured
143 uclibc
: $(STAGING_DIR
)/bin
/$(REAL_GNU_TARGET_NAME
)-gcc
$(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
/libc.a \
146 uclibc-source
: $(DL_DIR
)/$(UCLIBC_SOURCE
)
148 uclibc-configured-source
: uclibc-source
151 -$(MAKE
) -C
$(UCLIBC_DIR
) clean
152 rm -f
$(UCLIBC_DIR
)/.config
160 #############################################################
162 # uClibc for the target just needs its header files
163 # and whatnot installed.
165 #############################################################
167 $(TARGET_DIR
)/usr
/lib
/libc.a
: $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
/libc.a
168 $(MAKE
) -C
$(UCLIBC_DIR
) \
169 PREFIX
=$(TARGET_DIR
) \
174 ifeq ($(GCC_2_95_TOOLCHAIN
),true
)
175 uclibc_target
: gcc2_95 uclibc
$(TARGET_DIR
)/usr
/lib
/libc.a
177 uclibc_target
: gcc3_3 uclibc
$(TARGET_DIR
)/usr
/lib
/libc.a
181 rm -f
$(TARGET_DIR
)/include
183 uclibc_target-dirclean
:
184 rm -f
$(TARGET_DIR
)/include