Update to util-macros 1.13.0.

This commit is contained in:
matthieu 2011-03-20 17:09:44 +00:00
parent 4d8053ee26
commit e152f4eb11
4 changed files with 399 additions and 23 deletions

View File

@ -1,3 +1,130 @@
commit 5bb0cddcc5359d764015299021718f42b0a4055c
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Mon Mar 14 20:12:36 2011 -0400
Version bump: 1.13.0
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 700ecdc16426c14e649439138e8e40cdc41fe1c1
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Mar 9 18:53:43 2011 -0500
XORG_LD_WRAP: check if linker supports -wrap
Used mainly by test cases using a wrapper function.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 380074140f7b1e3f8ea006a4b1d928d23706b81d
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Mar 9 10:53:49 2011 -0500
XORG_WITH_GLIB: check for the GLib package
XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
----------------------------------------
Minimum version: 1.13.0
GLib is a library which provides advanced data structures and functions.
This macro enables a module to test for the presence of Glib.
When used in conjunction with XORG_ENABLE_UNIT_TESTS, use both AM_CONDITIONAL
ENABLE_UNIT_TESTS and HAVE_GLIB.
Glib may be used for purpose other than testing
Package builders should use --without-glib to ensure it does not get pulled in.
Unit tests may or may not use GLib.
Developers should use --with-glib to error out if GLib is missing.
Interface to module:
HAVE_GLIB: used in makefiles to conditionally build targets
with_glib: used in configure.ac to know if GLib has been found
--with-glib: 'yes' user instructs the module to use glib
'no' user instructs the module not to use glib
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 78af2b882e01b17e38d1361a4a58b7768bb59bec
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Mar 9 07:10:18 2011 -0500
XORG_ENABLE_UNIT_TESTS: add support for unit testing
This macro enables a builder to enable/disable unit testing
It makes no assumption about the test cases implementation
Test cases may or may not use Automake "Support for test suites"
They may or may not use the software utility library GLib
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 1218d7e6ed064e0c534a01caf013cff666cb44bf
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Fri Feb 25 16:58:10 2011 -0500
Version bump: 1.12.0
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit b22ce580bcc8343b880f19cc7f1c6bea176c8f13
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Sat Jan 29 16:17:09 2011 -0500
XORG_WITH_XSLTPROC: add XSLT processor command line tool
The primary use will be for DocBook/XML cross links database generation.
XSLT (Extensible Stylesheet Language Transformations) is a declarative,
XML-based language used for the transformation of XML documents.
The xsltproc command line tool is for applying XSLT stylesheets
to XML documents.
It is used under the cover by xmlto to generate html files from DocBook/XML.
The XSLT processor is often used as a standalone tool for transformations.
It should not be assumed that it is used only to work with documnetation.
Tested-by: Matt Dew <marcoz@osource.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 7370b0b3f0308aec2a32012eddb2f0761d5fe399
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Dec 5 01:25:11 2010 -0800
Use AC_LANG_PROGRAM in XORG_CHECK_MALLOC_ZERO to clear autoconf-2.68 warnings
configure.ac:126: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2730: _AC_RUN_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from...
../../lib/autoconf/general.m4:2749: AC_RUN_IFELSE is expanded from...
aclocal.m4:1952: XORG_CHECK_MALLOC_ZERO is expanded from...
configure.ac:126: the top level
Also, calloc() takes two arguments; and all of them return void *,
not char *; as the compiler points out when you #include <stdlib.h>
instead of faking it badly. (And sometimes when you don't, due to
compiler builtin versions of the functions.)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
commit 04030cbca37c04c48161debc0cade6db00cb347b
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Sat Nov 6 20:50:06 2010 -0400
XORG_ENABLE_DOCS: Fix "Enable building the documentation (yes: yes)"
The quoting did not prevent the m4 defined variable "default"
to replace the text string "default" in the help text.
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit ce32345589050b17b23b18157f95f060f4c776a3 commit ce32345589050b17b23b18157f95f060f4c776a3
Author: Alan Coopersmith <alan.coopersmith@oracle.com> Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Oct 29 20:43:53 2010 -0700 Date: Fri Oct 29 20:43:53 2010 -0700

