- @rm -rf /opt/$(MACHINE)-uClibc
- @mkdir -p $(DIR_APP)
- cd $(DIR_APP) && cp -R $(DIR_SRC)/src/uClibc/* .
- cd $(DIR_APP) && sed -i -e 's/ARCH:=i386/ARCH:=$(MACHINE)/' Makefile
- cd $(DIR_APP) && chmod +x sources/patch-kernel.sh
- cd $(DIR_APP) && make
- -mkdir -p /install/initrd/bin
- cd $(DIR_APP)/toolchain_build_$(MACHINE)/$(THISAPP) && make PREFIX=/install/initrd install_runtime
+ @mkdir -p /opt/$(MACHINE)-uClibc $(DIR_SRC)/uClibc_dev/usr/include $(DIR_SRC)/uClibc_dev/{,usr}/lib
+ @cd $(DIR_SRC) && tar xfj $(DIR_DL)/$(DL_FILE)
+ cp -f $(DIR_DL)/uClibc-locale-030818.tgz $(DIR_APP)/extra/locale/
+ cp -f $(DIR_SRC)/config/uClibc/{locales,codesets}.txt $(DIR_APP)/extra/locale
+ cd $(DIR_APP)/extra/locale && patch -Np3 < $(DIR_SRC)/src/patches/uClibc-gcc4-genwctype.patch
+ cp -f $(DIR_SRC)/config/uClibc/uClibc.config-$(MACHINE) $(DIR_APP)/.config
+ cd $(DIR_APP) && make oldconfig
+ cd $(DIR_APP)/extra/locale && make
+ cd $(DIR_APP) && make PREFIX=$(DIR_SRC)/uClibc_dev \
+ DEVEL_PREFIX=/usr/ \
+ RUNTIME_PREFIX=$(DIR_SRC)/uClibc_dev/ \
+ pregen install_dev
+else
+ifeq "$(PASS)" "2"
+ cd $(DIR_APP) && make PREFIX= \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
+ all
+ cd $(DIR_APP) && make PREFIX= \
+ DEVEL_PREFIX=/opt/$(MACHINE)-uClibc/ \
+ RUNTIME_PREFIX=/opt/$(MACHINE)-uClibc/ \
+ install_runtime install_dev
+
+ ## This is to fix a small bug
+ if [ ! -h /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib ]; then \
+ mv -vf /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib/* /opt/$(MACHINE)-uClibc/lib/; \
+ rm -rf /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib; \
+ ln -sfv ../lib /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/lib; \
+ fi
+
+ cd $(DIR_APP) && make -C utils/ PREFIX=/opt/$(MACHINE)-uClibc \
+ hostutils
+ cd $(DIR_APP) && make PREFIX=/install/initrd \
+ DEVEL_PREFIX=/usr/ \
+ RUNTIME_PREFIX=/ \
+ install_runtime
+ cp -f /opt/$(MACHINE)-uClibc/lib/ld-uClibc-$(VER).so /lib
+ cp -f /opt/$(MACHINE)-uClibc/lib/libuClibc-$(VER).so /lib
+ cd /lib && ln -sf ld-uClibc-$(VER).so ld-uClibc.so.0
+ cd /lib && ln -sf libuClibc-$(VER).so libc.so.0
+ cd /lib && ln -sf libc.so.0 libc.so
+ ln -sf /opt/$(MACHINE)-uClibc/lib/libm-$(VER).so /lib/libm.so.0
+else
+ cd $(DIR_APP) && make PREFIX=/install/initrd utils install_utils
+ chmod 755 /install/initrd/lib/libuClibc-$(VER).so
+ rm -f /install/initrd/lib/{libm*,libcrypt*,libutil*,librt*}