]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/glibc
Merge remote-tracking branch 'ms/glibc-update2' into glibc-update2
[ipfire-2.x.git] / lfs / glibc
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302 3# IPFire.org - A linux based firewall #
d10cf0df 4# Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
70df8302
MT
5# #
6# This program is free software: you can redistribute it and/or modify #
cd1a2927 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
cd1a2927
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
cd1a2927
MT
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 #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
cd1a2927 18# #
cd1a2927
MT
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
ce346d23
MT
27VER = 2.12.2
28PORTS_VER = 2.12.1
cd1a2927 29
dd714b8a 30THISAPP = glibc-$(VER)
cd1a2927 31DL_FILE = $(THISAPP).tar.bz2
7a98bae5 32DL_FROM = $(URL_IPFIRE)
cd1a2927 33DIR_APP = $(DIR_SRC)/$(THISAPP)
cd1a2927
MT
34
35# Normal build or /tools build.
36#
37ifeq "$(ROOT)" ""
38 TARGET = $(DIR_INFO)/$(THISAPP)
af4bfa79
MT
39 EXTRA_CONFIG = \
40 --prefix=/usr \
41 --libexecdir=/usr/lib/glibc
cd1a2927
MT
42 EXTRA_MAKE =
43 EXTRA_INSTALL =
44else
45 TARGET = $(DIR_INFO)/$(THISAPP)-tools
af4bfa79
MT
46 EXTRA_CONFIG = \
47 --prefix=/tools \
48 --with-binutils=/tools/bin \
49 --with-headers=/tools/include \
50 --without-gd
e22c7973
MT
51 EXTRA_MAKE =
52 EXTRA_INSTALL =
cd1a2927
MT
53endif
54
d10cf0df
AF
55EXTRA_CONFIG += --build=$(BUILDTARGET)
56
af4bfa79
MT
57# Enable some extra optimization for the glibc code.
58export CFLAGS := $(subst -O2,-O3,$(CFLAGS))
59
cc72d5cb 60ifeq "$(MACHINE_TYPE)" "arm"
51f9e7ac
MT
61 # Disable hardware FP for ARM.
62 EXTRA_CONFIG += \
1d2919b2 63 --without-fp
51f9e7ac
MT
64endif
65
af4bfa79
MT
66# Add some general configuration flags
67EXTRA_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
cd1a2927
MT
75###############################################################################
76# Top-level Rules
77###############################################################################
78
ce346d23 79objects = $(DL_FILE)
cd1a2927
MT
80
81$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
82
ce346d23 83$(DL_FILE)_MD5 = 903fcfa547df2f453476800e0838fe52
51f9e7ac
MT
84
85# ARM needs glibc-ports
cc72d5cb 86ifeq "$(MACHINE_TYPE)" "arm"
ce346d23
MT
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
51f9e7ac 90endif
cd1a2927
MT
91
92install : $(TARGET)
93
94check : $(patsubst %,$(DIR_CHK)/%,$(objects))
95
96download :$(patsubst %,$(DIR_DL)/%,$(objects))
97
98md5 : $(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)
cd1a2927 120 @mkdir $(DIR_SRC)/glibc-build
cc72d5cb 121ifeq "$(MACHINE_TYPE)" "arm"
ca2b2688
MT
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
51f9e7ac 124endif
82a8499a 125
9b0ff0a0 126ifeq "$(ROOT)" ""
dd714b8a
MT
127 # This locale causes a loop on bash login - exclude it
128 cd $(DIR_APP) && sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
cc72d5cb 129ifeq "$(MACHINE_TYPE)" "arm"
51f9e7ac
MT
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
132else
dd714b8a
MT
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
9b0ff0a0 135endif
51f9e7ac
MT
136endif
137 cd $(DIR_SRC)/glibc-build && CFLAGS="$(CFLAGS)" $(DIR_APP)/configure $(EXTRA_CONFIG)
9b0ff0a0 138
cd1a2927
MT
139ifeq "$(ROOT)" ""
140 touch /etc/ld.so.conf
dd714b8a 141 cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE)
cd1a2927
MT
142 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
143else
144 -mkdir /tools/etc
145 touch /tools/etc/ld.so.conf
dd714b8a
MT
146 cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE)
147 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
cd1a2927
MT
148endif
149
150 # Creating the locales
151ifeq "$(ROOT)" ""
152 mkdir -p /usr/lib/locale
cd1a2927
MT
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
cd1a2927 155endif
cd1a2927
MT
156 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
157 @$(POSTBUILD)