]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/glibc
make.sh: Drop option to generate a source ISO
[ipfire-2.x.git] / lfs / glibc
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302 3# IPFire.org - A linux based firewall #
bb330e25 4# Copyright (C) 2007-2016 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
6b9f806e 27VER = 2.25
cd1a2927 28
dd714b8a 29THISAPP = glibc-$(VER)
6b9f806e 30DL_FILE = $(THISAPP).tar.gz
7a98bae5 31DL_FROM = $(URL_IPFIRE)
cd1a2927 32DIR_APP = $(DIR_SRC)/$(THISAPP)
cd1a2927
MT
33
34# Normal build or /tools build.
35#
36ifeq "$(ROOT)" ""
37 TARGET = $(DIR_INFO)/$(THISAPP)
af4bfa79 38 EXTRA_CONFIG = \
2435f0cb 39 --build=$(BUILDTARGET) \
af4bfa79 40 --prefix=/usr \
dfa795eb
MT
41 --libexecdir=/usr/lib/glibc \
42 --enable-stack-protector=strong
cd1a2927
MT
43else
44 TARGET = $(DIR_INFO)/$(THISAPP)-tools
af4bfa79 45 EXTRA_CONFIG = \
12788f63
MT
46 --host=$(CROSSTARGET) \
47 --build=$(BUILDTARGET) \
af4bfa79 48 --prefix=/tools \
af4bfa79 49 --with-headers=/tools/include \
12788f63 50 libc_cv_forced_unwind=yes \
6b9f806e 51 libc_cv_c_cleanup=yes
cd1a2927
MT
52endif
53
6b9f806e
MT
54# Enable some extra optimization for the glibc code
55CFLAGS = -O3 -DNDEBUG -fasynchronous-unwind-tables -fPIC -DPIC
12788f63 56
dc7d6b20 57ifeq "$(BUILD_ARCH)" "armv7hl"
de1928cc
MT
58 CFLAGS += -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard
59endif
60
dc7d6b20 61ifeq "$(BUILD_ARCH)" "i586"
12788f63
MT
62 CFLAGS += -march=i586 -mtune=generic -mno-tls-direct-seg-refs
63endif
64
6b9f806e 65# Disable hardware FP for armv5tel
dc7d6b20 66ifeq "$(BUILD_ARCH)" "armv5tel"
51f9e7ac 67 EXTRA_CONFIG += \
1d2919b2 68 --without-fp
51f9e7ac
MT
69endif
70
af4bfa79
MT
71# Add some general configuration flags
72EXTRA_CONFIG += \
3e477b7d 73 --enable-obsolete-rpc \
af4bfa79 74 --disable-profile \
6b9f806e 75 --enable-kernel=3.2 \
af4bfa79
MT
76 --enable-add-ons \
77 --without-selinux \
78 --enable-experimental-malloc \
dfa795eb 79 --enable-bind-now
af4bfa79 80
cd1a2927
MT
81###############################################################################
82# Top-level Rules
83###############################################################################
84
ce346d23 85objects = $(DL_FILE)
cd1a2927
MT
86
87$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
88
6b9f806e 89$(DL_FILE)_MD5 = 0c9f827298841dbf3bff3060f3d7f19c
cd1a2927
MT
90
91install : $(TARGET)
92
93check : $(patsubst %,$(DIR_CHK)/%,$(objects))
94
95download :$(patsubst %,$(DIR_DL)/%,$(objects))
96
97md5 : $(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)
6b9f806e 118 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd1a2927 119 @mkdir $(DIR_SRC)/glibc-build
12788f63 120
15a2c03f
MT
121 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-localedef-no-archive.patch
122
dc7d6b20
MT
123ifneq "$(TOOLCHAIN)" "1"
124 ifeq "$(BUILD_ARCH)" "x86_64"
81aa9714
MT
125 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib64 -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -o|' \
126 scripts/test-installation.pl
dc7d6b20
MT
127 endif
128
129 ifeq "$(BUILD_ARCH)" "i586"
dd714b8a
MT
130 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
131 scripts/test-installation.pl
dc7d6b20
MT
132 endif
133
134 ifeq "$(BUILD_ARCH)" "armv5tel"
135 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
136 scripts/test-installation.pl
137 endif
51f9e7ac 138endif
9b0ff0a0 139
12788f63
MT
140 cd $(DIR_SRC)/glibc-build && \
141 CFLAGS="$(CFLAGS) -fno-asynchronous-unwind-tables" \
142 $(DIR_APP)/configure $(EXTRA_CONFIG)
3a317084 143
12788f63 144 cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(MAKETUNING) \
c51823b2 145 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
3a317084 146
6b9f806e 147 cd $(DIR_SRC)/glibc-build && make install
cd1a2927 148
b7093f17 149ifneq "$(TOOLCHAIN)" "1"
12788f63 150 # Creating the locales
cd1a2927 151 mkdir -p /usr/lib/locale
4e3ce543 152 cd $(DIR_SRC)/glibc-build && make localedata/install-locales
c1c60dbb
MT
153
154 # Timezone data will be shipped by tzdata.
155 rm -rfv /usr/share/zoneinfo
cd1a2927 156endif
dc7d6b20 157
fe2adb0c
MT
158ifeq "$(TOOLCHAIN)" "1"
159 # Test the linker in toolchain
160 cd $(DIR_APP) && echo "int main() { return 0; }" > dummy.c
161 cd $(DIR_APP) && $(CROSSTARGET)-gcc dummy.c -o dummy
162
163 # Must be using a runtime linker from /tools
164 cd $(DIR_APP) && readelf -l dummy | grep "Requesting program interpreter: /tools"
165 cd $(DIR_APP) && rm -vf dummy dummy.c
166endif
167
cd1a2927
MT
168 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
169 @$(POSTBUILD)