gettext-full: update to 0.22.5
[openwrt/staging/blocktrron.git] / package / libs / gettext-full / Makefile
1 #
2 # Copyright (C) 2006-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=gettext-full
11 PKG_VERSION:=0.22.5
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=gettext-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@GNU/gettext
16 PKG_HASH:=fe10c37353213d78a5b83d48af231e005c4da84db5ce88037d88355938259640
17 PKG_BUILD_DIR:=$(BUILD_DIR)/gettext-$(PKG_VERSION)
18 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/gettext-$(PKG_VERSION)
19
20 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
21 PKG_LICENSE:=GPL-3.0-or-later
22 PKG_CPE_ID:=cpe:/a:gnu:gettext
23
24 PKG_INSTALL:=1
25 PKG_BUILD_DEPENDS:=gettext-full/host libunistring libxml2
26 PKG_BUILD_PARALLEL:=0
27
28 PKG_FIXUP:=autoreconf
29
30 HOST_BUILD_DEPENDS:=gperf/host libiconv-full/host libunistring/host libxml2/host
31 HOST_BUILD_PARALLEL:=0
32
33 PKG_SUBDIRS:= \
34 $$$$(foreach dir, \
35 intl \
36 intl-csharp \
37 intl-java \
38 its \
39 gnulib-lib \
40 gnulib-local \
41 lib \
42 $$$$(SUBDIR_libasprintf) \
43 libgettextpo \
44 libgrep \
45 libtextstyle \
46 m4 \
47 misc \
48 po \
49 projects \
50 src \
51 styles \
52 gettext-runtime \
53 gettext-tools \
54 ,$$$$(wildcard $$$$(dir)) )
55
56 PKG_MAKEFILES_FAKE:= \
57 gnulib-local/m4/Makefile \
58 libtextstyle/gnulib-local/Makefile \
59 libtextstyle/m4/Makefile \
60 m4/Makefile
61
62 include $(INCLUDE_DIR)/package.mk
63 include $(INCLUDE_DIR)/host-build.mk
64
65 define Package/libintl-full
66 SECTION:=libs
67 CATEGORY:=Libraries
68 TITLE:=GNU Internationalization library
69 URL:=http://www.gnu.org/software/gettext/
70 ABI_VERSION:=8
71 endef
72
73 export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
74
75 TARGET_CFLAGS += $(FPIC)
76 ifneq ($(HOST_OS),Linux)
77 TARGET_CFLAGS += -I$(STAGING_DIR_HOSTPKG)/include
78 endif
79
80 CONFIGURE_ARGS += \
81 --enable-shared \
82 --enable-static \
83 --disable-libasprintf \
84 --disable-rpath \
85 --enable-nls \
86 --disable-java \
87 --disable-openmp \
88 --disable-curses \
89 --with-included-gettext \
90 --without-libintl-prefix \
91 --without-libexpat-prefix \
92 --with-libunistring-prefix=$(STAGING_DIR)/usr \
93 --with-libxml2-prefix=$(STAGING_DIR) \
94 --without-emacs
95
96 HOST_CONFIGURE_ARGS += \
97 --disable-shared \
98 --enable-static \
99 --disable-libasprintf \
100 --disable-rpath \
101 --disable-java \
102 --disable-openmp \
103 --without-emacs \
104 --with-libiconv-prefix=$(STAGING_DIR_HOSTPKG) \
105 --with-libunistring-prefix=$(STAGING_DIR_HOSTPKG) \
106 --with-libxml2-prefix=$(STAGING_DIR_HOSTPKG)
107
108 HOST_CONFIGURE_VARS += \
109 EMACS="no" \
110
111 HOST_CFLAGS += $(HOST_FPIC)
112
113 define Host/Bootstrap
114 ( \
115 cd $(HOST_BUILD_DIR); \
116 $(AM_TOOL_PATHS) \
117 ./autogen.sh \
118 )
119 endef
120
121 define Host/Prepare
122 $(call Host/Prepare/Default)
123 $(if $(QUILT),,$(call Host/Bootstrap))
124 endef
125
126 define Host/Configure
127 $(if $(QUILT),$(call Host/Bootstrap))
128 $(call Host/Configure/Default)
129 endef
130
131 define Host/Compile
132 $(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(HOST_BUILD_DIR)/$(makefile); )
133 $(call Host/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
134 endef
135
136 define Build/Bootstrap
137 ( \
138 cd $(PKG_BUILD_DIR); \
139 $(AM_TOOL_PATHS) \
140 ./autogen.sh \
141 )
142 endef
143
144 define Build/Prepare
145 $(call Build/Prepare/Default)
146 $(if $(QUILT),,$(call Build/Bootstrap))
147 endef
148
149 define Build/Configure
150 $(if $(QUILT),$(call Build/Bootstrap))
151 $(call Build/Configure/Default)
152 endef
153
154 define Build/Compile
155 $(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(PKG_BUILD_DIR)/$(makefile); )
156 $(call Build/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
157 endef
158
159 define Build/InstallDev
160 $(INSTALL_DIR) $(1)/usr/lib/libintl-full/include
161 $(CP) $(PKG_INSTALL_DIR)/usr/include/libintl.h $(1)/usr/lib/libintl-full/include/
162
163 $(INSTALL_DIR) $(1)/usr/lib/libintl-full/lib
164 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libintl.{a,so*} $(1)/usr/lib/libintl-full/lib/
165
166 $(INSTALL_DIR) $(1)/usr/share/aclocal
167 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal/
168
169 $(SED) '/read dummy/d' $(STAGING_DIR_HOSTPKG)/bin/gettextize
170 endef
171
172 define Host/Install
173 $(call Host/Compile/Default,install SUBDIRS='$(PKG_SUBDIRS)')
174 $(LN) msgfmt $(STAGING_DIR_HOSTPKG)/bin/gmsgfmt
175 endef
176
177 define Build/Install
178 $(call Build/Install/Default,install SUBDIRS='$(PKG_SUBDIRS)')
179 endef
180
181 define Package/libintl-full/install
182 $(INSTALL_DIR) $(1)/usr/lib
183 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libintl.so.* $(1)/usr/lib/
184 endef
185
186 $(eval $(call HostBuild))
187 $(eval $(call BuildPackage,libintl-full))