From: Michael Tremer Date: Sun, 25 May 2008 16:21:58 +0000 (+0200) Subject: Finally reordered the uClibc-toolchain. X-Git-Tag: v3.0-alpha1~1011 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ef6f206d64cbf5e1ef8b2f94eb37c139cca2abf;p=ipfire-3.x.git Finally reordered the uClibc-toolchain. --- diff --git a/config/uClibc/.config b/config/uClibc/.config index 8b9154208..4f67920e9 100644 --- a/config/uClibc/.config +++ b/config/uClibc/.config @@ -182,9 +182,9 @@ UCLIBC_HAS_GLOB=y # # Library Installation Options # -SHARED_LIB_LOADER_PREFIX="$(DEVEL_PREFIX)/lib" -RUNTIME_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/" -DEVEL_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/usr/" +SHARED_LIB_LOADER_PREFIX="/lib/" +RUNTIME_PREFIX="/" +DEVEL_PREFIX="/usr/" # # Security options diff --git a/lfs/Config b/lfs/Config index 38a032e24..614a5b2c2 100644 --- a/lfs/Config +++ b/lfs/Config @@ -65,7 +65,8 @@ DIR_PATCHES = $(DIR_DL) DIR_CONFIG = $(DIR_CONF) DIR_SOURCE = $(DIR_SRC)/src -KGCC = gcc +HOST_GCC="/usr/bin/gcc" +KGCC=$(HOST_GCC) ifeq "$(STAGE)" "toolchain" ifneq "$(MACHINE_REAL)" "$(MACHINE)" @@ -81,6 +82,20 @@ endif endif endif +ifeq "$(STAGE)" "installer" + UCLIBC_HEADERS_DIR=$(UCLIBC_SYSROOT_DIR)/usr/include + U_CC="${UCLIBC_TARGET}-gcc" + U_CXX="${UCLIBC_TARGET}-g++" + U_AR="${UCLIBC_TARGET}-ar" + U_AS="${UCLIBC_TARGET}-as" + U_RANLIB="${UCLIBC_TARGET}-ranlib" + U_LD="${UCLIBC_TARGET}-ld" + U_STRIP="${UCLIBC_TARGET}-strip" + U_TOOLS=CC=$(U_CC) CXX=$(U_CXX) AR=$(U_AR) \ + AS=$(U_AS) RANLIB=$(U_RANLIB) \ + LD=$(U_LD) STRIP=$(U_STRIP) +endif + ############################################################################### # Common Macro Definitions ############################################################################### @@ -91,7 +106,7 @@ endif define FIND_FILES cd $(LFS)/ && $(TOOLS_DIR)/bin/find -mount \ -not -path '.$(TOOLS_DIR)*' -not -path './tmp*' -not -path './usr/src*' \ - -not -path './dev*' -not -path './proc*' -not -path './sys*' -not -path './install*' + -not -path './dev*' -not -path './proc*' -not -path './sys*' endef # This is common starting logic for builds. diff --git a/lfs/adjust-toolchain b/lfs/adjust-toolchain index 551e95658..438aef4e6 100644 --- a/lfs/adjust-toolchain +++ b/lfs/adjust-toolchain @@ -77,15 +77,4 @@ ifeq "$(STAGE)" "base" `dirname $$(gcc --print-libgcc-file-name)`/specs endif -ifeq "$(STAGE)" "installer" - #$(UCLIBC_TARGET)-gcc -dumpspecs \ - # > $$($(UCLIBC_TARGET)-gcc --print-file specs) - #sed -e 's/%{shared:-lc}/%{!nointl: -lintl} &/' \ - # -i $$($(UCLIBC_TARGET)-gcc --print-file specs) - mv -v $(UCLIBC_DIR)/$(UCLIBC_TARGET)/bin/{ld,ld-old} - mv -v $(UCLIBC_DIR)/$(UCLIBC_TARGET)/bin/{ld-new,ld} - ln -sfv ../$(UCLIBC_TARGET)/bin/ld \ - $(UCLIBC_DIR)/bin/$(UCLIBC_TARGET)-ld -endif - @$(POSTBUILD) diff --git a/lfs/bash b/lfs/bash index cabfb79aa..4fe7d2d80 100644 --- a/lfs/bash +++ b/lfs/bash @@ -80,5 +80,17 @@ ifeq "$(STAGE)" "base" cd $(DIR_APP) && make install endif +ifeq "$(STAGE)" "installer" + cd $(DIR_APP) && patch -Np1 < $(DIR_PATCHES)/$(THISAPP)-fixes-7.patch + cd $(DIR_APP) && ./configure --prefix=/usr \ + --target=$(UCLIBC_TARGET) \ + --host=$(UCLIBC_TARGET) \ + --bindir=/bin \ + --without-bash-malloc \ + #--with-installed-readline + cd $(DIR_APP) && make -j $(PARALLELISM) + cd $(DIR_APP) && make install DESTDIR=$(INSTALLER_DIR) +endif + @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/lfs/binutils b/lfs/binutils index cfed808fb..fb930db90 100644 --- a/lfs/binutils +++ b/lfs/binutils @@ -146,19 +146,22 @@ ifeq "$(STAGE)" "base" endif ifeq "$(STAGE)" "installer" - cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-uClibc-1.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-ld_makefile.patch cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure \ + --target=$(UCLIBC_TARGET) \ --prefix=$(UCLIBC_DIR) \ - --disable-shared \ - --disable-nls \ - --target=$(UCLIBC_TARGET) + --with-sysroot=$(UCLIBC_SYSROOT_DIR) \ + --disable-multilib \ + --disable-werror \ + --disable-nls cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM) cd $(DIR_SRC)/binutils-build && make install - cd $(DIR_SRC)/binutils-build && make -C ld clean - cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/ulib - cd $(DIR_SRC)/binutils-build && cp -fv ld/ld-new \ - $(UCLIBC_DIR)/$(UCLIBC_TARGET)/bin + + for t in ar as ld strip; do \ + ln -sfv $(UCLIBC_DIR)/bin/$(UCLIBC_TARGET)-$${t} \ + $(UCLIBC_CC_CORE_STATIC_DIR)/$(UCLIBC_TARGET)/bin/$${t}; \ + ln -sfv $(UCLIBC_DIR)/bin/$(UCLIBC_TARGET)-$${t} \ + $(UCLIBC_CC_CORE_STATIC_DIR)/bin/$(UCLIBC_TARGET)-$${t}; \ + done endif @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build diff --git a/lfs/busybox b/lfs/busybox index 5a4bc8a10..bb5c69e0f 100644 --- a/lfs/busybox +++ b/lfs/busybox @@ -53,28 +53,25 @@ $(patsubst %,$(DIR_DL)/%,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && cp -f $(DIR_CONFIG)/$(PKG_NAME)/.config .config - sed -e "s@^CONFIG_PREFIX=.*@CONFIG_PREFIX=\"$(UCLIBC_DIR)\"@g" \ + cd $(DIR_APP) && cp -vf $(DIR_CONFIG)/$(PKG_NAME)/.config .config + sed -e "s@^CONFIG_PREFIX=.*@CONFIG_PREFIX=\"$(INSTALLER_DIR)\"@g" \ -i $(DIR_APP)/.config cd $(DIR_APP) && make ARCH=i386 \ CROSS_COMPILE=$(UCLIBC_TARGET)- \ CROSS=$(UCLIBC_TARGET)- \ - CC="ccache $(UCLIBC_TARGET)-gcc" \ oldconfig cd $(DIR_APP) && make ARCH=i386 \ CROSS_COMPILE=$(UCLIBC_TARGET)- \ CROSS=$(UCLIBC_TARGET)- \ - CC="ccache $(UCLIBC_TARGET)-gcc" \ -j $(PARALLELISM) cd $(DIR_APP) && make ARCH=i386 \ CROSS_COMPILE=$(UCLIBC_TARGET)- \ CROSS=$(UCLIBC_TARGET)- \ - CC="ccache $(UCLIBC_TARGET)-gcc" \ - PREFIX=$(UCLIBC_DIR) \ + PREFIX=$(INSTALLER_DIR) \ install - @rm -f $(UCLIBC_DIR)/linuxrc - -mkdir -p $(UCLIBC_DIR)/usr/share/udhcpc/ + -rm -vf $(INSTALLER_DIR)/linuxrc + -mkdir -p $(INSTALLER_DIR)/usr/share/udhcpc/ install -m 755 -v $(DIR_CONF)/busybox/default.script \ - $(UCLIBC_DIR)/usr/share/udhcpc/ + $(INSTALLER_DIR)/usr/share/udhcpc/ @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/lfs/cpio b/lfs/cpio index 1295995d7..e4c7ca3ff 100644 --- a/lfs/cpio +++ b/lfs/cpio @@ -56,20 +56,22 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) ifeq "$(STAGE)" "ipfire" cd $(DIR_APP) && ./configure CPIO_MT_PROG=mt --prefix=/usr \ - --bindir=/bin --libexecdir=/tmp \ - --with-rmt=/usr/sbin/rmt + --bindir=/bin --libexecdir=/tmp \ + --with-rmt=/usr/sbin/rmt cd $(DIR_APP) && make -j $(PARALLELISM) cd $(DIR_APP) && make install endif ifeq "$(STAGE)" "installer" - cd $(DIR_APP) && ./configure CPIO_MT_PROG=mt --prefix=/usr \ - --bindir=/bin --libexecdir=/tmp \ - --with-rmt=/usr/sbin/rmt \ - --build=$(IFS_TARGET) \ - --host=$(UCLIBC_TARGET) + cd $(DIR_APP) && ./configure CPIO_MT_PROG=mt \ + --prefix=/usr \ + --target=$(UCLIBC_TARGET) \ + --host=$(UCLIBC_TARGET) + --bindir=/bin --libexecdir=/tmp \ + --with-rmt=/usr/sbin/rmt \ + --disable-nls cd $(DIR_APP) && make -j $(PARALLELISM) - cd $(DIR_APP) && make install DESTDIR=$(UCLIBC_DIR) + cd $(DIR_APP) && make install DESTDIR=$(INSTALLER_DIR) endif @rm -rf $(DIR_APP) diff --git a/lfs/e2fsprogs b/lfs/e2fsprogs index 70fabceca..d4fc571d9 100644 --- a/lfs/e2fsprogs +++ b/lfs/e2fsprogs @@ -76,14 +76,14 @@ ifeq "$(STAGE)" "installer" cd $(DIR_APP)/build && ../configure --prefix=/usr \ --with-root-prefix="" \ --enable-elf-shlibs \ - --build=$(IFS_TARGET) \ + --target=$(UCLIBC_TARGET) \ --host=$(UCLIBC_TARGET) \ - --with-cc=$(UCLIBC_TARGET)-gcc \ - --with-linker=$(UCLIBC_TARGET)-ld + --with-cc=$(U_CC) \ + --with-linker=$(U_LD) cd $(DIR_APP)/build && make -j $(PARALLELISM) - cd $(DIR_APP)/build && make install install-libs DESTDIR=$(UCLIBC_DIR) + cd $(DIR_APP)/build && make install install-libs DESTDIR=$(INSTALLER_DIR) for lib in libblkid.so.1 libcom_err.so.2 libe2p.so.2 libext2fs.so.2 libss.so.2 libuuid.so.1; do \ - ln -svf $$lib $(UCLIBC_DIR)/lib/$$(awk -F. '{ print $$1"."$$2 }' <<< $$lib) || exit 1; \ + ln -svf $$lib $(INSTALLER_DIR)/lib/$$(awk -F. '{ print $$1"."$$2 }' <<< $$lib) || exit 1; \ done endif diff --git a/lfs/gcc b/lfs/gcc index dd3113297..766152119 100644 --- a/lfs/gcc +++ b/lfs/gcc @@ -30,7 +30,7 @@ VER = 4.2.3 THISAPP = $(PKG_NAME)-$(VER) DL_FILE = $(THISAPP).tar.bz2 DIR_APP = $(DIR_SRC)/$(THISAPP) -CFLAGS = +CFLAGS = -pipe CXXFLAGS = ifeq "$(STAGE)" "toolchain" @@ -54,7 +54,7 @@ endif objects = $(DL_FILE) \ $(THISAPP)-cross_search_paths-1.patch \ $(THISAPP)-specs-1.patch \ - $(THISAPP)-uClibc-conf-1.conf + $(THISAPP)-uClibc-1.patch install : $(TARGET) @@ -235,52 +235,53 @@ ifeq "$(STAGE)" "base" endif ifeq "$(STAGE)" "installer" - cd $(DIR_APP) && patch -p1 -i $(DIR_PATCHES)/$(THISAPP)-uClibc-conf-1.conf - sed -e "s@/lib/ld-uClibc.so.0@$(UCLIBC_LINKER)@g" -i $(DIR_APP)/gcc/config/linux.h - echo -e "\n#undef STARTFILE_PREFIX_SPEC\n#define STARTFILE_PREFIX_SPEC \"$(UCLIBC_DIR)/lib/\"" \ - >> $(DIR_APP)/gcc/config/linux.h + cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-uClibc-1.patch ifeq "$(PASS)" "1" - cd $(DIR_APP) && sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 $(UCLIBC_DIR)/include@g" \ - -i gcc/Makefile.in - touch ${UCLIBC_LINKER} - cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure \ - --prefix=$(UCLIBC_DIR) \ + ### Copying headers to install area of bootstrap gcc, + # so it can build libgcc2 + mkdir -pv $(UCLIBC_CC_CORE_STATIC_DIR)/$(UCLIBC_TARGET)/include + cp -rfv $(UCLIBC_HEADERS_DIR)/* $(UCLIBC_CC_CORE_STATIC_DIR)/$(UCLIBC_TARGET)/include + + cd $(DIR_SRC)/gcc-build && CC_FOR_BUILD="$(HOST_GCC)" ../$(THISAPP)/configure \ --target=$(UCLIBC_TARGET) \ + --prefix=$(UCLIBC_CC_CORE_STATIC_DIR) \ + --with-local-prefix=$(UCLIBC_SYSROOT_DIR) \ + --disable-multilib \ + --with-newlib \ + --with-sysroot=$(UCLIBC_SYSROOT_DIR) \ + --enable-__cxa_atexit \ --disable-nls \ - --disable-shared \ + --enable-threads=no \ + --enable-symvers=gnu \ --enable-languages=c \ - --disable-__cxa_atexit \ - --enable-target-optspace \ - --with-gnu-ld \ - --disable-multilib \ - --disable-libmudflap \ - --disable-libgomp - cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM) - cd $(DIR_SRC)/gcc-build && make install + --disable-shared \ + --enable-target-optspace + cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM) all-gcc + cd $(DIR_SRC)/gcc-build && make install-gcc endif ifeq "$(PASS)" "2" - cd $(DIR_APP) && sed -e 's/%{shared:-lc}/%{!nointl: -lintl} &/' \ - -i gcc/config/linux.h - cd $(DIR_APP) && cp -v gcc/Makefile.in{,.tmp} - #cd $(DIR_APP) && sed 's/^XCFLAGS =$$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp \ - # > gcc/Makefile.in - cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure \ - --prefix=$(UCLIBC_DIR) \ + cd $(DIR_SRC)/gcc-build && CC_FOR_BUILD="$(HOST_GCC)" ../$(THISAPP)/configure \ --target=$(UCLIBC_TARGET) \ - --libexecdir=/ulib \ - --enable-shared \ - --disable-__cxa_atexit \ - --enable-target-optspace \ - --enable-languages=c,c++ \ + --prefix=$(UCLIBC_DIR) \ + --with-local-prefix=$(UCLIBC_SYSROOT_DIR) \ --disable-multilib \ - --disable-libmudflap \ - --disable-libgomp \ - --with-gnu-ld \ - --disable-nls + --with-sysroot=$(UCLIBC_SYSROOT_DIR) \ + --enable-__cxa_atexit \ + --disable-nls \ + --enable-threads=posix \ + --enable-symvers=gnu \ + --enable-c99 \ + --enable-long-long \ + --enable-languages=c,c++ \ + --enable-target-optspace \ + --enable-shared cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM) cd $(DIR_SRC)/gcc-build && make install - ln -svf gcc $(UCLIBC_DIR)/$(UCLIBC_TARGET)/bin/cc + + ln -svf $(UCLIBC_DIR)/bin/$(UCLIBC_TARGET)-gcc \ + $(UCLIBC_DIR)/bin/$(UCLIBC_TARGET)-cc + cp -vaf $(UCLIBC_DIR)/$(UCLIBC_TARGET)/lib/* $(UCLIBC_SYSROOT_DIR)/usr/lib endif endif diff --git a/lfs/gettext b/lfs/gettext index 84d3f65e2..114f94893 100644 --- a/lfs/gettext +++ b/lfs/gettext @@ -31,11 +31,7 @@ THISAPP = $(PKG_NAME)-$(VER) DL_FILE = $(THISAPP).tar.gz DIR_APP = $(DIR_SRC)/$(THISAPP) -ifeq "$(STAGE)" "installer" - TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS) -else - TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP) -endif +TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP) ############################################################################### # Top-level Rules @@ -71,15 +67,17 @@ ifeq "$(STAGE)" "base" cd $(DIR_APP) && make install endif -ifeq "$(STAGE)" "installer" # Do this in pass 1 and 2 - cd $(DIR_APP)/gettext-runtime && CC=$(UCLIBC_TARGET)-gcc ./configure \ - --prefix=$(UCLIBC_DIR) \ +ifeq "$(STAGE)" "installer" + cd $(DIR_APP)/gettext-runtime && $(U_TOOLS) ./configure \ + --prefix=/usr \ + --target=$(UCLIBC_TARGET) \ --host=$(UCLIBC_TARGET) \ --with-included-gettext \ --without-csharp \ --disable-libasprintf cd $(DIR_APP)/gettext-runtime && make -C intl/ -j $(PARALLELISM) - cd $(DIR_APP)/gettext-runtime && make -C intl/ install + cd $(DIR_APP)/gettext-runtime && make -C intl/ install \ + DESTDIR=$(INSTALLER_DIR) endif @rm -rf $(DIR_APP) diff --git a/lfs/initramfs b/lfs/initramfs index 197db8725..c8dfd8b95 100644 --- a/lfs/initramfs +++ b/lfs/initramfs @@ -31,6 +31,9 @@ THISAPP = $(PKG_NAME)-$(VER) TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP) +COMPRESS_CMD = gzip -9 +#COMPRESS_CMD = lzma -si -so + ############################################################################### # Top-level Rules ############################################################################### @@ -45,55 +48,18 @@ download : $(TARGET) : @rm -rf $(INSTALLER_DIR) - -mkdir -p $(INSTALLER_DIR)/{bin,sbin,lib,dev,etc,mnt/{source,target}} - -mkdir -p $(INSTALLER_DIR)/{root,proc,tmp,sys,var/run} find $(DIR_SOURCE)/rootfiles/installer -maxdepth 1 -type f | xargs cat | \ - grep -v ^# | sed -e "s@UCLIBC_DIR@@g" | cut -c 2- | sort | uniq \ + grep -v ^# | sed -e "s@INSTALLER_DIR@@g" | cut -c 2- | sort | uniq \ > $(INSTALLER_DIR)/archive.files - cd $(UCLIBC_DIR) && cpio -pdl $(INSTALLER_DIR) \ - < $(INSTALLER_DIR)/archive.files 2>$(INSTALLER_DIR)/archive.errors + cd $(INSTALLER_DIR) && cpio -o -H newc \ + < $(INSTALLER_DIR)/archive.files 2>$(INSTALLER_DIR)/archive.errors \ + | $(COMPRESS_CMD) > $(IMAGES_DIR)/initramfs-$(VERSION).img @cat $(INSTALLER_DIR)/archive.errors @if grep -q "No such file or directory" < $(INSTALLER_DIR)/archive.errors; then \ exit 1; \ fi - # Remove precompiled python modules to keep everything small - find $(INSTALLER_DIR) -name *.pyc -exec rm -rf {} \; - #find $(INSTALLER_DIR) -name *.pyo -exec rm -rf {} \; - - @rm -f $(INSTALLER_DIR)/archive.{files,errors} - - ### kernel modules - # - -mkdir -p $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/{drivers,fs,lib/lzo} - cp -af \ - /lib/modules/$(KVER)/kernel/drivers/{ata,block,cdrom,dma,firewire} \ - /lib/modules/$(KVER)/kernel/drivers/{hid,ide,net,pcmcia,scsi,ssb,usb} \ - $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/drivers - cp -af \ - /lib/modules/$(KVER)/kernel/fs/{exportfs,ext{2,3},fat,jbd,mbcache.ko} \ - /lib/modules/$(KVER)/kernel/fs/{msdos,ntfs,reiser{4,fs},udf,vfat,xfs} \ - $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/fs - cp -af \ - /lib/modules/$(KVER)/kernel/lib/lzo/lzo_{,de}compress.ko \ - $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/lib/lzo - cp -f /lib/modules/$(KVER)/modules.* $(INSTALLER_DIR)/lib/modules/$(KVER) - - ### configuration - # - cp -af $(DIR_CONF)/install/* $(INSTALLER_DIR)/etc/ - cp -f $(DIR_SOURCE)/initscripts/init.d/functions $(INSTALLER_DIR)/etc/functions - chmod 755 $(INSTALLER_DIR)/etc/{halt,rc} - ln -sf etc/rc $(INSTALLER_DIR)/init - cp -f /etc/issue /etc/group $(INSTALLER_DIR)/etc/ - ln -sf /proc/mounts $(INSTALLER_DIR)/etc/mtab - - ### compressing everything - # - cd $(INSTALLER_DIR) && find . | cpio -o -H newc | gzip -9 > \ - $(IMAGES_DIR)/initramfs-$(VERSION).img - - @rm -rf $(INSTALLER_DIR) + @rm -rf $(INSTALLER_DIR)/archive.{files,errors} diff --git a/lfs/kudzu b/lfs/kudzu index c5651675e..ea6ec0ecd 100644 --- a/lfs/kudzu +++ b/lfs/kudzu @@ -67,13 +67,11 @@ ifeq "$(STAGE)" "installer" -i Makefile cd $(DIR_APP) && \ ARCH=$(MACHINE) \ - RPM_OPT_FLAGS="$(CFLAGS) -I$(UCLIBC_DIR)/usr/include" \ - CC=$(UCLIBC_TARGET)-gcc \ - AR=$(UCLIBC_TARGET)-ar \ - RANLIB=$(UCLIBC_TARGET)-ranlib \ + RPM_OPT_FLAGS="$(CFLAGS)" \ + $(U_TOOLS) \ make -j $(PARALLELISM) - cd $(DIR_APP) && ARCH=$(MACHINE) RPM_OPT_FLAGS="$(CFLAGS)" make install DESTDIR=$(UCLIBC_DIR) - cd $(DIR_APP) && ARCH=$(MACHINE) RPM_OPT_FLAGS="$(CFLAGS)" make install-program DESTDIR=$(UCLIBC_DIR) + cd $(DIR_APP) && ARCH=$(MACHINE) RPM_OPT_FLAGS="$(CFLAGS)" make install DESTDIR=$(INSTALLER_DIR) + cd $(DIR_APP) && ARCH=$(MACHINE) RPM_OPT_FLAGS="$(CFLAGS)" make install-program DESTDIR=$(INSTALLER_DIR) endif @rm -rf $(DIR_APP) diff --git a/lfs/linux b/lfs/linux index 5d6afbb71..4893f0a23 100644 --- a/lfs/linux +++ b/lfs/linux @@ -147,10 +147,11 @@ ifeq "$(STAGE)" "ipfire" endif ifeq "$(STAGE)" "installer" + -mkdir -pv $(UCLIBC_SYSROOT_DIR)/usr/include cd $(DIR_APP) && make mrproper cd $(DIR_APP) && make ARCH=x86 headers_check cd $(DIR_APP) && make ARCH=x86 INSTALL_HDR_PATH=dest headers_install - cd $(DIR_APP) && cp -rv dest/include/* $(UCLIBC_DIR)/include + cd $(DIR_APP) && cp -rv dest/include/* $(UCLIBC_SYSROOT_DIR)/usr/include endif @rm -rf $(DIR_APP) diff --git a/lfs/lzma b/lfs/lzma index 54b2a2ce6..34d97446e 100644 --- a/lfs/lzma +++ b/lfs/lzma @@ -67,12 +67,12 @@ endif ifeq "$(STAGE)" "installer" cd $(DIR_APP) && make -C CPP/7zip/Compress/LZMA_Alone \ -f makefile.gcc -j $(PARALLELISM) \ - CXX="$(UCLIBC_TARGET)-g++ $(CXXFLAGS)" \ - CXX_C="$(UCLIBC_TARGET)-gcc $(CFLAGS)" + CXX="$(U_CXX) $(CXXFLAGS)" \ + CXX_C="$(U_CC) $(CFLAGS)" install -m 755 \ $(DIR_APP)/CPP/7zip/Compress/LZMA_Alone/lzma \ - $(UCLIBC_DIR)/bin/lzma_sdk + $(INSTALLER_DIR)/usr/bin/lzma_sdk endif @rm -rf $(DIR_APP) diff --git a/lfs/ncurses b/lfs/ncurses index 9b246f076..273e920ab 100644 --- a/lfs/ncurses +++ b/lfs/ncurses @@ -89,13 +89,13 @@ endif ifeq "$(STAGE)" "installer" cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-coverity_fixes-1.patch cd $(DIR_APP) && ./configure --prefix=/usr \ - --build=$(IFS_TARGET) \ + --target=$(UCLIBC_TARGET) \ --host=$(UCLIBC_TARGET) \ --with-shared \ --without-debug \ #--enable-widec cd $(DIR_APP) && make -j $(PARALLELISM) - cd $(DIR_APP) && make install DESTDIR=$(UCLIBC_DIR) + cd $(DIR_APP) && make install DESTDIR=$(INSTALLER_DIR) endif @rm -rf $(DIR_APP) diff --git a/lfs/newt b/lfs/newt index ad6035120..ae2887e08 100644 --- a/lfs/newt +++ b/lfs/newt @@ -58,19 +58,19 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) ifeq "$(STAGE)" "ipfire" cd $(DIR_APP) && ./configure --prefix=/usr --without-gpm-support \ - --without-tcl + --without-tcl cd $(DIR_APP) && make -j $(PARALLELISM) cd $(DIR_APP) && make install endif ifeq "$(STAGE)" "installer" - cd $(DIR_APP) && ./configure --prefix=$(UCLIBC_DIR)/usr \ - --without-gpm-support \ - --without-tcl \ - --build=$(IFS_TARGET) \ - --host=$(UCLIBC_TARGET) + cd $(DIR_APP) && ./configure --prefix=/usr \ + --target=$(UCLIBC_TARGET) \ + --host=$(UCLIBC_TARGET) \ + --without-gpm-support \ + --without-tcl cd $(DIR_APP) && make -j $(PARALLELISM) - cd $(DIR_APP) && make install + cd $(DIR_APP) && make install instroot=$(INSTALLER_DIR) endif @rm -rf $(DIR_APP) diff --git a/lfs/parted b/lfs/parted index 193b9c8f4..ea5c21107 100644 --- a/lfs/parted +++ b/lfs/parted @@ -71,7 +71,7 @@ endif ifeq "$(STAGE)" "installer" cd $(DIR_APP) && ./configure --prefix=/usr \ - --build=$(IFS_TARGET) \ + --target=$(UCLIBC_TARGET) \ --host=$(UCLIBC_TARGET) \ --without-readline \ --disable-nls \ @@ -80,13 +80,13 @@ ifeq "$(STAGE)" "installer" --disable-debug \ --with-gnu-ld cd $(DIR_APP) && make -j $(PARALLELISM) - cd $(DIR_APP) && make install DESTDIR=$(UCLIBC_DIR) + cd $(DIR_APP) && make install DESTDIR=$(INSTALLER_DIR) ### pyparted # #cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(PYPARTED).tar.bz2 #cd $(DIR_SRC)/$(PYPARTED) && make all install \ - # libdir=$(UCLIBC_DIR)/usr/lib/python2.5/site-packages + # libdir=$(INSTALLER_DIR)/usr/lib/python2.5/site-packages endif @rm -rf $(DIR_APP) $(DIR_SRC)/$(PYPARTED) diff --git a/lfs/pciutils b/lfs/pciutils index 304648d87..2d5990979 100644 --- a/lfs/pciutils +++ b/lfs/pciutils @@ -66,14 +66,14 @@ ifeq "$(STAGE)" "ipfire" endif ifeq "$(STAGE)" "installer" - cd $(DIR_APP) && sed -e "s/^\tar/\t$(UCLIBC_TARGET)-ar/" \ - -e "s/^\tranlib/\t$(UCLIBC_TARGET)-ranlib/" -i lib/Makefile + cd $(DIR_APP) && sed -e "s/^\tar/\t$(U_AR)/" \ + -e "s/^\tranlib/\t$(U_RANLIB)/" -i lib/Makefile cd $(DIR_APP)/lib && ./configure /usr/share $(VER) $(UCLIBC_TARGET) $(KVER) - cd $(DIR_APP)/lib && make OPT=$(CLFLAGS) PREFIX=$(UCLIBC_DIR)/usr \ - HOST=$(UCLIBC_TARGET) CC=$(UCLIBC_TARGET)-gcc -j $(PARALLELISM) - install -v -m 755 -d $(UCLIBC_DIR)/usr/include/pci - cd $(DIR_APP) && install -v -m 644 lib/libpci.a $(UCLIBC_DIR)/usr/lib - cd $(DIR_APP) && install -v -m 644 lib/*.h $(UCLIBC_DIR)/usr/include/pci + cd $(DIR_APP)/lib && make OPT=$(CLFLAGS) PREFIX=$(INSTALLER_DIR)/usr \ + HOST=$(UCLIBC_TARGET) CC=$(U_CC) -j $(PARALLELISM) + install -v -m 755 -d $(INSTALLER_DIR)/usr/include/pci + cd $(DIR_APP) && install -v -m 644 lib/libpci.a $(INSTALLER_DIR)/usr/lib + cd $(DIR_APP) && install -v -m 644 lib/*.h $(INSTALLER_DIR)/usr/include/pci endif @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/lfs/pcre b/lfs/pcre index fa8d7c2ea..c7e8691e0 100644 --- a/lfs/pcre +++ b/lfs/pcre @@ -70,10 +70,10 @@ endif ifeq "$(STAGE)" "installer" cd $(DIR_APP) && ./configure --prefix=/usr \ --enable-utf8 \ - --build=$(IFS_TARGET) \ + --target=$(UCLIBC_TARGET) \ --host=$(UCLIBC_TARGET) cd $(DIR_APP) && make -j $(PARALLELISM) - cd $(DIR_APP) && make install DESTDIR=$(UCLIBC_DIR) + cd $(DIR_APP) && make install DESTDIR=$(INSTALLER_DIR) endif @rm -rf $(DIR_APP) diff --git a/lfs/pomona b/lfs/pomona index a2856bd82..325a2b42f 100644 --- a/lfs/pomona +++ b/lfs/pomona @@ -50,7 +50,7 @@ $(TARGET) : cd $(DIR_APP) && make -C po update-po cd $(DIR_APP) && make lang-names - cd $(DIR_APP) && make install DESTDIR=$(UCLIBC_DIR) NAME=$(NAME) \ + cd $(DIR_APP) && make install DESTDIR=$(INSTALLER_DIR) NAME=$(NAME) \ SNAME=$(SNAME) VERSION=$(VERSION) KVER=$(KVER) cd $(DIR_APP) && make clean diff --git a/lfs/popt b/lfs/popt index 7bbae2f6b..92418649e 100644 --- a/lfs/popt +++ b/lfs/popt @@ -25,7 +25,7 @@ include Config PKG_NAME = popt -VER = 1.10.4 +VER = 1.14 THISAPP = $(PKG_NAME)-$(VER) DL_FILE = $(THISAPP).tar.gz @@ -53,7 +53,7 @@ $(patsubst %,$(DIR_DL)/%,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && sed -i -e "/*origOptString ==/c 0)" popt.c + #cd $(DIR_APP) && sed -i -e "/*origOptString ==/c 0)" popt.c ifeq "$(STAGE)" "ipfire" cd $(DIR_APP) && ./configure --prefix=/usr @@ -62,15 +62,12 @@ ifeq "$(STAGE)" "ipfire" endif ifeq "$(STAGE)" "installer" - cd $(DIR_APP) && \ - CC=$(UCLIBC_TARGET)-gcc \ - AR=$(UCLIBC_TARGET)-ar \ - AS=$(UCLIBC_TARGET)-as \ - LD=$(UCLIBC_TARGET)-ld \ - RANLIB=$(UCLIBC_TARGET)-ranlib \ - ./configure --prefix=/usr + cd $(DIR_APP) && $(U_TOOLS) ac_cv_va_copy=yes \ + ./configure --prefix=/usr \ + --target=$(UCLIBC_TARGET) \ + --host=$(UCLIBC_TARGET) cd $(DIR_APP) && make -j $(PARALLELISM) - cd $(DIR_APP) && make install DESTDIR=$(UCLIBC_DIR) + cd $(DIR_APP) && make install DESTDIR=$(INSTALLER_DIR) endif @rm -rf $(DIR_APP) diff --git a/lfs/pyfire b/lfs/pyfire index 566c0c4a0..7d36d2a8c 100644 --- a/lfs/pyfire +++ b/lfs/pyfire @@ -57,7 +57,7 @@ ifeq "$(STAGE)" "ipfire" endif ifeq "$(STAGE)" "installer" - cd $(DIR_APP) && make install DESTDIR=$(UCLIBC_DIR) + cd $(DIR_APP) && make install DESTDIR=$(INSTALLER_DIR) endif cd $(DIR_APP) && make clean diff --git a/lfs/python b/lfs/python index 150b008a4..d9b8c447c 100644 --- a/lfs/python +++ b/lfs/python @@ -76,16 +76,17 @@ ifeq "$(STAGE)" "installer" cd $(DIR_APP) && sed -i -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \ -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \ Makefile.pre.in - -rm -rf $(DIR_APP)/Lib/test $(UCLIBC_DIR)/usr/lib/python2.5/test - cd $(DIR_APP) && OPT="$(CFLAGS)" ./configure --prefix=/usr \ - --build=$(IFS_TARGET) \ + -rm -rf $(DIR_APP)/Lib/test $(INSTALLER_DIR)/usr/lib/python2.5/test + cd $(DIR_APP) && OPT="$(CFLAGS)" $(U_TOOLS) ./configure \ + --prefix=/usr \ + --target=$(UCLIBC_TARGET) \ --host=$(UCLIBC_TARGET) \ --enable-shared \ --disable-ipv6 \ --with-cxx=no cd $(DIR_APP) && make -j $(PARALLELISM) \ HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen - cd $(DIR_APP) && make install DESTDIR=$(UCLIBC_DIR) \ + cd $(DIR_APP) && make install DESTDIR=$(INSTALLER_DIR) \ HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen endif diff --git a/lfs/readline b/lfs/readline index f795d5bea..fa8fed645 100644 --- a/lfs/readline +++ b/lfs/readline @@ -70,15 +70,10 @@ ifeq "$(STAGE)" "base" endif ifeq "$(STAGE)" "installer" - cd $(DIR_APP) && \ - CC=$(UCLIBC_TARGET)-gcc \ - AR=$(UCLIBC_TARGET)-ar \ - AS=$(UCLIBC_TARGET)-as \ - LD=$(UCLIBC_TARGET)-ld \ - RANLIB=$(UCLIBC_TARGET)-ranlib \ - ./configure --prefix=/ + cd $(DIR_APP) && $(U_TOOLS) bash_cv_func_sigsetjmp=yes \ + ./configure --prefix=/usr cd $(DIR_APP) && make -j $(PARALLELISM) SHLIB_LIBS=-lncurses - cd $(DIR_APP) && make install DESTDIR=$(UCLIBC_DIR) + cd $(DIR_APP) && make install DESTDIR=$(INSTALLER_DIR) endif @rm -rf $(DIR_APP) diff --git a/lfs/slang b/lfs/slang index 2892f468e..7abb0abec 100644 --- a/lfs/slang +++ b/lfs/slang @@ -66,12 +66,12 @@ ifeq "$(STAGE)" "installer" cd $(DIR_APP) && patch -Np1 -i $(DIR_DL)/$(THISAPP)-uclibc-1.patch cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/etc \ --with-png=no \ - --build=$(IFS_TARGET) \ + --target=$(UCLIBC_TARGET) \ --host=$(UCLIBC_TARGET) cd $(DIR_APP)/src && make -j $(PARALLELISM) - cd $(DIR_APP)/src && make DESTDIR=$(UCLIBC_DIR) install-all - -chmod -v 755 $(UCLIBC_DIR)/usr/lib/libslang.so.$(VER) \ - $(UCLIBC_DIR)/usr/lib/slang/v2/modules/*.so + cd $(DIR_APP)/src && make DESTDIR=$(INSTALLER_DIR) install-all + -chmod -v 755 $(INSTALLER_DIR)/usr/lib/libslang.so.$(VER) \ + $(INSTALLER_DIR)/usr/lib/slang/v2/modules/*.so endif @rm -rf $(DIR_APP) diff --git a/lfs/stage5 b/lfs/stage5 index aad1316da..a68e690d6 100644 --- a/lfs/stage5 +++ b/lfs/stage5 @@ -45,14 +45,45 @@ download : $(TARGET) : @$(PREBUILD) - for i in lib include $(UCLIBC_TARGET); do \ + + ### Prepare the toolchain's directory + # + for i in bin sbin lib include; do \ mkdir -pv $(UCLIBC_DIR)/$${i}; \ done - ln -svf ../include $(UCLIBC_DIR)/$(UCLIBC_TARGET)/sys-include - ln -svf ../lib /usr/$(UCLIBC_TARGET)/$(UCLIBC_TARGET)/lib - ln -svf usr/$(UCLIBC_TARGET)/lib /ulib - ln -svf lib /usr/$(UCLIBC_TARGET)/ulib - ln -svf . $(UCLIBC_DIR)/usr - #ln -svf ../bin $(UCLIBC_DIR)/usr/bin - #ln -svf ../sbin $(UCLIBC_DIR)/usr/sbin + for i in usr/include usr/lib lib; do \ + mkdir -pv $(UCLIBC_SYSROOT_DIR)/$${i}; \ + mkdir -pv $(INSTALLER_DIR)/$${i}; \ + done + -mkdir -pv "$(UCLIBC_CC_CORE_STATIC_DIR)/$(UCLIBC_TARGET)/bin" + -mkdir -pv "$(UCLIBC_CC_CORE_STATIC_DIR)/bin" + + + ### Prepare the installer's directory + # + -mkdir -p $(INSTALLER_DIR)/{bin,sbin,lib,dev,etc,mnt/{source,target}} + -mkdir -p $(INSTALLER_DIR)/{root,proc,tmp,sys,var/run} + -mkdir -p $(INSTALLER_DIR)/usr/{bin,sbin,lib,inlcude} + + cp -af $(DIR_CONF)/install/* $(INSTALLER_DIR)/etc/ + cp -f $(DIR_SOURCE)/initscripts/init.d/functions $(INSTALLER_DIR)/etc/functions + chmod 755 $(INSTALLER_DIR)/etc/{halt,rc} + ln -sf etc/rc $(INSTALLER_DIR)/init + cp -f /etc/issue /etc/group $(INSTALLER_DIR)/etc/ + ln -sf /proc/mounts $(INSTALLER_DIR)/etc/mtab + + -mkdir -p $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/{drivers,fs,lib/lzo} + cp -af \ + /lib/modules/$(KVER)/kernel/drivers/{ata,block,cdrom,dma,firewire} \ + /lib/modules/$(KVER)/kernel/drivers/{hid,ide,net,pcmcia,scsi,ssb,usb} \ + $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/drivers + cp -af \ + /lib/modules/$(KVER)/kernel/fs/{exportfs,ext{2,3},fat,jbd,mbcache.ko} \ + /lib/modules/$(KVER)/kernel/fs/{msdos,ntfs,reiser{4,fs},udf,vfat,xfs} \ + $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/fs + cp -af \ + /lib/modules/$(KVER)/kernel/lib/lzo/lzo_{,de}compress.ko \ + $(INSTALLER_DIR)/lib/modules/$(KVER)/kernel/lib/lzo + cp -f /lib/modules/$(KVER)/modules.* $(INSTALLER_DIR)/lib/modules/$(KVER) + @$(POSTBUILD) diff --git a/lfs/strip b/lfs/strip index 575ac5c1b..8168e1d9f 100644 --- a/lfs/strip +++ b/lfs/strip @@ -52,7 +52,7 @@ ifeq "$(STAGE)" "toolchain" endif ifeq "$(STAGE)" "installer" - -$(TOOLS_DIR)/bin/find $(UCLIBC_DIR)/{bin,sbin,lib} \ + -$(TOOLS_DIR)/bin/find $(INSTALLER_DIR)/{,usr/}{bin,sbin,lib} \ -type f -exec $(TOOLS_DIR)/bin/strip --strip-all '{}' ';' \ &>/dev/null endif diff --git a/lfs/uClibc b/lfs/uClibc index 2f9d01750..a907a12b1 100644 --- a/lfs/uClibc +++ b/lfs/uClibc @@ -60,31 +60,30 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cp -f $(DIR_CONF)/$(PKG_NAME)/.config $(DIR_APP)/.config cp -f $(DIR_DL)/$(LOCALE_FILE) $(DIR_APP)/extra/locale -ifeq "$(PASS)" "0" - rm -vf $(DIR_APP)/.config - cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-config-1.patch - cd $(DIR_APP) && make KERNEL_SOURCE=$(UCLIBC_DIR) headers all - rm -fvr $(DIR_APP)/include/{asm,asm-generic,linux} - cd $(DIR_APP) && make DEVEL_PREFIX=$(UCLIBC_DIR)/ install_dev -endif - -ifneq "$(PASS)" "0" # Do this on pass 1 and 2 - cd $(DIR_APP) && sed \ - -e "s@.*SHARED_LIB_LOADER_P.*@SHARED_LIB_LOADER_PREFIX=\"$(UCLIBC_DIR)/lib\"@g" \ - -e "s@.*RUNTIME_PREFIX.*@RUNTIME_PREFIX=\"$(UCLIBC_DIR)\"@g" \ - -e "s@.*DEVEL_PREFIX.*@DEVEL_PREFIX=\"$(UCLIBC_DIR)/\"@g" \ - -e "s@.*KERNEL_SOURCE.*@KERNEL_SOURCE=\"$(UCLIBC_DIR)\"@g" \ - -i .config - cd $(DIR_APP) && make CROSS=$(UCLIBC_TARGET)- all -j $(PARALLELISM) - rm -fr $(DIR_APP)/include/{asm,asm-generic,linux} - cd $(DIR_APP) && make install + #cd $(DIR_APP) && sed \ + # -e "s@.*CROSS_COMPILER_PREFIX=.*@CROSS_COMPILER_PREFIX=\"$(UCLIBC_DIR)/usr/bin/$(UCLIBC_TARGET)-\"@g" \ + # -e "s@.*SHARED_LIB_LOADER_P.*@SHARED_LIB_LOADER_PREFIX=\"$(UCLIBC_DIR)/lib\"@g" \ + # -e "s@.*RUNTIME_PREFIX.*@RUNTIME_PREFIX=\"$(UCLIBC_DIR)\"@g" \ + # -e "s@.*DEVEL_PREFIX.*@DEVEL_PREFIX=\"$(UCLIBC_DIR)/usr/\"@g" \ + # -e "s@.*KERNEL_SOURCE.*@KERNEL_SOURCE=\"$(UCLIBC_DIR)\"@g" \ + # -e "s@.*KERNEL_HEADERS.*@KERNEL_HEADERS=\"$(UCLIBC_DIR)/usr/include\"@g" \ + # -i .config + +ifeq "$(PASS)" "1" + # Make headers + cd $(DIR_APP) && make CROSS= PREFIX="${UCLIBC_SYSROOT_DIR}/" headers + cd $(DIR_APP) && make CROSS= PREFIX="${UCLIBC_SYSROOT_DIR}/" install_dev endif ifeq "$(PASS)" "2" - cd $(DIR_APP) && make headers - cd $(DIR_APP) && make CC="gcc -Wl,--dynamic-linker,$(UCLIBC_LINKER) /ulib/libc.so.0" \ - -C utils - mv -f $(DIR_APP)/utils/ldconfig $(UCLIBC_DIR)/bin + cd $(DIR_APP) && make CROSS=$(UCLIBC_TARGET)- \ + PREFIX=$(UCLIBC_SYSROOT_DIR)/ \ + STRIPTOOL=true \ + all + cd $(DIR_APP) && make CROSS=$(UCLIBC_TARGET)- \ + PREFIX=$(UCLIBC_SYSROOT_DIR)/ \ + STRIPTOOL=true \ + install endif @rm -rf $(DIR_APP) diff --git a/lfs/udev b/lfs/udev index f52270e3a..90b8d015b 100644 --- a/lfs/udev +++ b/lfs/udev @@ -77,22 +77,22 @@ ifeq "$(STAGE)" "base" endif ifeq "$(STAGE)" "installer" - install -dv $(UCLIBC_DIR)/lib/{firmware,udev/devices/{pts,shm}} - -mknod -m0666 $(UCLIBC_DIR)/lib/udev/devices/null c 1 3 - ln -sfv /proc/self/fd $(UCLIBC_DIR)/lib/udev/devices/fd - ln -sfv /proc/self/fd/0 $(UCLIBC_DIR)/lib/udev/devices/stdin - ln -sfv /proc/self/fd/1 $(UCLIBC_DIR)/lib/udev/devices/stdout - ln -sfv /proc/self/fd/2 $(UCLIBC_DIR)/lib/udev/devices/stderr - ln -sfv /proc/kcore $(UCLIBC_DIR)/lib/udev/devices/core + install -dv $(INSTALLER_DIR)/lib/{firmware,udev/devices/{pts,shm}} + -mknod -m0666 $(INSTALLER_DIR)/lib/udev/devices/null c 1 3 + ln -sfv /proc/self/fd $(INSTALLER_DIR)/lib/udev/devices/fd + ln -sfv /proc/self/fd/0 $(INSTALLER_DIR)/lib/udev/devices/stdin + ln -sfv /proc/self/fd/1 $(INSTALLER_DIR)/lib/udev/devices/stdout + ln -sfv /proc/self/fd/2 $(INSTALLER_DIR)/lib/udev/devices/stderr + ln -sfv /proc/kcore $(INSTALLER_DIR)/lib/udev/devices/core cd $(DIR_APP) && make EXTRAS="`echo extras/*/`" \ CROSS_COMPILE=$(UCLIBC_TARGET)- -j $(PARALLELISM) - cd $(DIR_APP) && make DESTDIR=$(UCLIBC_DIR) EXTRAS="`echo extras/*/`" \ + cd $(DIR_APP) && make DESTDIR=$(INSTALLER_DIR) EXTRAS="`echo extras/*/`" \ CROSS_COMPILE=$(UCLIBC_TARGET)- install - cd $(DIR_APP) && cp -vf etc/udev/rules.d/[0-9]* $(UCLIBC_DIR)/etc/udev/rules.d/ + cd $(DIR_APP) && cp -vf etc/udev/rules.d/[0-9]* $(INSTALLER_DIR)/etc/udev/rules.d/ - cd $(DIR_APP)/$(PKG_NAME)-config-$(CONFVER) && make install DESTDIR=$(UCLIBC_DIR) + cd $(DIR_APP)/$(PKG_NAME)-config-$(CONFVER) && make install DESTDIR=$(INSTALLER_DIR) endif @rm -rf $(DIR_APP) diff --git a/lfs/util-linux-ng b/lfs/util-linux-ng index 5567120a9..1bcbc005a 100644 --- a/lfs/util-linux-ng +++ b/lfs/util-linux-ng @@ -71,10 +71,11 @@ ifeq "$(STAGE)" "base" endif ifeq "$(STAGE)" "installer" - cd $(DIR_APP) && ./configure --build=$(IFS_TARGET) \ - --host=$(UCLIBC_TARGET) + cd $(DIR_APP) && ./configure --target=$(UCLIBC_TARGET) \ + --host=$(UCLIBC_TARGET) \ + --disable-nls cd $(DIR_APP) && make -C disk-utils mkswap -j $(PARALLELISM) - cd $(DIR_APP) && cp -vf disk-utils/mkswap $(UCLIBC_DIR)/sbin/mkswap + cd $(DIR_APP) && cp -vf disk-utils/mkswap $(INSTALLER_DIR)/sbin/mkswap endif @rm -rf $(DIR_APP) diff --git a/lfs/zlib b/lfs/zlib index 96ac1712f..bf5872574 100644 --- a/lfs/zlib +++ b/lfs/zlib @@ -73,16 +73,16 @@ ifeq "$(STAGE)" "base" endif ifeq "$(STAGE)" "installer" - cd $(DIR_APP) && CC=$(UCLIBC_TARGET)-gcc ./configure --prefix=/usr \ + cd $(DIR_APP) && $(U_TOOLS) ./configure --prefix=/usr \ --shared \ --libdir=/lib cd $(DIR_APP) && make -j $(PARALLELISM) cd $(DIR_APP) && install -v -m 644 zlib.h zconf.h \ - $(UCLIBC_DIR)/usr/include + $(INSTALLER_DIR)/usr/include cd $(DIR_APP) && install -v -m 755 libz.so.$(VER) \ - $(UCLIBC_DIR)/usr/lib - ln -svf libz.so.$(VER) $(UCLIBC_DIR)/usr/lib/libz.so.1 - ln -svf libz.so.$(VER) $(UCLIBC_DIR)/usr/lib/libz.so + $(INSTALLER_DIR)/usr/lib + ln -svf libz.so.$(VER) $(INSTALLER_DIR)/usr/lib/libz.so.1 + ln -svf libz.so.$(VER) $(INSTALLER_DIR)/usr/lib/libz.so endif @rm -rf $(DIR_APP) diff --git a/make.sh b/make.sh index 89a46f1ab..a36d648e8 100755 --- a/make.sh +++ b/make.sh @@ -401,7 +401,8 @@ misc_build() { ################################################################################ installer_build() { - PATH=${UCLIBC_DIR}/bin:${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin + PATH=${UCLIBC_DIR}/bin:${UCLIBC_DIR}/usr/bin:${UCLIBC_CC_CORE_STATIC_DIR}/bin + PATH=$PATH:${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin STAGE_ORDER=05 STAGE=installer @@ -410,22 +411,19 @@ installer_build() { ipfire_make stage5 ipfire_make linux - ipfire_make uClibc PASS=0 ipfire_make binutils - ipfire_make gcc PASS=1 ipfire_make uClibc PASS=1 - ipfire_make gettext PASS=1 - ipfire_make adjust-toolchain - ipfire_make gcc PASS=2 + ipfire_make gcc PASS=1 ipfire_make uClibc PASS=2 - ipfire_make gettext PASS=2 + ipfire_make gcc PASS=2 + ipfire_make gettext ipfire_make udev ipfire_make pciutils ipfire_make zlib ipfire_make ncurses ipfire_make pcre ipfire_make popt - ipfire_make readline + #ipfire_make readline ipfire_make e2fsprogs ipfire_make util-linux-ng ipfire_make parted @@ -433,11 +431,12 @@ installer_build() { ipfire_make kudzu ipfire_make slang ipfire_make newt + #ipfire_make bash ipfire_make cpio ipfire_make lzma - ipfire_make busybox ipfire_make pyfire ipfire_make pomona + ipfire_make busybox ipfire_make strip } diff --git a/tools/make-include b/tools/make-include index 93c9f3b20..8e118249b 100644 --- a/tools/make-include +++ b/tools/make-include @@ -90,7 +90,7 @@ if [ 'i686' = $TARGET -o 'i586' = $TARGET \ CFLAGS="-march=${MACHINE} -O2 -pipe -fomit-frame-pointer" CXXFLAGS="${CFLAGS}" UCLIBC_TARGET=i386-pc-linux-uclibc - UCLIBC_LINKER=/ulib/ld-uClibc.so.0 + UCLIBC_LINKER=/lib/ld-uClibc.so.0 UCLIBC_CFLAGS="-march=i386 -Os -pipe -fomit-frame-pointer" elif [ 'via-c7' = $TARGET ]; then MACHINE=i686 @@ -138,6 +138,10 @@ TOOLCHAINNAME=$SNAME-$TOOLCHAINVERSION-toolchain-t${TARGET}-m${MACHINE} # The place where all uclibc files are stored in UCLIBC_DIR=/usr/${UCLIBC_TARGET} +UCLIBC_CC_CORE_STATIC_DIR=${UCLIBC_DIR}/gcc-core-static + +#UCLIBC_SYSROOT_DIR=${UCLIBC_DIR}/${UCLIBC_TARGET}/sys-root +UCLIBC_SYSROOT_DIR=${INSTALLER_DIR} ############################################################################### # @@ -376,9 +380,6 @@ entershell() { LINKER=$LINKER \ TOOLS_DIR=$TOOLS_DIR \ INSTALLER_DIR=$INSTALLER_DIR \ - UCLIBC_DIR=$UCLIBC_DIR \ - UCLIBC_TARGET=$UCLIBC_TARGET \ - UCLIBC_LINKER=$UCLIBC_LINKER \ MACHINE="$MACHINE" \ MACHINE_REAL="$MACHINE_REAL" \ CFLAGS="$CFLAGS" \ @@ -497,7 +498,7 @@ ipfire_make() { fi local MYCFLAGS MYCXXFLAGS - if [ "${STAGE}" = "uclibc" ]; then + if [ "${STAGE}" = "installer" ]; then MYCFLAGS=${UCLIBC_CFLAGS} MYCXXFLAGS=${UCLIBC_CFLAGS} else @@ -527,8 +528,10 @@ ipfire_make() { CDROM_DIR=$CDROM_DIR \ IMAGES_DIR=$IMAGES_DIR \ UCLIBC_DIR=$UCLIBC_DIR \ + UCLIBC_SYSROOT_DIR=$UCLIBC_SYSROOT_DIR \ UCLIBC_TARGET=$UCLIBC_TARGET \ UCLIBC_LINKER=$UCLIBC_LINKER \ + UCLIBC_CC_CORE_STATIC_DIR=${UCLIBC_CC_CORE_STATIC_DIR} \ MACHINE="$MACHINE" \ MACHINE_REAL="$MACHINE_REAL" \ CFLAGS="$MYCFLAGS" \