~ubuntu-branches/ubuntu/trusty/xserver-xorg-video-nv/trusty

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2010-06-08 18:22:37 UTC
  • mfrom: (1.1.19 upstream) (14.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100608182237-d8duvizd661d0raj
Tags: 1:2.1.17-3ubuntu1
* Merge from Debian unstable.  Remaining Ubuntu changes:
  + debian/patches/100_fedora-panel-fix.patch:
    - Don't discard EDID blocks just because their input type bit
    disagrees with the hardware connection sensing; this usually
    just means the block is lying. (cf. LP: 188549).
* 105_gf7025_gf7050.patch:
  + Drop, these cards are supported by new upstream version.
* 0001-Move-the-logic-for-matching-devices-out-of-probe-rou.patch:
* 0002-Run-the-parsing-script-to-generate-an-initial-list-o.patch:
  + Drop.  These patches are annoying to update, and their task can be 
    handled better in the new X server's autoconfiguration paths.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
m4_ifndef([AC_AUTOCONF_VERSION],
15
15
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16
 
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17
 
[m4_warning([this file was generated for autoconf 2.63.
 
16
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],,
 
17
[m4_warning([this file was generated for autoconf 2.64.
18
18
You have another version of autoconf.  It may work, but is not guaranteed to.
19
19
If you have problems, you may need to regenerate the build system entirely.
20
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
2485
2485
  # before this can be enabled.
2486
2486
  hardcode_into_libs=yes
2487
2487
 
2488
 
  # Add ABI-specific directories to the system library path.
2489
 
  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
2490
 
 
2491
2488
  # Append ld.so.conf contents to the search path
2492
2489
  if test -f /etc/ld.so.conf; then
2493
2490
    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[   ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
2494
 
    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
 
2491
    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2495
2492
  fi
2496
2493
 
2497
2494
  # We used to test for /lib/ld.so.1 and disable shared libraries on
2503
2500
  dynamic_linker='GNU/Linux ld.so'
2504
2501
  ;;
2505
2502
 
 
2503
netbsdelf*-gnu)
 
2504
  version_type=linux
 
2505
  need_lib_prefix=no
 
2506
  need_version=no
 
2507
  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
 
2508
  soname_spec='${libname}${release}${shared_ext}$major'
 
2509
  shlibpath_var=LD_LIBRARY_PATH
 
2510
  shlibpath_overrides_runpath=no
 
2511
  hardcode_into_libs=yes
 
2512
  dynamic_linker='NetBSD ld.elf_so'
 
2513
  ;;
 
2514
 
2506
2515
netbsd*)
2507
2516
  version_type=sunos
2508
2517
  need_lib_prefix=no
3094
3103
  lt_cv_deplibs_check_method=pass_all
3095
3104
  ;;
3096
3105
 
3097
 
netbsd*)
 
3106
netbsd* | netbsdelf*-gnu)
3098
3107
  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3099
3108
    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3100
3109
  else
3775
3784
            ;;
3776
3785
        esac
3777
3786
        ;;
3778
 
      netbsd*)
 
3787
      netbsd* | netbsdelf*-gnu)
3779
3788
        ;;
3780
3789
      *qnx* | *nto*)
3781
3790
        # QNX uses GNU C++, but need to define -shared option too, otherwise
4200
4209
  cygwin* | mingw* | cegcc*)
4201
4210
    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4202
4211
  ;;
 
4212
  linux* | k*bsd*-gnu)
 
4213
    _LT_TAGVAR(link_all_deplibs, $1)=no
 
4214
  ;;
4203
4215
  *)
4204
4216
    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4205
4217
  ;;
4264
4276
  openbsd*)
4265
4277
    with_gnu_ld=no
4266
4278
    ;;
 
4279
  linux* | k*bsd*-gnu)
 
4280
    _LT_TAGVAR(link_all_deplibs, $1)=no
 
4281
    ;;
4267
4282
  esac
4268
4283
 
4269
4284
  _LT_TAGVAR(ld_shlibs, $1)=yes
4446
4461
      fi
4447
4462
      ;;
4448
4463
 
4449
 
    netbsd*)
 
4464
    netbsd* | netbsdelf*-gnu)
4450
4465
      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4451
4466
        _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4452
4467
        wlarc=
4621
4636
        if test "$aix_use_runtimelinking" = yes; then
4622
4637
          shared_flag="$shared_flag "'${wl}-G'
4623
4638
        fi
 
4639
        _LT_TAGVAR(link_all_deplibs, $1)=no
4624
4640
      else
4625
4641
        # not using gcc
4626
4642
        if test "$host_cpu" = ia64; then
4859
4875
      _LT_TAGVAR(link_all_deplibs, $1)=yes
4860
4876
      ;;
4861
4877
 
4862
 
    netbsd*)
 
4878
    netbsd* | netbsdelf*-gnu)
4863
4879
      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4864
4880
        _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
4865
4881
      else
8036
8052
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8037
8053
# ---------------------------------------------
8038
8054
m4_define([_PKG_CONFIG],
8039
 
[if test -n "$$1"; then
8040
 
    pkg_cv_[]$1="$$1"
8041
 
 elif test -n "$PKG_CONFIG"; then
8042
 
    PKG_CHECK_EXISTS([$3],
8043
 
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8044
 
                     [pkg_failed=yes])
8045
 
 else
8046
 
    pkg_failed=untried
 
8055
[if test -n "$PKG_CONFIG"; then
 
8056
    if test -n "$$1"; then
 
8057
        pkg_cv_[]$1="$$1"
 
8058
    else
 
8059
        PKG_CHECK_EXISTS([$3],
 
8060
                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 
8061
                         [pkg_failed=yes])
 
8062
    fi
 
8063
else
 
8064
        pkg_failed=untried
8047
8065
fi[]dnl
8048
8066
])# _PKG_CONFIG
8049
8067
 
8087
8105
if test $pkg_failed = yes; then
8088
8106
        _PKG_SHORT_ERRORS_SUPPORTED
8089
8107
        if test $_pkg_short_errors_supported = yes; then
8090
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
 
8108
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
8091
8109
        else 
8092
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
 
8110
                $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
8093
8111
        fi
8094
8112
        # Put the nasty error message in config.log where it belongs
8095
8113
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8124
8142
fi[]dnl
8125
8143
])# PKG_CHECK_MODULES
8126
8144
 
 
8145
dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
 
8146
dnl
 
8147
dnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
 
8148
dnl 
 
8149
dnl Permission is hereby granted, free of charge, to any person obtaining a
 
8150
dnl copy of this software and associated documentation files (the "Software"),
 
8151
dnl to deal in the Software without restriction, including without limitation
 
8152
dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
 
8153
dnl and/or sell copies of the Software, and to permit persons to whom the
 
8154
dnl Software is furnished to do so, subject to the following conditions:
 
8155
dnl
 
8156
dnl The above copyright notice and this permission notice (including the next
 
8157
dnl paragraph) shall be included in all copies or substantial portions of the
 
8158
dnl Software.
 
8159
dnl
 
8160
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
8161
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
8162
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 
8163
dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
8164
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
8165
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 
8166
dnl DEALINGS IN THE SOFTWARE.
 
8167
 
 
8168
# XORG_MACROS_VERSION(required-version)
 
8169
# -------------------------------------
 
8170
# Minimum version: 1.1.0
 
8171
#
 
8172
# If you're using a macro added in Version 1.1 or newer, include this in
 
8173
# your configure.ac with the minimum required version, such as:
 
8174
# XORG_MACROS_VERSION(1.1)
 
8175
#
 
8176
# To ensure that this macro is defined, also add:
 
8177
# m4_ifndef([XORG_MACROS_VERSION],
 
8178
#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
 
8179
#
 
8180
#
 
8181
# See the "minimum version" comment for each macro you use to see what 
 
8182
# version you require.
 