20
util/macros/configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.62 for util-macros 1.11.0. # Generated by GNU Autoconf 2.62 for util-macros 1.13.0.
# #
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
# #
@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package. # Identity of this package.
PACKAGE_NAME='util-macros' PACKAGE_NAME='util-macros'
PACKAGE_TARNAME='util-macros' PACKAGE_TARNAME='util-macros'
PACKAGE_VERSION='1.11.0' PACKAGE_VERSION='1.13.0'
PACKAGE_STRING='util-macros 1.11.0' PACKAGE_STRING='util-macros 1.13.0'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
ac_unique_file="Makefile.am" ac_unique_file="Makefile.am"
@ -1225,7 +1225,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures util-macros 1.11.0 to adapt to many kinds of systems. \`configure' configures util-macros 1.13.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1291,7 +1291,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of util-macros 1.11.0:";; short | recursive ) echo "Configuration of util-macros 1.13.0:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1365,7 +1365,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
util-macros configure 1.11.0 util-macros configure 1.13.0
generated by GNU Autoconf 2.62 generated by GNU Autoconf 2.62
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@ -1379,7 +1379,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by util-macros $as_me 1.11.0, which was It was created by util-macros $as_me 1.13.0, which was
generated by GNU Autoconf 2.62. Invocation command line was generated by GNU Autoconf 2.62. Invocation command line was
$ $0 $@ $ $0 $@
@ -2029,7 +2029,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='util-macros' PACKAGE='util-macros'
VERSION='1.11.0' VERSION='1.13.0'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -2812,7 +2812,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by util-macros $as_me 1.11.0, which was This file was extended by util-macros $as_me 1.13.0, which was
generated by GNU Autoconf 2.62. Invocation command line was generated by GNU Autoconf 2.62. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -2855,7 +2855,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\ ac_cs_version="\\
util-macros config.status 1.11.0 util-macros config.status 1.13.0
configured by $0, generated by GNU Autoconf 2.62, configured by $0, generated by GNU Autoconf 2.62,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"

View File

@ -23,7 +23,7 @@ dnl Process this file with autoconf to create configure.
AC_PREREQ([2.60]) AC_PREREQ([2.60])
AC_INIT([util-macros], AC_INIT([util-macros],
[1.11.0], [1.13.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[util-macros]) [util-macros])
AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_SRCDIR([Makefile.am])

View File

@ -432,6 +432,69 @@ AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
]) # XORG_WITH_XMLTO ]) # XORG_WITH_XMLTO
# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
# --------------------------------------------
# Minimum version: 1.12.0
# Minimum version for optional DEFAULT argument: 1.12.0
#
# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
# XML-based language used for the transformation of XML documents.
# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
# It is used under the cover by xmlto to generate html files from DocBook/XML.
# The XSLT processor is often used as a standalone tool for transformations.
# It should not be assumed that this tool is used only to work with documnetation.
# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
#
# Interface to module:
# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
# XSLTPROC: returns the path of the xsltproc program found
# returns the path set by the user in the environment
# --with-xsltproc: 'yes' user instructs the module to use xsltproc
# 'no' user instructs the module not to use xsltproc
# have_xsltproc: returns yes if xsltproc found in PATH or no
#
# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
#
AC_DEFUN([XORG_WITH_XSLTPROC],[
AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
m4_define([_defopt], m4_default([$2], [auto]))
AC_ARG_WITH(xsltproc,
AS_HELP_STRING([--with-xsltproc],
[Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
[use_xsltproc=$withval], [use_xsltproc=]_defopt)
m4_undefine([_defopt])
if test "x$use_xsltproc" = x"auto"; then
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test "x$XSLTPROC" = "x"; then
AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
have_xsltproc=no
else
have_xsltproc=yes
fi
elif test "x$use_xsltproc" = x"yes" ; then
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test "x$XSLTPROC" = "x"; then
AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
fi
have_xsltproc=yes
elif test "x$use_xsltproc" = x"no" ; then
if test "x$XSLTPROC" != "x"; then
AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
fi
have_xsltproc=no
else
AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
fi
# Checking for minimum version is not implemented
# but we want to keep the interface consistent with other commands
m4_ifval([$1],[AC_MSG_WARN(Checking for MIN-VERSION is not implemented.)])
AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
]) # XORG_WITH_XSLTPROC
# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
# ---------------- # ----------------
# Minimum version: 1.5.0 # Minimum version: 1.5.0
@ -811,12 +874,12 @@ AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
# parm1: specify the default value, yes or no. # parm1: specify the default value, yes or no.
# #
AC_DEFUN([XORG_ENABLE_DOCS],[ AC_DEFUN([XORG_ENABLE_DOCS],[
m4_define([default], m4_default([$1], [yes])) m4_define([docs_default], m4_default([$1], [yes]))
AC_ARG_ENABLE(docs, AC_ARG_ENABLE(docs,
AS_HELP_STRING([--enable-docs], AS_HELP_STRING([--enable-docs],
[Enable building the documentation (default: ]default[)]), [Enable building the documentation (default: ]docs_default[)]),
[build_docs=$enableval], [build_docs=]default) [build_docs=$enableval], [build_docs=]docs_default)
m4_undefine([default]) m4_undefine([docs_default])
AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
AC_MSG_CHECKING([whether to build documentation]) AC_MSG_CHECKING([whether to build documentation])
AC_MSG_RESULT([$build_docs]) AC_MSG_RESULT([$build_docs])
@ -888,6 +951,194 @@ AC_MSG_CHECKING([whether to build functional specifications])
AC_MSG_RESULT([$build_specs]) AC_MSG_RESULT([$build_specs])
]) # XORG_ENABLE_SPECS ]) # XORG_ENABLE_SPECS
# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
# ----------------------------------------------
# Minimum version: 1.13.0
#
# This macro enables a builder to enable/disable unit testing
# It makes no assumption about the test cases implementation
# Test cases may or may not use Automake "Support for test suites"
# They may or may not use the software utility library GLib
#
# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
# The variable enable_unit_tests is used by other macros in this file.
#
# Interface to module:
# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
# enable_unit_tests: used in configure.ac for additional configuration
# --enable-unit-tests: 'yes' user instructs the module to build tests
# 'no' user instructs the module not to build tests
# parm1: specify the default value, yes or no.
#
AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
AC_BEFORE([$0], [XORG_WITH_GLIB])
AC_BEFORE([$0], [XORG_LD_WRAP])
m4_define([_defopt], m4_default([$1], [auto]))
AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
[Enable building unit test cases (default: ]_defopt[)]),
[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
m4_undefine([_defopt])
AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
AC_MSG_CHECKING([whether to build unit test cases])
AC_MSG_RESULT([$enable_unit_tests])
]) # XORG_ENABLE_UNIT_TESTS
# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
# ----------------------------------------
# Minimum version: 1.13.0
#
# GLib is a library which provides advanced data structures and functions.
# This macro enables a module to test for the presence of Glib.
#
# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
# Otherwise the value of $enable_unit_tests is blank.
#
# Interface to module:
# HAVE_GLIB: used in makefiles to conditionally build targets
# with_glib: used in configure.ac to know if GLib has been found
# --with-glib: 'yes' user instructs the module to use glib
# 'no' user instructs the module not to use glib
#
AC_DEFUN([XORG_WITH_GLIB],[
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
m4_define([_defopt], m4_default([$2], [auto]))
AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
[Use GLib library for unit testing (default: ]_defopt[)]),
[with_glib=$withval], [with_glib=]_defopt)
m4_undefine([_defopt])
have_glib=no
# Do not probe GLib if user explicitly disabled unit testing
if test "x$enable_unit_tests" != x"no"; then
# Do not probe GLib if user explicitly disabled it
if test "x$with_glib" != x"no"; then
m4_ifval(
[$1],
[PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
[PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
)
fi
fi
# Not having GLib when unit testing has been explicitly requested is an error
if test "x$enable_unit_tests" = x"yes"; then
if test "x$have_glib" = x"no"; then
AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
fi
fi
# Having unit testing disabled when GLib has been explicitly requested is an error
if test "x$enable_unit_tests" = x"no"; then
if test "x$with_glib" = x"yes"; then
AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
fi
fi
# Not having GLib when it has been explicitly requested is an error
if test "x$with_glib" = x"yes"; then
if test "x$have_glib" = x"no"; then
AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
fi
fi
AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
]) # XORG_WITH_GLIB
# XORG_LD_WRAP
# ------------
# Minimum version: 1.13.0
#
# Check if linker supports -wrap, passed via compiler flags
#
# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
# Otherwise the value of $enable_unit_tests is blank.
#
AC_DEFUN([XORG_LD_WRAP],[
XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no])
# Not having ld wrap when unit testing has been explicitly requested is an error
if test "x$enable_unit_tests" = x"yes"; then
if test "x$have_ld_wrap" = x"no"; then
AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
fi
fi
AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
#
]) # XORG_LD_WRAP
# XORG_CHECK_LINKER_FLAGS
# -----------------------
# SYNOPSIS
#
# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
#
# DESCRIPTION
#
# Check whether the given linker FLAGS work with the current language's
# linker, or whether they give an error.
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# NOTE: Based on AX_CHECK_COMPILER_FLAGS.
#
# LICENSE
#
# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2009 Matteo Frigo
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.#
AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
[AC_MSG_CHECKING([whether the linker accepts $1])
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
AS_LITERAL_IF([$1],
[AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
ax_save_FLAGS=$LDFLAGS
LDFLAGS="$1"
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
LDFLAGS=$ax_save_FLAGS])],
[ax_save_FLAGS=$LDFLAGS
LDFLAGS="$1"
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
LDFLAGS=$ax_save_FLAGS])
eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
AC_MSG_RESULT($xorg_check_linker_flags)
if test "x$xorg_check_linker_flags" = xyes; then
m4_default([$2], :)
else
m4_default([$3], :)
fi
]) # XORG_CHECK_LINKER_FLAGS
# XORG_CHECK_MALLOC_ZERO # XORG_CHECK_MALLOC_ZERO
# ---------------------- # ----------------------
# Minimum version: 1.0.0 # Minimum version: 1.0.0
@ -904,18 +1155,16 @@ AC_ARG_ENABLE(malloc0returnsnull,
AC_MSG_CHECKING([whether malloc(0) returns NULL]) AC_MSG_CHECKING([whether malloc(0) returns NULL])
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
AC_RUN_IFELSE([ AC_RUN_IFELSE([AC_LANG_PROGRAM([
char *malloc(); #include <stdlib.h>
char *realloc(); ],[
char *calloc();
main() {
char *m0, *r0, *c0, *p; char *m0, *r0, *c0, *p;
m0 = malloc(0); m0 = malloc(0);
p = malloc(10); p = malloc(10);
r0 = realloc(p,0); r0 = realloc(p,0);
c0 = calloc(0); c0 = calloc(0,10);
exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
}], ])],
[MALLOC_ZERO_RETURNS_NULL=yes], [MALLOC_ZERO_RETURNS_NULL=yes],
[MALLOC_ZERO_RETURNS_NULL=no], [MALLOC_ZERO_RETURNS_NULL=no],
[MALLOC_ZERO_RETURNS_NULL=yes]) [MALLOC_ZERO_RETURNS_NULL=yes])