]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - lfs/glibc
glibc: Update to 2.12.2.
[people/teissler/ipfire-2.x.git] / lfs / glibc
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
5 # #
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. #
10 # #
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. #
15 # #
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/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 VER = 2.12.2
28 PORTS_VER = 2.12.1
29
30 THISAPP = glibc-$(VER)
31 DL_FILE = $(THISAPP).tar.bz2
32 DL_FROM = $(URL_IPFIRE)
33 DIR_APP = $(DIR_SRC)/$(THISAPP)
34
35 # Normal build or /tools build.
36 #
37 ifeq "$(ROOT)" ""
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
42 EXTRA_MAKE =
43 EXTRA_INSTALL =
44 else
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 \
50 --without-selinux
51 EXTRA_MAKE =
52 EXTRA_INSTALL =
53 endif
54
55 EXTRA_CONFIG += --build=$(BUILDTARGET)
56
57 ifeq "$(MACHINE_TYPE)" "arm"
58 # Disable hardware FP for ARM.
59 EXTRA_CONFIG += \
60 --without-fp
61 endif
62
63 ###############################################################################
64 # Top-level Rules
65 ###############################################################################
66
67 objects = $(DL_FILE)
68
69 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
70
71 $(DL_FILE)_MD5 = 903fcfa547df2f453476800e0838fe52
72
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
78 endif
79
80 install : $(TARGET)
81
82 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
83
84 download :$(patsubst %,$(DIR_DL)/%,$(objects))
85
86 md5 : $(subst %,%_MD5,$(objects))
87
88 ###############################################################################
89 # Downloading, checking, md5sum
90 ###############################################################################
91
92 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
93 @$(CHECK)
94
95 $(patsubst %,$(DIR_DL)/%,$(objects)) :
96 @$(LOAD)
97
98 $(subst %,%_MD5,$(objects)) :
99 @$(MD5)
100
101 ###############################################################################
102 # Installation Details
103 ###############################################################################
104
105 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
106 @$(PREBUILD)
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
112
113 cd $(DIR_APP)/ports && patch -Np1 -i $(DIR_SRC)/src/patches/glibc-ports-avoid-using-asm-procinfo.patch
114
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
117 endif
118
119 ifeq "$(ROOT)" ""
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
125 else
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
128 endif
129 endif
130 cd $(DIR_SRC)/glibc-build && CFLAGS="$(CFLAGS)" $(DIR_APP)/configure $(EXTRA_CONFIG)
131
132 ifeq "$(ROOT)" ""
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
136 else
137 -mkdir /tools/etc
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
141 endif
142
143 # Creating the locales
144 ifeq "$(ROOT)" ""
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
148 endif
149 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
150 @$(POSTBUILD)