]> git.ipfire.org Git - ipfire-2.x.git/blob - lfs/glibc
Update:
[ipfire-2.x.git] / lfs / glibc
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 # #
21 # Modifications by: #
22 # ??-12-2003 Mark Wormgoor < mark@wormgoor.com> #
23 # - Modified Makefile for IPCop build #
24 # #
25 # $Id: glibc,v 1.17.2.12 2005/02/05 15:38:15 gespinasse Exp $
26 # #
27 ###############################################################################
28
29 ###############################################################################
30 # Definitions
31 ###############################################################################
32
33 include Config
34
35 VER = 2.3.3
36
37 THISAPP = glibc-$(VER)-lfs-5.1
38 DL_FILE = $(THISAPP).tar.bz2
39 DL_FROM = $(URL_LFS_FTP)
40 DIR_APP = $(DIR_SRC)/$(THISAPP)
41 CFLAGS =
42 CXXFLAGS =
43
44 # Normal build or /tools build.
45 #
46 ifeq "$(ROOT)" ""
47 TARGET = $(DIR_INFO)/$(THISAPP)
48 EXTRA_CONFIG = --prefix=/usr \
49 --disable-profile --enable-add-ons=linuxthreads \
50 --libexecdir=/usr/lib --with-headers=/usr/include \
51 --without-cvs --disable-nls
52 EXTRA_MAKE =
53 EXTRA_INSTALL =
54 else
55 TARGET = $(DIR_INFO)/$(THISAPP)-tools
56 EXTRA_CONFIG = --prefix=/tools \
57 --disable-profile --enable-add-ons=linuxthreads \
58 --with-headers=/tools/include \
59 --with-binutils=/tools/bin --without-gd \
60 --without-cvs --disable-nls
61 EXTRA_MAKE =
62 EXTRA_INSTALL =
63 endif
64
65 ###############################################################################
66 # Top-level Rules
67 ###############################################################################
68
69 objects = $(DL_FILE)
70
71 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
72
73 $(DL_FILE)_MD5 = cd11fabdf5162ad68329e7b28b308278
74
75 install : $(TARGET)
76
77 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
78
79 download :$(patsubst %,$(DIR_DL)/%,$(objects))
80
81 md5 : $(subst %,%_MD5,$(objects))
82
83 ###############################################################################
84 # Downloading, checking, md5sum
85 ###############################################################################
86
87 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
88 @$(CHECK)
89
90 $(patsubst %,$(DIR_DL)/%,$(objects)) :
91 @$(LOAD)
92
93 $(subst %,%_MD5,$(objects)) :
94 @$(MD5)
95
96 ###############################################################################
97 # Installation Details
98 ###############################################################################
99
100 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
101 @$(PREBUILD)
102 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
103 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-2.3.3-ssp_frandom-2.patch
104 @mkdir $(DIR_SRC)/glibc-build
105 cd $(DIR_SRC)/glibc-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
106 ifeq "$(ROOT)" ""
107 touch /etc/ld.so.conf
108 cd $(DIR_SRC)/glibc-build && make $(EXTRA_MAKE)
109 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
110 else
111 -mkdir /tools/etc
112 touch /tools/etc/ld.so.conf
113 cd $(DIR_SRC)/glibc-build && make $(EXTRA_MAKE) AUTOCONF=no
114 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) AUTOCONF=no install
115 endif
116
117 # Locking in the toolchain
118 ifeq "$(ROOT)" ""
119 SPECFILE=/tools/lib/gcc-lib/*/*/specs && \
120 sed -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' \
121 $$SPECFILE > newspecfile && mv -f newspecfile $$SPECFILE
122 else
123 SPECFILE=/tools/lib/gcc-lib/*/*/specs && \
124 sed -e 's@/lib/ld-linux.so.2@/tools/lib/ld-linux.so.2@g' \
125 $$SPECFILE > tempspecfile && mv -f tempspecfile $$SPECFILE
126 rm -f /tools/lib/gcc-lib/*/*/include/{pthread.h,bits/sigthread.h}
127 endif
128
129 # Creating the locales
130 ifeq "$(ROOT)" ""
131 mkdir -p /usr/lib/locale
132 else
133 mkdir -p /tools/lib/locale
134 endif
135 cd $(DIR_SRC)/glibc-build && localedef -i en_US -f ISO-8859-1 en_US
136 cd $(DIR_SRC)/glibc-build && localedef -i en_US -f UTF-8 en_US.utf8
137
138 # Configuring Glibc
139 ifeq "$(ROOT)" ""
140 cp -f /usr/share/zoneinfo/GMT /etc/localtime
141 endif
142 # Cleanup
143 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
144 @$(POSTBUILD)