]>
Commit | Line | Data |
---|---|---|
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 | ||
25 | include Config | |
26 | ||
6b9f806e | 27 | VER = 2.25 |
cd1a2927 | 28 | |
dd714b8a | 29 | THISAPP = glibc-$(VER) |
6b9f806e | 30 | DL_FILE = $(THISAPP).tar.gz |
7a98bae5 | 31 | DL_FROM = $(URL_IPFIRE) |
cd1a2927 | 32 | DIR_APP = $(DIR_SRC)/$(THISAPP) |
cd1a2927 MT |
33 | |
34 | # Normal build or /tools build. | |
35 | # | |
36 | ifeq "$(ROOT)" "" | |
37 | TARGET = $(DIR_INFO)/$(THISAPP) | |
af4bfa79 | 38 | EXTRA_CONFIG = \ |
2435f0cb | 39 | --build=$(BUILDTARGET) \ |
af4bfa79 MT |
40 | --prefix=/usr \ |
41 | --libexecdir=/usr/lib/glibc | |
cd1a2927 MT |
42 | else |
43 | TARGET = $(DIR_INFO)/$(THISAPP)-tools | |
af4bfa79 | 44 | EXTRA_CONFIG = \ |
12788f63 MT |
45 | --host=$(CROSSTARGET) \ |
46 | --build=$(BUILDTARGET) \ | |
af4bfa79 | 47 | --prefix=/tools \ |
af4bfa79 | 48 | --with-headers=/tools/include \ |
12788f63 | 49 | libc_cv_forced_unwind=yes \ |
6b9f806e | 50 | libc_cv_c_cleanup=yes |
cd1a2927 MT |
51 | endif |
52 | ||
6b9f806e MT |
53 | # Enable some extra optimization for the glibc code |
54 | CFLAGS = -O3 -DNDEBUG -fasynchronous-unwind-tables -fPIC -DPIC | |
12788f63 | 55 | |
dc7d6b20 | 56 | ifeq "$(BUILD_ARCH)" "armv7hl" |
de1928cc MT |
57 | CFLAGS += -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard |
58 | endif | |
59 | ||
dc7d6b20 | 60 | ifeq "$(BUILD_ARCH)" "i586" |
12788f63 MT |
61 | CFLAGS += -march=i586 -mtune=generic -mno-tls-direct-seg-refs |
62 | endif | |
63 | ||
6b9f806e | 64 | # Disable hardware FP for armv5tel |
dc7d6b20 | 65 | ifeq "$(BUILD_ARCH)" "armv5tel" |
51f9e7ac | 66 | EXTRA_CONFIG += \ |
1d2919b2 | 67 | --without-fp |
51f9e7ac MT |
68 | endif |
69 | ||
af4bfa79 MT |
70 | # Add some general configuration flags |
71 | EXTRA_CONFIG += \ | |
72 | --disable-profile \ | |
6b9f806e | 73 | --enable-kernel=3.2 \ |
af4bfa79 MT |
74 | --enable-add-ons \ |
75 | --without-selinux \ | |
76 | --enable-experimental-malloc \ | |
6b9f806e MT |
77 | --enable-bind-now \ |
78 | --enable-stack-protector=strong | |
af4bfa79 | 79 | |
cd1a2927 MT |
80 | ############################################################################### |
81 | # Top-level Rules | |
82 | ############################################################################### | |
83 | ||
ce346d23 | 84 | objects = $(DL_FILE) |
cd1a2927 MT |
85 | |
86 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
87 | ||
6b9f806e | 88 | $(DL_FILE)_MD5 = 0c9f827298841dbf3bff3060f3d7f19c |
cd1a2927 MT |
89 | |
90 | install : $(TARGET) | |
91 | ||
92 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
93 | ||
94 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
95 | ||
96 | md5 : $(subst %,%_MD5,$(objects)) | |
97 | ||
98 | ############################################################################### | |
99 | # Downloading, checking, md5sum | |
100 | ############################################################################### | |
101 | ||
102 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
103 | @$(CHECK) | |
104 | ||
105 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
106 | @$(LOAD) | |
107 | ||
108 | $(subst %,%_MD5,$(objects)) : | |
109 | @$(MD5) | |
110 | ||
111 | ############################################################################### | |
112 | # Installation Details | |
113 | ############################################################################### | |
114 | ||
115 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
116 | @$(PREBUILD) | |
6b9f806e | 117 | @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) |
cd1a2927 | 118 | @mkdir $(DIR_SRC)/glibc-build |
12788f63 | 119 | |
dc7d6b20 MT |
120 | ifneq "$(TOOLCHAIN)" "1" |
121 | ifeq "$(BUILD_ARCH)" "x86_64" | |
81aa9714 MT |
122 | cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib64 -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -o|' \ |
123 | scripts/test-installation.pl | |
dc7d6b20 MT |
124 | endif |
125 | ||
126 | ifeq "$(BUILD_ARCH)" "i586" | |
dd714b8a MT |
127 | cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \ |
128 | scripts/test-installation.pl | |
dc7d6b20 MT |
129 | endif |
130 | ||
131 | ifeq "$(BUILD_ARCH)" "armv5tel" | |
132 | cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \ | |
133 | scripts/test-installation.pl | |
134 | endif | |
51f9e7ac | 135 | endif |
9b0ff0a0 | 136 | |
12788f63 MT |
137 | cd $(DIR_SRC)/glibc-build && \ |
138 | CFLAGS="$(CFLAGS) -fno-asynchronous-unwind-tables" \ | |
139 | $(DIR_APP)/configure $(EXTRA_CONFIG) | |
3a317084 | 140 | |
12788f63 | 141 | cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(MAKETUNING) \ |
c51823b2 | 142 | CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" |
3a317084 | 143 | |
6b9f806e | 144 | cd $(DIR_SRC)/glibc-build && make install |
cd1a2927 | 145 | |
dc7d6b20 MT |
146 | ifeq "$(TOOLCHAIN)" "1" |
147 | ln -svf lib /tools/lib64 | |
148 | else | |
12788f63 | 149 | # Creating the locales |
cd1a2927 | 150 | mkdir -p /usr/lib/locale |
4e3ce543 | 151 | cd $(DIR_SRC)/glibc-build && make localedata/install-locales |
c1c60dbb MT |
152 | |
153 | # Timezone data will be shipped by tzdata. | |
154 | rm -rfv /usr/share/zoneinfo | |
cd1a2927 | 155 | endif |
dc7d6b20 | 156 | |
cd1a2927 MT |
157 | @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build |
158 | @$(POSTBUILD) |