]> git.ipfire.org Git - ipfire-2.x.git/blob - lfs/glibc
Merge branch 'glibc-update2' of ssh://git.ipfire.org/pub/git/people/ms/ipfire-2.x...
[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 = \
40 --prefix=/usr \
41 --libexecdir=/usr/lib/glibc
42 EXTRA_MAKE =
43 EXTRA_INSTALL =
44 else
45 TARGET = $(DIR_INFO)/$(THISAPP)-tools
46 EXTRA_CONFIG = \
47 --prefix=/tools \
48 --with-binutils=/tools/bin \
49 --with-headers=/tools/include \
50 --without-gd
51 EXTRA_MAKE =
52 EXTRA_INSTALL =
53 endif
54
55 EXTRA_CONFIG += --build=$(BUILDTARGET)
56
57 # Enable some extra optimization for the glibc code.
58 export CFLAGS := $(subst -O2,-O3,$(CFLAGS))
59
60 ifeq "$(MACHINE_TYPE)" "arm"
61 # Disable hardware FP for ARM.
62 EXTRA_CONFIG += \
63 --without-fp
64 endif
65
66 # Add some general configuration flags
67 EXTRA_CONFIG += \
68 --disable-profile \
69 --enable-kernel=2.6.16 \
70 --enable-add-ons \
71 --without-selinux \
72 --enable-experimental-malloc \
73 --enable-bind-now
74
75 ###############################################################################
76 # Top-level Rules
77 ###############################################################################
78
79 objects = $(DL_FILE)
80
81 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
82
83 $(DL_FILE)_MD5 = 903fcfa547df2f453476800e0838fe52
84
85 # ARM needs glibc-ports
86 ifeq "$(MACHINE_TYPE)" "arm"
87 objects += glibc-ports-$(PORTS_VER).tar.bz2
88 glibc-ports-$(PORTS_VER).tar.bz2 = $(DL_FROM)/glibc-ports-$(PORTS_VER).tar.bz2
89 glibc-ports-$(PORTS_VER).tar.bz2_MD5 = cb01ab976180e98287cef5079e35359e
90 endif
91
92 install : $(TARGET)
93
94 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
95
96 download :$(patsubst %,$(DIR_DL)/%,$(objects))
97
98 md5 : $(subst %,%_MD5,$(objects))
99
100 ###############################################################################
101 # Downloading, checking, md5sum
102 ###############################################################################
103
104 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
105 @$(CHECK)
106
107 $(patsubst %,$(DIR_DL)/%,$(objects)) :
108 @$(LOAD)
109
110 $(subst %,%_MD5,$(objects)) :
111 @$(MD5)
112
113 ###############################################################################
114 # Installation Details
115 ###############################################################################
116
117 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
118 @$(PREBUILD)
119 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
120 @mkdir $(DIR_SRC)/glibc-build
121 ifeq "$(MACHINE_TYPE)" "arm"
122 cd $(DIR_APP) && tar jxf $(DIR_DL)/glibc-ports-$(PORTS_VER).tar.bz2
123 cd $(DIR_APP) && mv -v glibc-ports-$(PORTS_VER) ports
124 endif
125
126 ifeq "$(ROOT)" ""
127 # This locale causes a loop on bash login - exclude it
128 cd $(DIR_APP) && sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
129 ifeq "$(MACHINE_TYPE)" "arm"
130 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
131 scripts/test-installation.pl
132 else
133 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
134 scripts/test-installation.pl
135 endif
136 endif
137 cd $(DIR_SRC)/glibc-build && CFLAGS="$(CFLAGS)" $(DIR_APP)/configure $(EXTRA_CONFIG)
138
139 ifeq "$(ROOT)" ""
140 touch /etc/ld.so.conf
141 cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE)
142 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
143 else
144 -mkdir /tools/etc
145 touch /tools/etc/ld.so.conf
146 cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE)
147 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
148 endif
149
150 # Creating the locales
151 ifeq "$(ROOT)" ""
152 mkdir -p /usr/lib/locale
153 cd $(DIR_SRC)/glibc-build && localedef -i en_US -f ISO-8859-1 en_US
154 cd $(DIR_SRC)/glibc-build && localedef -i en_US -f UTF-8 en_US.utf8
155 endif
156 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
157 @$(POSTBUILD)