]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/libglib2/libglib2.mk
e23c4a2df8cd57e69c4f95f22f73ae6ae809fa66
[coffee/buildroot.git] / package / libglib2 / libglib2.mk
1 ################################################################################
2 #
3 # libglib2
4 #
5 ################################################################################
6
7 LIBGLIB2_VERSION_MAJOR = 2.50
8 LIBGLIB2_VERSION = $(LIBGLIB2_VERSION_MAJOR).2
9 LIBGLIB2_SOURCE = glib-$(LIBGLIB2_VERSION).tar.xz
10 LIBGLIB2_SITE = http://ftp.gnome.org/pub/gnome/sources/glib/$(LIBGLIB2_VERSION_MAJOR)
11 LIBGLIB2_LICENSE = LGPLv2+
12 LIBGLIB2_LICENSE_FILES = COPYING
13
14 LIBGLIB2_INSTALL_STAGING = YES
15 LIBGLIB2_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) LDFLAGS=-L$(STAGING_DIR)/usr/lib install
16
17 LIBGLIB2_CONF_ENV = \
18         ac_cv_func_posix_getpwuid_r=yes \
19         glib_cv_stack_grows=no \
20         glib_cv_uscore=no \
21         ac_cv_func_strtod=yes \
22         ac_fsusage_space=yes \
23         fu_cv_sys_stat_statfs2_bsize=yes \
24         ac_cv_func_closedir_void=no \
25         ac_cv_func_getloadavg=no \
26         ac_cv_lib_util_getloadavg=no \
27         ac_cv_lib_getloadavg_getloadavg=no \
28         ac_cv_func_getgroups=yes \
29         ac_cv_func_getgroups_works=yes \
30         ac_cv_func_chown_works=yes \
31         ac_cv_have_decl_euidaccess=no \
32         ac_cv_func_euidaccess=no \
33         ac_cv_have_decl_strnlen=yes \
34         ac_cv_func_strnlen_working=yes \
35         ac_cv_func_lstat_dereferences_slashed_symlink=yes \
36         ac_cv_func_lstat_empty_string_bug=no \
37         ac_cv_func_stat_empty_string_bug=no \
38         vb_cv_func_rename_trailing_slash_bug=no \
39         ac_cv_have_decl_nanosleep=yes \
40         jm_cv_func_nanosleep_works=yes \
41         gl_cv_func_working_utimes=yes \
42         ac_cv_func_utime_null=yes \
43         ac_cv_have_decl_strerror_r=yes \
44         ac_cv_func_strerror_r_char_p=no \
45         jm_cv_func_svid_putenv=yes \
46         ac_cv_func_getcwd_null=yes \
47         ac_cv_func_getdelim=yes \
48         ac_cv_func_mkstemp=yes \
49         utils_cv_func_mkstemp_limitations=no \
50         utils_cv_func_mkdir_trailing_slash_bug=no \
51         jm_cv_func_gettimeofday_clobber=no \
52         gl_cv_func_working_readdir=yes \
53         jm_ac_cv_func_link_follows_symlink=no \
54         utils_cv_localtime_cache=no \
55         ac_cv_struct_st_mtim_nsec=no \
56         gl_cv_func_tzset_clobber=no \
57         gl_cv_func_getcwd_null=yes \
58         gl_cv_func_getcwd_path_max=yes \
59         ac_cv_func_fnmatch_gnu=yes \
60         am_getline_needs_run_time_check=no \
61         am_cv_func_working_getline=yes \
62         gl_cv_func_mkdir_trailing_slash_bug=no \
63         gl_cv_func_mkstemp_limitations=no \
64         ac_cv_func_working_mktime=yes \
65         jm_cv_func_working_re_compile_pattern=yes \
66         ac_use_included_regex=no \
67         gl_cv_c_restrict=no \
68         ac_cv_path_GLIB_GENMARSHAL=$(HOST_DIR)/usr/bin/glib-genmarshal \
69         ac_cv_prog_F77=no \
70         ac_cv_func_posix_getgrgid_r=no \
71         glib_cv_long_long_format=ll \
72         ac_cv_func_printf_unix98=yes \
73         ac_cv_func_vsnprintf_c99=yes \
74         ac_cv_func_newlocale=no \
75         ac_cv_func_uselocale=no \
76         ac_cv_func_strtod_l=no \
77         ac_cv_func_strtoll_l=no \
78         ac_cv_func_strtoull_l=no \
79         gt_cv_c_wchar_t=$(if $(BR2_USE_WCHAR),yes,no)
80
81 # old uClibc versions don't provide qsort_r
82 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
83 LIBGLIB2_CONF_ENV += glib_cv_have_qsort_r=no
84 else
85 LIBGLIB2_CONF_ENV += glib_cv_have_qsort_r=yes
86 endif
87
88 # glib/valgrind.h contains inline asm not compatible with thumb1
89 ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
90 LIBGLIB2_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -marm"
91 endif
92
93 HOST_LIBGLIB2_CONF_OPTS = \
94         --disable-coverage \
95         --disable-dtrace \
96         --disable-fam \
97         --disable-libelf \
98         --disable-selinux \
99         --disable-systemtap \
100         --disable-xattr \
101         --with-pcre=system
102
103 LIBGLIB2_DEPENDENCIES = \
104         host-pkgconf host-libglib2 host-gettext \
105         libffi pcre util-linux zlib $(if $(BR2_NEEDS_GETTEXT),gettext)
106
107 HOST_LIBGLIB2_DEPENDENCIES = \
108         host-gettext \
109         host-libffi \
110         host-pcre \
111         host-pkgconf \
112         host-util-linux \
113         host-zlib
114
115 LIBGLIB2_CONF_OPTS = \
116         --with-pcre=system \
117         --disable-compile-warnings
118
119 ifneq ($(BR2_ENABLE_LOCALE),y)
120 LIBGLIB2_DEPENDENCIES += libiconv
121 endif
122
123 ifeq ($(BR2_PACKAGE_ELFUTILS),y)
124 LIBGLIB2_CONF_OPTS += --enable-libelf
125 LIBGLIB2_DEPENDENCIES += elfutils
126 else
127 LIBGLIB2_CONF_OPTS += --disable-libelf
128 endif
129
130 ifeq ($(BR2_PACKAGE_LIBICONV),y)
131 LIBGLIB2_CONF_OPTS += --with-libiconv=gnu
132 LIBGLIB2_DEPENDENCIES += libiconv
133 endif
134
135 # Purge gdb-related files
136 ifneq ($(BR2_PACKAGE_GDB),y)
137 define LIBGLIB2_REMOVE_GDB_FILES
138         rm -rf $(TARGET_DIR)/usr/share/glib-2.0/gdb
139 endef
140 endif
141
142 # Purge useless binaries from target
143 define LIBGLIB2_REMOVE_DEV_FILES
144         rm -rf $(TARGET_DIR)/usr/lib/glib-2.0
145         rm -rf $(addprefix $(TARGET_DIR)/usr/share/glib-2.0/,codegen gettext)
146         rm -f $(addprefix $(TARGET_DIR)/usr/bin/,gdbus-codegen glib-compile-schemas glib-compile-resources glib-genmarshal glib-gettextize glib-mkenums gobject-query gtester gtester-report)
147         $(LIBGLIB2_REMOVE_GDB_FILES)
148 endef
149
150 LIBGLIB2_POST_INSTALL_TARGET_HOOKS += LIBGLIB2_REMOVE_DEV_FILES
151
152 # Remove schema sources/DTDs, we use staging ones to compile them.
153 # Do so at target finalization since other packages install additional
154 # ones and we want to deal with it in a single place.
155 define LIBGLIB2_REMOVE_TARGET_SCHEMAS
156         rm -f $(TARGET_DIR)/usr/share/glib-2.0/schemas/*.xml \
157                 $(TARGET_DIR)/usr/share/glib-2.0/schemas/*.dtd
158 endef
159
160 # Compile schemas at target finalization since other packages install
161 # them as well, and better do it in a central place.
162 # It's used at run time so it doesn't matter defering it.
163 define LIBGLIB2_COMPILE_SCHEMAS
164         $(HOST_DIR)/usr/bin/glib-compile-schemas \
165                 $(STAGING_DIR)/usr/share/glib-2.0/schemas \
166                 --targetdir=$(TARGET_DIR)/usr/share/glib-2.0/schemas
167 endef
168
169 LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_REMOVE_TARGET_SCHEMAS
170 LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_COMPILE_SCHEMAS
171
172 $(eval $(autotools-package))
173 $(eval $(host-autotools-package))
174
175 LIBGLIB2_HOST_BINARY = $(HOST_DIR)/usr/bin/glib-genmarshal