# log/<TARGET> name. Modified files are not identified
#
define FIND_FILES
- cd $(ROOT)/ && find -mount \
- -not -path './tools*' -not -path './tmp*' -not -path './usr/src*' \
- -not -path './dev*' -not -path './proc*' -not -path './install*'
+ cd $(LFS)/ && 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*'
endef
# This is common starting logic for builds.
#
-ifeq "$(ROOT)" ""
+ifneq "$(STAGE)" "toolchain"
define PREBUILD
echo "====================================== Installing $(THISAPP) ..."
- @echo "Install started; saving file list to $(DIR_SRC)/lsalr ..."
- @if [ ! -f $(DIR_SRC)/lsalr ]; then $(FIND_FILES) > $(DIR_SRC)/lsalr; fi
- # Fix installation on partial rebuild, so modules install where they should
- # and not everytime on the last compiled kernel
- if [ -f $(DIR_SRC)/linux-$(KVER) ]; then \
- if [ "$(SMP)" = "" ]; then \
- cd $(DIR_SRC)/linux-$(KVER) && \
- sed -i -e 's+^EXTRAVERSION.*$$+EXTRAVERSION\ =\ $(word 4,$(subst ., .,$(KVER)))-ipfire+' Makefile; \
- else \
- cd $(DIR_SRC)/linux-$(KVER) && \
- sed -i -e 's+^EXTRAVERSION.*$$+EXTRAVERSION\ =\ $(word 4,$(subst ., .,$(KVER)))-ipfire-smp+' Makefile; \
- fi; \
- fi
+ echo "Install started; saving file list to $(DIR_SRC)/lsalr ..."
+ if [ ! -f $(DIR_SRC)/lsalr ]; then $(FIND_FILES) > $(DIR_SRC)/lsalr; fi
endef
else
define PREBUILD
# Common end-of-installation logic for Stage 2 and beyond.
#
-ifeq "$(ROOT)" ""
+ifneq "$(STAGE)" "toolchain"
define POSTBUILD
@echo "Install done; saving file list to $(TARGET) ..."
@$(FIND_FILES) > $(DIR_SRC)/lsalrnew
- @diff $(DIR_SRC)/lsalr $(DIR_SRC)/lsalrnew | grep '^> ' | sed 's/^> //' | sort > $(TARGET)_diff
- @cp -f $(DIR_SRC)/lsalrnew $(DIR_SRC)/lsalr
- @rm -f $(DIR_SRC)/lsalrnew
- sed -i -e 's+.\/++' $(TARGET)_diff
+ @diff $(DIR_SRC)/lsalr $(DIR_SRC)/lsalrnew | grep '^> ' | sed 's+^> \./++' | sort > $(TARGET)_diff
+ @mv -f $(DIR_SRC)/lsalrnew $(DIR_SRC)/lsalr
# compare roofile ( same name as lfs script) with the list of installed files
# special cases
# - if the corresponding rootfile is not found, touch $(TARGET)_missing_rootfile
# $(TARGET)_rootfile : ROOTFILE with KVER replacement
# $(TARGET) : log result with {commented|include|added} files
if [ -s "$(TARGET)_diff" ]; then \
- if [ "$(PASS)" = "SMP" ]; then LFS_SCRIPT=$(firstword $(MAKEFILE_LIST))-smp; \
- else LFS_SCRIPT=$(firstword $(MAKEFILE_LIST)); \
- fi; \
- echo $(LFS_SCRIPT); \
- ROOTFILE=`find $(DIR_SRC)/config/rootfiles/common $(DIR_SRC)/config/rootfiles/packages -maxdepth 1 -type f -name $$LFS_SCRIPT`; \
+ LFS_SCRIPT=$(firstword $(MAKEFILE_LIST)); \
+ ROOTFILE=`find $(DIR_SRC)/config/rootfiles/common -maxdepth 1 -type f -name $$LFS_SCRIPT`; \
if [ "$$ROOTFILE" = "" ]; then \
- ROOTFILE=`find $(DIR_SRC)/config/rootfiles/ver_$(IPFVER) -type f -name $$LFS_SCRIPT`; \
+ ROOTFILE=`find $(DIR_SRC)/config/rootfiles/packages -type f -name $$LFS_SCRIPT`; \
fi; \
if [ "$$ROOTFILE" = "" ]; then \
touch $(TARGET)_missing_rootfile; \
ROOTFILE=$(TARGET)_missing_rootfile ; \
echo "error $$LFS_SCRIPT not found in config/rootfiles"; \
fi; \
- sed "s/KVER/$(KVER)/g" $$ROOTFILE > $(TARGET)_rootfile; \
- for line in `cat $(TARGET)_diff`; do \
- if grep -qE "^#$$line$$" $(TARGET)_rootfile; then echo "#$$line" >> $(TARGET); \
- elif grep -qE "^$$line$$" $(TARGET)_rootfile ; then echo "$$line" >> $(TARGET); \
- else echo "+$$line" >> $(TARGET); \
- fi; \
- done; \
+ sed "s/KVER/$(KVER)/g" $$ROOTFILE > $(TARGET)_rootfile; \
+ echo 'open (F,"$(TARGET)_rootfile"); \
+ while (<F>) { $$allfile{$$_} = "x" };close (F); \
+ while (<>) { \
+ if ( defined ($$allfile{"#$$_"}) ) {print "#$$_"} \
+ elsif ( defined ($$allfile{$$_}) ) {print $$_} \
+ else {print "+$$_"} \
+ }; \
+ ' > /tmp/perl.pl; \
+ perl /tmp/perl.pl <$(TARGET)_diff > $(TARGET); \
rm -f $(TARGET)_rootfile; \
else \
touch $(TARGET); \
fi
@rm -f $(TARGET)_diff
+
+ if [ "$(OTHER_SRC)" = "yes" ] && \
+ ! grep -qEi "^$(PKG_NAME),$(VER),$(STAGE_ORDER),$(STAGE)" $(DIR_SRC)/LIST_OF_SOFTWARE-$(MACHINE).txt; then \
+ echo "$(PKG_NAME),$(VER),$(STAGE_ORDER),$(STAGE)" >> $(DIR_SRC)/LIST_OF_SOFTWARE-$(MACHINE).txt; \
+ fi
+
+ @echo "===================================== Install done for $(THISAPP)."
endef
else
define POSTBUILD
+ if [ "$(OTHER_SRC)" = "yes" ] && \
+ ! grep -qEi "^$(PKG_NAME),$(VER),$(STAGE_ORDER),$(STAGE)" $(DIR_SRC)/LIST_OF_SOFTWARE-$(MACHINE).txt; then \
+ echo "$(PKG_NAME),$(VER),$(STAGE_ORDER),$(STAGE)" >> $(DIR_SRC)/LIST_OF_SOFTWARE-$(MACHINE).txt; \
+ fi
+
@echo "===================================== Install done for $(THISAPP)."
touch $(TARGET)
endef
rm -vf `grep -l "DO NOT EDIT THIS FILE" $${GCC_INCLUDEDIR}/*` && \
unset GCC_INCLUDEDIR
endif
+
+ifeq "$(STAGE)" "base"
+ mv -v $(TOOLS_DIR)/bin/{ld,ld-old}
+ mv -v $(TOOLS_DIR)/$$(gcc -dumpmachine)/bin/{ld,ld-old}
+ mv -v $(TOOLS_DIR)/bin/{ld-new,ld}
+ 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
+endif
@$(POSTBUILD)
cd $(DIR_APP) && make -j $(PARALLELISM)
cd $(DIR_APP) && make install
ln -sf bash $(TOOLS_DIR)/bin/sh
+
+ # Without the following lines, stage2 will not work
+ if [ ! -e $(LFS)/bin/bash ]; then \
+ install -d $(LFS)/bin && \
+ ln -sf $(TOOLS_DIR)/bin/bash $(LFS)/bin && \
+ ln -sf bash $(LFS)/bin/sh; \
+ fi
@rm -rf $(DIR_APP)
@$(POSTBUILD)
include Config
-VER = 4.4.20
+PKG_NAME = db
+VER = 4.6.21
-THISAPP = db-$(VER)
+THISAPP = $(PKG_NAME)-$(VER)
DL_FILE = $(THISAPP).tar.gz
-DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
objects = $(DL_FILE)
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-
-$(DL_FILE)_MD5 = d84dff288a19186b136b0daf7067ade3
-
install : $(TARGET)
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
download :$(patsubst %,$(DIR_DL)/%,$(objects))
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
-
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
-$(subst %,%_MD5,$(objects)) :
- @$(MD5)
-
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/db-4.4.20-fixes-1.patch
cd $(DIR_APP)/build_unix && ../dist/configure --prefix=/usr --enable-compat185 --enable-cxx
- cd $(DIR_APP)/build_unix && make $(MAKETUNING)
+ cd $(DIR_APP)/build_unix && make -j $(PARALLELISM)
cd $(DIR_APP)/build_unix && make docdir=/usr/share/doc/$(THISAPP) install
- chown -v root:root /usr/bin/db_* /usr/lib/libdb* /usr/include/db*
chown -Rv root:root /usr/share/doc/$(THISAPP)
@rm -rf $(DIR_APP)
@$(POSTBUILD)
cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib
cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new $(TOOLS_DIR)/bin
endif
+
+ifeq "$(STAGE)" "base"
+ cd $(DIR_SRC)/binutils-build && ../$(THISAPP)/configure --prefix=/usr \
+ --enable-shared
+ cd $(DIR_SRC)/binutils-build && make tooldir=/usr -j $(PARALLELISM)
+ cd $(DIR_SRC)/binutils-build && make tooldir=/usr install
+
+ cp -fv ../$(THISAPP)/include/libiberty.h /usr/include
+endif
@rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build
@$(POSTBUILD)
include Config
-VER = 2.2
+PKG_NAME = bison
+VER = 2.3
-THISAPP = bison-$(VER)
+THISAPP = $(PKG_NAME)-$(VER)
DL_FILE = $(THISAPP).tar.bz2
-DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
-TARGET = $(DIR_INFO)/$(THISAPP)
+
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
###############################################################################
# Top-level Rules
objects =$(DL_FILE)
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-
-$(DL_FILE)_MD5 = e345a5d021db850f06ce49eba78af027
-
install : $(TARGET)
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
download :$(patsubst %,$(DIR_DL)/%,$(objects))
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
-
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
-$(subst %,%_MD5,$(objects)) :
- @$(MD5)
-
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && ./configure --prefix=/usr --disable-nls
- # Disable NLS
- #cd $(DIR_APP) && echo '#define YYENABLE_NLS 1' >> config.h
- cd $(DIR_APP) && make $(MAKETUNING)
- cd $(DIR_APP) && make $(EXTRA_INSTALL) install
+ cd $(DIR_APP) && ./configure --prefix=/usr
+ cd $(DIR_APP) && echo '#define YYENABLE_NLS 1' >> config.h
+ cd $(DIR_APP) && make -j $(PARALLELISM)
+ cd $(DIR_APP) && make install
@rm -rf $(DIR_APP)
@$(POSTBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -p0 < $(DIR_SRC)/src/patches/$(THISAPP).patch
cd $(DIR_APP) && CFLAGS="-O2 -static" ./configure --prefix=$(PREFIX)
- cd $(DIR_APP) && make
+ cd $(DIR_APP) && make -j $(PARALLELISM)
cd $(DIR_APP) && make install
ln -sf ccache $(PREFIX)/bin/gcc
ln -sf ccache $(PREFIX)/bin/g++
# Top-level Rules
###############################################################################
-objects =$(DL_FILE)
+objects = $(DL_FILE) $(THISAPP)-uname-1.patch \
+ $(THISAPP)-suppress_uptime_kill_su-1.patch $(THISAPP)-i18n-1.patch
install : $(TARGET)
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
+ifeq "$(STAGE)" "toolchain"
cd $(DIR_APP) && \
for file in src/{copy,touch}.c lib/utimens.{c,h}; do \
cp -v $$file{,.orig}; \
cd $(DIR_APP) && ./configure --prefix=$(TOOLS_DIR)
cd $(DIR_APP) && make -j $(PARALLELISM)
cd $(DIR_APP) && make install
+
cd $(DIR_APP) && cp -v src/su $(TOOLS_DIR)/bin/su-tools
+endif
+
+ifeq "$(STAGE)" "base"
+ cd $(DIR_APP) && sed -i 's/futimens/gl_&/' src/{copy,touch}.c lib/utimens.{c,h}
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-uname-1.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-suppress_uptime_kill_su-1.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-i18n-1.patch
+
+ cd $(DIR_APP) && ./configure --prefix=/usr
+ cd $(DIR_APP) && make -j $(PARALLELISM)
+ cd $(DIR_APP) && make install
+
+ mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
+ mv -v /usr/bin/{false,hostname,ln,ls,mkdir,mknod,mv,pwd,readlink,rm} /bin
+ mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
+ mv -v /usr/bin/chroot /usr/sbin
+ mv -v /usr/bin/{head,sleep,nice} /bin
+endif
@rm -rf $(DIR_APP)
@$(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 = distcc
+VER = 2.18.3
+
+THISAPP = $(PKG_NAME)-$(VER)
+DL_FILE = $(THISAPP).tar.bz2
+DIR_APP = $(DIR_SRC)/$(THISAPP)
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
+PREFIX = $(LFS_BASEDIR)/build_$(MACHINE)/usr/local/distcc
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+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)
+ cd $(DIR_APP) && CFLAGS="-O2 -static" ./configure --prefix=$(PREFIX)
+ cd $(DIR_APP) && make -j $(PARALLELISM)
+ cd $(DIR_APP) && make install
+ #ln -sf distcc $(PREFIX)/bin/gcc
+ #ln -sf distcc $(PREFIX)/bin/g++
+ #ln -sf distcc $(PREFIX)/bin/cc
+ @rm -rf $(DIR_APP)
+ @$(POSTBUILD)
include Config
-VER = 1.39
+PKG_NAME = e2fsprogs
+VER = 1.40.2
-THISAPP = e2fsprogs-$(VER)
+THISAPP = $(PKG_NAME)-$(VER)
DL_FILE = $(THISAPP).tar.gz
-DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
-TARGET = $(DIR_INFO)/$(THISAPP)
+
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
###############################################################################
# Top-level Rules
objects = $(DL_FILE)
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-
-$(DL_FILE)_MD5 = 06f7806782e357797fad1d34b7ced0c6
-
install : $(TARGET)
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
-download :$(patsubst %,$(DIR_DL)/%,$(objects))
-
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
+download : $(patsubst %,$(DIR_DL)/%,$(objects))
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
-$(subst %,%_MD5,$(objects)) :
- @$(MD5)
-
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
- @rm -rf $(DIR_APP) $(DIR_SRC)/e2fsprogs-build && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_SRC) && mkdir build
- cd $(DIR_SRC)/build && $(DIR_APP)/configure --prefix=/usr --with-root-prefix="" \
- --enable-elf-shlibs --disable-evms --disable-nls
- cd $(DIR_SRC)/build && make $(MAKETUNING)
- cd $(DIR_SRC)/build && make install
- cd $(DIR_SRC)/build && make install-libs
- @rm -rf $(DIR_APP) $(DIR_SRC)/e2fsprogs-build
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+ -mkdir $(DIR_APP)/build
+ cd $(DIR_APP)/build && ../configure --prefix=/usr --with-root-prefix="" \
+ --enable-elf-shlibs
+ cd $(DIR_APP)/build && make -j $(PARALLELISM)
+ cd $(DIR_APP)/build && make install
+ cd $(DIR_APP)/build && make install-libs
+ @rm -rf $(DIR_APP)
@$(POSTBUILD)
cd $(DIR_SRC)/gcc-build && CC="gcc -B/usr/bin/" ../gcc-4.2.2/configure \
--prefix=$(TOOLS_DIR) --with-local-prefix=/tools --disable-nls \
--enable-shared --enable-languages=c
- cd $(DIR_SRC)/gcc-build && make bootstrap -j $(PARALLELISM)
+
+ cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM)
cd $(DIR_SRC)/gcc-build && make install
ln -vs gcc $(TOOLS_DIR)/bin/cc
endif
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_APP) && sed "s,/tools,$(TOOLS_DIR),g" $(DIR_PATCHES)/$(THISAPP)-specs-1.patch | patch -Np1
+
+ 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; \
+ 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 \
cd $(DIR_SRC)/gcc-build && make install
endif
+ifeq "$(STAGE)" "base"
+ cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
+ cd $(DIR_APP) && sed -i 's/^XCFLAGS =$$/& -fomit-frame-pointer/' gcc/Makefile.in
+ cd $(DIR_APP) && sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
+ cd $(DIR_APP) && sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.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
+
+ cd $(DIR_SRC)/gcc-build && make -j $(PARALLELISM)
+ cd $(DIR_SRC)/gcc-build && make install
+
+ ln -sfv ../usr/bin/cpp /lib
+ ln -sfv gcc /usr/bin/cc
+endif
+
@rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build
@$(POSTBUILD)
# Top-level Rules
###############################################################################
-objects = $(DL_FILE)
+objects = $(DL_FILE) glibc-libidn-$(VER).tar.bz2
install : $(TARGET)
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
+ @mkdir $(DIR_SRC)/glibc-build
ifeq "$(STAGE)" "toolchain"
- @mkdir $(DIR_SRC)/glibc-build
cd $(DIR_SRC)/glibc-build && echo "CFLAGS += -march=$(MACHINE)" > configparms
cd $(DIR_SRC)/glibc-build && CFLAGS="$(CFLAGS)" ../$(THISAPP)/configure \
--prefix=$(TOOLS_DIR) --disable-profile --enable-add-ons \
cd $(DIR_SRC)/glibc-build && make install
endif
+ifeq "$(STAGE)" "base"
+ tar jxf $(DIR_DL)/glibc-libidn-$(VER).tar.bz2 -C $(DIR_APP)
+ cd $(DIR_APP) && mv glibc-libidn-$(VER) libidn
+ cd $(DIR_APP) && sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
+ cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=$(LINKER) -o|' \
+ scripts/test-installation.pl
+ cd $(DIR_APP) && sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
+ cd $(DIR_SRC)/glibc-build && echo "CFLAGS += -march=$(MACHINE)" > configparms
+ cd $(DIR_SRC)/glibc-build && ../$(THISAPP)/configure --prefix=/usr \
+ --disable-profile --enable-add-ons --enable-kernel=2.6.0 \
+ --libexecdir=/usr/lib/glibc
+
+ cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=-j$(PARALLELISM)
+ touch /etc/ld.so.conf
+ cd $(DIR_SRC)/glibc-build && make install
+
+ # Locales
+ -mkdir -pv /usr/lib/locale
+ localedef -i en_US -f UTF-8 en_US.UTF-8
+ localedef -i en_US -f ISO-8859-1 en_US
+ localedef -i en_GB -f UTF-8 en_GB.UTF-8
+ localedef -i en_GB -f ISO-8859-1 en_GB
+
+ # Timezone
+ cp -v --remove-destination /usr/share/zoneinfo/GMT /etc/localtime
+endif
+
@rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
@$(POSTBUILD)
include Config
-VER = 2.10
+PKG_NAME = iana-etc
+VER = 2.20
-THISAPP = iana-etc-$(VER)
+THISAPP = $(PKG_NAME)-$(VER)
DL_FILE = $(THISAPP).tar.bz2
-DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
-TARGET = $(DIR_INFO)/$(THISAPP)
+
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
###############################################################################
# Top-level Rules
objects = $(DL_FILE)
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-
-$(DL_FILE)_MD5 = 53dea53262b281322143c744ca60ffbb
-
install : $(TARGET)
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
-download :$(patsubst %,$(DIR_DL)/%,$(objects))
-
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
+download : $(patsubst %,$(DIR_DL)/%,$(objects))
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
-$(subst %,%_MD5,$(objects)) :
- @$(MD5)
-
###############################################################################
# Installation Details
###############################################################################
include Config
-VER = 1.5.22
+PKG_NAME = libtool
+VER = 1.5.24
-THISAPP = libtool-$(VER)
+THISAPP = $(PKG_NAME)-$(VER)
DL_FILE = $(THISAPP).tar.gz
-DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
-TARGET = $(DIR_INFO)/$(THISAPP)
+
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
###############################################################################
# Top-level Rules
objects = $(DL_FILE)
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-
-$(DL_FILE)_MD5 = 8e0ac9797b62ba4dcc8a2fb7936412b0
-
install : $(TARGET)
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
download :$(patsubst %,$(DIR_DL)/%,$(objects))
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
-
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
-$(subst %,%_MD5,$(objects)) :
- @$(MD5)
-
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && ./configure --prefix=/usr --disable-nls
- cd $(DIR_APP) && make $(MAKETUNING)
+ cd $(DIR_APP) && ./configure --prefix=/usr
+ cd $(DIR_APP) && make -j $(PARALLELISM)
cd $(DIR_APP) && make install
@rm -rf $(DIR_APP)
@$(POSTBUILD)
CFLAGS =
CXXFLAGS =
-ifeq "$(STAGE)" "toolchain"
- TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
-endif
-
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
###############################################################################
# Top-level Rules
cd $(DIR_APP) && cp -rv dest/include/* $(TOOLS_DIR)/include
endif
+ifeq "$(STAGE)" "base"
+ cd $(DIR_APP) && sed -i '/scsi/d' include/Kbuild
+ cd $(DIR_APP) && make mrproper
+ cd $(DIR_APP) && make headers_check
+ cd $(DIR_APP) && make INSTALL_HDR_PATH=dest headers_install
+ cd $(DIR_APP) && cp -rv dest/include/* /usr/include
+endif
+
@rm -rf $(DIR_APP)
@$(POSTBUILD)
include Config
-VER = 1.4.4
+PKG_NAME = m4
+VER = 1.4.10
-THISAPP = m4-$(VER)
-DL_FILE = $(THISAPP).tar.gz
-DL_FROM = $(URL_IPFIRE)
+THISAPP = $(PKG_NAME)-$(VER)
+DL_FILE = $(THISAPP).tar.bz2
DIR_APP = $(DIR_SRC)/$(THISAPP)
-# Normal build or /tools build.
-#
-ifeq "$(ROOT)" ""
- TARGET = $(DIR_INFO)/$(THISAPP)
- EXTRA_CONFIG = --prefix=/usr --disable-nls
- EXTRA_LDFLAGS =
- EXTRA_MAKE =
- EXTRA_INSTALL =
-else
- TARGET = $(DIR_INFO)/$(THISAPP)-tools
- EXTRA_CONFIG = --prefix=/tools --disable-nls
- EXTRA_LDFLAGS = -static
- EXTRA_MAKE =
- EXTRA_INSTALL =
-endif
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
###############################################################################
# Top-level Rules
objects = $(DL_FILE)
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-
-$(DL_FILE)_MD5 = 8d1d64dbecf1494690a0f3ba8db4482a
-
install : $(TARGET)
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
download :$(patsubst %,$(DIR_DL)/%,$(objects))
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
-
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
-$(subst %,%_MD5,$(objects)) :
- @$(MD5)
-
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
- @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && LDFLAGS="$(EXTRA_LDFLAGS)" ./configure $(EXTRA_CONFIG)
- cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE)
- cd $(DIR_APP) && make $(EXTRA_INSTALL) install
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
+ cd $(DIR_APP) && ./configure --prefix=/usr
+ cd $(DIR_APP) && make -j $(PARALLELISM)
+ cd $(DIR_APP) && make install
@rm -rf $(DIR_APP)
@$(POSTBUILD)
include Config
-VER = 2.34
+PKG_NAME = man-pages
+VER = 2.67
-THISAPP = man-pages-$(VER)
+THISAPP = $(PKG_NAME)-$(VER)
DL_FILE = $(THISAPP).tar.bz2
-DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
-TARGET = $(DIR_INFO)/$(THISAPP)
+
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
###############################################################################
# Top-level Rules
objects = $(DL_FILE)
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-
-$(DL_FILE)_MD5 = fb8d9f55fef19ea5ab899437159c9420
-
install : $(TARGET)
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
-download :$(patsubst %,$(DIR_DL)/%,$(objects))
-
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
+download : $(patsubst %,$(DIR_DL)/%,$(objects))
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
-$(subst %,%_MD5,$(objects)) :
- @$(MD5)
-
###############################################################################
# Installation Details
###############################################################################
# Top-level Rules
###############################################################################
-objects = $(DL_FILE)
+objects = $(DL_FILE) $(THISAPP)-coverity_fixes-1.patch
install : $(TARGET)
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+
+ifeq "$(STAGE)" "toolchain"
cd $(DIR_APP) && ./configure --prefix=$(TOOLS_DIR) --with-shared \
--without-debug --without-ada --enable-overwrite
+
cd $(DIR_APP) && make -j $(PARALLELISM)
cd $(DIR_APP) && make install
+endif
+
+ifeq "$(STAGE)" "base"
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-coverity_fixes-1.patch
+ cd $(DIR_APP) && ./configure --prefix=/usr --with-shared --without-debug --enable-widec
+
+ cd $(DIR_APP) && make -j $(PARALLELISM)
+ cd $(DIR_APP) && make install
+
+ chmod -v 644 /usr/lib/libncurses++w.a
+ 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 ; \
+ done
+ ln -sfv libncurses++w.a /usr/lib/libncurses++.a
+
+ rm -vf /usr/lib/libcursesw.so
+ echo "INPUT(-lncursesw)" >/usr/lib/libcursesw.so
+ ln -sfv libncurses.so /usr/lib/libcurses.so
+ ln -sfv libncursesw.a /usr/lib/libcursesw.a
+ ln -sfv libncurses.a /usr/lib/libcurses.a
+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)
+
+ifeq "$(STAGE)" "toolchain"
cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-libc-2.patch
cd $(DIR_APP) && mv -v makedepend.SH{,.orig}
cd $(DIR_APP) && sed 's/command /command[ -]/' makedepend.SH.orig > makedepend.SH
+
cd $(DIR_APP) && ./configure.gnu --prefix=$(TOOLS_DIR) -Dstatic_ext='Data/Dumper Fcntl IO POSIX'
+
cd $(DIR_APP) && make perl utilities -j $(PARALLELISM)
+
cd $(DIR_APP) && cp -v perl pod/pod2man $(TOOLS_DIR)/bin
-mkdir -pv $(TOOLS_DIR)/lib/perl5/$(VER)
cd $(DIR_APP) && cp -Rv lib/* $(TOOLS_DIR)/lib/perl5/$(VER)
+endif
+
+ifeq "$(STAGE)" "base"
+ echo "127.0.0.1 localhost $(hostname)" > /etc/hosts
+
+ cd $(DIR_APP) && sed -i 's/command /command[ -]/' makedepend.SH
+ cd $(DIR_APP) && ./configure.gnu --prefix=/usr \
+ -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 \
+ -Dpager="/usr/bin/less -isR"
+
+ cd $(DIR_APP) && make -j $(PARALLELISM)
+ cd $(DIR_APP) && make install
+
+ rm -f /etc/hosts
+endif
+
@rm -rf $(DIR_APP)
@$(POSTBUILD)
include Config
-VER = 3.2.6
+PKG_NAME = procps
+VER = 3.2.7
-THISAPP = procps-$(VER)
+THISAPP = $(PKG_NAME)-$(VER)
DL_FILE = $(THISAPP).tar.gz
-DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
-TARGET = $(DIR_INFO)/$(THISAPP)
+
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
###############################################################################
# Top-level Rules
objects = $(DL_FILE)
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-
-$(DL_FILE)_MD5 = 7ce39ea27d7b3da0e8ad74dd41d06783
-
install : $(TARGET)
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
download :$(patsubst %,$(DIR_DL)/%,$(objects))
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
-
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
-$(subst %,%_MD5,$(objects)) :
- @$(MD5)
-
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && make $(MAKETUNING)
+ cd $(DIR_APP) && make -j $(PARALLELISM)
cd $(DIR_APP) && make install
- install -m 0644 $(DIR_SRC)/config/etc/sysctl.conf /etc
@rm -rf $(DIR_APP)
@$(POSTBUILD)
include Config
-VER = 5.1
+PKG_NAME = readline
+VER = 5.2
-THISAPP = readline-$(VER)
+THISAPP = $(PKG_NAME)-$(VER)
DL_FILE = $(THISAPP).tar.gz
-DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
-TARGET = $(DIR_INFO)/$(THISAPP)
+
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
###############################################################################
# Top-level Rules
###############################################################################
-objects = $(DL_FILE)
-
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-
-$(DL_FILE)_MD5 = 7ee5a692db88b30ca48927a13fd60e46
+objects = $(DL_FILE) $(THISAPP)-fixes-4.patch
install : $(TARGET)
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
download :$(patsubst %,$(DIR_DL)/%,$(objects))
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
-
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
-$(subst %,%_MD5,$(objects)) :
- @$(MD5)
-
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
- cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/readline-5.1-fixes-3.patch
cd $(DIR_APP) && sed -i '/MV.*old/d' Makefile.in
cd $(DIR_APP) && sed -i '/{OLDSUFF}/c:' support/shlib-install
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_PATCHES)/$(THISAPP)-fixes-4.patch
+
cd $(DIR_APP) && ./configure --prefix=/usr --libdir=/lib
- cd $(DIR_APP) && make $(MAKETUNING) SHLIB_LIBS=-lncurses
+
+ cd $(DIR_APP) && make -j $(PARALLELISM) SHLIB_LIBS=-lncurses
cd $(DIR_APP) && make install
- chmod -v 755 /lib/lib{readline,history}.so*
+
mv -v /lib/lib{readline,history}.a /usr/lib
- rm -v /lib/lib{readline,history}.so
+ rm -fv /lib/lib{readline,history}.so
ln -sfv ../../lib/libreadline.so.5 /usr/lib/libreadline.so
ln -sfv ../../lib/libhistory.so.5 /usr/lib/libhistory.so
@rm -rf $(DIR_APP)
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+
+ifeq "$(STAGE)" "toolchain"
cd $(DIR_APP) && ./configure --prefix=$(TOOLS_DIR)
+endif
+
+ifeq "$(STAGE)" "base"
+ cd $(DIR_APP) && ./configure --prefix=/usr --bindir=/bin --enable-html
+endif
+
cd $(DIR_APP) && make -j $(PARALLELISM)
cd $(DIR_APP) && make install
@rm -rf $(DIR_APP)
include Config
-VER = ipfire
+PKG_NAME = stage2
+VER = LFS
-THISAPP = stage2
-TARGET = $(DIR_INFO)/$(THISAPP)
+THISAPP = $(PKG_NAME)-$(VER)
+
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
###############################################################################
# Top-level Rules
install : $(TARGET)
-check :
-
download :
-md5 :
-
###############################################################################
# Installation Details
###############################################################################
$(TARGET) :
@$(PREBUILD)
-
+
# Create directories
- -mkdir -pv /{bin,boot,etc/opt,etc/modprobe.d,home,lib,mnt,opt}
- -mkdir -pv /{media/{floppy,cdrom,usbkey},sbin,srv,var}
+ -mkdir -pv /{bin,boot,etc/opt,home,lib,mnt,opt}
+ -mkdir -pv /{media/{floppy,cdrom},sbin,srv,var}
-install -dv -m 0750 /root
-install -dv -m 1777 /tmp /var/tmp
-mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src}
-mkdir -pv /usr/{,local/}share/{doc,info,locale,man}
-mkdir -v /usr/{,local/}share/{misc,terminfo,zoneinfo}
-mkdir -pv /usr/{,local/}share/man/man{1..8}
- #-for dir in /usr /usr/local; do \
- # ln -sv share/{man,doc,info} $$dir; \
- #done
+ -for dir in /usr /usr/local; do \
+ ln -sfv share/{man,doc,info} $$dir; \
+ done
+ -mkdir -v /var/{lock,log,mail,run,spool}
+ -mkdir -pv /var/{opt,cache,lib/{misc,locate},local}
+
+ # Check for some important links and create them if they don't exist
+ if [ ! -e /bin/bash ]; then ln -sfn $(TOOLS_DIR)/bin/bash /bin/bash && ln -sf bash /bin/sh; fi
+ if [ ! -e /bin/cat ]; then ln -sfn $(TOOLS_DIR)/bin/cat /bin/cat; fi
+ if [ ! -e /bin/echo ]; then ln -sfn $(TOOLS_DIR)/bin/echo /bin/echo; fi
+ if [ ! -e /bin/grep ]; then ln -sfn $(TOOLS_DIR)/bin/grep /bin/grep; fi
+ if [ ! -e /bin/pwd ]; then ln -sfn $(TOOLS_DIR)/bin/pwd /bin/pwd; fi
+ if [ ! -e /bin/stty ]; then ln -sfn $(TOOLS_DIR)/bin/stty /bin/stty; fi
+
+ if [ ! -e /usr/bin/perl ]; then ln -sfn $(TOOLS_DIR)/bin/perl /usr/bin/perl; fi
+
+ [ ! -e /lib/libgcc_s.so.1 ] && ln -sfn $(TOOLS_DIR)/lib/libgcc_s.so{,.1} /usr/lib/
+ [ ! -e /lib/libstdc++.so.6 ] && ln -sfn $(TOOLS_DIR)/lib/libstdc++.so{,.6} /usr/lib/
+
+ # Creating an empty mtab
+ touch /etc/mtab #ln -sf /proc/mounts /etc/mtab
+
+ # This trick is necessary in order to create two devices in the target /dev
+ # rather than in the host /dev
+ mkdir -p /dev1
+ mount --move /dev /dev1
+
+ # Make /dev/null and /dev/console
+ cd /dev && rm -f null console
+ cd /dev && mknod -m 0666 null c 1 3
+ cd /dev && mknod -m 0600 console c 5 1
+
+ # Now move the target /dev to point back to the host /dev
+ mount --move /dev1 /dev
+ rm -fr /dev1
- # Symlinks
- # for this reason, stage2 rebuild will broke the iso:perl, grubbatch
- -ln -sv /tools/bin/{bash,cat,grep,pwd,stty} /bin
- -ln -sv /tools/bin/perl /usr/bin
- -ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib
- -ln -sv bash /bin/sh
-
# Config files
for i in $(DIR_SRC)/config/etc/*; do \
- [ -f $$i ] && cp $$i /etc; \
+ [ -f $$i ] && cp $$i /etc; \
done
- touch /etc/mtab
- echo "$(NAME) v$(VERSION) - $(SLOGAN)" > /etc/issue
+
+ ln -sf /proc/mounts /etc/mtab
+
+ echo "$(NAME) v$(VERSION) for $(MACHINE) - $(SLOGAN) (\l)" > /etc/issue
echo "===============================" >> /etc/issue
echo "\n running on \s \r \m" >> /etc/issue
-
+
+ touch /var/run/utmp /var/log/{btmp,lastlog,wtmp}
+ chgrp -v utmp /var/run/utmp /var/log/lastlog
+ chmod -v 664 /var/run/utmp /var/log/lastlog
+
# Bash startup files
install --directory --mode=0755 --owner=root --group=root /etc/profile.d
for i in $(DIR_SRC)/config/profile.d/*; do \
[ -f $$i ] && cp $$i /etc/profile.d; \
done
- chmod 755 /etc/bashrc
- ln -svf ../bashrc /etc/profile.d/bashrc.sh
-
+
# Scripts
for i in `find $(DIR_SRC)/src/scripts -maxdepth 1 -type f`; do \
sed "s+CONFIG_ROOT+$(CONFIG_ROOT)+g" $$i > /usr/local/bin/`basename $$i`; \
chmod 755 /usr/local/bin/`basename $$i`; \
done
-
+
# Nobody user
-mkdir -p /home/nobody
chown -R nobody:nobody /home/nobody
-
- # Create /var dirs and files
- -mkdir -v /var/{lock,log,mail,run,spool,empty}
- -mkdir -pv /var/{opt,cache,lib/{misc,locate},local}
- -mkdir -pv /var/log/{counter,calamaris}
- chown nobody.nobody /var/log/calamaris
- touch /var/run/utmp /var/log/{btmp,lastlog,wtmp,net-traffic.log}
- chgrp -v utmp /var/run/utmp /var/log/lastlog
- chmod -v 664 /var/run/utmp /var/log/lastlog
-
- # Permissions
- chmod 0711 /var/empty
- # A small hack to include /root to the iso but not all of it's files.
- touch /root/ipfire
-
@$(POSTBUILD)
ifeq "$(STAGE)" "toolchain"
-strip --strip-debug $(TOOLS_DIR)/lib/*
-strip --strip-unneeded $(TOOLS_DIR)/{,s}bin/*
- rm -rf $(TOOLS_DIR)/{info,man}
- chown -R root:root $(LFS)/$(TOOLS_DIR)
+ rm -rf $(TOOLS_DIR)/{,share/}{info,man}
+ chown -R root:root $(LFS)$(TOOLS_DIR)
endif
include Config
+PKG_NAME = zlib
VER = 1.2.3
-THISAPP = zlib-$(VER)
-DL_FILE = $(THISAPP).tar.bz2
-DL_FROM = $(URL_IPFIRE)
+THISAPP = $(PKG_NAME)-$(VER)
+DL_FILE = $(THISAPP).tar.gz
DIR_APP = $(DIR_SRC)/$(THISAPP)
-ifeq "$(LFS_PASS)" "install"
- TARGET = $(DIR_INFO)/$(THISAPP)-install
-else
- TARGET = $(DIR_INFO)/$(THISAPP)
-endif
+
+TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
+
CFLAGS += -fPIC
###############################################################################
# Top-level Rules
###############################################################################
-objects = $(DL_FILE)
-
-$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = dee233bf288ee795ac96a98cc2e369b6
+objects = $(DL_FILE)
install : $(TARGET)
-check : $(patsubst %,$(DIR_CHK)/%,$(objects))
-
download :$(patsubst %,$(DIR_DL)/%,$(objects))
-md5 : $(subst %,%_MD5,$(objects))
-
-###############################################################################
-# Downloading, checking, md5sum
-###############################################################################
-
-$(patsubst %,$(DIR_CHK)/%,$(objects)) :
- @$(CHECK)
-
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
-$(subst %,%_MD5,$(objects)) :
- @$(MD5)
-
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
- @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
-ifeq "$(LFS_PASS)" "install"
- cd $(DIR_APP) && ./configure --prefix=/opt/$(MACHINE)-uClibc
- cd $(DIR_APP) && make $(MAKETUNING)
- cd $(DIR_APP) && make install
- chmod -v 644 /opt/$(MACHINE)-uClibc/lib/libz.a
-else
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+
cd $(DIR_APP) && ./configure --prefix=/usr --shared --libdir=/lib
- cd $(DIR_APP) && make $(MAKETUNING)
+ cd $(DIR_APP) && make -j $(PARALLELISM)
cd $(DIR_APP) && make install
+
rm -v /lib/libz.so
- ln -sfv ../../lib/libz.so.1.2.3 /usr/lib/libz.so
+ ln -sfv ../../lib/libz.so.$(VER) /usr/lib/libz.so
+
cd $(DIR_APP) && make clean
cd $(DIR_APP) && ./configure --prefix=/usr
- cd $(DIR_APP) && make $(MAKETUNING)
+ cd $(DIR_APP) && make -j $(PARALLELISM)
cd $(DIR_APP) && make install
+
chmod -v 644 /usr/lib/libz.a
-endif
+
@rm -rf $(DIR_APP)
@$(POSTBUILD)
toolchain_make tar
toolchain_make texinfo
toolchain_make util-linux
- toolchain_make strip
+ # toolchain_make strip
export PATH=$ORG_PATH
}
LOGFILE="$BASEDIR/log_${MACHINE}/_build.base.log"
export LOGFILE
-
+
ipfire_make stage2
- ipfire_make linux-libc-header
+ ipfire_make linux
ipfire_make man-pages
ipfire_make glibc
- ipfire_make cleanup-toolchain PASS=3
+ ipfire_make adjust-toolchain
ipfire_make binutils
ipfire_make gcc
ipfire_make berkeley
+ ipfire_make sed
+ ipfire_make e2fsprogs
ipfire_make coreutils
ipfire_make iana-etc
ipfire_make m4
ipfire_make bison
ipfire_make ncurses
ipfire_make procps
- ipfire_make sed
ipfire_make libtool
ipfire_make perl
ipfire_make readline
ipfire_make zlib
+ exiterror "Stop here."
ipfire_make autoconf
ipfire_make automake
ipfire_make bash
ipfire_make bzip2
ipfire_make diffutils
- ipfire_make e2fsprogs
ipfire_make ed
ipfire_make file
ipfire_make findutils
echo -ne "Building for ${BOLD}${MACHINE} on ${MACHINE_REAL}${NORMAL}\n"
- if [ -f $BASEDIR/log_${MACHINE}/02_base/stage2 ]; then
+ if [ -f $BASEDIR/log_${MACHINE}/02_base/stage2-LFS ]; then
prepareenv
echo "Using installed toolchain" >> $LOGFILE
beautify message DONE "Stage toolchain already built or extracted"
fi
fi
- if [ ! -e $BASEDIR/log_${MACHINE}/03_ipfire/stage3 ]; then
+ if [ ! -e $BASEDIR/log_${MACHINE}/03_ipfire/stage3-LFS ]; then
beautify build_stage "Building base"
base_build
else
beautify message DONE "Stage base already built"
fi
- if [ ! -e $BASEDIR/log_${MACHINE}/04_misc/stage4 ]; then
+ if [ ! -e $BASEDIR/log_${MACHINE}/04_misc/stage4-LFS ]; then
beautify build_stage "Building $NAME"
ipfire_build
else
beautify message DONE "Stage ipfire already built"
fi
- if [ ! -e $BASEDIR/log_${MACHINE}/05_installer/stage5 ]; then
+ if [ ! -e $BASEDIR/log_${MACHINE}/05_installer/stage5-LFS ]; then
beautify build_stage "Building miscellaneous"
misc_build
else
# Check if host can build the toolchain
check_toolchain_prerequisites
toolchain_build
- echo "Create toolchain tar.gz for $MACHINE" | tee -a $LOGFILE
+ echo "Create toolchain tar.bz for $MACHINE" | tee -a $LOGFILE
# Safer inside the chroot
echo -ne "Stripping lib"
chroot $LFS $TOOLS_DIR/bin/find $TOOLS_DIR/lib \
PWD=`pwd`
cd $BASEDIR/cache/
echo -e "Uploading cache to ftp server:"
+ for i in *; do
+ echo "${i}" | fgrep -q .md5 && continue
+ [ -e ${i}.md5 ] && continue
+ md5sum ${i} | tee ${i}.md5
+ done
ncftpls -u $FTP_CACHE_USER -p $FTP_CACHE_PASS ftp://$FTP_CACHE_URL/$FTP_CACHE_PATH/ > /tmp/ftplist
for i in *; do
if [ "$(basename $i)" == "toolchains" ]; then continue; fi
MACHINE=`uname -m`
SVN_REVISION=`svn info | grep Revision | cut -c 11-`
+DISTCC_HOSTS=localhost
+
PWD=`pwd`
BASENAME=`basename $0`
# Run LFS static binary creation scripts one by one
export CCACHE_DIR=$BASEDIR/ccache
export CCACHE_HASHDIR=1
- if [ ! -z $DISTCC_HOSTS ]; then
+ if [ ! -z "$DISTCC_HOSTS" ]; then
export CCACHE_PREFIX="distcc"
export DISTCC_DIR=$BASEDIR/distcc
fi
- [ -z $DISTCC_HOSTS ] || echo $DISTCC_HOSTS > $DISTCC_DIR/hosts
+ [ -z "$DISTCC_HOSTS" ] || echo "$DISTCC_HOSTS" > $DISTCC_DIR/hosts
# Remove pre-install list of installed files in case user erase some files before rebuild
rm -f $LFS/usr/src/lsalr 2>/dev/null