8183
m4_defun([XORG_MACROS_VERSION],[
 
8184
m4_define([vers_have], [1.5.0])
 
8185
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
 
8186
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
 
8187
m4_if(m4_cmp(maj_have, maj_needed), 0,,
 
8188
    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
 
8189
m4_if(m4_version_compare(vers_have, [$1]), -1,
 
8190
    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
 
8191
m4_undefine([vers_have])
 
8192
m4_undefine([maj_have])
 
8193
m4_undefine([maj_needed])
 
8194
]) # XORG_MACROS_VERSION
 
8195
 
 
8196
# XORG_PROG_RAWCPP()
 
8197
# ------------------
 
8198
# Minimum version: 1.0.0
 
8199
#
 
8200
# Find cpp program and necessary flags for use in pre-processing text files
 
8201
# such as man pages and config files
 
8202
AC_DEFUN([XORG_PROG_RAWCPP],[
 
8203
AC_REQUIRE([AC_PROG_CPP])
 
8204
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
 
8205
   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
 
8206
 
 
8207
# Check for flag to avoid builtin definitions - assumes unix is predefined,
 
8208
# which is not the best choice for supporting other OS'es, but covers most
 
8209
# of the ones we need for now.
 
8210
AC_MSG_CHECKING([if $RAWCPP requires -undef])
 
8211
AC_LANG_CONFTEST([Does cpp redefine unix ?])
 
8212
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
 
8213
        AC_MSG_RESULT([no])
 
8214
else
 
8215
        if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
 
8216
                RAWCPPFLAGS=-undef
 
8217
                AC_MSG_RESULT([yes])
 
8218
        # under Cygwin unix is still defined even with -undef
 
8219
        elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
 
8220
                RAWCPPFLAGS="-undef -ansi"
 
8221
                AC_MSG_RESULT([yes, with -ansi])
 
8222
        else
 
8223
                AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
 
8224
        fi
 
8225
fi
 
8226
rm -f conftest.$ac_ext
 
8227
 
 
8228
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
 
8229
AC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
 
8230
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
 
8231
        AC_MSG_RESULT([no])
 
8232
else
 
8233
        if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
 
8234
                RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
 
8235
                AC_MSG_RESULT([yes])
 
8236
        else
 
8237
                AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
 
8238
        fi
 
8239
fi
 
8240
rm -f conftest.$ac_ext
 
8241
AC_SUBST(RAWCPPFLAGS)
 
8242
]) # XORG_PROG_RAWCPP
 
8243
 
 
8244
# XORG_MANPAGE_SECTIONS()
 
8245
# -----------------------
 
8246
# Minimum version: 1.0.0
 
8247
#
 
8248
# Determine which sections man pages go in for the different man page types
 
8249
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
 
8250
# Not sure if there's any better way than just hardcoding by OS name.
 
8251
# Override default settings by setting environment variables
 
8252
 
 
8253
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
 
8254
AC_REQUIRE([AC_CANONICAL_HOST])
 
8255
 
 
8256
if test x$APP_MAN_SUFFIX = x    ; then
 
8257
    APP_MAN_SUFFIX=1
 
8258
fi
 
8259
if test x$APP_MAN_DIR = x    ; then
 
8260
    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
 
8261
fi
 
8262
 
 
8263
if test x$LIB_MAN_SUFFIX = x    ; then
 
8264
    LIB_MAN_SUFFIX=3
 
8265
fi
 
8266
if test x$LIB_MAN_DIR = x    ; then
 
8267
    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
 
8268
fi
 
8269
 
 
8270
if test x$FILE_MAN_SUFFIX = x    ; then
 
8271
    case $host_os in
 
8272
        solaris*)       FILE_MAN_SUFFIX=4  ;;
 
8273
        *)              FILE_MAN_SUFFIX=5  ;;
 
8274
    esac
 
8275
fi
 
8276
if test x$FILE_MAN_DIR = x    ; then
 
8277
    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
 
8278
fi
 
8279
 
 
8280
if test x$MISC_MAN_SUFFIX = x    ; then
 
8281
    case $host_os in
 
8282
        solaris*)       MISC_MAN_SUFFIX=5  ;;
 
8283
        *)              MISC_MAN_SUFFIX=7  ;;
 
8284
    esac
 
8285
fi
 
8286
if test x$MISC_MAN_DIR = x    ; then
 
8287
    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
 
8288
fi
 
8289
 
 
8290
if test x$DRIVER_MAN_SUFFIX = x    ; then
 
8291
    case $host_os in
 
8292
        solaris*)       DRIVER_MAN_SUFFIX=7  ;;
 
8293
        *)              DRIVER_MAN_SUFFIX=4  ;;
 
8294
    esac
 
8295
fi
 
8296
if test x$DRIVER_MAN_DIR = x    ; then
 
8297
    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
 
8298
fi
 
8299
 
 
8300
if test x$ADMIN_MAN_SUFFIX = x    ; then
 
8301
    case $host_os in
 
8302
        solaris*)       ADMIN_MAN_SUFFIX=1m ;;
 
8303
        *)              ADMIN_MAN_SUFFIX=8  ;;
 
8304
    esac
 
8305
fi
 
8306
if test x$ADMIN_MAN_DIR = x    ; then
 
8307
    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
 
8308
fi
 
8309
 
 
8310
 
 
8311
AC_SUBST([APP_MAN_SUFFIX])
 
8312
AC_SUBST([LIB_MAN_SUFFIX])
 
8313
AC_SUBST([FILE_MAN_SUFFIX])
 
8314
AC_SUBST([MISC_MAN_SUFFIX])
 
8315
AC_SUBST([DRIVER_MAN_SUFFIX])
 
8316
AC_SUBST([ADMIN_MAN_SUFFIX])
 
8317
AC_SUBST([APP_MAN_DIR])
 
8318
AC_SUBST([LIB_MAN_DIR])
 
8319
AC_SUBST([FILE_MAN_DIR])
 
8320
AC_SUBST([MISC_MAN_DIR])
 
8321
AC_SUBST([DRIVER_MAN_DIR])
 
8322
AC_SUBST([ADMIN_MAN_DIR])
 
8323
]) # XORG_MANPAGE_SECTIONS
 
8324
 
 
8325
# XORG_CHECK_LINUXDOC
 
8326
# -------------------
 
8327
# Minimum version: 1.0.0
 
8328
#
 
8329
# Defines the variable MAKE_TEXT if the necessary tools and
 
8330
# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
 
8331
# Whether or not the necessary tools and files are found can be checked
 
8332
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
 
8333
AC_DEFUN([XORG_CHECK_LINUXDOC],[
 
8334
if test x$XORG_SGML_PATH = x ; then
 
8335
    XORG_SGML_PATH=$prefix/share/sgml
 
8336
fi
 
8337
HAVE_DEFS_ENT=
 
8338
 
 
8339
if test x"$cross_compiling" = x"yes" ; then
 
8340
  HAVE_DEFS_ENT=no
 
8341
else
 
8342
  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
 
8343
fi
 
8344
 
 
8345
AC_PATH_PROG(LINUXDOC, linuxdoc)
 
8346
AC_PATH_PROG(PS2PDF, ps2pdf)
 
8347
 
 
8348
AC_MSG_CHECKING([Whether to build documentation])
 
8349
 
 
8350
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
 
8351
   BUILDDOC=yes
 
8352
else
 
8353
   BUILDDOC=no
 
8354
fi
 
8355
 
 
8356
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
 
8357
 
 
8358
AC_MSG_RESULT([$BUILDDOC])
 
8359
 
 
8360
AC_MSG_CHECKING([Whether to build pdf documentation])
 
8361
 
 
8362
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
 
8363
   BUILDPDFDOC=yes
 
8364
else
 
8365
   BUILDPDFDOC=no
 
8366
fi
 
8367
 
 
8368
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
 
8369
 
 
8370
AC_MSG_RESULT([$BUILDPDFDOC])
 
8371
 
 
8372
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
 
8373
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
 
8374
MAKE_PDF="$PS2PDF"
 
8375
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
 
8376
 
 
8377
AC_SUBST(MAKE_TEXT)
 
8378
AC_SUBST(MAKE_PS)
 
8379
AC_SUBST(MAKE_PDF)
 
8380
AC_SUBST(MAKE_HTML)
 
8381
]) # XORG_CHECK_LINUXDOC
 
8382
 
 
8383
# XORG_CHECK_DOCBOOK
 
8384
# -------------------
 
8385
# Minimum version: 1.0.0
 
8386
#
 
8387
# Checks for the ability to build output formats from SGML DocBook source.
 
8388
# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
 
8389
# indicates whether the necessary tools and files are found and, if set,
 
8390
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
 
