[packages] glibmm: supply missing macros
[openwrt/svn-archive/archive.git] / libs / glibmm / patches / 001-missing-macros.patch
1 --- /dev/null
2 +++ b/acinclude.m4
3 @@ -0,0 +1,407 @@
4 +#serial 20090814
5 +
6 +AC_DEFUN([_MM_PRE_INIT], [m4_pattern_forbid([^_?MM_])])
7 +
8 +m4_define([_MM_PREREQ],
9 +[dnl
10 +m4_if(m4_quote(m4_version_compare([$2], [$3])), [-1],
11 + [m4_fatal([$4 requires $1 $3 (version $2 is installed)])])[]dnl
12 +])
13 +
14 +AC_DEFUN([MM_PREREQ],
15 +[dnl
16 +m4_assert([$# >= 1])[]dnl
17 +AC_REQUIRE([_MM_PRE_INIT])[]dnl
18 +_MM_PREREQ([mm-common], [0.8], [$1], m4_defn([AC_PACKAGE_NAME]))[]dnl
19 +])
20 +
21 +
22 +#serial 20090817
23 +
24 +m4_define([_MM_ARG_DISABLE_DEPRECATED_API_OPTION],
25 +[dnl
26 +AC_PROVIDE([$0])[]dnl
27 +AC_ARG_ENABLE([deprecated-api],
28 + [AS_HELP_STRING([--disable-deprecated-api],
29 + [omit deprecated API from the library])],
30 + [mm_enable_deprecated_api=$enableval],
31 + [mm_enable_deprecated_api=yes])[]dnl
32 +AS_IF([test "x$mm_enable_deprecated_api" = xno],
33 + [AC_MSG_WARN([[Deprecated API will not be built, breaking compatibility.
34 +Do not use this option for distribution packages.]])],
35 + [AC_MSG_NOTICE([[Deprecated API will be built, for backwards-compatibility.]])])
36 +AM_CONDITIONAL([DISABLE_DEPRECATED_API], [test "x$mm_enable_deprecated_api" = xno])[]dnl
37 +])
38 +
39 +m4_define([_MM_ARG_DISABLE_DEPRECATED_API_DEFINE],
40 +[m4_foreach_w([mm_prefix], [$1],
41 +[AC_DEFINE(m4_defn([mm_prefix])[_DISABLE_DEPRECATED], [1],
42 + [Define to omit deprecated API from the library.])
43 +])])
44 +
45 +AC_DEFUN([MM_ARG_DISABLE_DEPRECATED_API],
46 +[dnl
47 +AC_REQUIRE([_MM_PRE_INIT])[]dnl
48 +AC_REQUIRE([_MM_ARG_DISABLE_DEPRECATED_API_OPTION])[]dnl
49 +AS_IF([test "x$mm_enable_deprecated_api" = xno],
50 + [_MM_ARG_DISABLE_DEPRECATED_API_DEFINE(
51 + m4_ifval([$1], [[$1]], [AS_TR_CPP(m4_defn([AC_PACKAGE_TARNAME]))]))])[]dnl
52 +])
53 +
54 +
55 +#serial 20090828
56 +
57 +m4_define([_MM_CONFIG_DOCTOOL_DIR],
58 +[dnl
59 +AC_PROVIDE([$0])[]dnl
60 +AC_REQUIRE([PKG_PROG_PKG_CONFIG])[]dnl
61 +dnl
62 +AC_MSG_CHECKING([location of documentation utilities])
63 +AS_IF([test "x$MMDOCTOOLDIR" = x],
64 +[
65 + MMDOCTOOLDIR=`$PKG_CONFIG --variable=doctooldir glibmm-2.4 2>&AS_MESSAGE_LOG_FD`
66 + AS_IF([test "[$]?" -ne 0],
67 + [AC_MSG_ERROR([[not found
68 +The required module glibmm could not be found on this system. If you
69 +are running a binary distribution and the glibmm package is installed,
70 +make sure that any separate development package for glibmm is installed
71 +as well. If you built glibmm yourself, it may be necessary to adjust
72 +the PKG_CONFIG_PATH environment variable for pkg-config to find it.
73 +]])])
74 +])
75 +AC_MSG_RESULT([$MMDOCTOOLDIR])[]dnl
76 +])
77 +
78 +AC_DEFUN([MM_CONFIG_DOCTOOL_DIR],
79 +[dnl
80 +AC_REQUIRE([_MM_PRE_INIT])[]dnl
81 +AC_REQUIRE([MM_CHECK_GNU_MAKE])[]dnl
82 +m4_ifval([$1], [MMDOCTOOLDIR='[$]{top_srcdir}/$1'], [AC_REQUIRE([_MM_CONFIG_DOCTOOL_DIR])])
83 +AC_SUBST([MMDOCTOOLDIR])[]dnl
84 +])
85 +
86 +m4_define([_MM_ARG_ENABLE_DOCUMENTATION],
87 +[dnl
88 +AC_PROVIDE([$0])[]dnl
89 +dnl
90 +AC_ARG_VAR([DOT], [path to dot utility])[]dnl
91 +AC_ARG_VAR([DOXYGEN], [path to Doxygen utility])[]dnl
92 +AC_ARG_VAR([XSLTPROC], [path to xsltproc utility])[]dnl
93 +dnl
94 +AC_PATH_PROG([DOT], [dot], [dot])
95 +AC_PATH_PROG([DOXYGEN], [doxygen], [doxygen])
96 +AC_PATH_PROG([XSLTPROC], [xsltproc], [xsltproc])
97 +dnl
98 +AC_ARG_ENABLE([documentation],
99 + [AS_HELP_STRING([--disable-documentation],
100 + [do not build or install the documentation])],
101 + [ENABLE_DOCUMENTATION=$enableval],
102 + [ENABLE_DOCUMENTATION=auto])
103 +AS_IF([test "x$ENABLE_DOCUMENTATION" != xno],
104 +[
105 + mm_err=
106 + AS_IF([test "x$MMDOCTOOLDIR" = x], [mm_err='dnl
107 +The glibmm module is available, but the installation of glibmm on this
108 +machine is missing the shared documentation utilities of the GNOME C++
109 +bindings. It may be necessary to upgrade to a more recent release of
110 +glibmm in order to build '$PACKAGE_NAME' and install the documentation.'],
111 + [test "x$PERL" = xperl], [mm_err='Perl is required for installing the documentation.'],
112 + [test "x$USE_MAINTAINER_MODE" != xno],
113 + [
114 + test "x$DOT" != xdot || mm_err=' dot'
115 + test "x$DOXYGEN" != xdoxygen || mm_err="$mm_err doxygen"
116 + test "x$XSLTPROC" != xxsltproc || mm_err="$mm_err xsltproc"
117 + test -z "$mm_err" || mm_err='The documentation cannot be generated because
118 +not all of the required tools are available:'$mm_err
119 + ])
120 + AS_IF([test -z "$mm_err"], [ENABLE_DOCUMENTATION=yes],
121 + [test "x$ENABLE_DOCUMENTATION" = xyes], [AC_MSG_FAILURE([[$mm_err]])],
122 + [ENABLE_DOCUMENTATION=no; AC_MSG_WARN([[$mm_err]])])
123 +])
124 +AM_CONDITIONAL([ENABLE_DOCUMENTATION], [test "x$ENABLE_DOCUMENTATION" = xyes])
125 +AC_SUBST([DOXYGEN_TAGFILES], [[]])
126 +AC_SUBST([DOCINSTALL_FLAGS], [[]])[]dnl
127 +])
128 +
129 +AC_DEFUN([MM_ARG_ENABLE_DOCUMENTATION],
130 +[dnl
131 +AC_BEFORE([$0], [MM_ARG_WITH_TAGFILE_DOC])[]dnl
132 +AC_REQUIRE([_MM_PRE_INIT])[]dnl
133 +AC_REQUIRE([MM_CONFIG_DOCTOOL_DIR])[]dnl
134 +AC_REQUIRE([MM_PATH_PERL])[]dnl
135 +AC_REQUIRE([_MM_ARG_ENABLE_DOCUMENTATION])[]dnl
136 +])
137 +
138 +m4_define([_MM_TR_URI],
139 +[dnl
140 +[`expr "X$1" : 'X\(.*[^\\/]\)[\\/]*' 2>&]AS_MESSAGE_LOG_FD[ |]dnl
141 +[ sed 's|[\\]|/|g;s| |%20|g;s|^/|file:///|;s|^.:/|file:///&|' 2>&]AS_MESSAGE_LOG_FD[`]dnl
142 +])
143 +
144 +m4_define([_MM_ARG_WITH_TAGFILE_DOC],
145 +[dnl
146 + AC_MSG_CHECKING([for $1 documentation])
147 + AC_ARG_WITH([$1-doc],
148 + [AS_HELP_STRING([[--with-$1-doc=[TAGFILE@]HTMLREFDIR]],
149 + [Link to external $1 documentation]m4_ifval([$4], [[ [auto]]]))],
150 + [
151 + mm_htmlrefdir=`[expr "@$withval" : '.*@\(.*\)' 2>&]AS_MESSAGE_LOG_FD`
152 + mm_tagname=`[expr "/$withval" : '[^@]*[\\/]\([^\\/@]*\)@' 2>&]AS_MESSAGE_LOG_FD`
153 + mm_tagpath=`[expr "X$withval" : 'X\([^@]*\)@' 2>&]AS_MESSAGE_LOG_FD`
154 + test "x$mm_tagname" != x || mm_tagname="$3"
155 + test "x$mm_tagpath" != x || mm_tagpath=$mm_tagname[]dnl
156 + ], [
157 + mm_htmlrefdir=
158 + mm_tagname="$3"
159 + mm_tagpath=$mm_tagname[]dnl
160 + ])
161 + # Prepend working direcory if the tag file path starts with ./ or ../
162 + AS_CASE([$mm_tagpath], [[.[\\/]*|..[\\/]*]], [mm_tagpath=`pwd`/$mm_tagpath])
163 +
164 +m4_ifval([$4], [dnl
165 + # If no local directory was specified, get the default from the .pc file
166 + AS_IF([test "x$mm_htmlrefdir" = x],
167 + [
168 + mm_htmlrefdir=`$PKG_CONFIG --variable=htmlrefdir "$4" 2>&AS_MESSAGE_LOG_FD`dnl
169 + ])
170 + # If the user specified a Web URL, allow it to override the public location
171 + AS_CASE([$mm_htmlrefdir], [[http://*|https://*]], [mm_htmlrefpub=$mm_htmlrefdir],
172 + [
173 + mm_htmlrefpub=`$PKG_CONFIG --variable=htmlrefpub "$4" 2>&AS_MESSAGE_LOG_FD`
174 + test "x$mm_htmlrefpub" != x || mm_htmlrefpub=$mm_htmlrefdir
175 + test "x$mm_htmlrefdir" != x || mm_htmlrefdir=$mm_htmlrefpub
176 + ])
177 + # The user-supplied tag-file name takes precedence if it includes the path
178 + AS_CASE([$mm_tagpath], [[*[\\/]*]],,
179 + [
180 + mm_doxytagfile=`$PKG_CONFIG --variable=doxytagfile "$4" 2>&AS_MESSAGE_LOG_FD`
181 + test "x$mm_doxytagfile" = x || mm_tagpath=$mm_doxytagfile
182 + ])
183 + # Remove trailing slashes and translate to URI
184 + mm_htmlrefpub=_MM_TR_URI([$mm_htmlrefpub])
185 +])[]dnl
186 + mm_htmlrefdir=_MM_TR_URI([$mm_htmlrefdir])
187 +
188 + AC_MSG_RESULT([$mm_tagpath@$mm_htmlrefdir])
189 +
190 + AS_IF([test "x$USE_MAINTAINER_MODE" != xno && test ! -f "$mm_tagpath"],
191 + [AC_MSG_WARN([Doxygen tag file $3 not found])])
192 + AS_IF([test "x$mm_htmlrefdir" = x],
193 + [AC_MSG_WARN([Location of external $1 documentation not set])],
194 + [AS_IF([test "x$DOCINSTALL_FLAGS" = x],
195 + [DOCINSTALL_FLAGS="-l '$mm_tagname@$mm_htmlrefdir/'"],
196 + [DOCINSTALL_FLAGS="$DOCINSTALL_FLAGS -l '$mm_tagname@$mm_htmlrefdir/'"])])
197 +
198 + AS_IF([test "x$mm_$2" = x], [mm_val=$mm_tagpath], [mm_val="$mm_tagpath=$mm_$2"])
199 + AS_IF([test "x$DOXYGEN_TAGFILES" = x],
200 + [DOXYGEN_TAGFILES=[\]"$mm_val[\]"],
201 + [DOXYGEN_TAGFILES="$DOXYGEN_TAGFILES "[\]"$mm_val[\]"])[]dnl
202 +])
203 +
204 +AC_DEFUN([MM_ARG_WITH_TAGFILE_DOC],
205 +[dnl
206 +m4_assert([$# >= 1])[]dnl
207 +m4_ifval([$2], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])])[]dnl
208 +AC_REQUIRE([MM_CONFIG_DOCTOOL_DIR])[]dnl
209 +AC_REQUIRE([_MM_ARG_ENABLE_DOCUMENTATION])[]dnl
210 +dnl
211 +AS_IF([test "x$ENABLE_DOCUMENTATION" != xno],
212 + [_MM_ARG_WITH_TAGFILE_DOC(m4_quote(m4_bpatsubst([$1], [[+]*\([-+][0123456789]\|[._]\).*$])),
213 + [htmlref]m4_ifval([$2], [[pub]], [[dir]]), [$1], [$2])])[]dnl
214 +])
215 +
216 +
217 +#serial 20090822
218 +
219 +m4_define([_MM_INIT_MODULE_VERSION],
220 +[dnl
221 +m4_ifval([$3],
222 +[AC_SUBST([$2][_MAJOR_VERSION], [$3])
223 +AC_DEFINE([$2][_MAJOR_VERSION], [$3], [Major version number of $1.])
224 +])[]dnl
225 +m4_ifval([$4],
226 +[AC_SUBST([$2][_MINOR_VERSION], [$4])
227 +AC_DEFINE([$2][_MINOR_VERSION], [$4], [Minor version number of $1.])
228 +])[]dnl
229 +m4_ifval([$5],
230 +[AC_SUBST([$2][_MICRO_VERSION], [$5])
231 +AC_DEFINE([$2][_MICRO_VERSION], [$5], [Micro version number of $1.])
232 +])[]dnl
233 +])
234 +
235 +m4_define([_MM_INIT_MODULE_SUBST],
236 +[dnl
237 +AC_SUBST([$5][_MODULE_NAME], ['$1'])
238 +AC_SUBST([$5][_VERSION], ['$2'])
239 +m4_ifval([$4],
240 +[AC_SUBST([$5][_API_VERSION], ['$4'])
241 +])[]dnl
242 +_MM_INIT_MODULE_VERSION([$3], [$5], m4_bpatsubst([$2], [[^0123456789]+], [,]))[]dnl
243 +])
244 +
245 +m4_define([_MM_INIT_MODULE_BASENAME],
246 + [_MM_INIT_MODULE_SUBST([$1], [$2], [$3], [$4],
247 + m4_quote(AS_TR_CPP(m4_quote(m4_translit([$3], [+], [X])))))])
248 +
249 +AC_DEFUN([MM_INIT_MODULE],
250 +[dnl
251 +m4_assert([$# >= 1])[]dnl
252 +AC_REQUIRE([_MM_PRE_INIT])[]dnl
253 +AC_REQUIRE([MM_CHECK_GNU_MAKE])[]dnl
254 +_MM_INIT_MODULE_BASENAME([$1],
255 + m4_quote(m4_ifval([$2], [$2], m4_defn([AC_PACKAGE_VERSION]))),
256 + m4_quote(m4_bpatsubst([$1], [-[.0123456789]+$])),
257 + m4_quote(m4_bregexp([$1], [-\([.0123456789]+\)$], [\1])))[]dnl
258 +])
259 +
260 +
261 +#serial 20090822
262 +
263 +m4_define([_MM_CHECK_GNU_MAKE],
264 +[dnl
265 +AC_PROVIDE([$0])[]dnl
266 +AC_MSG_CHECKING([whether [$]{MAKE-make} supports GNU make features])
267 +cat >conftest.make <<'_MMEOF'
268 +override reverse = [$](2)[$](subst ,, )[$](1)
269 +override result := [$](word 2,[$](call reverse,success,failure))
270 +all: ; test '[$](result)' = success
271 +.PHONY: all
272 +_MMEOF
273 +AS_IF([[$]{MAKE-make} -f conftest.make >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD],
274 + [mm_gnu_make=yes], [mm_gnu_make=no])
275 +rm -f conftest.make
276 +AC_MSG_RESULT([$mm_gnu_make])
277 +AS_IF([test "x$mm_gnu_make" != xyes],
278 + [AC_MSG_FAILURE([[The GNU make program is required to build $PACKAGE_NAME.]])])[]dnl
279 +])
280 +
281 +AC_DEFUN([MM_CHECK_GNU_MAKE],
282 +[dnl
283 +AC_REQUIRE([_MM_PRE_INIT])[]dnl
284 +AC_REQUIRE([_MM_CHECK_GNU_MAKE])[]dnl
285 +])
286 +
287 +m4_define([_MM_PATH_PERL],
288 +[dnl
289 +AC_PROVIDE([$0])[]dnl
290 +AC_ARG_VAR([PERL], [path to Perl interpreter])[]dnl
291 +AC_PATH_PROG([PERL], [perl], [perl])[]dnl
292 +])
293 +
294 +AC_DEFUN([MM_PATH_PERL],
295 +[dnl
296 +AC_REQUIRE([_MM_PRE_INIT])[]dnl
297 +AC_REQUIRE([_MM_PATH_PERL])[]dnl
298 +])
299 +
300 +m4_define([_MM_CHECK_PERL],
301 +[dnl
302 +AS_IF([$PERL -e "require v$1; exit 0;" >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD],
303 + [$2], m4_ifval([$2$3], [[$3]],
304 + [[AC_MSG_FAILURE([[At least Perl ]$1[ is required to build $PACKAGE_NAME.]])]]))[]dnl
305 +])
306 +
307 +AC_DEFUN([MM_CHECK_PERL],
308 +[dnl
309 +AC_REQUIRE([_MM_PRE_INIT])[]dnl
310 +AC_REQUIRE([_MM_PATH_PERL])[]dnl
311 +_MM_CHECK_PERL(m4_ifval([$1], [[$1]], [[5.6.0]]), [$2], [$3])[]dnl
312 +])
313 +
314 +AC_DEFUN([MM_PKG_CONFIG_SUBST],
315 +[dnl
316 +m4_assert([$# >= 2])[]dnl
317 +AC_REQUIRE([_MM_PRE_INIT])[]dnl
318 +AC_REQUIRE([PKG_PROG_PKG_CONFIG])[]dnl
319 +AC_MSG_CHECKING([for $1])
320 +dnl
321 +AS_IF([test -z "[$]{$1+set}"],
322 + [$1=`$PKG_CONFIG $2 2>&AS_MESSAGE_LOG_FD`
323 + AS_IF([test "[$]?" -eq 0], [$3], [$4])])
324 +dnl
325 +AC_MSG_RESULT([[$]$1])
326 +AC_SUBST([$1])[]dnl
327 +])
328 +
329 +
330 +#serial 20090910
331 +
332 +m4_define([_MM_ARG_ENABLE_WARNINGS_OPTION],
333 +[dnl
334 +AC_PROVIDE([$0])[]dnl
335 +AC_ARG_ENABLE([warnings],
336 + [AS_HELP_STRING([[--enable-warnings[=min|max|fatal|no]]],
337 + [set compiler pedantry level [default=min]])],
338 + [mm_enable_warnings=$enableval],
339 + [mm_enable_warnings=min])[]dnl
340 +])
341 +
342 +AC_DEFUN([MM_ARG_ENABLE_WARNINGS],
343 +[dnl
344 +m4_assert([$# >= 3])[]dnl
345 +AC_REQUIRE([_MM_PRE_INIT])[]dnl
346 +AC_REQUIRE([_MM_ARG_ENABLE_WARNINGS_OPTION])[]dnl
347 +dnl
348 +AS_CASE([$ac_compile],
349 + [[*'$CXXFLAGS '*]], [mm_lang='C++' mm_cc=$CXX mm_conftest="conftest.[$]{ac_ext-cc}"],
350 + [[*'$CFLAGS '*]], [mm_lang=C mm_cc=$CC mm_conftest="conftest.[$]{ac_ext-c}"],
351 + [AC_MSG_ERROR([[current language is neither C nor C++]])])
352 +dnl
353 +AC_MSG_CHECKING([which $mm_lang compiler warning flags to use])
354 +m4_ifval([$4], [mm_deprecation_flags=
355 +])mm_tested_flags=
356 +dnl
357 +AS_CASE([$mm_enable_warnings],
358 + [no], [mm_warning_flags=],
359 + [max], [mm_warning_flags="$3"],
360 + [fatal], [mm_warning_flags="$3 -Werror"[]m4_ifval([$4], [
361 + for mm_prefix in $4
362 + do
363 + mm_deprecation_flags="$mm_deprecation_flags-D[$]{mm_prefix}_DISABLE_DEPRECATED "
364 + done])],
365 + [mm_warning_flags="$2"])
366 +dnl
367 +AS_IF([test "x$mm_warning_flags" != x],
368 +[
369 + # Keep in mind that the dummy source must be devoid of any
370 + # problems that might cause diagnostics.
371 + AC_LANG_CONFTEST([AC_LANG_SOURCE([[
372 +int main(int argc, char** argv) { return (argv != 0) ? argc : 0; }
373 +]])])
374 + for mm_flag in $mm_warning_flags
375 + do
376 + # Test whether the compiler accepts the flag. Look at standard output,
377 + # since GCC only shows a warning message if an option is not supported.
378 + mm_cc_out=`$mm_cc $mm_tested_flags $mm_flag -c "$mm_conftest" 2>&1 || echo failed`
379 + rm -f "conftest.[$]{OBJEXT-o}"
380 +
381 + AS_IF([test "x$mm_cc_out" = x],
382 + [AS_IF([test "x$mm_tested_flags" = x],
383 + [mm_tested_flags=$mm_flag],
384 + [mm_tested_flags="$mm_tested_flags $mm_flag"])],
385 +[cat <<_MMEOF >&AS_MESSAGE_LOG_FD
386 +$mm_cc: $mm_cc_out
387 +_MMEOF
388 +])
389 + done
390 + rm -f "$mm_conftest"
391 +])
392 +mm_all_flags=m4_ifval([$4], [$mm_deprecation_flags])$mm_tested_flags
393 +AC_SUBST([$1], [$mm_all_flags])
394 +dnl
395 +test "x$mm_all_flags" != x || mm_all_flags=none
396 +AC_MSG_RESULT([$mm_all_flags])[]dnl
397 +])
398 +
399 +m4_include([build/c_std.m4])
400 +m4_include([build/cxx.m4])
401 +m4_include([build/cxx_std.m4])
402 +m4_include([build/dk-feature.m4])
403 +m4_include([build/libtool.m4])
404 +m4_include([build/ltoptions.m4])
405 +m4_include([build/ltsugar.m4])
406 +m4_include([build/ltversion.m4])
407 +m4_include([build/lt~obsolete.m4])
408 +m4_include([build/macros.m4])
409 +m4_include([build/reduced.m4])
410 +m4_include([build/sun.m4])