1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2020 IPFire Team <info@ipfire.org> #
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. #
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. #
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/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
29 THISAPP = glibc-$(VER)
30 DL_FILE = $(THISAPP).tar.xz
31 DL_FROM = $(URL_IPFIRE)
32 DIR_APP = $(DIR_SRC)/$(THISAPP)
34 # Normal build or $(TOOLS_DIR) build.
37 TARGET = $(DIR_INFO)/$(THISAPP)
39 --build=$(BUILDTARGET) \
41 --libexecdir=/usr/lib/glibc \
42 --enable-stack-protector=strong
44 TARGET = $(DIR_INFO)/$(THISAPP)-tools
46 --host=$(CROSSTARGET) \
47 --build=$(BUILDTARGET) \
48 --prefix=$(TOOLS_DIR) \
49 --with-headers=$(TOOLS_DIR)/include \
50 libc_cv_forced_unwind=yes \
54 ifeq "$(BUILD_ARCH)" "aarch64"
55 CFLAGS += -Wno-error=maybe-uninitialized
58 # Disable hardware FP for armv5tel
59 ifeq "$(BUILD_ARCH)" "armv5tel"
64 # Add some general configuration flags
67 --enable-kernel=4.14.0 \
70 --enable-experimental-malloc \
74 ###############################################################################
76 ###############################################################################
80 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
82 $(DL_FILE)_MD5 = 720c7992861c57cf97d66a2f36d8d1fa
86 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
88 download :$(patsubst %,$(DIR_DL)/%,$(objects))
90 md5 : $(subst %,%_MD5,$(objects))
92 ###############################################################################
93 # Downloading, checking, md5sum
94 ###############################################################################
96 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
99 $(patsubst %,$(DIR_DL)/%,$(objects)) :
102 $(subst %,%_MD5,$(objects)) :
105 ###############################################################################
106 # Installation Details
107 ###############################################################################
109 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
111 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
112 @mkdir $(DIR_SRC)/glibc-build
114 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-localedef-no-archive.patch
116 ifneq "$(TOOLCHAIN)" "1"
117 ifeq "$(BUILD_ARCH)" "x86_64"
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
122 ifeq "$(BUILD_ARCH)" "i586"
123 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
124 scripts/test-installation.pl
127 ifeq "$(BUILD_ARCH)" "armv5tel"
128 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
129 scripts/test-installation.pl
133 cd $(DIR_SRC)/glibc-build && \
134 CFLAGS="$(CFLAGS) -fno-asynchronous-unwind-tables" \
135 $(DIR_APP)/configure $(EXTRA_CONFIG)
137 cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(MAKETUNING) \
138 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
140 cd $(DIR_APP) && sed '/test-installation/s@\$$(PERL)@echo not running@' -i Makefile
142 cd $(DIR_SRC)/glibc-build && make install
144 ifneq "$(TOOLCHAIN)" "1"
145 # Creating the locales
146 mkdir -p /usr/lib/locale
147 cd $(DIR_SRC)/glibc-build && make localedata/install-locales $(MAKETUNING)
149 # Timezone data will be shipped by tzdata.
150 rm -rfv /usr/share/zoneinfo
153 ifeq "$(TOOLCHAIN)" "1"
154 # Test the linker in toolchain
155 cd $(DIR_APP) && echo "int main() { return 0; }" > dummy.c
156 cd $(DIR_APP) && $(CROSSTARGET)-gcc dummy.c -o dummy
158 # Must be using a runtime linker from $(TOOLS_DIR)
159 cd $(DIR_APP) && readelf -l dummy | grep "Requesting program interpreter: $(TOOLS_DIR)"
160 cd $(DIR_APP) && rm -vf dummy dummy.c
163 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build