]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame_incremental - lfs/glibc
libnfsidmap: Split into a separate package
[people/pmueller/ipfire-2.x.git] / lfs / glibc
... / ...
CommitLineData
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007-2018 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
25include Config
26
27VER = 2.32
28
29THISAPP = glibc-$(VER)
30DL_FILE = $(THISAPP).tar.xz
31DL_FROM = $(URL_IPFIRE)
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33
34# Normal build or $(TOOLS_DIR) build.
35#
36ifeq "$(ROOT)" ""
37 TARGET = $(DIR_INFO)/$(THISAPP)
38 EXTRA_CONFIG = \
39 --build=$(BUILDTARGET) \
40 --prefix=/usr \
41 --libexecdir=/usr/lib/glibc \
42 --enable-stack-protector=strong
43else
44 TARGET = $(DIR_INFO)/$(THISAPP)-tools
45 EXTRA_CONFIG = \
46 --host=$(CROSSTARGET) \
47 --build=$(BUILDTARGET) \
48 --prefix=$(TOOLS_DIR) \
49 --with-headers=$(TOOLS_DIR)/include \
50 libc_cv_forced_unwind=yes \
51 libc_cv_c_cleanup=yes
52endif
53
54# Enable some extra optimization for the glibc code
55CFLAGS = -O3 -DNDEBUG -fasynchronous-unwind-tables -fPIC -DPIC
56
57ifeq "$(BUILD_ARCH)" "armv7hl"
58 CFLAGS += -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard
59endif
60
61ifeq "$(BUILD_ARCH)" "i586"
62 CFLAGS += -march=i586 -mtune=generic -mindirect-branch=thunk -mfunction-return=thunk -mno-tls-direct-seg-refs
63endif
64
65ifeq "$(BUILD_ARCH)" "x86_64"
66 CFLAGS += -mindirect-branch=thunk -mfunction-return=thunk
67endif
68
69# Disable hardware FP for armv5tel
70ifeq "$(BUILD_ARCH)" "armv5tel"
71 EXTRA_CONFIG += \
72 --without-fp
73endif
74
75# Add some general configuration flags
76EXTRA_CONFIG += \
77 --disable-profile \
78 --enable-kernel=4.14.0 \
79 --enable-add-ons \
80 --without-selinux \
81 --enable-experimental-malloc \
82 --enable-bind-now \
83 --disable-nss-crypt
84
85###############################################################################
86# Top-level Rules
87###############################################################################
88
89objects = $(DL_FILE)
90
91$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
92
93$(DL_FILE)_MD5 = 720c7992861c57cf97d66a2f36d8d1fa
94
95install : $(TARGET)
96
97check : $(patsubst %,$(DIR_CHK)/%,$(objects))
98
99download :$(patsubst %,$(DIR_DL)/%,$(objects))
100
101md5 : $(subst %,%_MD5,$(objects))
102
103###############################################################################
104# Downloading, checking, md5sum
105###############################################################################
106
107$(patsubst %,$(DIR_CHK)/%,$(objects)) :
108 @$(CHECK)
109
110$(patsubst %,$(DIR_DL)/%,$(objects)) :
111 @$(LOAD)
112
113$(subst %,%_MD5,$(objects)) :
114 @$(MD5)
115
116###############################################################################
117# Installation Details
118###############################################################################
119
120$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
121 @$(PREBUILD)
122 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
123 @mkdir $(DIR_SRC)/glibc-build
124
125 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-localedef-no-archive.patch
126
127ifneq "$(TOOLCHAIN)" "1"
128 ifeq "$(BUILD_ARCH)" "x86_64"
129 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib64 -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -o|' \
130 scripts/test-installation.pl
131 endif
132
133 ifeq "$(BUILD_ARCH)" "i586"
134 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
135 scripts/test-installation.pl
136 endif
137
138 ifeq "$(BUILD_ARCH)" "armv5tel"
139 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
140 scripts/test-installation.pl
141 endif
142endif
143
144 cd $(DIR_SRC)/glibc-build && \
145 CFLAGS="$(CFLAGS) -fno-asynchronous-unwind-tables" \
146 $(DIR_APP)/configure $(EXTRA_CONFIG)
147
148 cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(MAKETUNING) \
149 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
150
151 cd $(DIR_APP) && sed '/test-installation/s@\$$(PERL)@echo not running@' -i Makefile
152
153 cd $(DIR_SRC)/glibc-build && make install
154
155ifneq "$(TOOLCHAIN)" "1"
156 # Creating the locales
157 mkdir -p /usr/lib/locale
158 cd $(DIR_SRC)/glibc-build && make localedata/install-locales $(MAKETUNING)
159
160 # Timezone data will be shipped by tzdata.
161 rm -rfv /usr/share/zoneinfo
162endif
163
164ifeq "$(TOOLCHAIN)" "1"
165 # Test the linker in toolchain
166 cd $(DIR_APP) && echo "int main() { return 0; }" > dummy.c
167 cd $(DIR_APP) && $(CROSSTARGET)-gcc dummy.c -o dummy
168
169 # Must be using a runtime linker from $(TOOLS_DIR)
170 cd $(DIR_APP) && readelf -l dummy | grep "Requesting program interpreter: $(TOOLS_DIR)"
171 cd $(DIR_APP) && rm -vf dummy dummy.c
172endif
173
174 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
175 @$(POSTBUILD)