8391
AC_DEFUN([XORG_CHECK_DOCBOOK],[
 
8392
if test x$XORG_SGML_PATH = x ; then
 
8393
    XORG_SGML_PATH=$prefix/share/sgml
 
8394
fi
 
8395
HAVE_DEFS_ENT=
 
8396
BUILDTXTDOC=no
 
8397
BUILDPDFDOC=no
 
8398
BUILDPSDOC=no
 
8399
BUILDHTMLDOC=no
 
8400
 
 
8401
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
 
8402
 
 
8403
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
 
8404
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
 
8405
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
 
8406
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
 
8407
 
 
8408
AC_MSG_CHECKING([Whether to build text documentation])
 
8409
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
 
8410
   test x$BUILD_TXTDOC != xno; then
 
8411
        BUILDTXTDOC=yes
 
8412
fi
 
8413
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
 
8414
AC_MSG_RESULT([$BUILDTXTDOC])
 
8415
 
 
8416
AC_MSG_CHECKING([Whether to build PDF documentation])
 
8417
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
 
8418
   test x$BUILD_PDFDOC != xno; then
 
8419
        BUILDPDFDOC=yes
 
8420
fi
 
8421
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
 
8422
AC_MSG_RESULT([$BUILDPDFDOC])
 
8423
 
 
8424
AC_MSG_CHECKING([Whether to build PostScript documentation])
 
8425
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
 
8426
   test x$BUILD_PSDOC != xno; then
 
8427
        BUILDPSDOC=yes
 
8428
fi
 
8429
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
 
8430
AC_MSG_RESULT([$BUILDPSDOC])
 
8431
 
 
8432
AC_MSG_CHECKING([Whether to build HTML documentation])
 
8433
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
 
8434
   test x$BUILD_HTMLDOC != xno; then
 
8435
        BUILDHTMLDOC=yes
 
8436
fi
 
8437
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
 
8438
AC_MSG_RESULT([$BUILDHTMLDOC])
 
8439
 
 
8440
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
 
8441
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
 
8442
MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
 
8443
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
 
8444
 
 
8445
AC_SUBST(MAKE_TEXT)
 
8446
AC_SUBST(MAKE_PS)
 
8447
AC_SUBST(MAKE_PDF)
 
8448
AC_SUBST(MAKE_HTML)
 
8449
]) # XORG_CHECK_DOCBOOK
 
8450
 
 
8451
# XORG_WITH_XMLTO
 
8452
# ----------------
 
8453
# Minimum version: 1.5.0
 
8454
#
 
8455
# Documentation tools are not always available on all platforms and sometimes
 
8456
# not at the appropriate level. This macro enables a module to test for the
 
8457
# presence of the tool and obtain it's path in separate variables. Coupled with
 
8458
# the --with-xmlto option, it allows maximum flexibilty in making decisions
 
8459
# as whether or not to use the xmlto package.
 
8460
#
 
8461
# Interface to module:
 
8462
# HAVE_XMLTO:   used in makefiles to conditionally generate documentation
 
8463
# XMLTO:        returns the path of the xmlto program found
 
8464
#               returns the path set by the user in the environment
 
8465
# --with-xmlto: 'yes' user instructs the module to use xmlto
 
8466
#               'no' user instructs the module not to use xmlto
 
8467
#
 
8468
# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
 
8469
#
 
8470
AC_DEFUN([XORG_WITH_XMLTO],[
 
8471
AC_ARG_VAR([XMLTO], [Path to xmlto command])
 
8472
AC_ARG_WITH(xmlto,
 
8473
        AS_HELP_STRING([--with-xmlto],
 
8474
           [Use xmlto to regenerate documentation (default: yes, if installed)]),
 
8475
           [use_xmlto=$withval], [use_xmlto=auto])
 
8476
 
 
8477
if test "x$use_xmlto" = x"auto"; then
 
8478
   AC_PATH_PROG([XMLTO], [xmlto])
 
8479
   if test "x$XMLTO" = "x"; then
 
8480
        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
 
8481
        have_xmlto=no
 
8482
   else
 
8483
        have_xmlto=yes
 
8484
   fi
 
8485
elif test "x$use_xmlto" = x"yes" ; then
 
8486
   AC_PATH_PROG([XMLTO], [xmlto])
 
8487
   if test "x$XMLTO" = "x"; then
 
8488
        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
 
8489
   fi
 
8490
   have_xmlto=yes
 
8491
elif test "x$use_xmlto" = x"no" ; then
 
8492
   if test "x$XMLTO" != "x"; then
 
8493
      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
 
8494
   fi
 
8495
   have_xmlto=no
 
8496
else
 
8497
   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
 
8498
fi
 
8499
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
 
8500
]) # XORG_CHECK_XMLTO
 
8501
 
 
8502
# XORG_WITH_ASCIIDOC
 
8503
# ----------------
 
8504
# Minimum version: 1.5.0
 
8505
#
 
8506
# Documentation tools are not always available on all platforms and sometimes
 
8507
# not at the appropriate level. This macro enables a module to test for the
 
8508
# presence of the tool and obtain it's path in separate variables. Coupled with
 
8509
# the --with-asciidoc option, it allows maximum flexibilty in making decisions
 
8510
# as whether or not to use the asciidoc package.
 
8511
#
 
8512
# Interface to module:
 
8513
# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
 
8514
# ASCIIDOC:      returns the path of the asciidoc program found
 
8515
#                returns the path set by the user in the environment
 
8516
# --with-asciidoc: 'yes' user instructs the module to use asciidoc
 
8517
#                 'no' user instructs the module not to use asciidoc
 
8518
#
 
8519
# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
 
8520
#
 
8521
AC_DEFUN([XORG_WITH_ASCIIDOC],[
 
8522
AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
 
8523
AC_ARG_WITH(asciidoc,
 
8524
        AS_HELP_STRING([--with-asciidoc],
 
8525
           [Use asciidoc to regenerate documentation (default: yes, if installed)]),
 
8526
           [use_asciidoc=$withval], [use_asciidoc=auto])
 
8527
 
 
8528
if test "x$use_asciidoc" = x"auto"; then
 
8529
   AC_PATH_PROG([ASCIIDOC], [asciidoc])
 
8530
   if test "x$ASCIIDOC" = "x"; then
 
8531
        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
 
8532
        have_asciidoc=no
 
8533
   else
 
8534
        have_asciidoc=yes
 
8535
   fi
 
8536
elif test "x$use_asciidoc" = x"yes" ; then
 
8537
   AC_PATH_PROG([ASCIIDOC], [asciidoc])
 
8538
   if test "x$ASCIIDOC" = "x"; then
 
8539
        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
 
8540
   fi
 
8541
   have_asciidoc=yes
 
8542
elif test "x$use_asciidoc" = x"no" ; then
 
8543
   if test "x$ASCIIDOC" != "x"; then
 
8544
      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
 
8545
   fi
 
8546
   have_asciidoc=no
 
8547
else
 
8548
   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
 
8549
fi
 
8550
AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
 
8551
]) # XORG_CHECK_ASCIIDOC
 
8552
 
 
8553
# XORG_WITH_DOXYGEN
 
8554
# ----------------
 
8555
# Minimum version: 1.5.0
 
8556
#
 
8557
# Documentation tools are not always available on all platforms and sometimes
 
8558
# not at the appropriate level. This macro enables a module to test for the
 
8559
# presence of the tool and obtain it's path in separate variables. Coupled with
 
8560
# the --with-doxygen option, it allows maximum flexibilty in making decisions
 
8561
# as whether or not to use the doxygen package.
 
8562
#
 
8563
# Interface to module:
 
8564
# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
 
8565
# DOXYGEN:       returns the path of the doxygen program found
 
8566
#                returns the path set by the user in the environment
 
8567
# --with-doxygen: 'yes' user instructs the module to use doxygen
 
8568
#                 'no' user instructs the module not to use doxygen
 
8569
#
 
8570
# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
 
8571
#
 
8572
AC_DEFUN([XORG_WITH_DOXYGEN],[
 
8573
AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
 
8574
AC_ARG_WITH(doxygen,
 
8575
        AS_HELP_STRING([--with-doxygen],
 
8576
           [Use doxygen to regenerate documentation (default: yes, if installed)]),
 
8577
           [use_doxygen=$withval], [use_doxygen=auto])
 
8578
 
 
8579
if test "x$use_doxygen" = x"auto"; then
 
8580
   AC_PATH_PROG([DOXYGEN], [doxygen])
 
8581
   if test "x$DOXYGEN" = "x"; then
 
8582
        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
 
8583
        have_doxygen=no
 
8584
   else
 
8585
        have_doxygen=yes
 
8586
   fi
 
8587
elif test "x$use_doxygen" = x"yes" ; then
 
8588
   AC_PATH_PROG([DOXYGEN], [doxygen])
 
8589
   if test "x$DOXYGEN" = "x"; then
 
8590
        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
 
8591
   fi
 
8592
   have_doxygen=yes
 
8593
elif test "x$use_doxygen" = x"no" ; then
 
8594
   if test "x$DOXYGEN" != "x"; then
 
8595
      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
 
8596
   fi
 
8597
   have_doxygen=no
 
8598
else
 
8599
   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
 
8600
fi
 
8601
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
 
8602
]) # XORG_CHECK_DOXYGEN
 
