]>
Commit | Line | Data |
---|---|---|
cd1a2927 MT |
1 | ############################################################################### |
2 | # This file is part of the IPCop Firewall. # | |
3 | # # | |
4 | # IPCop is free software; you can redistribute it and/or modify # | |
5 | # it under the terms of the GNU General Public License as published by # | |
6 | # the Free Software Foundation; either version 2 of the License, or # | |
7 | # (at your option) any later version. # | |
8 | # # | |
9 | # IPCop is distributed in the hope that it will be useful, # | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
12 | # GNU General Public License for more details. # | |
13 | # # | |
14 | # You should have received a copy of the GNU General Public License # | |
15 | # along with IPCop; if not, write to the Free Software # | |
16 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # | |
17 | # # | |
18 | # Makefiles are based on LFSMake, which is # | |
19 | # Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> # | |
20 | # # | |
cd1a2927 MT |
21 | ############################################################################### |
22 | ||
23 | ############################################################################### | |
24 | # Definitions | |
25 | ############################################################################### | |
26 | ||
27 | include Config | |
28 | ||
29 | VER = 2.3.3 | |
30 | ||
31 | THISAPP = glibc-$(VER)-lfs-5.1 | |
32 | DL_FILE = $(THISAPP).tar.bz2 | |
7a98bae5 | 33 | DL_FROM = $(URL_IPFIRE) |
cd1a2927 MT |
34 | DIR_APP = $(DIR_SRC)/$(THISAPP) |
35 | CFLAGS = | |
36 | CXXFLAGS = | |
37 | ||
38 | # Normal build or /tools build. | |
39 | # | |
40 | ifeq "$(ROOT)" "" | |
41 | TARGET = $(DIR_INFO)/$(THISAPP) | |
42 | EXTRA_CONFIG = --prefix=/usr \ | |
43 | --disable-profile --enable-add-ons=linuxthreads \ | |
44 | --libexecdir=/usr/lib --with-headers=/usr/include \ | |
45 | --without-cvs --disable-nls | |
46 | EXTRA_MAKE = | |
47 | EXTRA_INSTALL = | |
48 | else | |
49 | TARGET = $(DIR_INFO)/$(THISAPP)-tools | |
50 | EXTRA_CONFIG = --prefix=/tools \ | |
51 | --disable-profile --enable-add-ons=linuxthreads \ | |
52 | --with-headers=/tools/include \ | |
53 | --with-binutils=/tools/bin --without-gd \ | |
54 | --without-cvs --disable-nls | |
55 | EXTRA_MAKE = | |
56 | EXTRA_INSTALL = | |
57 | endif | |
58 | ||
59 | ############################################################################### | |
60 | # Top-level Rules | |
61 | ############################################################################### | |
62 | ||
63 | objects = $(DL_FILE) | |
64 | ||
65 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
66 | ||
67 | $(DL_FILE)_MD5 = cd11fabdf5162ad68329e7b28b308278 | |
68 | ||
69 | install : $(TARGET) | |
70 | ||
71 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
72 | ||
73 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
74 | ||
75 | md5 : $(subst %,%_MD5,$(objects)) | |
76 | ||
77 | ############################################################################### | |
78 | # Downloading, checking, md5sum | |
79 | ############################################################################### | |
80 | ||
81 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
82 | @$(CHECK) | |
83 | ||
84 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
85 | @$(LOAD) | |
86 | ||
87 | $(subst %,%_MD5,$(objects)) : | |
88 | @$(MD5) | |
89 | ||
90 | ############################################################################### | |
91 | # Installation Details | |
92 | ############################################################################### | |
93 | ||
94 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
95 | @$(PREBUILD) | |
96 | @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) | |
97 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-2.3.3-ssp_frandom-2.patch | |
98 | @mkdir $(DIR_SRC)/glibc-build | |
99 | cd $(DIR_SRC)/glibc-build && $(DIR_APP)/configure $(EXTRA_CONFIG) | |
100 | ifeq "$(ROOT)" "" | |
101 | touch /etc/ld.so.conf | |
102 | cd $(DIR_SRC)/glibc-build && make $(EXTRA_MAKE) | |
103 | cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install | |
104 | else | |
105 | -mkdir /tools/etc | |
106 | touch /tools/etc/ld.so.conf | |
107 | cd $(DIR_SRC)/glibc-build && make $(EXTRA_MAKE) AUTOCONF=no | |
108 | cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) AUTOCONF=no install | |
109 | endif | |
110 | ||
111 | # Locking in the toolchain | |
112 | ifeq "$(ROOT)" "" | |
113 | SPECFILE=/tools/lib/gcc-lib/*/*/specs && \ | |
114 | sed -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' \ | |
115 | $$SPECFILE > newspecfile && mv -f newspecfile $$SPECFILE | |
116 | else | |
117 | SPECFILE=/tools/lib/gcc-lib/*/*/specs && \ | |
118 | sed -e 's@/lib/ld-linux.so.2@/tools/lib/ld-linux.so.2@g' \ | |
119 | $$SPECFILE > tempspecfile && mv -f tempspecfile $$SPECFILE | |
120 | rm -f /tools/lib/gcc-lib/*/*/include/{pthread.h,bits/sigthread.h} | |
121 | endif | |
122 | ||
123 | # Creating the locales | |
124 | ifeq "$(ROOT)" "" | |
125 | mkdir -p /usr/lib/locale | |
126 | else | |
127 | mkdir -p /tools/lib/locale | |
128 | endif | |
129 | cd $(DIR_SRC)/glibc-build && localedef -i en_US -f ISO-8859-1 en_US | |
130 | cd $(DIR_SRC)/glibc-build && localedef -i en_US -f UTF-8 en_US.utf8 | |
131 | ||
132 | # Configuring Glibc | |
133 | ifeq "$(ROOT)" "" | |
134 | cp -f /usr/share/zoneinfo/GMT /etc/localtime | |
135 | endif | |
136 | # Cleanup | |
137 | @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build | |
138 | @$(POSTBUILD) |