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