]>
Commit | Line | Data |
---|---|---|
cd1a2927 | 1 | ############################################################################### |
cd1a2927 | 2 | # # |
70df8302 MT |
3 | # IPFire.org - A linux based firewall # |
4 | # Copyright (C) 2007 Michael Tremer & Christian Schmidt # | |
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 | ||
51f9e7ac MT |
27 | ifeq "$(MACHINE)" "arm" |
28 | VER = 2.5 | |
29 | else | |
30 | VER = 2.3.6 | |
31 | endif | |
cd1a2927 | 32 | |
dd714b8a | 33 | THISAPP = glibc-$(VER) |
cd1a2927 | 34 | DL_FILE = $(THISAPP).tar.bz2 |
7a98bae5 | 35 | DL_FROM = $(URL_IPFIRE) |
cd1a2927 | 36 | DIR_APP = $(DIR_SRC)/$(THISAPP) |
cd1a2927 MT |
37 | |
38 | # Normal build or /tools build. | |
39 | # | |
40 | ifeq "$(ROOT)" "" | |
41 | TARGET = $(DIR_INFO)/$(THISAPP) | |
42 | EXTRA_CONFIG = --prefix=/usr \ | |
51f9e7ac | 43 | --disable-profile \ |
dd714b8a | 44 | --enable-kernel=2.6.0 --libexecdir=/usr/lib/glibc |
cd1a2927 MT |
45 | EXTRA_MAKE = |
46 | EXTRA_INSTALL = | |
47 | else | |
48 | TARGET = $(DIR_INFO)/$(THISAPP)-tools | |
49 | EXTRA_CONFIG = --prefix=/tools \ | |
51f9e7ac | 50 | --disable-profile \ |
dd714b8a MT |
51 | --enable-kernel=2.6.0 --with-binutils=/tools/bin \ |
52 | --without-gd --with-headers=/tools/include \ | |
53 | --without-selinux | |
e22c7973 MT |
54 | EXTRA_MAKE = |
55 | EXTRA_INSTALL = | |
cd1a2927 MT |
56 | endif |
57 | ||
51f9e7ac MT |
58 | ifeq "$(MACHINE)" "arm" |
59 | # Disable hardware FP for ARM. | |
60 | EXTRA_CONFIG += \ | |
61 | --build=$(MACHINE) \ | |
62 | --host=$(BUILDTARGET) \ | |
63 | --without-fp \ | |
64 | --enable-add-ons=nptl,ports | |
65 | else | |
66 | EXTRA_CONFIG += --enable-add-ons | |
67 | endif | |
68 | ||
cd1a2927 MT |
69 | ############################################################################### |
70 | # Top-level Rules | |
71 | ############################################################################### | |
72 | ||
dd714b8a MT |
73 | objects = $(DL_FILE) \ |
74 | glibc-libidn-$(VER).tar.bz2 | |
cd1a2927 MT |
75 | |
76 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
dd714b8a | 77 | glibc-libidn-$(VER).tar.bz2 = $(DL_FROM)/glibc-libidn-$(VER).tar.bz2 |
cd1a2927 | 78 | |
51f9e7ac MT |
79 | ifeq "$(MACHINE)" "arm" |
80 | $(DL_FILE)_MD5 = 1fb29764a6a650a4d5b409dda227ac9f | |
81 | glibc-libidn-$(VER).tar.bz2_MD5 = 8787868ba8962d9b125997ec2f25ac01 | |
82 | else | |
83 | $(DL_FILE)_MD5 = bfdce99f82d6dbcb64b7f11c05d6bc96 | |
84 | glibc-libidn-$(VER).tar.bz2_MD5 = 49dbe06ce830fc73874d6b38bdc5b4db | |
85 | endif | |
86 | ||
87 | # ARM needs glibc-ports | |
88 | ifeq "$(MACHINE)" "arm" | |
89 | objects += glibc-ports-$(VER).tar.bz2 | |
90 | glibc-ports-$(VER).tar.bz2 = $(DL_FROM)/glibc-ports-$(VER).tar.bz2 | |
91 | glibc-ports-$(VER).tar.bz2_MD5 = 183f6d46e8fa5e4b2aff240ab1586c2e | |
92 | endif | |
cd1a2927 MT |
93 | |
94 | install : $(TARGET) | |
95 | ||
96 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
97 | ||
98 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
99 | ||
100 | md5 : $(subst %,%_MD5,$(objects)) | |
101 | ||
102 | ############################################################################### | |
103 | # Downloading, checking, md5sum | |
104 | ############################################################################### | |
105 | ||
106 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
107 | @$(CHECK) | |
108 | ||
109 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
110 | @$(LOAD) | |
111 | ||
112 | $(subst %,%_MD5,$(objects)) : | |
113 | @$(MD5) | |
114 | ||
115 | ############################################################################### | |
116 | # Installation Details | |
117 | ############################################################################### | |
118 | ||
119 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
120 | @$(PREBUILD) | |
121 | @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) | |
cd1a2927 | 122 | @mkdir $(DIR_SRC)/glibc-build |
51f9e7ac MT |
123 | ifeq "$(MACHINE)" "arm" |
124 | cd $(DIR_APP) && tar jxf $(DIR_DL)/glibc-ports-$(VER).tar.bz2 | |
125 | cd $(DIR_APP) && mv -v glibc-ports-$(VER) ports | |
126 | ||
127 | cd $(DIR_APP)/ports && patch -Np1 -i $(DIR_SRC)/src/patches/glibc-ports-avoid-using-asm-procinfo.patch | |
128 | ||
129 | # asm/page.h should not be included in sysdeps/unix/sysv/linux/arm/ioperm.c. | |
130 | cd $(DIR_APP) && sed "/asm\/page.h/d" -i ports/sysdeps/unix/sysv/linux/arm/ioperm.c | |
131 | else | |
82a8499a | 132 | cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-dont_use_origin_on_privil_exec.patch |
51f9e7ac | 133 | endif |
82a8499a | 134 | |
9b0ff0a0 | 135 | ifeq "$(ROOT)" "" |
51f9e7ac | 136 | ifeq "$(MACHINE)" "i586" |
9b0ff0a0 MT |
137 | cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-linux_types-1.patch |
138 | cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-inotify-1.patch | |
51f9e7ac | 139 | endif |
dd714b8a MT |
140 | # This locale causes a loop on bash login - exclude it |
141 | cd $(DIR_APP) && sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED | |
51f9e7ac MT |
142 | ifeq "$(MACHINE)" "arm" |
143 | cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \ | |
144 | scripts/test-installation.pl | |
145 | else | |
dd714b8a MT |
146 | cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \ |
147 | scripts/test-installation.pl | |
9b0ff0a0 | 148 | endif |
51f9e7ac MT |
149 | endif |
150 | cd $(DIR_SRC)/glibc-build && CFLAGS="$(CFLAGS)" $(DIR_APP)/configure $(EXTRA_CONFIG) | |
9b0ff0a0 | 151 | |
cd1a2927 MT |
152 | ifeq "$(ROOT)" "" |
153 | touch /etc/ld.so.conf | |
dd714b8a | 154 | cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE) |
cd1a2927 | 155 | cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install |
51f9e7ac | 156 | ifeq "$(MACHINE)" "i586" |
dd714b8a | 157 | cp -v $(DIR_APP)/sysdeps/unix/sysv/linux/inotify.h /usr/include/sys |
51f9e7ac | 158 | endif |
cd1a2927 MT |
159 | else |
160 | -mkdir /tools/etc | |
161 | touch /tools/etc/ld.so.conf | |
dd714b8a MT |
162 | cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE) |
163 | cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install | |
cd1a2927 MT |
164 | endif |
165 | ||
166 | # Creating the locales | |
167 | ifeq "$(ROOT)" "" | |
168 | mkdir -p /usr/lib/locale | |
cd1a2927 MT |
169 | cd $(DIR_SRC)/glibc-build && localedef -i en_US -f ISO-8859-1 en_US |
170 | cd $(DIR_SRC)/glibc-build && localedef -i en_US -f UTF-8 en_US.utf8 | |
51f9e7ac MT |
171 | # XXX zoneinfo stuff is not installed |
172 | #cp -f /usr/share/zoneinfo/GMT /etc/localtime | |
cd1a2927 | 173 | endif |
cd1a2927 MT |
174 | @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build |
175 | @$(POSTBUILD) |