8603
 
 
8604
# XORG_CHECK_MALLOC_ZERO
 
8605
# ----------------------
 
8606
# Minimum version: 1.0.0
 
8607
#
 
8608
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
 
8609
# malloc(0) returns NULL.  Packages should add one of these cflags to
 
8610
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
 
8611
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
 
8612
AC_ARG_ENABLE(malloc0returnsnull,
 
8613
        AS_HELP_STRING([--enable-malloc0returnsnull],
 
8614
                       [malloc(0) returns NULL (default: auto)]),
 
8615
        [MALLOC_ZERO_RETURNS_NULL=$enableval],
 
8616
        [MALLOC_ZERO_RETURNS_NULL=auto])
 
8617
 
 
8618
AC_MSG_CHECKING([whether malloc(0) returns NULL])
 
8619
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
 
8620
        AC_RUN_IFELSE([
 
8621
char *malloc();
 
8622
char *realloc();
 
8623
char *calloc();
 
8624
main() {
 
8625
    char *m0, *r0, *c0, *p;
 
8626
    m0 = malloc(0);
 
8627
    p = malloc(10);
 
8628
    r0 = realloc(p,0);
 
8629
    c0 = calloc(0);
 
8630
    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
 
8631
}],
 
8632
                [MALLOC_ZERO_RETURNS_NULL=yes],
 
8633
                [MALLOC_ZERO_RETURNS_NULL=no],
 
8634
                [MALLOC_ZERO_RETURNS_NULL=yes])
 
8635
fi
 
8636
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
 
8637
 
 
8638
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
 
8639
        MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
 
8640
        XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
 
8641
        XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
 
8642
else
 
8643
        MALLOC_ZERO_CFLAGS=""
 
8644
        XMALLOC_ZERO_CFLAGS=""
 
8645
        XTMALLOC_ZERO_CFLAGS=""
 
8646
fi
 
8647
 
 
8648
AC_SUBST([MALLOC_ZERO_CFLAGS])
 
8649
AC_SUBST([XMALLOC_ZERO_CFLAGS])
 
8650
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
 
8651
]) # XORG_CHECK_MALLOC_ZERO
 
8652
 
 
8653
# XORG_WITH_LINT()
 
8654
# ----------------
 
8655
# Minimum version: 1.1.0
 
8656
#
 
8657
# Sets up flags for source checkers such as lint and sparse if --with-lint
 
8658
# is specified.   (Use --with-lint=sparse for sparse.)
 
8659
# Sets $LINT to name of source checker passed with --with-lint (default: lint)
 
8660
# Sets $LINT_FLAGS to flags to pass to source checker
 
8661
# Sets LINT automake conditional if enabled (default: disabled)
 
8662
#
 
8663
AC_DEFUN([XORG_WITH_LINT],[
 
8664
 
 
8665
# Allow checking code with lint, sparse, etc.
 
8666
AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
 
8667
                [Use a lint-style source code checker (default: disabled)])],
 
8668
                [use_lint=$withval], [use_lint=no])
 
8669
if test "x$use_lint" = "xyes" ; then
 
8670
        LINT="lint"
 
8671
else
 
8672
        LINT="$use_lint"
 
8673
fi
 
8674
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
 
8675
    case $LINT in
 
8676
        lint|*/lint)
 
8677
            case $host_os in
 
8678
                solaris*)
 
8679
                        LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
 
8680
                        ;;
 
8681
            esac
 
8682
            ;;
 
8683
    esac
 
8684
fi
 
8685
 
 
8686
AC_SUBST(LINT)
 
8687
AC_SUBST(LINT_FLAGS)
 
8688
AM_CONDITIONAL(LINT, [test x$LINT != xno])
 
8689
 
 
8690
]) # XORG_WITH_LINT
 
8691
 
 
8692
# XORG_LINT_LIBRARY(LIBNAME)
 
8693
# --------------------------
 
8694
# Minimum version: 1.1.0
 
8695
#
 
8696
# Sets up flags for building lint libraries for checking programs that call
 
8697
# functions in the library.
 
8698
# Disabled by default, enable with --enable-lint-library
 
8699
# Sets: 
 
8700
#       @LINTLIB@               - name of lint library file to make
 
8701
#       MAKE_LINT_LIB           - automake conditional
 
8702
#
 
8703
 
 
8704
AC_DEFUN([XORG_LINT_LIBRARY],[
 
8705
AC_REQUIRE([XORG_WITH_LINT])
 
8706
# Build lint "library" for more indepth checks of programs calling this library
 
8707
AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
 
8708
        [Create lint library (default: disabled)])],
 
8709
        [make_lint_lib=$enableval], [make_lint_lib=no])
 
8710
if test "x$make_lint_lib" != "xno" ; then
 
8711
        if test "x$LINT" = "xno" ; then
 
8712
                AC_MSG_ERROR([Cannot make lint library without --with-lint])
 
8713
        fi
 
8714
        if test "x$make_lint_lib" = "xyes" ; then
 
8715
                LINTLIB=llib-l$1.ln
 
8716
        else
 
8717
                LINTLIB=$make_lint_lib
 
8718
        fi
 
8719
fi
 
8720
AC_SUBST(LINTLIB)
 
8721
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
 
8722
 
 
8723
]) # XORG_LINT_LIBRARY
 
8724
 
 
8725
# XORG_CWARNFLAGS
 
8726
# ---------------
 
8727
# Minimum version: 1.2.0
 
8728
#
 
8729
# Defines CWARNFLAGS to enable C compiler warnings.
 
8730
#
 
8731
AC_DEFUN([XORG_CWARNFLAGS], [
 
8732
AC_REQUIRE([AC_PROG_CC])
 
8733
if  test "x$GCC" = xyes ; then
 
8734
    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
 
8735
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
 
8736
-Wbad-function-cast"
 
8737
    case `$CC -dumpversion` in
 
8738
    3.4.* | 4.*)
 
8739
        CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
 
8740
        ;;
 
8741
    esac
 
8742
else
 
8743
    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
 
8744
    if test "x$SUNCC" = "xyes"; then
 
8745
        CWARNFLAGS="-v"
 
8746
    fi
 
8747
fi
 
8748
AC_SUBST(CWARNFLAGS)
 
8749
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
8750
]) # XORG_CWARNFLAGS
 
8751
 
 
8752
# XORG_STRICT_OPTION
 
8753
# -----------------------
 
8754
# Minimum version: 1.3.0
 
8755
#
 
8756
# Add configure option to enable strict compilation
 
8757
AC_DEFUN([XORG_STRICT_OPTION], [
 
8758
AC_REQUIRE([AC_PROG_CC])
 
8759
AC_REQUIRE([AC_PROG_CC_C99])
 
8760
AC_REQUIRE([XORG_CWARNFLAGS])
 
8761
 
 
8762
AC_ARG_ENABLE(strict-compilation,
 
8763
                          AS_HELP_STRING([--enable-strict-compilation],
 
8764
                          [Enable all warnings from compiler and make them errors (default: disabled)]),
 
8765
                          [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
 
8766
if test "x$STRICT_COMPILE" = "xyes"; then
 
8767
        AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
 
8768
        AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
 
8769
        if test "x$GCC" = xyes ; then
 
8770
                STRICT_CFLAGS="-pedantic -Werror"
 
8771
        elif test "x$SUNCC" = "xyes"; then
 
8772
                STRICT_CFLAGS="-errwarn"
 
8773
    elif test "x$INTELCC" = "xyes"; then
 
8774
                STRICT_CFLAGS="-Werror"
 
8775
        fi
 
8776
fi
 
8777
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
 
8778
AC_SUBST([CWARNFLAGS])
 
8779
]) # XORG_STRICT_OPTION
 
8780
 
 
8781
# XORG_DEFAULT_OPTIONS
 
8782
# --------------------
 
8783
# Minimum version: 1.3.0
 
8784
#
 
8785
# Defines default options for X.Org modules.
 
8786
#
 
8787
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
 
8788
XORG_CWARNFLAGS
 
8789
XORG_STRICT_OPTION
 
8790
XORG_RELEASE_VERSION
 
8791
XORG_CHANGELOG
 
8792
XORG_INSTALL
 
8793
XORG_MANPAGE_SECTIONS
 
8794
]) # XORG_DEFAULT_OPTIONS
 
