]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - lfs/glibc
Merge branch 'arm-port' of ssh://git.ipfire.org/pub/git/people/ms/ipfire-2.x into...
[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 ifeq "$(MACHINE_TYPE)" "arm"
28 VER = 2.5
29 else
30 VER = 2.3.6
31 endif
32
33 THISAPP = glibc-$(VER)
34 DL_FILE = $(THISAPP).tar.bz2
35 DL_FROM = $(URL_IPFIRE)
36 DIR_APP = $(DIR_SRC)/$(THISAPP)
37
38 # Normal build or /tools build.
39 #
40 ifeq "$(ROOT)" ""
41 TARGET = $(DIR_INFO)/$(THISAPP)
42 EXTRA_CONFIG = --prefix=/usr \
43 --disable-profile --enable-add-ons \
44 --enable-kernel=2.6.0 --libexecdir=/usr/lib/glibc
45 EXTRA_MAKE =
46 EXTRA_INSTALL =
47 else
48 TARGET = $(DIR_INFO)/$(THISAPP)-tools
49 EXTRA_CONFIG = --prefix=/tools \
50 --disable-profile --enable-add-ons \
51 --enable-kernel=2.6.0 --with-binutils=/tools/bin \
52 --without-gd --with-headers=/tools/include \
53 --without-selinux
54 EXTRA_MAKE =
55 EXTRA_INSTALL =
56 endif
57
58 EXTRA_CONFIG += --build=$(BUILDTARGET)
59
60 ifeq "$(MACHINE_TYPE)" "arm"
61 # Disable hardware FP for ARM.
62 EXTRA_CONFIG += \
63 --without-fp
64 endif
65
66 ###############################################################################
67 # Top-level Rules
68 ###############################################################################
69
70 objects = $(DL_FILE) \
71 glibc-libidn-$(VER).tar.bz2
72
73 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
74 glibc-libidn-$(VER).tar.bz2 = $(DL_FROM)/glibc-libidn-$(VER).tar.bz2
75
76 ifeq "$(MACHINE_TYPE)" "arm"
77 $(DL_FILE)_MD5 = 1fb29764a6a650a4d5b409dda227ac9f
78 glibc-libidn-$(VER).tar.bz2_MD5 = 8787868ba8962d9b125997ec2f25ac01
79 else
80 $(DL_FILE)_MD5 = bfdce99f82d6dbcb64b7f11c05d6bc96
81 glibc-libidn-$(VER).tar.bz2_MD5 = 49dbe06ce830fc73874d6b38bdc5b4db
82 endif
83
84 # ARM needs glibc-ports
85 ifeq "$(MACHINE_TYPE)" "arm"
86 objects += glibc-ports-$(VER).tar.bz2
87 glibc-ports-$(VER).tar.bz2 = $(DL_FROM)/glibc-ports-$(VER).tar.bz2
88 glibc-ports-$(VER).tar.bz2_MD5 = 183f6d46e8fa5e4b2aff240ab1586c2e
89 endif
90
91 install : $(TARGET)
92
93 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
94
95 download :$(patsubst %,$(DIR_DL)/%,$(objects))
96
97 md5 : $(subst %,%_MD5,$(objects))
98
99 ###############################################################################
100 # Downloading, checking, md5sum
101 ###############################################################################
102
103 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
104 @$(CHECK)
105
106 $(patsubst %,$(DIR_DL)/%,$(objects)) :
107 @$(LOAD)
108
109 $(subst %,%_MD5,$(objects)) :
110 @$(MD5)
111
112 ###############################################################################
113 # Installation Details
114 ###############################################################################
115
116 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
117 @$(PREBUILD)
118 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
119 @mkdir $(DIR_SRC)/glibc-build
120 ifeq "$(MACHINE_TYPE)" "arm"
121 cd $(DIR_APP) && tar jxf $(DIR_DL)/glibc-ports-$(VER).tar.bz2
122 cd $(DIR_APP) && mv -v glibc-ports-$(VER) ports
123
124 cd $(DIR_APP)/ports && patch -Np1 -i $(DIR_SRC)/src/patches/glibc-ports-avoid-using-asm-procinfo.patch
125
126 # asm/page.h should not be included in sysdeps/unix/sysv/linux/arm/ioperm.c.
127 cd $(DIR_APP) && sed "/asm\/page.h/d" -i ports/sysdeps/unix/sysv/linux/arm/ioperm.c
128 else
129 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-dont_use_origin_on_privil_exec.patch
130 endif
131
132 ifeq "$(ROOT)" ""
133 ifeq "$(MACHINE)" "i586"
134 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-linux_types-1.patch
135 cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-inotify-1.patch
136 endif
137 # This locale causes a loop on bash login - exclude it
138 cd $(DIR_APP) && sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
139 ifeq "$(MACHINE_TYPE)" "arm"
140 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
141 scripts/test-installation.pl
142 else
143 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
144 scripts/test-installation.pl
145 endif
146 endif
147 cd $(DIR_SRC)/glibc-build && CFLAGS="$(CFLAGS)" $(DIR_APP)/configure $(EXTRA_CONFIG)
148
149 ifeq "$(ROOT)" ""
150 touch /etc/ld.so.conf
151 cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE)
152 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
153 ifeq "$(MACHINE)" "i586"
154 cp -v $(DIR_APP)/sysdeps/unix/sysv/linux/inotify.h /usr/include/sys
155 endif
156 else
157 -mkdir /tools/etc
158 touch /tools/etc/ld.so.conf
159 cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE)
160 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
161 endif
162
163 # Creating the locales
164 ifeq "$(ROOT)" ""
165 mkdir -p /usr/lib/locale
166 cd $(DIR_SRC)/glibc-build && localedef -i en_US -f ISO-8859-1 en_US
167 cd $(DIR_SRC)/glibc-build && localedef -i en_US -f UTF-8 en_US.utf8
168 ifneq "$(MACHINE_TYPE)" "arm"
169 cp -f /usr/share/zoneinfo/GMT /etc/localtime
170 endif
171 endif
172 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
173 @$(POSTBUILD)