~ubuntu-branches/ubuntu/precise/xorg-server/precise-updates

« back to all changes in this revision

Viewing changes to aclocal.m4

Tags: 2:1.10.1-2
* Build xserver-xorg-core-udeb on hurd-i386.  Thanks, Samuel Thibault!
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1039
1039
]) # _AM_PROG_TAR
1040
1040
 
1041
1041
m4_include([m4/ac_define_dir.m4])
1042
 
m4_include([m4/dolt.m4])
 
1042
m4_include([m4/ax_tls.m4])
1043
1043
dnl fontutil.m4.  Generated from fontutil.m4.in by configure.
1044
1044
dnl
1045
1045
dnl This file comes from X.Org's font-util 1.2.0
10027
10027
# See the "minimum version" comment for each macro you use to see what 
10028
10028
# version you require.
10029
10029
m4_defun([XORG_MACROS_VERSION],[
10030
 
m4_define([vers_have], [1.12.0])
 
10030
m4_define([vers_have], [1.13.0])
10031
10031
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10032
10032
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10033
10033
m4_if(m4_cmp(maj_have, maj_needed), 0,,
10941
10941
AC_MSG_RESULT([$build_specs])
10942
10942
]) # XORG_ENABLE_SPECS
10943
10943
 
 
10944
# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
 
10945
# ----------------------------------------------
 
10946
# Minimum version: 1.13.0
 
10947
#
 
10948
# This macro enables a builder to enable/disable unit testing
 
10949
# It makes no assumption about the test cases implementation
 
10950
# Test cases may or may not use Automake "Support for test suites"
 
10951
# They may or may not use the software utility library GLib
 
10952
#
 
10953
# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
 
10954
# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
 
10955
# The variable enable_unit_tests is used by other macros in this file.
 
10956
#
 
10957
# Interface to module:
 
10958
# ENABLE_UNIT_TESTS:    used in makefiles to conditionally build tests
 
10959
# enable_unit_tests:    used in configure.ac for additional configuration
 
10960
# --enable-unit-tests:  'yes' user instructs the module to build tests
 
10961
#                       'no' user instructs the module not to build tests
 
10962
# parm1:                specify the default value, yes or no.
 
10963
#
 
10964
AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
 
10965
AC_BEFORE([$0], [XORG_WITH_GLIB])
 
10966
AC_BEFORE([$0], [XORG_LD_WRAP])
 
10967
m4_define([_defopt], m4_default([$1], [auto]))
 
10968
AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
 
10969
        [Enable building unit test cases (default: ]_defopt[)]),
 
10970
        [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
 
10971
m4_undefine([_defopt])
 
10972
AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
 
10973
AC_MSG_CHECKING([whether to build unit test cases])
 
10974
AC_MSG_RESULT([$enable_unit_tests])
 
10975
]) # XORG_ENABLE_UNIT_TESTS
 
10976
 
 
10977
# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
 
10978
# ----------------------------------------
 
10979
# Minimum version: 1.13.0
 
10980
#
 
10981
# GLib is a library which provides advanced data structures and functions.
 
10982
# This macro enables a module to test for the presence of Glib.
 
10983
#
 
10984
# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
 
10985
# Otherwise the value of $enable_unit_tests is blank.
 
10986
#
 
10987
# Interface to module:
 
10988
# HAVE_GLIB: used in makefiles to conditionally build targets
 
10989
# with_glib: used in configure.ac to know if GLib has been found
 
10990
# --with-glib:  'yes' user instructs the module to use glib
 
10991
#               'no' user instructs the module not to use glib
 
10992
#
 
10993
AC_DEFUN([XORG_WITH_GLIB],[
 
10994
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
10995
m4_define([_defopt], m4_default([$2], [auto]))
 
10996
AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
 
10997
        [Use GLib library for unit testing (default: ]_defopt[)]),
 
10998
        [with_glib=$withval], [with_glib=]_defopt)
 
10999
m4_undefine([_defopt])
 
11000
 
 
11001
have_glib=no
 
11002
# Do not probe GLib if user explicitly disabled unit testing
 
11003
if test "x$enable_unit_tests" != x"no"; then
 
11004
  # Do not probe GLib if user explicitly disabled it
 
11005
  if test "x$with_glib" != x"no"; then
 
11006
    m4_ifval(
 
11007
      [$1],
 
11008
      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
 
11009
      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
 
11010
    )
 
11011
  fi
 
11012
fi
 
11013
 
 
11014
# Not having GLib when unit testing has been explicitly requested is an error
 
11015
if test "x$enable_unit_tests" = x"yes"; then
 
11016
  if test "x$have_glib" = x"no"; then
 
11017
    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
 
11018
  fi
 
11019
fi
 
11020
 
 
11021
# Having unit testing disabled when GLib has been explicitly requested is an error
 