8795
 
 
8796
# XORG_INSTALL()
 
8797
# ----------------
 
8798
# Minimum version: 1.4.0
 
8799
#
 
8800
# Defines the variable INSTALL_CMD as the command to copy
 
8801
# INSTALL from $prefix/share/util-macros.
 
8802
#
 
8803
AC_DEFUN([XORG_INSTALL], [
 
8804
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
8805
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
 
8806
INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
 
8807
mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
 
8808
|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
 
8809
echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
 
8810
AC_SUBST([INSTALL_CMD])
 
8811
]) # XORG_INSTALL
 
8812
dnl Copyright 2005 Red Hat, Inc
 
8813
dnl
 
8814
dnl Permission to use, copy, modify, distribute, and sell this software and its
 
8815
dnl documentation for any purpose is hereby granted without fee, provided that
 
8816
dnl the above copyright notice appear in all copies and that both that
 
8817
dnl copyright notice and this permission notice appear in supporting
 
8818
dnl documentation.
 
8819
dnl
 
8820
dnl The above copyright notice and this permission notice shall be included
 
8821
dnl in all copies or substantial portions of the Software.
 
8822
dnl
 
8823
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
8824
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
8825
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 
8826
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 
8827
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 
8828
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 
8829
dnl OTHER DEALINGS IN THE SOFTWARE.
 
8830
dnl
 
8831
dnl Except as contained in this notice, the name of the copyright holders shall
 
8832
dnl not be used in advertising or otherwise to promote the sale, use or
 
8833
dnl other dealings in this Software without prior written authorization
 
8834
dnl from the copyright holders.
 
8835
dnl
 
8836
 
 
8837
# XORG_RELEASE_VERSION
 
8838
# --------------------
 
8839
# Adds --with/without-release-string and changes the PACKAGE and
 
8840
# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
 
8841
# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
 
8842
# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
 
8843
 
 
8844
AC_DEFUN([XORG_RELEASE_VERSION],[
 
8845
        AC_ARG_WITH(release-version,
 
8846
                        AS_HELP_STRING([--with-release-version=STRING],
 
8847
                                [Use release version string in package name]),
 
8848
                        [RELEASE_VERSION="$withval"],
 
8849
                        [RELEASE_VERSION=""])
 
8850
        if test "x$RELEASE_VERSION" != "x"; then
 
8851
                PACKAGE="$PACKAGE-$RELEASE_VERSION"
 
8852
                PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
 
8853
                AC_MSG_NOTICE([Building with package name set to $PACKAGE])
 
8854
        fi
 
8855
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
 
8856
                [`echo $PACKAGE_VERSION | cut -d . -f 1`],
 
8857
                [Major version of this package])
 
8858
        PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
 
8859
        if test "x$PVM" = "x"; then
 
8860
                PVM="0"
 
8861
        fi
 
8862
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
 
8863
                [$PVM],
 
8864
                [Minor version of this package])
 
8865
        PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
 
8866
        if test "x$PVP" = "x"; then
 
8867
                PVP="0"
 
8868
        fi
 
8869
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
 
8870
                [$PVP],
 
8871
                [Patch version of this package])
 
8872
])
 
8873
 
 
8874
# XORG_CHANGELOG()
 
8875
# ----------------
 
8876
# Minimum version: 1.2.0
 
8877
#
 
8878
# Defines the variable CHANGELOG_CMD as the command to generate
 
8879
# ChangeLog from git.
 
8880
#
 
8881
#
 
8882
AC_DEFUN([XORG_CHANGELOG], [
 
8883
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
 
8884
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
 
8885
|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
 
8886
echo 'git directory not found: installing possibly empty changelog.' >&2)"
 
8887
AC_SUBST([CHANGELOG_CMD])
 
8888
]) # XORG_CHANGELOG
 
8889
 
 
8890
dnl Copyright 2005 Red Hat, Inc
 
8891
dnl 
 
8892
dnl Permission to use, copy, modify, distribute, and sell this software and its
 
8893
dnl documentation for any purpose is hereby granted without fee, provided that
 
8894
dnl the above copyright notice appear in all copies and that both that
 
8895
dnl copyright notice and this permission notice appear in supporting
 
8896
dnl documentation.
 
8897
dnl 
 
8898
dnl The above copyright notice and this permission notice shall be included
 
8899
dnl in all copies or substantial portions of the Software.
 
8900
dnl 
 
8901
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
8902
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
8903
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 
8904
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 
8905
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 
8906
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 
8907
dnl OTHER DEALINGS IN THE SOFTWARE.
 
8908
dnl 
 
8909
dnl Except as contained in this notice, the name of the copyright holders shall
 
8910
dnl not be used in advertising or otherwise to promote the sale, use or
 
8911
dnl other dealings in this Software without prior written authorization
 
8912
dnl from the copyright holders.
 
8913
dnl 
 
8914
 
 
8915
# XORG_DRIVER_CHECK_EXT()
 
8916
# --------------------------
 
8917
# Checks for the $1 define in xorg-server.h (from the sdk).  If it
 
8918
# is defined, then add $1 to $REQUIRED_MODULES.
 
8919
 
 
8920
AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
 
8921
        SAVE_CFLAGS="$CFLAGS"
 
8922
        CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
 
8923
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
8924
#include "xorg-server.h"
 
8925
#if !defined $1
 
8926
#error $1 not defined
 
8927
#endif
 
8928
                ]])],
 
8929
                [_EXT_CHECK=yes],
 
8930
                [_EXT_CHECK=no])
 
8931
        CFLAGS="$SAVE_CFLAGS"
 
8932
        AC_MSG_CHECKING([if $1 is defined])
 
8933
        AC_MSG_RESULT([$_EXT_CHECK])
 
8934
        if test "$_EXT_CHECK" != no; then
 
8935
                REQUIRED_MODULES="$REQUIRED_MODULES $2"
 
8936
        fi
 
8937
])
 
8938
 
8127
8939
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
8128
8940
#
8129
8941
# This file is free software; the Free Software Foundation
8963
9775
fi
8964
9776
AC_MSG_RESULT(yes)])
8965
9777
 
 
9778
# Copyright (C) 2009  Free Software Foundation, Inc.
 
9779
#
 
9780
# This file is free software; the Free Software Foundation
 
9781
# gives unlimited permission to copy and/or distribute it,
 
9782
# with or without modifications, as long as this notice is preserved.
 
9783
 
 
9784
# serial 1
 
9785
 
 
9786
# AM_SILENT_RULES([DEFAULT])
 
9787
# --------------------------
 
9788
# Enable less verbose build rules; with the default set to DEFAULT
 
9789
# (`yes' being less verbose, `no' or empty being verbose).
 
9790
AC_DEFUN([AM_SILENT_RULES],
 
9791
[AC_ARG_ENABLE([silent-rules],
 
9792
[  --enable-silent-rules          less verbose build output (undo: `make V=1')
 
9793
  --disable-silent-rules         verbose build output (undo: `make V=0')])
 
9794
case $enable_silent_rules in
 
9795
yes) AM_DEFAULT_VERBOSITY=0;;
 
9796
no)  AM_DEFAULT_VERBOSITY=1;;
 
9797
*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
 
9798
esac
 
9799
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
 
9800
AM_BACKSLASH='\'
 
9801
AC_SUBST([AM_BACKSLASH])dnl
 
9802
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 
9803
])
 
9804
 
8966
9805
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8967
9806
#
8968
9807
# This file is free software; the Free Software Foundation
9106
9945
AC_SUBST([am__untar])
9107
9946
]) # _AM_PROG_TAR
9108
9947
 
9109
 
dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9110
 
dnl
9111
 
dnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
9112
 
dnl 
9113
 
dnl Permission is hereby granted, free of charge, to any person obtaining a
9114
 
dnl copy of this software and associated documentation files (the
9115
 
dnl "Software"), to deal in the Software without restriction, including
9116
 
dnl without limitation the rights to use, copy, modify, merge, publish,
9117
 
dnl distribute, and/or sell copies of the Software, and to permit persons
9118
 
dnl to whom the Software is furnished to do so, provided that the above
9119
 
dnl copyright notice(s) and this permission notice appear in all copies of
9120
 
dnl the Software and that both the above copyright notice(s) and this
9121
 
dnl permission notice appear in supporting documentation.
9122
 
dnl
9123
 
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9124
 
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9125
 
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
9126
 
dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
9127
 
dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
9128
 
dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
9129
 
dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
9130
 
dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
9131
 
dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9132
 
dnl
9133
 
dnl Except as contained in this notice, the name of a copyright holder
9134
 
dnl shall not be used in advertising or otherwise to promote the sale, use
9135
 
dnl or other dealings in this Software without prior written authorization
9136
 
dnl of the copyright holder.
9137
 
 
9138
 
# XORG_MACROS_VERSION(required-version)
9139
 
# -------------------------------------
9140
 
# Minimum version: 1.1.0
9141
 
#
9142
 
# If you're using a macro added in Version 1.1 or newer, include this in
9143
 
# your configure.ac with the minimum required version, such as:
9144
 
# XORG_MACROS_VERSION(1.1)
9145
 
#
9146
 
# To ensure that this macro is defined, also add:
9147
 
# m4_ifndef([XORG_MACROS_VERSION],
9148
 
#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9149
 
#
9150
 
#
9151
 
# See the "minimum version" comment for each macro you use to see what 
9152
 
# version you require.
9153
 
m4_defun([XORG_MACROS_VERSION],[
9154
 
m4_define([vers_have], [1.3.0])
9155
 
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9156
 
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9157
 
m4_if(m4_cmp(maj_have, maj_needed), 0,,
9158
 
    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9159
 
m4_if(m4_version_compare(vers_have, [$1]), -1,
9160
 
    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9161
 
m4_undefine([vers_have])
9162
 
m4_undefine([maj_have])
9163
 
m4_undefine([maj_needed])
9164
 
]) # XORG_MACROS_VERSION
9165
 
 
9166
 
# XORG_PROG_RAWCPP()
9167
 
# ------------------
9168
 
# Minimum version: 1.0.0
9169
 
#
9170
 
# Find cpp program and necessary flags for use in pre-processing text files
9171
 
# such as man pages and config files
9172
 
AC_DEFUN([XORG_PROG_RAWCPP],[
9173
 
AC_REQUIRE([AC_PROG_CPP])
9174
 
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9175
 
   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9176
 
 
9177
 
# Check for flag to avoid builtin definitions - assumes unix is predefined,
9178
 
# which is not the best choice for supporting other OS'es, but covers most
9179
 
# of the ones we need for now.
9180
 
AC_MSG_CHECKING([if $RAWCPP requires -undef])
9181
 
AC_LANG_CONFTEST([Does cpp redefine unix ?])
9182
 
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9183
 
        AC_MSG_RESULT([no])
9184
 
else
9185
 
        if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9186
 
                RAWCPPFLAGS=-undef
9187
 
                AC_MSG_RESULT([yes])
9188
 
        # under Cygwin unix is still defined even with -undef
9189
 
        elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9190
 
                RAWCPPFLAGS="-undef -ansi"
9191
 
                AC_MSG_RESULT([yes, with -ansi])
9192
 
        else
9193
 
                AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9194
 
        fi
9195
 
fi
9196
 
rm -f conftest.$ac_ext
9197
 
 
9198
 
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
9199
 
AC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
9200
 
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9201
 
        AC_MSG_RESULT([no])
9202
 
else
9203
 
        if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9204
 
                RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9205
 
                AC_MSG_RESULT([yes])
9206
 
        else
9207
 
                AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9208
 
        fi
9209
 
fi
9210
 
rm -f conftest.$ac_ext
9211
 
AC_SUBST(RAWCPPFLAGS)
9212
 
]) # XORG_PROG_RAWCPP
9213
 
 
9214
 
# XORG_MANPAGE_SECTIONS()
9215
 
# -----------------------
9216
 
# Minimum version: 1.0.0
9217
 
#
9218
 
# Determine which sections man pages go in for the different man page types
9219
 
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9220
 
# Not sure if there's any better way than just hardcoding by OS name.
9221
 
# Override default settings by setting environment variables
9222
 
 
9223
 
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
9224
 
AC_REQUIRE([AC_CANONICAL_HOST])
9225
 
 
9226
 
if test x$APP_MAN_SUFFIX = x    ; then
9227
 
    APP_MAN_SUFFIX=1
9228
 
fi
9229
 
if test x$APP_MAN_DIR = x    ; then
9230
 
    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9231
 
fi
9232
 
 
9233
 
if test x$LIB_MAN_SUFFIX = x    ; then
9234
 
    LIB_MAN_SUFFIX=3
9235
 
fi
9236
 
if test x$LIB_MAN_DIR = x    ; then
9237
 
    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9238
 
fi
9239
 
 
9240
 
if test x$FILE_MAN_SUFFIX = x    ; then
9241
 
    case $host_os in
9242
 
        solaris*)       FILE_MAN_SUFFIX=4  ;;
9243
 
        *)              FILE_MAN_SUFFIX=5  ;;
9244
 
    esac
9245
 
fi
9246
 
if test x$FILE_MAN_DIR = x    ; then
9247
 
    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9248
 
fi
9249
 
 
9250
 
if test x$MISC_MAN_SUFFIX = x    ; then
9251
 
    case $host_os in
9252
 
        solaris*)       MISC_MAN_SUFFIX=5  ;;
9253
 
        *)              MISC_MAN_SUFFIX=7  ;;
9254
 
    esac
9255
 
fi
9256
 
if test x$MISC_MAN_DIR = x    ; then
9257
 
    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9258
 
fi
9259
 
 
9260
 
if test x$DRIVER_MAN_SUFFIX = x    ; then
9261
 
    case $host_os in
9262
 
        solaris*)       DRIVER_MAN_SUFFIX=7  ;;
9263
 
        *)              DRIVER_MAN_SUFFIX=4  ;;
9264
 
    esac
9265
 
fi
9266
 
if test x$DRIVER_MAN_DIR = x    ; then
9267
 
    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9268
 
fi
9269
 
 
9270
 
if test x$ADMIN_MAN_SUFFIX = x    ; then
9271
 
    case $host_os in
9272
 
        solaris*)       ADMIN_MAN_SUFFIX=1m ;;
9273
 
        *)              ADMIN_MAN_SUFFIX=8  ;;
9274
 
    esac
9275
 
fi
9276
 
if test x$ADMIN_MAN_DIR = x    ; then
9277
 
    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9278
 
fi
9279
 
 
9280
 
 
9281
 
AC_SUBST([APP_MAN_SUFFIX])
9282
 
AC_SUBST([LIB_MAN_SUFFIX])
9283
 
AC_SUBST([FILE_MAN_SUFFIX])
9284
 
AC_SUBST([MISC_MAN_SUFFIX])
9285
 
AC_SUBST([DRIVER_MAN_SUFFIX])
9286
 
AC_SUBST([ADMIN_MAN_SUFFIX])
9287
 
AC_SUBST([APP_MAN_DIR])
9288
 
AC_SUBST([LIB_MAN_DIR])
9289
 
AC_SUBST([FILE_MAN_DIR])
9290
 
AC_SUBST([MISC_MAN_DIR])
9291
 
AC_SUBST([DRIVER_MAN_DIR])
9292
 
AC_SUBST([ADMIN_MAN_DIR])
9293
 
]) # XORG_MANPAGE_SECTIONS
9294
 
 
9295
 
# XORG_CHECK_LINUXDOC
9296
 
# -------------------
9297
 
# Minimum version: 1.0.0
9298
 
#
9299
 
# Defines the variable MAKE_TEXT if the necessary tools and
9300
 
# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9301
 
# Whether or not the necessary tools and files are found can be checked
9302
 
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
9303
 
AC_DEFUN([XORG_CHECK_LINUXDOC],[
9304
 
if test x$XORG_SGML_PATH = x ; then
9305
 
    XORG_SGML_PATH=$prefix/share/sgml
9306
 
fi
9307
 
HAVE_DEFS_ENT=
9308
 
 
9309
 
if test x"$cross_compiling" = x"yes" ; then
9310
 
  HAVE_DEFS_ENT=no
9311
 
else
9312
 
  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
9313
 
fi
9314
 
 
9315
 
AC_PATH_PROG(LINUXDOC, linuxdoc)
9316
 
AC_PATH_PROG(PS2PDF, ps2pdf)
9317
 
 
9318
 
AC_MSG_CHECKING([Whether to build documentation])
9319
 
 
9320
 
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
9321
 
   BUILDDOC=yes
9322
 
else
9323
 
   BUILDDOC=no
9324
 
fi
9325
 
 
9326
 
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9327
 
 
9328
 
AC_MSG_RESULT([$BUILDDOC])
9329
 
 
9330
 
AC_MSG_CHECKING([Whether to build pdf documentation])
9331
 
 
9332
 
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
9333
 
   BUILDPDFDOC=yes
9334
 
else
9335
 
   BUILDPDFDOC=no
9336
 
fi
9337
 
 
9338
 
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9339
 
 
9340
 
AC_MSG_RESULT([$BUILDPDFDOC])
9341
 
 
9342
 
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
9343
 
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9344
 
MAKE_PDF="$PS2PDF"
9345
 
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9346
 
 
9347
 
AC_SUBST(MAKE_TEXT)
9348
 
AC_SUBST(MAKE_PS)
9349
 
AC_SUBST(MAKE_PDF)
9350
 
AC_SUBST(MAKE_HTML)
9351
 
]) # XORG_CHECK_LINUXDOC
9352
 
 
9353
 
