]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/glibc
man: Update to version 2.10.2
[ipfire-2.x.git] / lfs / glibc
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302 3# IPFire.org - A linux based firewall #
aafdd71b 4# Copyright (C) 2007-2021 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
fd34a1c8 27VER = 2.35
cd1a2927 28
dd714b8a 29THISAPP = glibc-$(VER)
65a75e0d 30DL_FILE = $(THISAPP).tar.xz
7a98bae5 31DL_FROM = $(URL_IPFIRE)
cd1a2927 32DIR_APP = $(DIR_SRC)/$(THISAPP)
cd1a2927 33
6c4cc7ea 34# Normal build or $(TOOLS_DIR) build.
cd1a2927
MT
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) \
6c4cc7ea 48 --prefix=$(TOOLS_DIR) \
fd34a1c8 49 --with-headers=$(TOOLS_DIR)/include
44bfc406 50endif
de57b780 51
44bfc406
MT
52ifeq "$(BUILD_ARCH)" "aarch64"
53 CFLAGS += -Wno-error=maybe-uninitialized
cd1a2927
MT
54endif
55
af4bfa79
MT
56# Add some general configuration flags
57EXTRA_CONFIG += \
58 --disable-profile \
6843949d 59 --enable-kernel=4.14.0 \
af4bfa79
MT
60 --enable-add-ons \
61 --without-selinux \
62 --enable-experimental-malloc \
65a75e0d 63 --enable-bind-now \
cf6c8e67 64 --disable-crypt
af4bfa79 65
cf557eca
MT
66ifeq "$(BUILD_ARCH)" "x86_64"
67 EXTRA_CONFIG += --enable-cet
68endif
69
173a4d54
MT
70ifeq "$(BUILD_ARCH)" "aarch64"
71 EXTRA_CONFIG += --enable-memory-tagging
72endif
73
cd1a2927
MT
74###############################################################################
75# Top-level Rules
76###############################################################################
77
ce346d23 78objects = $(DL_FILE)
cd1a2927
MT
79
80$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
81
9a7e4d85 82$(DL_FILE)_BLAKE2 = 623c728884f070cd87ffeb9203f74206197c52405ac9bc44f3dd519a3468b8e8ae2536c883e5d17d94417dbd1e91775de2e674314e4ff7424f9720026d6b7063
cd1a2927
MT
83
84install : $(TARGET)
85
86check : $(patsubst %,$(DIR_CHK)/%,$(objects))
87
88download :$(patsubst %,$(DIR_DL)/%,$(objects))
89
9a7e4d85 90b2 : $(subst %,%_BLAKE2,$(objects))
cd1a2927
MT
91
92###############################################################################
9a7e4d85 93# Downloading, checking, b2sum
cd1a2927
MT
94###############################################################################
95
96$(patsubst %,$(DIR_CHK)/%,$(objects)) :
97 @$(CHECK)
98
99$(patsubst %,$(DIR_DL)/%,$(objects)) :
100 @$(LOAD)
101
9a7e4d85
PM
102$(subst %,%_BLAKE2,$(objects)) :
103 @$(B2SUM)
cd1a2927
MT
104
105###############################################################################
106# Installation Details
107###############################################################################
108
109$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
110 @$(PREBUILD)
6b9f806e 111 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd1a2927 112 @mkdir $(DIR_SRC)/glibc-build
12788f63 113
15a2c03f
MT
114 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-localedef-no-archive.patch
115
dc7d6b20
MT
116ifneq "$(TOOLCHAIN)" "1"
117 ifeq "$(BUILD_ARCH)" "x86_64"
81aa9714
MT
118 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib64 -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -o|' \
119 scripts/test-installation.pl
dc7d6b20
MT
120 endif
121
aafdd71b 122 ifeq "$(BUILD_ARCH)" "armv6l"
dc7d6b20
MT
123 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
124 scripts/test-installation.pl
125 endif
51f9e7ac 126endif
9b0ff0a0 127
12788f63
MT
128 cd $(DIR_SRC)/glibc-build && \
129 CFLAGS="$(CFLAGS) -fno-asynchronous-unwind-tables" \
130 $(DIR_APP)/configure $(EXTRA_CONFIG)
3a317084 131
12788f63 132 cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(MAKETUNING) \
c51823b2 133 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
3a317084 134
65a75e0d
MT
135 cd $(DIR_APP) && sed '/test-installation/s@\$$(PERL)@echo not running@' -i Makefile
136
6b9f806e 137 cd $(DIR_SRC)/glibc-build && make install
cd1a2927 138
b7093f17 139ifneq "$(TOOLCHAIN)" "1"
12788f63 140 # Creating the locales
cd1a2927 141 mkdir -p /usr/lib/locale
6ef219bb 142 cd $(DIR_SRC)/glibc-build && make localedata/install-locales $(MAKETUNING)
c1c60dbb
MT
143
144 # Timezone data will be shipped by tzdata.
145 rm -rfv /usr/share/zoneinfo
cd1a2927 146endif
dc7d6b20 147
fe2adb0c
MT
148ifeq "$(TOOLCHAIN)" "1"
149 # Test the linker in toolchain
150 cd $(DIR_APP) && echo "int main() { return 0; }" > dummy.c
151 cd $(DIR_APP) && $(CROSSTARGET)-gcc dummy.c -o dummy
152
6c4cc7ea
MT
153 # Must be using a runtime linker from $(TOOLS_DIR)
154 cd $(DIR_APP) && readelf -l dummy | grep "Requesting program interpreter: $(TOOLS_DIR)"
fe2adb0c
MT
155 cd $(DIR_APP) && rm -vf dummy dummy.c
156endif
157
cd1a2927
MT
158 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
159 @$(POSTBUILD)