1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
################################################################################
# Embtoolkit
# Copyright(C) 2009-2011 Abdoulaye Walsimou GAYE. All rights reserved.
#
# This program is free software; you can distribute it and/or modify it
# under the terms of the GNU General Public License
# (Version 2 or later) published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
################################################################################
#
# \file gettext.mk
# \brief gettext.mk of Embtoolkit
# \author Abdoulaye Walsimou GAYE <awg@embtoolkit.org>
# \date December 2009
################################################################################
GETTEXT_VERSION := $(subst ",,$(strip $(CONFIG_EMBTK_GETTEXT_VERSION_STRING)))
GETTEXT_SITE := http://ftp.gnu.org/pub/gnu/gettext
GETTEXT_PATCH_SITE := ftp://ftp.embtoolkit.org/embtoolkit.org/gettext/$(GETTEXT_VERSION)
GETTEXT_PACKAGE := gettext-$(GETTEXT_VERSION).tar.gz
GETTEXT_BUILD_DIR := $(PACKAGES_BUILD)/gettext-$(GETTEXT_VERSION)
GETTEXT_BINS = autopoint gettext gettext.sh msgcat msgcomm msgen msgfilter \
msggrep msgmerge msguniq recode-sr-latin envsubst gettextize \
msgattrib msgcmp msgconv msgexec msgfmt msginit msgunfmt \
ngettext xgettext
GETTEXT_SBINS =
GETTEXT_INCLUDES = autosprintf.h gettext-po.h libintl.h
GETTEXT_LIBS = gettext libgettext* libasprintf* libintl*
GETTEXT_PKGCONFIGS =
GETTEXT_DEPS = ncurses_install libxml2_install
gettext_install:
@test -e $(GETTEXT_BUILD_DIR)/.installed || \
$(MAKE) $(GETTEXT_BUILD_DIR)/.installed
$(GETTEXT_BUILD_DIR)/.installed: $(GETTEXT_DEPS) download_gettext \
$(GETTEXT_BUILD_DIR)/.decompressed $(GETTEXT_BUILD_DIR)/.configured
$(call EMBTK_GENERIC_MESSAGE,"Compiling and installing \
gettext-$(GETTEXT_VERSION) in your root filesystem...")
$(call EMBTK_KILL_LT_RPATH, $(GETTEXT_BUILD_DIR))
$(Q)$(MAKE) -C $(GETTEXT_BUILD_DIR) $(J)
$(Q)$(MAKE) -C $(GETTEXT_BUILD_DIR) DESTDIR=$(SYSROOT) install
$(Q)$(MAKE) libtool_files_adapt
$(Q)$(MAKE) $(GETTEXT_BUILD_DIR)/.patchlibtool
@touch $@
download_gettext:
$(call EMBTK_GENERIC_MESSAGE,"Downloading $(GETTEXT_PACKAGE) \
if necessary...")
@test -e $(DOWNLOAD_DIR)/$(GETTEXT_PACKAGE) || \
wget -O $(DOWNLOAD_DIR)/$(GETTEXT_PACKAGE) \
$(GETTEXT_SITE)/$(GETTEXT_PACKAGE)
ifeq ($(CONFIG_EMBTK_GETTEXT_NEED_PATCH),y)
@test -e $(DOWNLOAD_DIR)/gettext-$(GETTEXT_VERSION).patch || \
wget -O $(DOWNLOAD_DIR)/gettext-$(GETTEXT_VERSION).patch \
$(GETTEXT_PATCH_SITE)/gettext-$(GETTEXT_VERSION)-*.patch
endif
$(GETTEXT_BUILD_DIR)/.decompressed:
$(call EMBTK_GENERIC_MESSAGE,"Decompressing $(GETTEXT_PACKAGE) ...")
@tar -C $(PACKAGES_BUILD) -xzf $(DOWNLOAD_DIR)/$(GETTEXT_PACKAGE)
ifeq ($(CONFIG_EMBTK_GETTEXT_NEED_PATCH),y)
@cd $(GETTEXT_BUILD_DIR); \
patch -p1 < $(DOWNLOAD_DIR)/gettext-$(GETTEXT_VERSION).patch
endif
@touch $@
$(GETTEXT_BUILD_DIR)/.configured:
$(Q)cd $(GETTEXT_BUILD_DIR); \
CC=$(TARGETCC_CACHED) CXX=$(TARGETCXX_CACHED) \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="-L$(SYSROOT)/$(LIBDIR) -L$(SYSROOT)/usr/$(LIBDIR)" \
CPPFLAGS="-I$(SYSROOT)/usr/include" \
gl_cv_func_wcwidth_works=yes \
am_cv_func_iconv_works=yes \
gt_cv_func_printf_posix=yes \
gt_cv_int_divbyzero_sigfpe=no \
./configure --build=$(HOST_BUILD) --host=$(STRICT_GNU_TARGET) \
--target=$(STRICT_GNU_TARGET) --libdir=/usr/$(LIBDIR) \
--prefix=/usr --enable-relocatable --with-included-gettext \
--disable-rpath --disable-openmp --disable-java \
--with-libxml2-prefix=$(SYSROOT)/usr --disable-openmp
@touch $@
gettext_clean:
$(call EMBTK_GENERIC_MESSAGE,"cleanup gettext-$(GETTEXT_VERSION)...")
$(Q)-cd $(SYSROOT)/usr/bin; rm -rf $(GETTEXT_BINS)
$(Q)-cd $(SYSROOT)/usr/sbin; rm -rf $(GETTEXT_SBINS)
$(Q)-cd $(SYSROOT)/usr/include; rm -rf $(GETTEXT_INCLUDES)
$(Q)-cd $(SYSROOT)/usr/$(LIBDIR); rm -rf $(GETTEXT_LIBS)
$(Q)-cd $(SYSROOT)/usr/$(LIBDIR)/pkgconfig; rm -rf $(GETTEXT_PKGCONFIGS)
$(Q)-rm -rf $(GETTEXT_BUILD_DIR)*
#FIXME: this should be fixed in gettext project
$(GETTEXT_BUILD_DIR)/.patchlibtool:
$(Q)sed \
-i "s;/usr/$(LIBDIR)/libintl.la;$(SYSROOT)/$(LIBDIR)/libintl.la;" \
$(SYSROOT)/usr/$(LIBDIR)/libgettextlib.la \
$(SYSROOT)/usr/$(LIBDIR)/libgettextpo.la \
$(SYSROOT)/usr/$(LIBDIR)/libgettextsrc.la
$(Q)sed \
-i "s;/usr/$(LIBDIR)/libgettextlib.la;$(SYSROOT)/$(LIBDIR)/libgettextlib.la;" \
$(SYSROOT)/usr/$(LIBDIR)/libgettextsrc.la
|