Installer-Toolchain nochmals ueberarbeitet.
[people/teissler/ipfire-2.x.git] / lfs / uClibc
index 26bb27f24e2a55b7ec10f7854d0537204d2c2d16..166e1aa5ce529f1102b905d1d460625f01ba39df 100644 (file)
@@ -50,13 +50,13 @@ STAGING_DIR=/opt/$(MACHINE)-uClibc
 
 objects = $(DL_FILE) buildroot-snapshot-20061026.tar.bz2 uClibc-locale-030818.tgz
 
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-buildroot-snapshot-20061026.tar.bz2 = $(DL_FROM)/buildroot-snapshot-20061026.tar.bz2
-uClibc-locale-030818.tgz = $(DL_FROM)/uClibc-locale-030818.tgz
+$(DL_FILE)                                     = $(DL_FROM)/$(DL_FILE)
+buildroot-snapshot-20061026.tar.bz2    = $(DL_FROM)/buildroot-snapshot-20061026.tar.bz2
+uClibc-locale-030818.tgz                       = $(DL_FROM)/uClibc-locale-030818.tgz
 
-$(DL_FILE)_MD5 = 1ada58d919a82561061e4741fb6abd29
-buildroot-snapshot-20061026.tar.bz2_MD5 = ecc5d48a780e46a56d1d39207d5868bd
-uClibc-locale-030818.tgz_MD5 = d75b2239b4e27c3c9cbed1c8f6eabba6
+$(DL_FILE)_MD5                         = 1ada58d919a82561061e4741fb6abd29
+buildroot-snapshot-20061026.tar.bz2_MD5        = ecc5d48a780e46a56d1d39207d5868bd
+uClibc-locale-030818.tgz_MD5           = d75b2239b4e27c3c9cbed1c8f6eabba6
 
 install : $(TARGET)
 
@@ -87,18 +87,42 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
 ifeq "$(PASS)" "1"
        @rm -rf $(DIR_APP)
-       @mkdir -p /opt/$(MACHINE)-uClibc
+       @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 CROSS= PREFIX=$(STAGING_DIR) oldconfig
-       cd $(DIR_APP) && make CROSS= PREFIX=$(STAGING_DIR) pregen headers install_dev
-#      cd $(DIR_APP)/extra/locale && make
+       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) && CROSS=$(MACHINE)-linux-uclibc- PREFIX=/opt/$(MACHINE)-uClibc make all install
+       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
@@ -106,12 +130,7 @@ ifeq "$(PASS)" "2"
        cd /lib && ln -sf libc.so.0 libc.so
        ln -sf /opt/$(MACHINE)-uClibc/lib/libm-$(VER).so /lib/libm.so.0
 else
-       cd /opt/$(MACHINE)-uClibc/bin && for i in `ls -w1 $(MACHINE)-linux-uclibc-*`; do \
-               ln -sf $$i $(MACHINE)-linux-`echo $$i | cut -c 19-`; \
-       done
-       ln -sf $(MACHINE)-linux-uclibc /opt/$(MACHINE)-uClibc/$(MACHINE)-linux
-       ln -sf gcc /opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc/bin/cc
-       cd $(DIR_APP) && make RUNTIME_PREFIX=/install/initrd/ install_runtime
+       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*}
        @rm -rf $(DIR_APP)