1ed0e82df05899e28b46b9a1b44ae59125700a68
[openwrt/openwrt.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.21.1
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=gettext-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@GNU/gettext
16 PKG_HASH:=50dbc8f39797950aa2c98e939947c527e5ac9ebd2c1b99dd7b06ba33a6767ae6
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 HOST_BUILD_DEPENDS:=gperf/host libunistring/host libxml2/host
29 HOST_BUILD_PARALLEL:=0
30
31 PKG_SUBDIRS:= \
32 $$$$(foreach dir, \
33 intl \
34 intl-csharp \
35 intl-java \
36 its \
37 gnulib-lib \
38 gnulib-local \
39 lib \
40 $$$$(SUBDIR_libasprintf) \
41 libgettextpo \
42 libgrep \
43 libtextstyle \
44 m4 \
45 misc \
46 po \
47 projects \
48 src \
49 styles \
50 gettext-runtime \
51 gettext-tools \
52 ,$$$$(wildcard $$$$(dir)) )
53
54 PKG_MAKEFILES_FAKE:= \
55 gnulib-local/m4/Makefile \
56 libtextstyle/gnulib-local/Makefile \
57 libtextstyle/m4/Makefile \
58 m4/Makefile
59
60 include $(INCLUDE_DIR)/package.mk
61 include $(INCLUDE_DIR)/host-build.mk
62
63 define Package/libintl-full
64 SECTION:=libs
65 CATEGORY:=Libraries
66 TITLE:=GNU Internationalization library
67 URL:=http://www.gnu.org/software/gettext/
68 ABI_VERSION:=8
69 endef
70
71 export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
72
73 TARGET_CFLAGS += $(FPIC)
74 ifneq ($(HOST_OS),Linux)
75 TARGET_CFLAGS += -I$(STAGING_DIR_HOSTPKG)/include
76 endif
77
78 CONFIGURE_ARGS += \
79 --enable-shared \
80 --enable-static \
81 --disable-libasprintf \
82 --disable-rpath \
83 --enable-nls \
84 --disable-java \
85 --disable-openmp \
86 --disable-curses \
87 --with-included-gettext \
88 --without-libintl-prefix \
89 --without-libexpat-prefix \
90 --with-libunistring-prefix=$(STAGING_DIR)/usr \
91 --with-libxml2-prefix=$(STAGING_DIR) \
92 --without-emacs
93
94 HOST_CONFIGURE_ARGS += \
95 --disable-shared \
96 --enable-static \
97 --disable-libasprintf \
98 --disable-rpath \
99 --disable-java \
100 --disable-openmp \
101 --without-emacs \
102 --with-libunistring-prefix=$(STAGING_DIR_HOSTPKG) \
103 --with-libxml2-prefix=$(STAGING_DIR_HOSTPKG)
104
105 HOST_CONFIGURE_VARS += \
106 EMACS="no" \
107 am_cv_lib_iconv=no \
108 am_cv_func_iconv=no \
109 ac_cv_header_iconv_h=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))