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