gettext-full: link to local libxml2
[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:=1
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_FIXUP:=autoreconf
25 PKG_INSTALL:=1
26 PKG_BUILD_DEPENDS:=gettext-full/host libxml2
27 PKG_BUILD_PARALLEL:=0
28
29 HOST_BUILD_DEPENDS:=gperf/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 TARGET_CFLAGS += $(FPIC)
73 ifneq ($(HOST_OS),Linux)
74 TARGET_CFLAGS += -I$(STAGING_DIR_HOSTPKG)/include
75 endif
76
77 CONFIGURE_ARGS += \
78 --enable-shared \
79 --enable-static \
80 --disable-libasprintf \
81 --disable-rpath \
82 --enable-nls \
83 --disable-java \
84 --disable-openmp \
85 --disable-curses \
86 --with-included-gettext \
87 --without-libintl-prefix \
88 --without-libexpat-prefix \
89 --with-libxml2-prefix=$(STAGING_DIR) \
90 --without-emacs
91
92 HOST_CONFIGURE_ARGS += \
93 --disable-shared \
94 --enable-static \
95 --disable-libasprintf \
96 --disable-rpath \
97 --disable-java \
98 --disable-openmp \
99 --without-emacs \
100 --with-libxml2-prefix=$(STAGING_DIR_HOSTPKG)
101
102 HOST_CONFIGURE_VARS += \
103 EMACS="no" \
104 am_cv_lib_iconv=no \
105 am_cv_func_iconv=no \
106 ac_cv_header_iconv_h=no \
107
108 HOST_CFLAGS += $(HOST_FPIC)
109
110 define Host/Compile
111 $(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(HOST_BUILD_DIR)/$(makefile); )
112 $(call Host/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
113 endef
114
115 define Build/Compile
116 $(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(PKG_BUILD_DIR)/$(makefile); )
117 $(call Build/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
118 endef
119
120 define Build/InstallDev
121 $(INSTALL_DIR) $(1)/usr/lib/libintl-full/include
122 $(CP) $(PKG_INSTALL_DIR)/usr/include/libintl.h $(1)/usr/lib/libintl-full/include/
123
124 $(INSTALL_DIR) $(1)/usr/lib/libintl-full/lib
125 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libintl.{a,so*} $(1)/usr/lib/libintl-full/lib/
126
127 $(INSTALL_DIR) $(1)/usr/share/aclocal
128 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* $(1)/usr/share/aclocal/
129
130 $(SED) '/read dummy/d' $(STAGING_DIR_HOSTPKG)/bin/gettextize
131 endef
132
133 define Host/Install
134 $(call Host/Compile/Default,install SUBDIRS='$(PKG_SUBDIRS)')
135 $(LN) msgfmt $(STAGING_DIR_HOSTPKG)/bin/gmsgfmt
136 endef
137
138 define Build/Install
139 $(call Build/Install/Default,install SUBDIRS='$(PKG_SUBDIRS)')
140 endef
141
142 define Package/libintl-full/install
143 $(INSTALL_DIR) $(1)/usr/lib
144 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libintl.so.* $(1)/usr/lib/
145 endef
146
147 $(eval $(call HostBuild))
148 $(eval $(call BuildPackage,libintl-full))