# XORG_CHECK_DOCBOOK
9354
 
# -------------------
9355
 
# Minimum version: 1.0.0
9356
 
#
9357
 
# Checks for the ability to build output formats from SGML DocBook source.
9358
 
# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9359
 
# indicates whether the necessary tools and files are found and, if set,
9360
 
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
9361
 
AC_DEFUN([XORG_CHECK_DOCBOOK],[
9362
 
if test x$XORG_SGML_PATH = x ; then
9363
 
    XORG_SGML_PATH=$prefix/share/sgml
9364
 
fi
9365
 
HAVE_DEFS_ENT=
9366
 
BUILDTXTDOC=no
9367
 
BUILDPDFDOC=no
9368
 
BUILDPSDOC=no
9369
 
BUILDHTMLDOC=no
9370
 
 
9371
 
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
9372
 
 
9373
 
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
9374
 
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9375
 
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
9376
 
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9377
 
 
9378
 
AC_MSG_CHECKING([Whether to build text documentation])
9379
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
9380
 
   test x$BUILD_TXTDOC != xno; then
9381
 
        BUILDTXTDOC=yes
9382
 
fi
9383
 
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9384
 
AC_MSG_RESULT([$BUILDTXTDOC])
9385
 
 
9386
 
AC_MSG_CHECKING([Whether to build PDF documentation])
9387
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
9388
 
   test x$BUILD_PDFDOC != xno; then
9389
 
        BUILDPDFDOC=yes
9390
 
fi
9391
 
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9392
 
AC_MSG_RESULT([$BUILDPDFDOC])
9393
 
 
9394
 
AC_MSG_CHECKING([Whether to build PostScript documentation])
9395
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
9396
 
   test x$BUILD_PSDOC != xno; then
9397
 
        BUILDPSDOC=yes
9398
 
fi
9399
 
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9400
 
AC_MSG_RESULT([$BUILDPSDOC])
9401
 
 
9402
 
AC_MSG_CHECKING([Whether to build HTML documentation])
9403
 
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
9404
 
   test x$BUILD_HTMLDOC != xno; then
9405
 
        BUILDHTMLDOC=yes
9406
 
fi
9407
 
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9408
 
AC_MSG_RESULT([$BUILDHTMLDOC])
9409
 
 
9410
 
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9411
 
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9412
 
MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9413
 
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9414
 
 
9415
 
AC_SUBST(MAKE_TEXT)
9416
 
AC_SUBST(MAKE_PS)
9417
 
AC_SUBST(MAKE_PDF)
9418
 
AC_SUBST(MAKE_HTML)
9419
 
]) # XORG_CHECK_DOCBOOK
9420
 
 
9421
 
# XORG_CHECK_MALLOC_ZERO
9422
 
# ----------------------
9423
 
# Minimum version: 1.0.0
9424
 
#
9425
 
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
9426
 
# malloc(0) returns NULL.  Packages should add one of these cflags to
9427
 
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
9428
 
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
9429
 
AC_ARG_ENABLE(malloc0returnsnull,
9430
 
        AS_HELP_STRING([--enable-malloc0returnsnull],
9431
 
                       [malloc(0) returns NULL (default: auto)]),
9432
 
        [MALLOC_ZERO_RETURNS_NULL=$enableval],
9433
 
        [MALLOC_ZERO_RETURNS_NULL=auto])
9434
 
 
9435
 
AC_MSG_CHECKING([whether malloc(0) returns NULL])
9436
 
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
9437
 
        AC_RUN_IFELSE([
9438
 
char *malloc();
9439
 
char *realloc();
9440
 
char *calloc();
9441
 
main() {
9442
 
    char *m0, *r0, *c0, *p;
9443
 
    m0 = malloc(0);
9444
 
    p = malloc(10);
9445
 
    r0 = realloc(p,0);
9446
 
    c0 = calloc(0);
9447
 
    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
9448
 
}],
9449
 
                [MALLOC_ZERO_RETURNS_NULL=yes],
9450
 
                [MALLOC_ZERO_RETURNS_NULL=no])
9451
 
fi
9452
 
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
9453
 
 
9454
 
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
9455
 
        MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
9456
 
        XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
9457
 
        XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
9458
 
else
9459
 
        MALLOC_ZERO_CFLAGS=""
9460
 
        XMALLOC_ZERO_CFLAGS=""
9461
 
        XTMALLOC_ZERO_CFLAGS=""
9462
 
fi
9463
 
 
9464
 
AC_SUBST([MALLOC_ZERO_CFLAGS])
9465
 
AC_SUBST([XMALLOC_ZERO_CFLAGS])
9466
 
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
9467
 
]) # XORG_CHECK_MALLOC_ZERO
9468
 
 
9469
 
# XORG_WITH_LINT()
9470
 
# ----------------
9471
 
# Minimum version: 1.1.0
9472
 
#
9473
 
# Sets up flags for source checkers such as lint and sparse if --with-lint
9474
 
# is specified.   (Use --with-lint=sparse for sparse.)
9475
 
# Sets $LINT to name of source checker passed with --with-lint (default: lint)
9476
 
# Sets $LINT_FLAGS to flags to pass to source checker
9477
 
# Sets LINT automake conditional if enabled (default: disabled)
9478
 
#
9479
 
AC_DEFUN([XORG_WITH_LINT],[
9480
 
 
9481
 
# Allow checking code with lint, sparse, etc.
9482
 
AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
9483
 
                [Use a lint-style source code checker (default: disabled)])],
9484
 
                [use_lint=$withval], [use_lint=no])
9485
 
if test "x$use_lint" = "xyes" ; then
9486
 
        LINT="lint"
9487
 
else
9488
 
        LINT="$use_lint"
9489
 
fi
9490
 
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
9491
 
    case $LINT in
9492
 
        lint|*/lint)
9493
 
            case $host_os in
9494
 
                solaris*)
9495
 
                        LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
9496
 
                        ;;
9497
 
            esac
9498
 
            ;;
9499
 
    esac
9500
 
fi
9501
 
 
9502
 
AC_SUBST(LINT)
9503
 
AC_SUBST(LINT_FLAGS)
9504
 
AM_CONDITIONAL(LINT, [test x$LINT != xno])
9505
 
 
9506
 
]) # XORG_WITH_LINT
9507
 
 
9508
 
# XORG_LINT_LIBRARY(LIBNAME)
9509
 
# --------------------------
9510
 
# Minimum version: 1.1.0
9511
 
#
9512
 
# Sets up flags for building lint libraries for checking programs that call
9513
 
# functions in the library.
9514
 
# Disabled by default, enable with --enable-lint-library
9515
 
# Sets: 
9516
 
#       @LINTLIB@               - name of lint library file to make
9517
 
#       MAKE_LINT_LIB           - automake conditional
9518
 
#
9519
 
 
9520
 
AC_DEFUN([XORG_LINT_LIBRARY],[
9521
 
AC_REQUIRE([XORG_WITH_LINT])
9522
 
# Build lint "library" for more indepth checks of programs calling this library
9523
 
AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
9524
 
        [Create lint library (default: disabled)])],
9525
 
        [make_lint_lib=$enableval], [make_lint_lib=no])
9526
 
if test "x$make_lint_lib" != "xno" ; then
9527
 
        if test "x$LINT" = "xno" ; then
9528
 
                AC_MSG_ERROR([Cannot make lint library without --with-lint])
9529
 
        fi
9530
 
        if test "x$make_lint_lib" = "xyes" ; then
9531
 
                LINTLIB=llib-l$1.ln
9532
 
        else
9533
 
                LINTLIB=$make_lint_lib
9534
 
        fi
9535
 
fi
9536
 
