1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
30 THISAPP = glibc-$(VER)
31 DL_FILE = $(THISAPP).tar.bz2
32 DL_FROM = $(URL_IPFIRE)
33 DIR_APP = $(DIR_SRC)/$(THISAPP)
35 # Normal build or /tools build.
38 TARGET = $(DIR_INFO)/$(THISAPP)
39 EXTRA_CONFIG = --prefix=/usr \
40 --disable-profile --enable-add-ons \
41 --enable-kernel=2.6.0 --libexecdir=/usr/lib/glibc
45 TARGET = $(DIR_INFO)/$(THISAPP)-tools
46 EXTRA_CONFIG = --prefix=/tools \
47 --disable-profile --enable-add-ons \
48 --enable-kernel=2.6.0 --with-binutils=/tools/bin \
49 --without-gd --with-headers=/tools/include \
55 EXTRA_CONFIG += --build=$(BUILDTARGET)
57 ifeq "$(MACHINE_TYPE)" "arm"
58 # Disable hardware FP for ARM.
63 ###############################################################################
65 ###############################################################################
69 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
71 $(DL_FILE)_MD5 = 903fcfa547df2f453476800e0838fe52
73 # ARM needs glibc-ports
74 ifeq "$(MACHINE_TYPE)" "arm"
75 objects += glibc-ports-$(PORTS_VER).tar.bz2
76 glibc-ports-$(PORTS_VER).tar.bz2 = $(DL_FROM)/glibc-ports-$(PORTS_VER).tar.bz2
77 glibc-ports-$(PORTS_VER).tar.bz2_MD5 = cb01ab976180e98287cef5079e35359e
82 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
84 download :$(patsubst %,$(DIR_DL)/%,$(objects))
86 md5 : $(subst %,%_MD5,$(objects))
88 ###############################################################################
89 # Downloading, checking, md5sum
90 ###############################################################################
92 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
95 $(patsubst %,$(DIR_DL)/%,$(objects)) :
98 $(subst %,%_MD5,$(objects)) :
101 ###############################################################################
102 # Installation Details
103 ###############################################################################
105 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
107 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
108 @mkdir $(DIR_SRC)/glibc-build
109 ifeq "$(MACHINE_TYPE)" "arm"
110 cd $(DIR_APP) && tar jxf $(DIR_DL)/glibc-ports-$(VER).tar.bz2
111 cd $(DIR_APP) && mv -v glibc-ports-$(VER) ports
113 cd $(DIR_APP)/ports && patch -Np1 -i $(DIR_SRC)/src/patches/glibc-ports-avoid-using-asm-procinfo.patch
115 # asm/page.h should not be included in sysdeps/unix/sysv/linux/arm/ioperm.c.
116 cd $(DIR_APP) && sed "/asm\/page.h/d" -i ports/sysdeps/unix/sysv/linux/arm/ioperm.c
120 # This locale causes a loop on bash login - exclude it
121 cd $(DIR_APP) && sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
122 ifeq "$(MACHINE_TYPE)" "arm"
123 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
124 scripts/test-installation.pl
126 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
127 scripts/test-installation.pl
130 cd $(DIR_SRC)/glibc-build && CFLAGS="$(CFLAGS)" $(DIR_APP)/configure $(EXTRA_CONFIG)
133 touch /etc/ld.so.conf
134 cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE)
135 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
138 touch /tools/etc/ld.so.conf
139 cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE)
140 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
143 # Creating the locales
145 mkdir -p /usr/lib/locale
146 cd $(DIR_SRC)/glibc-build && localedef -i en_US -f ISO-8859-1 en_US
147 cd $(DIR_SRC)/glibc-build && localedef -i en_US -f UTF-8 en_US.utf8
149 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build