11022
if test "x$enable_unit_tests" = x"no"; then
 
11023
  if test "x$with_glib" = x"yes"; then
 
11024
    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
 
11025
  fi
 
11026
fi
 
11027
 
 
11028
# Not having GLib when it has been explicitly requested is an error
 
11029
if test "x$with_glib" = x"yes"; then
 
11030
  if test "x$have_glib" = x"no"; then
 
11031
    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
 
11032
  fi
 
11033
fi
 
11034
 
 
11035
AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
 
11036
]) # XORG_WITH_GLIB
 
11037
 
 
11038
# XORG_LD_WRAP
 
11039
# ------------
 
11040
# Minimum version: 1.13.0
 
11041
#
 
11042
# Check if linker supports -wrap, passed via compiler flags
 
11043
#
 
11044
# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
 
11045
# Otherwise the value of $enable_unit_tests is blank.
 
11046
#
 
11047
AC_DEFUN([XORG_LD_WRAP],[
 
11048
XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no])
 
11049
# Not having ld wrap when unit testing has been explicitly requested is an error
 
11050
if test "x$enable_unit_tests" = x"yes"; then
 
11051
  if test "x$have_ld_wrap" = x"no"; then
 
11052
    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
 
11053
  fi
 
11054
fi
 
11055
AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
 
11056
#
 
11057
]) # XORG_LD_WRAP
 
11058
 
 
11059
# XORG_CHECK_LINKER_FLAGS
 
11060
# -----------------------
 
11061
# SYNOPSIS
 
11062
#
 
11063
#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
 
11064
#
 
11065
# DESCRIPTION
 
11066
#
 
11067
#   Check whether the given linker FLAGS work with the current language's
 
11068
#   linker, or whether they give an error.
 
11069
#
 
11070
#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
 
11071
#   success/failure.
 
11072
#
 
11073
#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
 
11074
#
 
11075
# LICENSE
 
11076
#
 
11077
#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
 
11078
#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
 
11079
#   Copyright (c) 2009 Matteo Frigo
 
11080
#
 
11081
#   This program is free software: you can redistribute it and/or modify it
 
11082
#   under the terms of the GNU General Public License as published by the
 
11083
#   Free Software Foundation, either version 3 of the License, or (at your
 
11084
#   option) any later version.
 
11085
#
 
11086
#   This program is distributed in the hope that it will be useful, but
 
11087
#   WITHOUT ANY WARRANTY; without even the implied warranty of
 
11088
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
 
11089
#   Public License for more details.
 
11090
#
 
11091
#   You should have received a copy of the GNU General Public License along
 
11092
#   with this program. If not, see <http://www.gnu.org/licenses/>.
 
11093
#
 
11094
#   As a special exception, the respective Autoconf Macro's copyright owner
 
11095
#   gives unlimited permission to copy, distribute and modify the configure
 
11096
#   scripts that are the output of Autoconf when processing the Macro. You
 
11097
#   need not follow the terms of the GNU General Public License when using
 
11098
#   or distributing such scripts, even though portions of the text of the
 
11099
#   Macro appear in them. The GNU General Public License (GPL) does govern
 
11100
#   all other use of the material that constitutes the Autoconf Macro.
 
11101
#
 
11102
#   This special exception to the GPL applies to versions of the Autoconf
 
11103
#   Macro released by the Autoconf Archive. When you make and distribute a
 
11104
#   modified version of the Autoconf Macro, you may extend this special
 
11105
#   exception to the GPL to apply to your modified version as well.#
 
11106
AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
 
11107
[AC_MSG_CHECKING([whether the linker accepts $1])
 
11108
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
 
11109
AS_LITERAL_IF([$1],
 
11110
  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
 
11111
      ax_save_FLAGS=$LDFLAGS
 
11112
      LDFLAGS="$1"
 
11113
      AC_LINK_IFELSE([AC_LANG_PROGRAM()],
 
11114
        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
 
11115
        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
 
11116
      LDFLAGS=$ax_save_FLAGS])],
 
11117
  [ax_save_FLAGS=$LDFLAGS
 
11118
   LDFLAGS="$1"
 
11119
   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
 
11120
     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
 
11121
     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
 
11122
   LDFLAGS=$ax_save_FLAGS])
 
11123
eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
 
11124
AC_MSG_RESULT($xorg_check_linker_flags)
 
11125
if test "x$xorg_check_linker_flags" = xyes; then
 
11126
        m4_default([$2], :)
 
11127
else
 
11128
        m4_default([$3], :)
 
11129
fi
 
11130
]) # XORG_CHECK_LINKER_FLAGS
 
11131
 
10944
11132
# XORG_CHECK_MALLOC_ZERO
10945
11133
# ----------------------
10946
11134
# Minimum version: 1.0.0