Some work has to be done yet, but I hope this will compile.
#
# Automatically generated make config: don't edit
# Busybox version: 1.10.0
-# Mon Apr 7 12:33:34 2008
+# Sat Apr 26 17:29:28 2008
#
CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
-CONFIG_PREFIX="/installer/busybox"
+CONFIG_PREFIX=""
#
# Busybox Library Tuning
ln -sfv $(TOOLS_DIR)/bin/ld $(TOOLS_DIR)/$$(gcc -dumpmachine)/bin/ld
gcc -dumpspecs | sed \
- -e 's@$(TOOLS_DIR)$(LINKER)@$(LINKER)@g' \
- -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
- -e '/\*cpp:/{n;s@$$@ -isystem /usr/include@}' > \
- `dirname $$(gcc --print-libgcc-file-name)`/specs
+ -e 's@$(TOOLS_DIR)$(LINKER)@$(LINKER)@g' \
+ -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
+ -e '/\*cpp:/{n;s@$$@ -isystem /usr/include@}' > \
+ `dirname $$(gcc --print-libgcc-file-name)`/specs
+endif
+
+ifeq "$(STAGE)" "uclibc"
+ $(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)
# Top-level Rules
###############################################################################
-objects = $(DL_FILE) $(THISAPP)-configure-1.patch
+objects = $(DL_FILE) $(THISAPP)-configure-1.patch \
+ $(THISAPP)-uClibc-1.patch \
+ $(THISAPP)-ld_makefile.patch
install : $(TARGET)
-mkdir -v $(DIR_SRC)/binutils-build
cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-configure-1.patch
+ifeq "$(STAGE)" "toolchain"
ifeq "$(firstword $(MAKEFILE_LIST))" "$(PKG_NAME)"
#
# Normal build
ifeq "$(PASS)" "1"
ifeq "$(MACHINE)" "$(MACHINE_REAL)"
cd $(DIR_SRC)/binutils-build && CC="gcc -B/usr/bin/" ../$(THISAPP)/configure \
- --prefix=$(TOOLS_DIR) \
- --disable-nls \
- --disable-werror
-
+ --prefix=$(TOOLS_DIR) \
+ --disable-nls \
+ --disable-werror
cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/binutils-build && make install
cd $(DIR_SRC)/binutils-build && make -C ld clean
# Cross build
#
cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure \
- --prefix=$(TOOLS_DIR) \
- --build=${IFS_HOST} \
- --host=${IFS_TARGET} \
- --target=${IFS_TARGET} \
- --disable-nls \
- --enable-shared \
- --disable-multilib
-
+ --prefix=$(TOOLS_DIR) \
+ --build=${IFS_HOST} \
+ --host=${IFS_TARGET} \
+ --target=${IFS_TARGET} \
+ --disable-nls \
+ --enable-shared \
+ --disable-multilib
cd $(DIR_SRC)/binutils-build && make configure-host
cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/binutils-build && make install
ifeq "$(PASS)" "2"
cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure \
- --prefix=$(TOOLS_DIR) \
- --disable-nls \
- --with-lib-path=$(TOOLS_DIR)/lib
-
+ --prefix=$(TOOLS_DIR) \
+ --disable-nls \
+ --with-lib-path=$(TOOLS_DIR)/lib
cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/binutils-build && make install
#
cd $(DIR_SRC)/binutils-build && AR=ar AS=as ../$(THISAPP)/configure \
- --prefix=$(CTOOLS_DIR) \
- --host=${IFS_HOST} \
- --target=${IFS_TARGET} \
- --with-lib-path=$(TOOLS_DIR)/lib \
- --disable-nls \
- --enable-shared \
- --disable-multilib
+ --prefix=$(CTOOLS_DIR) \
+ --host=${IFS_HOST} \
+ --target=${IFS_TARGET} \
+ --with-lib-path=$(TOOLS_DIR)/lib \
+ --disable-nls \
+ --enable-shared \
+ --disable-multilib
cd $(DIR_SRC)/binutils-build && make configure-host
cd $(DIR_SRC)/binutils-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/binutils-build && make install
-mkdir -p $(TOOLS_DIR)/include
cp -fv $(DIR_APP)/include/libiberty.h $(TOOLS_DIR)/include
endif
+endif
+
+ifeq "$(STAGE)" "uclibc"
+ 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 \
+ --prefix=$(UCLIBC_DIR) \
+ --disable-shared \
+ --disable-nls \
+ --target=$(UCLIBC_TARGET)
+ 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
+endif
@rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build
@$(POSTBUILD)
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
- -mkdir -p $(INSTALLER_DIR)/busybox
cd $(DIR_APP) && cp -f $(DIR_CONFIG)/$(PKG_NAME)/.config .config
- cd $(DIR_APP) && make oldconfig
- cd $(DIR_APP) && make -j $(PARALLELISM)
- cd $(DIR_APP) && make install
- rm -vf $(INSTALLER_DIR)/linuxrc
- -mkdir -p $(INSTALLER_DIR)/busybox/usr/share/udhcpc/
+ sed -e "s@^CONFIG_PREFIX=.*@CONFIG_PREFIX=\"$(UCLIBC_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) \
+ install
+ @rm -f $(UCLIBC_DIR)/linuxrc
+ -mkdir -p $(UCLIBC_DIR)/usr/share/udhcpc/
install -m 755 -v $(DIR_CONF)/busybox/default.script \
- $(INSTALLER_DIR)/busybox/usr/share/udhcpc/
+ $(UCLIBC_DIR)/usr/share/udhcpc/
@rm -rf $(DIR_APP)
@$(POSTBUILD)
cd $(DIR_APP)/build && make install-libs
endif
+ifeq "$(STAGE)" "uclibc"
+ cd $(DIR_APP)/build && ../configure --prefix=/usr --with-root-prefix="" \
+ --enable-elf-shlibs --build=$(IFS_TARGET) --host=$(UCLIBC_TARGET)
+ cd $(DIR_APP)/build && make -j $(PARALLELISM)
+ cd $(DIR_APP)/build && make install DESTDIR=$(UCLIBC_DIR)
+ cd $(DIR_APP)/build && make install-libs DESTDIR=$(UCLIBC_DIR)
+endif
+
@rm -rf $(DIR_APP)
@$(POSTBUILD)
else
TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-cross$(PASS)
endif
+else
+ifeq "$(STAGE)" "uclibc"
+ TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
else
TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
endif
+endif
###############################################################################
# Top-level Rules
objects = $(DL_FILE) \
$(THISAPP)-cross_search_paths-1.patch \
- $(THISAPP)-specs-1.patch
+ $(THISAPP)-specs-1.patch \
+ $(THISAPP)-uClibc-conf-1.conf
install : $(TARGET)
ifeq "$(PASS)" "1"
ifeq "$(MACHINE)" "$(MACHINE_REAL)"
cd $(DIR_SRC)/gcc-build && CC="gcc -B/usr/bin/" ../$(THISAPP)/configure \
- --prefix=$(TOOLS_DIR) \
- --with-local-prefix=$(TOOLS_DIR) \
- --disable-nls \
- --enable-shared \
- --enable-languages=c
-
+ --prefix=$(TOOLS_DIR) \
+ --with-local-prefix=$(TOOLS_DIR) \
+ --disable-nls \
+ --enable-shared \
+ --enable-languages=c
cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/gcc-build && make install
ln -vs gcc $(TOOLS_DIR)/bin/cc
gcc/Makefile.in.orig > gcc/Makefile.in
cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure \
- --prefix=$(TOOLS_DIR) \
- --build=${IFS_HOST} \
- --host=${IFS_TARGET} \
- --target=${IFS_TARGET} \
- --with-local-prefix=$(TOOLS_DIR) \
- --enable-long-long \
- --enable-c99 \
- --enable-shared \
- --enable-threads=posix \
- --enable-__cxa_atexit \
- --disable-nls \
- --enable-languages=c,c++ \
- --disable-libstdcxx-pch
-
+ --prefix=$(TOOLS_DIR) \
+ --build=${IFS_HOST} \
+ --host=${IFS_TARGET} \
+ --target=${IFS_TARGET} \
+ --with-local-prefix=$(TOOLS_DIR) \
+ --enable-long-long \
+ --enable-c99 \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --disable-nls \
+ --enable-languages=c,c++ \
+ --disable-libstdcxx-pch
cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM) AS_FOR_TARGET=$(AS) \
- LD_FOR_TARGET=$(LD)
+ LD_FOR_TARGET=$(LD)
cd $(DIR_SRC)/gcc-build && make install
endif
endif
cd $(DIR_APP) && \
for file in $$(find gcc/config -name linux64.h -o -name linux.h); do \
cp -uv $$file{,.orig}; \
- sed -e 's@/lib\(64\)\?\(32\)\?/ld@$(TOOLS_DIR)&@g' \
- -e 's@/usr@$(TOOLS_DIR)@g' $$file.orig > $$file; \
+ sed -e 's@/lib\(64\)\?\(32\)\?/ld@$(TOOLS_DIR)&@g' \
+ -e 's@/usr@$(TOOLS_DIR)@g' $$file.orig > $$file; \
echo -e "\n#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR 0" >> $$file; \
touch $$file.orig; \
done
cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure \
- --prefix=$(TOOLS_DIR) \
- --with-local-prefix=$(TOOLS_DIR) \
- --enable-clocale=gnu \
- --enable-shared \
- --enable-threads=posix \
- --enable-__cxa_atexit \
- --enable-languages=c,c++ \
- --disable-libstdcxx-pch \
- --disable-bootstrap
-
+ --prefix=$(TOOLS_DIR) \
+ --with-local-prefix=$(TOOLS_DIR) \
+ --enable-clocale=gnu \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --enable-languages=c,c++ \
+ --disable-libstdcxx-pch \
+ --disable-bootstrap
cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/gcc-build && make install
endif
cd $(DIR_APP) && cp -v gcc/Makefile.in{,.orig}
cd $(DIR_APP) && sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 $(TOOLS_DIR)/include@g" \
- gcc/Makefile.in.orig > gcc/Makefile.in
+ gcc/Makefile.in.orig > gcc/Makefile.in
ifeq "$(PASS)" "1"
cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure \
- --prefix=$(CTOOLS_DIR) \
- --host=${IFS_HOST} \
- --target=${IFS_TARGET} \
- --disable-multilib \
- --with-local-prefix=$(TOOLS_DIR) \
- --disable-nls \
- --disable-shared \
- --disable-threads \
- --enable-languages=c
-
+ --prefix=$(CTOOLS_DIR) \
+ --host=${IFS_HOST} \
+ --target=${IFS_TARGET} \
+ --disable-multilib \
+ --with-local-prefix=$(TOOLS_DIR) \
+ --disable-nls \
+ --disable-shared \
+ --disable-threads \
+ --enable-languages=c
cd $(DIR_SRC)/gcc-build && make all-gcc -j $(PARALLELISM)
cd $(DIR_SRC)/gcc-build && make install-gcc
endif
configure
cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure \
- --prefix=$(CTOOLS_DIR) \
- --target=${IFS_TARGET} \
- --host=${IFS_HOST} \
- --disable-multilib \
- --with-local-prefix=$(TOOLS_DIR) \
- --disable-nls \
- --enable-shared \
- --enable-languages=c,c++ \
- --enable-__cxa_atexit \
- --enable-c99 \
- --enable-long-long \
- --enable-threads=posix
-
+ --prefix=$(CTOOLS_DIR) \
+ --target=${IFS_TARGET} \
+ --host=${IFS_HOST} \
+ --disable-multilib \
+ --with-local-prefix=$(TOOLS_DIR) \
+ --disable-nls \
+ --enable-shared \
+ --enable-languages=c,c++ \
+ --enable-__cxa_atexit \
+ --enable-c99 \
+ --enable-long-long \
+ --enable-threads=posix
+
cd $(DIR_SRC)/gcc-build && make AS_FOR_TARGET="${IFS_TARGET}-as" \
- LD_FOR_TARGET="${IFS_TARGET}-ld"
+ LD_FOR_TARGET="${IFS_TARGET}-ld"
cd $(DIR_SRC)/gcc-build && make install
endif
endif
cd $(DIR_APP) && sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
cd $(DIR_SRC)/gcc-build && ../$(THISAPP)/configure \
- --prefix=/usr \
- --libexecdir=/usr/lib \
- --enable-shared \
- --enable-threads=posix \
- --enable-__cxa_atexit \
- --enable-clocale=gnu \
- --enable-languages=c,c++ \
- --disable-bootstrap
-
+ --prefix=/usr \
+ --libexecdir=/usr/lib \
+ --enable-shared \
+ --enable-threads=posix \
+ --enable-__cxa_atexit \
+ --enable-clocale=gnu \
+ --enable-languages=c,c++ \
+ --disable-bootstrap
cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/gcc-build && make install
ln -sfv gcc /usr/bin/cc
endif
+ifeq "$(STAGE)" "uclibc"
+ 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
+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) \
+ --target=$(UCLIBC_TARGET) \
+ --disable-nls \
+ --disable-shared \
+ --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
+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) \
+ --target=$(UCLIBC_TARGET) \
+ --libexecdir=/ulib \
+ --enable-shared \
+ --disable-__cxa_atexit \
+ --enable-target-optspace \
+ --enable-languages=c,c++ \
+ --disable-multilib \
+ --disable-libmudflap \
+ --with-gnu-ld \
+ --disable-nls
+ cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM)
+ cd $(DIR_SRC)/gcc-build && make install
+ ln -svf gcc $(UCLIBC_DIR)/$(UCLIBC_TARGET)/bin/cc
+endif
+endif
+
@rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build
@$(POSTBUILD)
DL_FILE = $(THISAPP).tar.gz
DIR_APP = $(DIR_SRC)/$(THISAPP)
-TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
+ifeq "$(STAGE)" "uclibc"
+ TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
+else
+ TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
+endif
###############################################################################
# Top-level Rules
cd $(DIR_APP) && make install
endif
+ifeq "$(STAGE)" "uclibc" # Do this in pass 1 and 2
+ cd $(DIR_APP)/gettext-runtime && CC=$(UCLIBC_TARGET)-gcc ./configure \
+ --prefix=$(UCLIBC_DIR) \
+ --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
+endif
+
@rm -rf $(DIR_APP)
@$(POSTBUILD)
ln -svf System.map-$(FULLVER) /boot/System.map
endif
+ifeq "$(STAGE)" "uclibc"
+ cd $(DIR_APP) && make mrproper
+ cd $(DIR_APP) && make ARCH=i386 headers_check
+ cd $(DIR_APP) && make ARCH=i386 INSTALL_HDR_PATH=dest headers_install
+ cd $(DIR_APP) && cp -rv dest/include/* $(UCLIBC_DIR)/include
+endif
+
@rm -rf $(DIR_APP)
@$(POSTBUILD)
mv -v /usr/lib/libncursesw.so.5* /lib
ln -sfv ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so
for lib in curses ncurses form panel menu; do \
- rm -vf /usr/lib/lib$${lib}.so ; \
- echo "INPUT(-l$${lib}w)" >/usr/lib/lib$${lib}.so ; \
- ln -sfv lib$${lib}w.a /usr/lib/lib$${lib}.a ; \
+ rm -vf /usr/lib/lib$${lib}.so ; \
+ echo "INPUT(-l$${lib}w)" >/usr/lib/lib$${lib}.so ; \
+ ln -sfv lib$${lib}w.a /usr/lib/lib$${lib}.a ; \
done
ln -sfv libncurses++w.a /usr/lib/libncurses++.a
ln -sfv libncurses.a /usr/lib/libcurses.a
endif
+ifeq "$(STAGE)" "uclibc"
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-coverity_fixes-1.patch
+ cd $(DIR_APP) && ./configure --prefix=/usr \
+ --build=$(IFS_TARGET) \
+ --host=$(UCLIBC_TARGET) \
+ --with-shared \
+ --without-debug \
+ #--enable-widec
+ cd $(DIR_APP) && make -j $(PARALLELISM)
+ cd $(DIR_APP) && make install DESTDIR=$(INSTALLER_DIR)
+endif
+
@rm -rf $(DIR_APP)
@$(POSTBUILD)
$(TARGET) :
@$(PREBUILD)
-
+ for i in lib include $(UCLIBC_TARGET); 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
@$(POSTBUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+PKG_NAME = stage6
+VER = LFS
+
+THISAPP = $(PKG_NAME)-$(VER)
+
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+install : $(TARGET)
+
+download :
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) :
+ @$(PREBUILD)
+
+ @$(POSTBUILD)
--- /dev/null
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+PKG_NAME = uClibc
+VER = 0.9.29
+
+THISAPP = $(PKG_NAME)-$(VER)
+DL_FILE = $(THISAPP).tar.bz2
+DIR_APP = $(DIR_SRC)/$(THISAPP)
+
+LOCALE_FILE = $(PKG_NAME)-locale-030818.tgz
+
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)-pass$(PASS)
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE) $(LOCALE_FILE) $(THISAPP)-config-1.patch
+
+install : $(TARGET)
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+ @$(LOAD)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+ @$(PREBUILD)
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
+
+ ## Copy configuration
+ cp -fv $(DIR_CONF)/$(PKG_NAME)/.config $(DIR_APP)/.config
+ cp -fv $(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 -fvr $(DIR_APP)/include/{asm,asm-generic,linux}
+ cd $(DIR_APP) && make install
+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
+ make -C utils install
+ mv -vf $(UCLIBC_DIR)/sbin/ldconfig $(UCLIBC_DIR)/bin
+ rm -rvf $(UCLIBC_DIR)/sbin/
+endif
+
+ @rm -rf $(DIR_APP)
+ @$(POSTBUILD)
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && tar -xvf $(DIR_DL)/$(PKG_NAME)-config-$(CONFVER).tar.bz2
+ cd $(DIR_APP) && tar -jxf $(DIR_DL)/$(PKG_NAME)-config-$(CONFVER).tar.bz2
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-usb_id-1.patch
+
+ifeq "$(STAGE)" "base"
install -dv /lib/{firmware,udev/devices/{pts,shm}}
-mknod -m0666 /lib/udev/devices/null c 1 3
ln -sfv /proc/self/fd /lib/udev/devices/fd
ln -sfv /proc/self/fd/1 /lib/udev/devices/stdout
ln -sfv /proc/self/fd/2 /lib/udev/devices/stderr
ln -sfv /proc/kcore /lib/udev/devices/core
-
- cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-usb_id-1.patch
-
+
cd $(DIR_APP) && make EXTRAS="`echo extras/*/`" -j $(PARALLELISM)
cd $(DIR_APP) && make DESTDIR=/ EXTRAS="`echo extras/*/`" install
-
+
cd $(DIR_APP) && cp -v etc/udev/rules.d/[0-9]* /etc/udev/rules.d/
-
+
cd $(DIR_APP)/$(PKG_NAME)-config-$(CONFVER) && make install
+endif
+
+ifeq "$(STAGE)" "uclibc"
+ ### XXX The predefined devnodes go here
+
+ cd $(DIR_APP) && make EXTRAS="`echo extras/*/`" \
+ CROSS_COMPILE=$(UCLIBC_TARGET)- -j $(PARALLELISM)
+ cd $(DIR_APP) && make DESTDIR=$(INSTALLER_DIR) EXTRAS="`echo extras/*/`" \
+ CROSS_COMPILE=$(UCLIBC_TARGET)- install
+
+ cd $(DIR_APP) && cp -v etc/udev/rules.d/[0-9]* $(INSTALLER_DIR)/etc/udev/rules.d/
+
+ cd $(DIR_APP)/$(PKG_NAME)-config-$(CONFVER) && make install DESTDIR=$(INSTALLER_DIR)
+endif
@rm -rf $(DIR_APP)
@$(POSTBUILD)
cd $(DIR_APP) && make install
endif
+ifeq "$(STAGE)" "uclibc"
+ cd $(DIR_APP) && ./configure --build=$(IFS_TARGET) \
+ --host=$(UCLIBC_TARGET)
+ cd $(DIR_APP) && make -j $(PARALLELISM)
+ cd $(DIR_APP) && cp -vf disk-utils/mkswap $(UCLIBC_DIR)/sbin/mkswap
+endif
+
@rm -rf $(DIR_APP)
@$(POSTBUILD)
############################################################################
#
-NAME="IPFire" # Software name
-SNAME="ipfire" # Short name
-VERSION="3.0-prealpha" # Version number
+NAME="IPFire" # Software name
+SNAME="ipfire" # Short name
+VERSION="3.0-prealpha" # Version number
TOOLCHAINVERSION="${VERSION}-1" # Toolchain
-SLOGAN="www.ipfire.org" # Software slogan
+SLOGAN="www.ipfire.org" # Software slogan
# Include funtions
. tools/make-include
if [ "${MACHINE}" != "${MACHINE_REAL}" ]; then
toolchain_make binutils-x-compile
- toolchain_make gcc-x-compile PASS=1
+ toolchain_make gcc-x-compile PASS=1
toolchain_make glibc-x-compile
- toolchain_make gcc-x-compile PASS=2
+ toolchain_make gcc-x-compile PASS=2
fi
- toolchain_make binutils PASS=1
+ toolchain_make binutils PASS=1
toolchain_make gcc PASS=1
toolchain_make glibc
toolchain_make adjust-toolchain
toolchain_make expect
toolchain_make dejagnu
toolchain_make gcc PASS=2
- toolchain_make binutils PASS=2
+ toolchain_make binutils PASS=2
fi
toolchain_make ncurses
#ipfire_make mbr
}
+################################################################################
+# This builds the entire stage "uclibc" #
+################################################################################
+uclibc_build() {
+
+ PATH=${UCLIBC_DIR}/bin:${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
+ STAGE_ORDER=05
+ STAGE=uclibc
+
+ LOGFILE="$BASEDIR/log_${MACHINE}/_build.${STAGE_ORDER}-uclibc.log"
+ export LOGFILE
+
+ 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 uClibc PASS=2
+ ipfire_make gettext PASS=2
+ ipfire_make busybox
+ ipfire_make udev
+ ipfire_make ncurses
+ #ipfire_make e2fsprogs
+ #ipfire_make util-linux-ng
+}
+
################################################################################
# This builds the entire stage "installer" #
################################################################################
installer_build() {
PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
- STAGE_ORDER=05
+ STAGE_ORDER=06
STAGE=installer
LOGFILE="$BASEDIR/log_${MACHINE}/_build.${STAGE_ORDER}-installer.log"
export LOGFILE
- ipfire_make stage5
- ipfire_make busybox
+ ipfire_make stage6
ipfire_make installer
ipfire_make initramfs
}
packages_build() {
PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
- STAGE_ORDER=06
+ STAGE_ORDER=07
STAGE=packages
LOGFILE="$BASEDIR/log_${MACHINE}/_build.${STAGE_ORDER}-packages.log"
export LOGFILE
- toolchain_make strip
-
- # Generating list of packages used
+ toolchain_make strip
+
+ # Generating list of packages used
### MISSING ATM
ipfire_make cdrom
- # Check if there is a loop device for building in virtual environments
- #if [ -e /dev/loop/0 ] || [ -e /dev/loop0 ]; then
- # ipfire_make usb-stick
- #fi
- mv $LFS/$IMAGES_DIR/{*.iso,*.tgz,*.img.gz} $BASEDIR >> $LOGFILE 2>&1
+ # Check if there is a loop device for building in virtual environments
+ #if [ -e /dev/loop/0 ] || [ -e /dev/loop0 ]; then
+ # ipfire_make usb-stick
+ #fi
+ mv $LFS/$IMAGES_DIR/{*.iso,*.tgz,*.img.gz} $BASEDIR >> $LOGFILE 2>&1
#ipfire_make core-updates
### DISABLED ATM
fi
done
- # Cleanup
- stdumount
- rm -rf $LFS/tmp/*
-
- cd $PWD
+ # Cleanup
+ stdumount
+ rm -rf $LFS/tmp/*
+
+ cd $PWD
}
# See what we're supposed to do
#
###############################################################################
-CONFIG_ROOT=/etc/$SNAME # Configuration rootdir
-NICE=10 # Nice level
-TARGET=i686 # Default target
+CONFIG_ROOT=/etc/$SNAME # Configuration rootdir
+NICE=10 # Nice level
+TARGET=i686 # Default target
KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }' | tr -d '\n'; grep --max-count=1 FULLVER lfs/linux | awk '{ print $3 }' | cut -c 7-| tail -1`
MACHINE_REAL=`uname -m`
GIT_TAG=$(git tag | tail -1)
IFS_TARGET="${MACHINE}-pc-linux-gnu"
CFLAGS="-march=${MACHINE} -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
+ UCLIBC_TARGET=i386-pc-linux-uclibc
+ UCLIBC_LINKER=/ulib/ld-uClibc.so.0
+ UCLIBC_CFLAGS="-march=i386 -Os -pipe -fomit-frame-pointer"
elif [ 'via-c7' = $TARGET ]; then
MACHINE=i686
MACHINE_REAL=${MACHINE_REAL}
IFS_TARGET="${MACHINE}-pc-linux-gnu"
CFLAGS="-march=${MACHINE} -mmmx -msse -msse2 -msse3 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
+ UCLIBC_TARGET=i386-pc-linux-uclibc
+ UCLIBC_LINKER=/ulib/ld-uClibc.so.0
+ UCLIBC_CFLAGS="-march=i386 -Os -pipe -fomit-frame-pointer"
elif [ 'via-c3' = $TARGET ]; then
MACHINE=i586
MACHINE_REAL=${MACHINE_REAL}
IFS_TARGET="${MACHINE}-pc-linux-gnu"
CFLAGS="-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
+ UCLIBC_TARGET=i386-pc-linux-uclibc
+ UCLIBC_LINKER=/ulib/ld-uClibc.so.0
+ UCLIBC_CFLAGS="-march=i386 -Os -pipe -fomit-frame-pointer"
else
beautify message FAIL
echo "Not a valid target arch (i686|i586|i486|i386|via-c7|via-c3) - $TARGET"
# include machine in TOOLCHAINNAME
TOOLCHAINNAME=$SNAME-$TOOLCHAINVERSION-toolchain-t${TARGET}-m${MACHINE}
+# The place where all uclibc files are stored in
+UCLIBC_DIR=/usr/${UCLIBC_TARGET}
###############################################################################
#
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" \
} # End of toolchain_make()
################################################################################
-# This is the function that builds every package in stage "base" #
+# This is the function that builds every package in stage "base" and "ipfire" #
################################################################################
ipfire_make() {
lfsmakecommoncheck $*
if grep -qEi 'KERNEL_MOD = yes' $1 ; then
unset EXTRA_MAKE
fi
+
+ local MYCFLAGS MYCXXFLAGS
+ if [ "${STAGE}" = "uclibc" ]; then
+ MYCFLAGS=${UCLIBC_CFLAGS}
+ MYCXXFLAGS=${UCLIBC_CFLAGS}
+ else
+ MYCFLAGS=${CFLAGS}
+ MYCXXFLAGS=${CXXFLAGS}
+ fi
local PKG_TIME_START=`date +%s`
chroot $LFS $TOOLS_DIR/bin/env -i \
INSTALLER_DIR=$INSTALLER_DIR \
CDROM_DIR=$CDROM_DIR \
IMAGES_DIR=$IMAGES_DIR \
+ UCLIBC_DIR=$UCLIBC_DIR \
+ UCLIBC_TARGET=$UCLIBC_TARGET \
+ UCLIBC_LINKER=$UCLIBC_LINKER \
MACHINE="$MACHINE" \
MACHINE_REAL="$MACHINE_REAL" \
- CFLAGS="$CFLAGS" \
- CXXFLAGS="$CXXFLAGS" \
+ CFLAGS="$MYCFLAGS" \
+ CXXFLAGS="$MYCXXFLAGS" \
IFS_HOST="$IFS_HOST" \
IFS_TARGET="$IFS_TARGET" \
KVER=$KVER \
mkdir -p $BASEDIR/log_${MACHINE}/02_base 2>/dev/null
mkdir -p $BASEDIR/log_${MACHINE}/03_${SNAME} 2>/dev/null
mkdir -p $BASEDIR/log_${MACHINE}/04_misc 2>/dev/null
- mkdir -p $BASEDIR/log_${MACHINE}/05_installer 2>/dev/null
- mkdir -p $BASEDIR/log_${MACHINE}/06_packages 2>/dev/null
+ mkdir -p $BASEDIR/log_${MACHINE}/05_uclibc 2>/dev/null
+ mkdir -p $BASEDIR/log_${MACHINE}/06_installer 2>/dev/null
+ mkdir -p $BASEDIR/log_${MACHINE}/07_packages 2>/dev/null
#############################################################################
# Are we running the right shell? #
mknod -m 666 $BASEDIR/build/dev/null c 1 3 2>/dev/null
# Make all sources and proc available under lfs build
- mount --bind /dev $LFS/dev
- mount --bind /proc $LFS/proc
- mount --bind $BASEDIR/cache $LFS/usr/src/cache
- mount --bind $BASEDIR/ccache $LFS/usr/src/ccache
- mount --bind $BASEDIR/distcc $LFS/usr/src/distcc
- mount --bind $BASEDIR/config $LFS/usr/src/config
- mount --bind $BASEDIR/doc $LFS/usr/src/doc
- mount --bind $BASEDIR/lfs $LFS/usr/src/lfs
- mount --bind $BASEDIR/log_${MACHINE} $LFS/usr/src/log_${MACHINE}
- mount --bind $BASEDIR/src $LFS/usr/src/src
- mount --bind $BASEDIR/build_${MACHINE}/$TOOLS_DIR $LFS/$TOOLS_DIR
- mount --bind $BASEDIR/build_${MACHINE}/$CTOOLS_DIR $LFS/$CTOOLS_DIR
- mount --bind $BASEDIR/build_${MACHINE}/$INSTALLER_DIR $LFS/$INSTALLER_DIR
- mount --bind $BASEDIR/build_${MACHINE}/$CDROM_DIR $LFS/$CDROM_DIR
- mount --bind $BASEDIR/build_${MACHINE}/$IMAGES_DIR $LFS/$IMAGES_DIR
+ mount --bind /dev $LFS/dev
+ mount --bind /proc $LFS/proc
+ mount --bind $BASEDIR/cache $LFS/usr/src/cache
+ mount --bind $BASEDIR/ccache $LFS/usr/src/ccache
+ mount --bind $BASEDIR/distcc $LFS/usr/src/distcc
+ mount --bind $BASEDIR/config $LFS/usr/src/config
+ mount --bind $BASEDIR/doc $LFS/usr/src/doc
+ mount --bind $BASEDIR/lfs $LFS/usr/src/lfs
+ mount --bind $BASEDIR/log_${MACHINE} $LFS/usr/src/log_${MACHINE}
+ mount --bind $BASEDIR/src $LFS/usr/src/src
+ mount --bind $BASEDIR/build_${MACHINE}/$TOOLS_DIR $LFS/$TOOLS_DIR
+ mount --bind $BASEDIR/build_${MACHINE}/$CTOOLS_DIR $LFS/$CTOOLS_DIR
+ mount --bind $BASEDIR/build_${MACHINE}/$INSTALLER_DIR $LFS/$INSTALLER_DIR
+ mount --bind $BASEDIR/build_${MACHINE}/$CDROM_DIR $LFS/$CDROM_DIR
+ mount --bind $BASEDIR/build_${MACHINE}/$IMAGES_DIR $LFS/$IMAGES_DIR
# Run LFS static binary creation scripts one by one
export CCACHE_DIR=$BASEDIR/ccache
beautify build_stage "Building miscellaneous"
misc_build
+ beautify build_stage "Building uclibc"
+ uclibc_build
+
beautify build_stage "Building installer"
installer_build