1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
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. #
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. #
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/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
30 THISAPP = glibc-$(VER)
31 DL_FILE = $(THISAPP).tar.bz2
32 DL_FROM = $(URL_IPFIRE)
33 DIR_APP = $(DIR_SRC)/$(THISAPP)
35 # Normal build or /tools build.
38 TARGET = $(DIR_INFO)/$(THISAPP)
41 --libexecdir=/usr/lib/glibc
45 TARGET = $(DIR_INFO)/$(THISAPP)-tools
48 --with-binutils=/tools/bin \
49 --with-headers=/tools/include \
55 EXTRA_CONFIG += --build=$(BUILDTARGET)
57 # Enable some extra optimization for the glibc code.
58 export CFLAGS := $(subst -O2,-O3,$(CFLAGS))
60 ifeq "$(MACHINE_TYPE)" "arm"
61 # Disable hardware FP for ARM.
66 # Add some general configuration flags
69 --enable-kernel=2.6.0 \
72 --enable-experimental-malloc \
75 ###############################################################################
77 ###############################################################################
81 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
83 $(DL_FILE)_MD5 = 903fcfa547df2f453476800e0838fe52
85 # ARM needs glibc-ports
86 ifeq "$(MACHINE_TYPE)" "arm"
87 objects += glibc-ports-$(PORTS_VER).tar.bz2
88 glibc-ports-$(PORTS_VER).tar.bz2 = $(DL_FROM)/glibc-ports-$(PORTS_VER).tar.bz2
89 glibc-ports-$(PORTS_VER).tar.bz2_MD5 = cb01ab976180e98287cef5079e35359e
94 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
96 download :$(patsubst %,$(DIR_DL)/%,$(objects))
98 md5 : $(subst %,%_MD5,$(objects))
100 ###############################################################################
101 # Downloading, checking, md5sum
102 ###############################################################################
104 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
107 $(patsubst %,$(DIR_DL)/%,$(objects)) :
110 $(subst %,%_MD5,$(objects)) :
113 ###############################################################################
114 # Installation Details
115 ###############################################################################
117 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
119 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
120 @mkdir $(DIR_SRC)/glibc-build
121 ifeq "$(MACHINE_TYPE)" "arm"
122 cd $(DIR_APP) && tar jxf $(DIR_DL)/glibc-ports-$(PORTS_VER).tar.bz2
123 cd $(DIR_APP) && mv -v glibc-ports-$(PORTS_VER) ports
127 # This locale causes a loop on bash login - exclude it
128 cd $(DIR_APP) && sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
129 ifeq "$(MACHINE_TYPE)" "arm"
130 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.3 -o|' \
131 scripts/test-installation.pl
133 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
134 scripts/test-installation.pl
137 cd $(DIR_SRC)/glibc-build && CFLAGS="$(CFLAGS)" $(DIR_APP)/configure $(EXTRA_CONFIG)
140 touch /etc/ld.so.conf
141 cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE)
142 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
145 touch /tools/etc/ld.so.conf
146 cd $(DIR_SRC)/glibc-build && make $(MAKETUNING) $(EXTRA_MAKE)
147 cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
150 # Creating the locales
152 mkdir -p /usr/lib/locale
153 cd $(DIR_SRC)/glibc-build && localedef -i en_US -f ISO-8859-1 en_US
154 cd $(DIR_SRC)/glibc-build && localedef -i en_US -f UTF-8 en_US.utf8
156 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build