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