d6d5f7efe83a21454d4f08ea1ca39d790d0d2b56
[openwrt/svn-archive/archive.git] / Xorg / xorg / lib / libXau / patches / 001-missing-macros.patch
1 --- /dev/null
2 +++ b/xorg.m4
3 @@ -0,0 +1,537 @@
4 +dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
5 +dnl
6 +dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
7 +dnl
8 +dnl Permission is hereby granted, free of charge, to any person obtaining a
9 +dnl copy of this software and associated documentation files (the
10 +dnl "Software"), to deal in the Software without restriction, including
11 +dnl without limitation the rights to use, copy, modify, merge, publish,
12 +dnl distribute, and/or sell copies of the Software, and to permit persons
13 +dnl to whom the Software is furnished to do so, provided that the above
14 +dnl copyright notice(s) and this permission notice appear in all copies of
15 +dnl the Software and that both the above copyright notice(s) and this
16 +dnl permission notice appear in supporting documentation.
17 +dnl
18 +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
21 +dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
22 +dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
23 +dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
24 +dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
25 +dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
26 +dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
27 +dnl
28 +dnl Except as contained in this notice, the name of a copyright holder
29 +dnl shall not be used in advertising or otherwise to promote the sale, use
30 +dnl or other dealings in this Software without prior written authorization
31 +dnl of the copyright holder.
32 +
33 +# XORG_MACROS_VERSION(required-version)
34 +# -------------------------------------
35 +# Minimum version: 1.1.0
36 +#
37 +# If you're using a macro added in Version 1.1 or newer, include this in
38 +# your configure.ac with the minimum required version, such as:
39 +# XORG_MACROS_VERSION(1.1)
40 +#
41 +# To ensure that this macro is defined, also add:
42 +# m4_ifndef([XORG_MACROS_VERSION],
43 +# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
44 +#
45 +#
46 +# See the "minimum version" comment for each macro you use to see what
47 +# version you require.
48 +m4_defun([XORG_MACROS_VERSION],[
49 +m4_define([vers_have], [1.2.2])
50 +m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
51 +m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
52 +m4_if(m4_cmp(maj_have, maj_needed), 0,,
53 + [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
54 +m4_if(m4_version_compare(vers_have, [$1]), -1,
55 + [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
56 +m4_undefine([vers_have])
57 +m4_undefine([maj_have])
58 +m4_undefine([maj_needed])
59 +]) # XORG_MACROS_VERSION
60 +
61 +# XORG_PROG_RAWCPP()
62 +# ------------------
63 +# Minimum version: 1.0.0
64 +#
65 +# Find cpp program and necessary flags for use in pre-processing text files
66 +# such as man pages and config files
67 +AC_DEFUN([XORG_PROG_RAWCPP],[
68 +AC_REQUIRE([AC_PROG_CPP])
69 +AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
70 + [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
71 +
72 +# Check for flag to avoid builtin definitions - assumes unix is predefined,
73 +# which is not the best choice for supporting other OS'es, but covers most
74 +# of the ones we need for now.
75 +AC_MSG_CHECKING([if $RAWCPP requires -undef])
76 +AC_LANG_CONFTEST([Does cpp redefine unix ?])
77 +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
78 + AC_MSG_RESULT([no])
79 +else
80 + if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
81 + RAWCPPFLAGS=-undef
82 + AC_MSG_RESULT([yes])
83 + # under Cygwin unix is still defined even with -undef
84 + elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
85 + RAWCPPFLAGS="-undef -ansi"
86 + AC_MSG_RESULT([yes, with -ansi])
87 + else
88 + AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
89 + fi
90 +fi
91 +rm -f conftest.$ac_ext
92 +
93 +AC_MSG_CHECKING([if $RAWCPP requires -traditional])
94 +AC_LANG_CONFTEST([Does cpp preserve "whitespace"?])
95 +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
96 + AC_MSG_RESULT([no])
97 +else
98 + if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
99 + RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
100 + AC_MSG_RESULT([yes])
101 + else
102 + AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
103 + fi
104 +fi
105 +rm -f conftest.$ac_ext
106 +AC_SUBST(RAWCPPFLAGS)
107 +]) # XORG_PROG_RAWCPP
108 +
109 +# XORG_MANPAGE_SECTIONS()
110 +# -----------------------
111 +# Minimum version: 1.0.0
112 +#
113 +# Determine which sections man pages go in for the different man page types
114 +# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
115 +# Not sure if there's any better way than just hardcoding by OS name.
116 +# Override default settings by setting environment variables
117 +
118 +AC_DEFUN([XORG_MANPAGE_SECTIONS],[
119 +AC_REQUIRE([AC_CANONICAL_HOST])
120 +
121 +if test x$APP_MAN_SUFFIX = x ; then
122 + APP_MAN_SUFFIX=1
123 +fi
124 +if test x$APP_MAN_DIR = x ; then
125 + APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
126 +fi
127 +
128 +if test x$LIB_MAN_SUFFIX = x ; then
129 + LIB_MAN_SUFFIX=3
130 +fi
131 +if test x$LIB_MAN_DIR = x ; then
132 + LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
133 +fi
134 +
135 +if test x$FILE_MAN_SUFFIX = x ; then
136 + case $host_os in
137 + solaris*) FILE_MAN_SUFFIX=4 ;;
138 + *) FILE_MAN_SUFFIX=5 ;;
139 + esac
140 +fi
141 +if test x$FILE_MAN_DIR = x ; then
142 + FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
143 +fi
144 +
145 +if test x$MISC_MAN_SUFFIX = x ; then
146 + case $host_os in
147 + solaris*) MISC_MAN_SUFFIX=5 ;;
148 + *) MISC_MAN_SUFFIX=7 ;;
149 + esac
150 +fi
151 +if test x$MISC_MAN_DIR = x ; then
152 + MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
153 +fi
154 +
155 +if test x$DRIVER_MAN_SUFFIX = x ; then
156 + case $host_os in
157 + solaris*) DRIVER_MAN_SUFFIX=7 ;;
158 + *) DRIVER_MAN_SUFFIX=4 ;;
159 + esac
160 +fi
161 +if test x$DRIVER_MAN_DIR = x ; then
162 + DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
163 +fi
164 +
165 +if test x$ADMIN_MAN_SUFFIX = x ; then
166 + case $host_os in
167 + solaris*) ADMIN_MAN_SUFFIX=1m ;;
168 + *) ADMIN_MAN_SUFFIX=8 ;;
169 + esac
170 +fi
171 +if test x$ADMIN_MAN_DIR = x ; then
172 + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
173 +fi
174 +
175 +
176 +AC_SUBST([APP_MAN_SUFFIX])
177 +AC_SUBST([LIB_MAN_SUFFIX])
178 +AC_SUBST([FILE_MAN_SUFFIX])
179 +AC_SUBST([MISC_MAN_SUFFIX])
180 +AC_SUBST([DRIVER_MAN_SUFFIX])
181 +AC_SUBST([ADMIN_MAN_SUFFIX])
182 +AC_SUBST([APP_MAN_DIR])
183 +AC_SUBST([LIB_MAN_DIR])
184 +AC_SUBST([FILE_MAN_DIR])
185 +AC_SUBST([MISC_MAN_DIR])
186 +AC_SUBST([DRIVER_MAN_DIR])
187 +AC_SUBST([ADMIN_MAN_DIR])
188 +]) # XORG_MANPAGE_SECTIONS
189 +
190 +# XORG_CHECK_LINUXDOC
191 +# -------------------
192 +# Minimum version: 1.0.0
193 +#
194 +# Defines the variable MAKE_TEXT if the necessary tools and
195 +# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
196 +# Whether or not the necessary tools and files are found can be checked
197 +# with the AM_CONDITIONAL "BUILD_LINUXDOC"
198 +AC_DEFUN([XORG_CHECK_LINUXDOC],[
199 +if test x$XORG_SGML_PATH = x ; then
200 + XORG_SGML_PATH=$prefix/share/sgml
201 +fi
202 +HAVE_DEFS_ENT=
203 +
204 +if test x"$cross_compiling" = x"yes" ; then
205 + HAVE_DEFS_ENT=no
206 +else
207 + AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
208 +fi
209 +
210 +AC_PATH_PROG(LINUXDOC, linuxdoc)
211 +AC_PATH_PROG(PS2PDF, ps2pdf)
212 +
213 +AC_MSG_CHECKING([Whether to build documentation])
214 +
215 +if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
216 + BUILDDOC=yes
217 +else
218 + BUILDDOC=no
219 +fi
220 +
221 +AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
222 +
223 +AC_MSG_RESULT([$BUILDDOC])
224 +
225 +AC_MSG_CHECKING([Whether to build pdf documentation])
226 +
227 +if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
228 + BUILDPDFDOC=yes
229 +else
230 + BUILDPDFDOC=no
231 +fi
232 +
233 +AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
234 +
235 +AC_MSG_RESULT([$BUILDPDFDOC])
236 +
237 +MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
238 +MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
239 +MAKE_PDF="$PS2PDF"
240 +MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
241 +
242 +AC_SUBST(MAKE_TEXT)
243 +AC_SUBST(MAKE_PS)
244 +AC_SUBST(MAKE_PDF)
245 +AC_SUBST(MAKE_HTML)
246 +]) # XORG_CHECK_LINUXDOC
247 +
248 +# XORG_CHECK_DOCBOOK
249 +# -------------------
250 +# Minimum version: 1.0.0
251 +#
252 +# Checks for the ability to build output formats from SGML DocBook source.
253 +# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
254 +# indicates whether the necessary tools and files are found and, if set,
255 +# $(MAKE_XXX) blah.sgml will produce blah.xxx.
256 +AC_DEFUN([XORG_CHECK_DOCBOOK],[
257 +if test x$XORG_SGML_PATH = x ; then
258 + XORG_SGML_PATH=$prefix/share/sgml
259 +fi
260 +HAVE_DEFS_ENT=
261 +BUILDTXTDOC=no
262 +BUILDPDFDOC=no
263 +BUILDPSDOC=no
264 +BUILDHTMLDOC=no
265 +
266 +AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
267 +
268 +AC_PATH_PROG(DOCBOOKPS, docbook2ps)
269 +AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
270 +AC_PATH_PROG(DOCBOOKHTML, docbook2html)
271 +AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
272 +
273 +AC_MSG_CHECKING([Whether to build text documentation])
274 +if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
275 + test x$BUILD_TXTDOC != xno; then
276 + BUILDTXTDOC=yes
277 +fi
278 +AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
279 +AC_MSG_RESULT([$BUILDTXTDOC])
280 +
281 +AC_MSG_CHECKING([Whether to build PDF documentation])
282 +if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
283 + test x$BUILD_PDFDOC != xno; then
284 + BUILDPDFDOC=yes
285 +fi
286 +AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
287 +AC_MSG_RESULT([$BUILDPDFDOC])
288 +
289 +AC_MSG_CHECKING([Whether to build PostScript documentation])
290 +if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
291 + test x$BUILD_PSDOC != xno; then
292 + BUILDPSDOC=yes
293 +fi
294 +AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
295 +AC_MSG_RESULT([$BUILDPSDOC])
296 +
297 +AC_MSG_CHECKING([Whether to build HTML documentation])
298 +if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
299 + test x$BUILD_HTMLDOC != xno; then
300 + BUILDHTMLDOC=yes
301 +fi
302 +AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
303 +AC_MSG_RESULT([$BUILDHTMLDOC])
304 +
305 +MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
306 +MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
307 +MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
308 +MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
309 +
310 +AC_SUBST(MAKE_TEXT)
311 +AC_SUBST(MAKE_PS)
312 +AC_SUBST(MAKE_PDF)
313 +AC_SUBST(MAKE_HTML)
314 +]) # XORG_CHECK_DOCBOOK
315 +
316 +# XORG_CHECK_MALLOC_ZERO
317 +# ----------------------
318 +# Minimum version: 1.0.0
319 +#
320 +# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
321 +# malloc(0) returns NULL. Packages should add one of these cflags to
322 +# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
323 +AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
324 +AC_ARG_ENABLE(malloc0returnsnull,
325 + AC_HELP_STRING([--enable-malloc0returnsnull],
326 + [malloc(0) returns NULL (default: auto)]),
327 + [MALLOC_ZERO_RETURNS_NULL=$enableval],
328 + [MALLOC_ZERO_RETURNS_NULL=auto])
329 +
330 +AC_MSG_CHECKING([whether malloc(0) returns NULL])
331 +if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
332 + AC_RUN_IFELSE([
333 +char *malloc();
334 +char *realloc();
335 +char *calloc();
336 +main() {
337 + char *m0, *r0, *c0, *p;
338 + m0 = malloc(0);
339 + p = malloc(10);
340 + r0 = realloc(p,0);
341 + c0 = calloc(0);
342 + exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
343 +}],
344 + [MALLOC_ZERO_RETURNS_NULL=yes],
345 + [MALLOC_ZERO_RETURNS_NULL=no])
346 +fi
347 +AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
348 +
349 +if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
350 + MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
351 + XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
352 + XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
353 +else
354 + MALLOC_ZERO_CFLAGS=""
355 + XMALLOC_ZERO_CFLAGS=""
356 + XTMALLOC_ZERO_CFLAGS=""
357 +fi
358 +
359 +AC_SUBST([MALLOC_ZERO_CFLAGS])
360 +AC_SUBST([XMALLOC_ZERO_CFLAGS])
361 +AC_SUBST([XTMALLOC_ZERO_CFLAGS])
362 +]) # XORG_CHECK_MALLOC_ZERO
363 +
364 +# XORG_WITH_LINT()
365 +# ----------------
366 +# Minimum version: 1.1.0
367 +#
368 +# Sets up flags for source checkers such as lint and sparse if --with-lint
369 +# is specified. (Use --with-lint=sparse for sparse.)
370 +# Sets $LINT to name of source checker passed with --with-lint (default: lint)
371 +# Sets $LINT_FLAGS to flags to pass to source checker
372 +# Sets LINT automake conditional if enabled (default: disabled)
373 +#
374 +AC_DEFUN([XORG_WITH_LINT],[
375 +
376 +# Allow checking code with lint, sparse, etc.
377 +AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
378 + [Use a lint-style source code checker (default: disabled)])],
379 + [use_lint=$withval], [use_lint=no])
380 +if test "x$use_lint" = "xyes" ; then
381 + LINT="lint"
382 +else
383 + LINT="$use_lint"
384 +fi
385 +if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
386 + case $LINT in
387 + lint|*/lint)
388 + case $host_os in
389 + solaris*)
390 + LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
391 + ;;
392 + esac
393 + ;;
394 + esac
395 +fi
396 +
397 +AC_SUBST(LINT)
398 +AC_SUBST(LINT_FLAGS)
399 +AM_CONDITIONAL(LINT, [test x$LINT != xno])
400 +
401 +]) # XORG_WITH_LINT
402 +
403 +# XORG_LINT_LIBRARY(LIBNAME)
404 +# --------------------------
405 +# Minimum version: 1.1.0
406 +#
407 +# Sets up flags for building lint libraries for checking programs that call
408 +# functions in the library.
409 +# Disabled by default, enable with --enable-lint-library
410 +# Sets:
411 +# @LINTLIB@ - name of lint library file to make
412 +# MAKE_LINT_LIB - automake conditional
413 +#
414 +
415 +AC_DEFUN([XORG_LINT_LIBRARY],[
416 +AC_REQUIRE([XORG_WITH_LINT])
417 +# Build lint "library" for more indepth checks of programs calling this library
418 +AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
419 + [Create lint library (default: disabled)])],
420 + [make_lint_lib=$enableval], [make_lint_lib=no])
421 +if test "x$make_lint_lib" != "xno" ; then
422 + if test "x$LINT" = "xno" ; then
423 + AC_MSG_ERROR([Cannot make lint library without --with-lint])
424 + fi
425 + if test "x$make_lint_lib" = "xyes" ; then
426 + LINTLIB=llib-l$1.ln
427 + else
428 + LINTLIB=$make_lint_lib
429 + fi
430 +fi
431 +AC_SUBST(LINTLIB)
432 +AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
433 +
434 +]) # XORG_LINT_LIBRARY
435 +
436 +# XORG_CWARNFLAGS
437 +# ---------------
438 +# Minimum version: 1.2.0
439 +#
440 +# Defines CWARNFLAGS to enable C compiler warnings.
441 +#
442 +AC_DEFUN([XORG_CWARNFLAGS], [
443 +AC_REQUIRE([AC_PROG_CC])
444 +if test "x$GCC" = xyes ; then
445 + CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
446 +-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
447 +-Wbad-function-cast"
448 + case `$CC -dumpversion` in
449 + 3.4.* | 4.*)
450 + CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
451 + ;;
452 + esac
453 +else
454 + AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
455 + if test "x$SUNCC" = "xyes"; then
456 + CWARNFLAGS="-v"
457 + fi
458 +fi
459 +AC_SUBST(CWARNFLAGS)
460 +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
461 +]) # XORG_CWARNFLAGS
462 +dnl Copyright 2005 Red Hat, Inc
463 +dnl
464 +dnl Permission to use, copy, modify, distribute, and sell this software and its
465 +dnl documentation for any purpose is hereby granted without fee, provided that
466 +dnl the above copyright notice appear in all copies and that both that
467 +dnl copyright notice and this permission notice appear in supporting
468 +dnl documentation.
469 +dnl
470 +dnl The above copyright notice and this permission notice shall be included
471 +dnl in all copies or substantial portions of the Software.
472 +dnl
473 +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
474 +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
475 +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
476 +dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
477 +dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
478 +dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
479 +dnl OTHER DEALINGS IN THE SOFTWARE.
480 +dnl
481 +dnl Except as contained in this notice, the name of the copyright holders shall
482 +dnl not be used in advertising or otherwise to promote the sale, use or
483 +dnl other dealings in this Software without prior written authorization
484 +dnl from the copyright holders.
485 +dnl
486 +
487 +# XORG_RELEASE_VERSION
488 +# --------------------
489 +# Adds --with/without-release-string and changes the PACKAGE and
490 +# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If
491 +# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also
492 +# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
493 +
494 +AC_DEFUN([XORG_RELEASE_VERSION],[
495 + AC_ARG_WITH(release-version,
496 + AC_HELP_STRING([--with-release-version=STRING],
497 + [Use release version string in package name]),
498 + [RELEASE_VERSION="$withval"],
499 + [RELEASE_VERSION=""])
500 + if test "x$RELEASE_VERSION" != "x"; then
501 + PACKAGE="$PACKAGE-$RELEASE_VERSION"
502 + PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
503 + AC_MSG_NOTICE([Building with package name set to $PACKAGE])
504 + fi
505 + AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
506 + [`echo $PACKAGE_VERSION | cut -d . -f 1`],
507 + [Major version of this package])
508 + PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
509 + if test "x$PVM" = "x"; then
510 + PVM="0"
511 + fi
512 + AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
513 + [$PVM],
514 + [Minor version of this package])
515 + PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
516 + if test "x$PVP" = "x"; then
517 + PVP="0"
518 + fi
519 + AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
520 + [$PVP],
521 + [Patch version of this package])
522 +])
523 +
524 +# XORG_CHANGELOG()
525 +# ----------------
526 +# Minimum version: 1.2.0
527 +#
528 +# Defines the variable CHANGELOG_CMD as the command to generate
529 +# ChangeLog from git.
530 +#
531 +# Arrange that distcleancheck ignores ChangeLog left over by distclean.
532 +#
533 +AC_DEFUN([XORG_CHANGELOG], [
534 +CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
535 +mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
536 +echo 'git directory not found: installing possibly empty changelog.' >&2)"
537 +AC_SUBST([CHANGELOG_CMD])
538 +AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
539 +]) # XORG_CHANGELOG
540 +