AC_SUBST(LINTLIB)
9537
 
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
9538
 
 
9539
 
]) # XORG_LINT_LIBRARY
9540
 
 
9541
 
# XORG_CWARNFLAGS
9542
 
# ---------------
9543
 
# Minimum version: 1.2.0
9544
 
#
9545
 
# Defines CWARNFLAGS to enable C compiler warnings.
9546
 
#
9547
 
AC_DEFUN([XORG_CWARNFLAGS], [
9548
 
AC_REQUIRE([AC_PROG_CC])
9549
 
if  test "x$GCC" = xyes ; then
9550
 
    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
9551
 
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
9552
 
-Wbad-function-cast"
9553
 
    case `$CC -dumpversion` in
9554
 
    3.4.* | 4.*)
9555
 
        CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
9556
 
        ;;
9557
 
    esac
9558
 
else
9559
 
    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
9560
 
    if test "x$SUNCC" = "xyes"; then
9561
 
        CWARNFLAGS="-v"
9562
 
    fi
9563
 
fi
9564
 
AC_SUBST(CWARNFLAGS)
9565
 
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
9566
 
]) # XORG_CWARNFLAGS
9567
 
 
9568
 
# XORG_STRICT_OPTION
9569
 
# -----------------------
9570
 
# Minimum version: 1.3.0
9571
 
#
9572
 
# Add configure option to enable strict compilation
9573
 
AC_DEFUN([XORG_STRICT_OPTION], [
9574
 
AC_REQUIRE([AC_PROG_CC])
9575
 
AC_REQUIRE([AC_PROG_CC_C99])
9576
 
AC_REQUIRE([XORG_CWARNFLAGS])
9577
 
 
9578
 
AC_ARG_ENABLE(strict-compilation,
9579
 
                          AS_HELP_STRING([--enable-strict-compilation],
9580
 
                          [Enable all warnings from compiler and make them errors (default: disabled)]),
9581
 
                          [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
9582
 
if test "x$STRICT_COMPILE" = "xyes"; then
9583
 
        AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
9584
 
        AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
9585
 
        if test "x$GCC" = xyes ; then
9586
 
                STRICT_CFLAGS="-pedantic -Werror"
9587
 
        elif test "x$SUNCC" = "xyes"; then
9588
 
                STRICT_CFLAGS="-errwarn"
9589
 
    elif test "x$INTELCC" = "xyes"; then
9590
 
                STRICT_CFLAGS="-Werror"
9591
 
        fi
9592
 
fi
9593
 
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
9594
 
AC_SUBST([CWARNFLAGS])
9595
 
]) # XORG_STRICT_OPTION
9596
 
 
9597
 
# XORG_DEFAULT_OPTIONS
9598
 
# --------------------
9599
 
# Minimum version: 1.3.0
9600
 
#
9601
 
# Defines default options for X.Org modules.
9602
 
#
9603
 
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
9604
 
XORG_CWARNFLAGS
9605
 
XORG_STRICT_OPTION
9606
 
XORG_RELEASE_VERSION
9607
 
XORG_CHANGELOG
9608
 
XORG_MANPAGE_SECTIONS
9609
 
]) # XORG_DEFAULT_OPTIONS
9610
 
dnl Copyright 2005 Red Hat, Inc
9611
 
dnl
9612
 
dnl Permission to use, copy, modify, distribute, and sell this software and its
9613
 
dnl documentation for any purpose is hereby granted without fee, provided that
9614
 
dnl the above copyright notice appear in all copies and that both that
9615
 
dnl copyright notice and this permission notice appear in supporting
9616
 
dnl documentation.
9617
 
dnl
9618
 
dnl The above copyright notice and this permission notice shall be included
9619
 
dnl in all copies or substantial portions of the Software.
9620
 
dnl
9621
 
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9622
 
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9623
 
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9624
 
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
9625
 
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9626
 
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9627
 
dnl OTHER DEALINGS IN THE SOFTWARE.
9628
 
dnl
9629
 
dnl Except as contained in this notice, the name of the copyright holders shall
9630
 
dnl not be used in advertising or otherwise to promote the sale, use or
9631
 
dnl other dealings in this Software without prior written authorization
9632
 
dnl from the copyright holders.
9633
 
dnl
9634
 
 
9635
 
# XORG_RELEASE_VERSION
9636
 
# --------------------
9637
 
# Adds --with/without-release-string and changes the PACKAGE and
9638
 
# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
9639
 
# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
9640
 
# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
9641
 
 
9642
 
AC_DEFUN([XORG_RELEASE_VERSION],[
9643
 
        AC_ARG_WITH(release-version,
9644
 
                        AS_HELP_STRING([--with-release-version=STRING],
9645
 
                                [Use release version string in package name]),
9646
 
                        [RELEASE_VERSION="$withval"],
9647
 
                        [RELEASE_VERSION=""])
9648
 
        if test "x$RELEASE_VERSION" != "x"; then
9649
 
                PACKAGE="$PACKAGE-$RELEASE_VERSION"
9650
 
                PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
9651
 
                AC_MSG_NOTICE([Building with package name set to $PACKAGE])
9652
 
        fi
9653
 
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
9654
 
                [`echo $PACKAGE_VERSION | cut -d . -f 1`],
9655
 
                [Major version of this package])
9656
 
        PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
9657
 
        if test "x$PVM" = "x"; then
9658
 
                PVM="0"
9659
 
        fi
9660
 
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
9661
 
                [$PVM],
9662
 
                [Minor version of this package])
9663
 
        PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
9664
 
        if test "x$PVP" = "x"; then
9665
 
                PVP="0"
9666
 
        fi
9667
 
        AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
9668
 
                [$PVP],
9669
 
                [Patch version of this package])
9670
 
])
9671
 
 
9672
 
# XORG_CHANGELOG()
9673
 
# ----------------
9674
 
# Minimum version: 1.2.0
9675
 
#
9676
 
# Defines the variable CHANGELOG_CMD as the command to generate
9677
 
# ChangeLog from git.
9678
 
#
9679
 
# Arrange that distcleancheck ignores ChangeLog left over by distclean.
9680
 
#
9681
 
AC_DEFUN([XORG_CHANGELOG], [
9682
 
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
9683
 
mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
9684
 
echo 'git directory not found: installing possibly empty changelog.' >&2)"
9685
 
AC_SUBST([CHANGELOG_CMD])
9686
 
AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
9687
 
]) # XORG_CHANGELOG
9688
 
 
9689
 
dnl Copyright 2005 Red Hat, Inc
9690
 
dnl 
9691
 
dnl Permission to use, copy, modify, distribute, and sell this software and its
9692
 
dnl documentation for any purpose is hereby granted without fee, provided that
9693
 
dnl the above copyright notice appear in all copies and that both that
9694
 
dnl copyright notice and this permission notice appear in supporting
9695
 
dnl documentation.
9696
 
dnl 
9697
 
dnl The above copyright notice and this permission notice shall be included
9698
 
dnl in all copies or substantial portions of the Software.
9699
 
dnl 
9700
 
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9701
 
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9702
 
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9703
 
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
9704
 
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9705
 
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9706
 
dnl OTHER DEALINGS IN THE SOFTWARE.
9707
 
dnl 
9708
 
dnl Except as contained in this notice, the name of the copyright holders shall
9709
 
dnl not be used in advertising or otherwise to promote the sale, use or
9710
 
dnl other dealings in this Software without prior written authorization
9711
 
dnl from the copyright holders.
9712
 
dnl 
9713
 
 
9714
 
# XORG_DRIVER_CHECK_EXT()
9715
 
# --------------------------
9716
 
# Checks for the $1 define in xorg-server.h (from the sdk).  If it
9717
 
# is defined, then add $1 to $REQUIRED_MODULES.
9718
 
 
9719
 
AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
9720
 
        SAVE_CFLAGS="$CFLAGS"
9721
 
        CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
9722
 
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9723
 
#include "xorg-server.h"
9724
 
#if !defined $1
9725
 
#error $1 not defined
9726
 
#endif
9727
 
                ]])],
9728
 
                [_EXT_CHECK=yes],
9729
 
                [_EXT_CHECK=no])
9730
 
        CFLAGS="$SAVE_CFLAGS"
9731
 
        AC_MSG_CHECKING([if $1 is defined])
9732
 
        AC_MSG_RESULT([$_EXT_CHECK])
9733
 
        if test "$_EXT_CHECK" != no; then
9734
 
                REQUIRED_MODULES="$REQUIRED_MODULES $2"
9735
 
        fi
9736
 
])
9737