e7a85bf4b8b21847dc4a6d73f8d0d5f5839dfee8
[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.24.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=gettext-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@GNU/gettext
16 PKG_HASH:=6164ec7aa61653ac9cdfb41d5c2344563b21f707da1562712e48715f1d2052a6
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:=LGPL-2.1-or-later
22 PKG_LICENSE_FILES:=gettext-runtime/intl/COPYING.LIB
23 PKG_CPE_ID:=cpe:/a:gnu:gettext
24
25 PKG_INSTALL:=1
26 PKG_BUILD_DEPENDS:=gettext-full/host libunistring libxml2
27 PKG_BUILD_PARALLEL:=0
28
29 HOST_BUILD_DEPENDS:=gnulib-l10n/host gperf/host libiconv-full/host libunistring/host libxml2/host
30 HOST_BUILD_PARALLEL:=0
31
32 PKG_SUBDIRS:= \
33 $$$$(foreach dir, \
34 intl \
35 intl-csharp \
36 intl-java \
37 its \
38 gnulib-lib \
39 gnulib-local \
40 lib \
41 $$$$(SUBDIR_libasprintf) \
42 libgettextpo \
43 libgrep \
44 libtextstyle \
45 m4 \
46 misc \
47 po \
48 projects \
49 src \
50 styles \
51 gettext-runtime \
52 gettext-tools \
53 ,$$$$(wildcard $$$$(dir)) )
54
55 PKG_MAKEFILES_FAKE:= \
56 gnulib-local/m4/Makefile \
57 libtextstyle/gnulib-local/Makefile \
58 libtextstyle/m4/Makefile \
59 m4/Makefile
60
61 include $(INCLUDE_DIR)/package.mk
62 include $(INCLUDE_DIR)/host-build.mk
63
64 define Package/libintl-full
65 SECTION:=libs
66 CATEGORY:=Libraries
67 TITLE:=GNU Internationalization library
68 URL:=http://www.gnu.org/software/gettext/
69 ABI_VERSION:=8
70 endef
71
72 export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
73
74 TARGET_CFLAGS += $(FPIC)
75 TARGET_CFLAGS += -std=gnu23
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/gettext/m4
167 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gettext/m4/* $(1)/usr/share/gettext/m4/
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))