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