1565
1565
# See the "minimum version" comment for each macro you use to see what
1566
1566
# version you require.
1567
1567
m4_defun([XORG_MACROS_VERSION],[
1568
m4_define([vers_have], [1.7.0])
1568
m4_define([vers_have], [1.8.0])
1569
1569
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1570
1570
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1571
1571
m4_if(m4_cmp(maj_have, maj_needed), 0,,
1633
1633
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1634
1634
# Not sure if there's any better way than just hardcoding by OS name.
1635
1635
# Override default settings by setting environment variables
1636
# Added MAN_SUBSTS in version 1.8
1637
# Added AC_PROG_SED in version 1.8
1637
1639
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
1638
1640
AC_REQUIRE([AC_CANONICAL_HOST])
1641
AC_REQUIRE([AC_PROG_SED])
1640
1643
if test x$APP_MAN_SUFFIX = x ; then
1641
1644
APP_MAN_SUFFIX=1
1704
1707
AC_SUBST([MISC_MAN_DIR])
1705
1708
AC_SUBST([DRIVER_MAN_DIR])
1706
1709
AC_SUBST([ADMIN_MAN_DIR])
1711
XORG_MAN_PAGE="X Version 11"
1712
AC_SUBST([XORG_MAN_PAGE])
1714
-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1715
-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1716
-e 's|__xservername__|Xorg|g' \
1717
-e 's|__xconfigfile__|xorg.conf|g' \
1718
-e 's|__projectroot__|\$(prefix)|g' \
1719
-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1720
-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1721
-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1722
-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1723
-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1724
-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1725
AC_SUBST([MAN_SUBSTS])
1707
1727
]) # XORG_MANPAGE_SECTIONS
1709
# XORG_CHECK_SGML_DOCTOOLS
1729
# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1710
1730
# ------------------------
1711
1731
# Minimum version: 1.7.0
1713
1733
# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1714
1734
# provided by xorg-sgml-doctools, if installed.
1715
1735
AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1716
AC_MSG_CHECKING([for X.Org SGML entities])
1736
AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1717
1737
XORG_SGML_PATH=
1718
PKG_CHECK_EXISTS([xorg-sgml-doctools],
1738
PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1719
1739
[XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1720
[if test x"$cross_compiling" != x"yes" ; then
1721
AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1722
[XORG_SGML_PATH=$prefix/share/sgml])
1741
[if test x"$cross_compiling" != x"yes" ; then
1742
AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1743
[XORG_SGML_PATH=$prefix/share/sgml])
1725
1747
if test "x$XORG_SGML_PATH" != "x" ; then
1726
1748
AC_MSG_RESULT([$XORG_SGML_PATH])
1741
1763
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1742
1764
AC_DEFUN([XORG_CHECK_LINUXDOC],[
1743
1765
AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1766
AC_REQUIRE([XORG_WITH_PS2PDF])
1745
1768
AC_PATH_PROG(LINUXDOC, linuxdoc)
1746
AC_PATH_PROG(PS2PDF, ps2pdf)
1748
1770
AC_MSG_CHECKING([whether to build documentation])
2381
2403
# ----------------
2382
2404
# Minimum version: 1.1.0
2384
# Sets up flags for source checkers such as lint and sparse if --with-lint
2385
# is specified. (Use --with-lint=sparse for sparse.)
2386
# Sets $LINT to name of source checker passed with --with-lint (default: lint)
2387
# Sets $LINT_FLAGS to flags to pass to source checker
2388
# Sets LINT automake conditional if enabled (default: disabled)
2406
# This macro enables the use of a tool that flags some suspicious and
2407
# non-portable constructs (likely to be bugs) in C language source code.
2408
# It will attempt to locate the tool and use appropriate options.
2409
# There are various lint type tools on different platforms.
2411
# Interface to module:
2412
# LINT: returns the path to the tool found on the platform
2413
# or the value set to LINT on the configure cmd line
2414
# also an Automake conditional
2415
# LINT_FLAGS: an Automake variable with appropriate flags
2417
# --with-lint: 'yes' user instructs the module to use lint
2418
# 'no' user instructs the module not to use lint (default)
2420
# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
2421
# If the user sets the value of LINT_FLAGS, they are used verbatim.
2390
2423
AC_DEFUN([XORG_WITH_LINT],[
2392
# Allow checking code with lint, sparse, etc.
2425
AC_ARG_VAR([LINT], [Path to a lint-style command])
2426
AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
2393
2427
AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
2394
2428
[Use a lint-style source code checker (default: disabled)])],
2395
2429
[use_lint=$withval], [use_lint=no])
2396
if test "x$use_lint" = "xyes" ; then
2431
# Obtain platform specific info like program name and options
2432
# The lint program on FreeBSD and NetBSD is different from the one on Solaris
2434
*linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2436
lint_options="-badflag"
2438
*freebsd* | *netbsd*)
2440
lint_options="-u -b"
2444
lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2448
# Test for the presence of the program (either guessed by the code or spelled out by the user)
2449
if test "x$use_lint" = x"yes" ; then
2450
AC_PATH_PROG([LINT], [$lint_name])
2451
if test "x$LINT" = "x"; then
2452
AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2454
elif test "x$use_lint" = x"no" ; then
2455
if test "x$LINT" != "x"; then
2456
AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2401
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
2406
LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2414
AC_SUBST(LINT_FLAGS)
2415
AM_CONDITIONAL(LINT, [test x$LINT != xno])
2459
AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2462
# User supplied flags override default flags
2463
if test "x$LINT_FLAGS" != "x"; then
2464
lint_options=$LINT_FLAGS
2467
AC_SUBST([LINT_FLAGS],[$lint_options])
2468
AM_CONDITIONAL(LINT, [test "x$LINT" != x])
2417
2470
]) # XORG_WITH_LINT
2423
2476
# Sets up flags for building lint libraries for checking programs that call
2424
2477
# functions in the library.
2425
# Disabled by default, enable with --enable-lint-library
2427
# @LINTLIB@ - name of lint library file to make
2428
# MAKE_LINT_LIB - automake conditional
2479
# Interface to module:
2480
# LINTLIB - Automake variable with the name of lint library file to make
2481
# MAKE_LINT_LIB - Automake conditional
2483
# --enable-lint-library: - 'yes' user instructs the module to created a lint library
2484
# - 'no' user instructs the module not to create a lint library (default)
2431
2486
AC_DEFUN([XORG_LINT_LIBRARY],[
2432
2487
AC_REQUIRE([XORG_WITH_LINT])
2433
# Build lint "library" for more indepth checks of programs calling this library
2434
2488
AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2435
2489
[Create lint library (default: disabled)])],
2436
2490
[make_lint_lib=$enableval], [make_lint_lib=no])
2437
if test "x$make_lint_lib" != "xno" ; then
2438
if test "x$LINT" = "xno" ; then
2439
AC_MSG_ERROR([Cannot make lint library without --with-lint])
2441
if test "x$make_lint_lib" = "xyes" ; then
2444
LINTLIB=$make_lint_lib
2492
if test "x$make_lint_lib" = x"yes" ; then
2494
if test "x$LINT" = "x"; then
2495
AC_MSG_ERROR([Cannot make lint library without --with-lint])
2497
elif test "x$make_lint_lib" != x"no" ; then
2498
AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2447
2501
AC_SUBST(LINTLIB)
2448
2502
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2565
2620
# XORG_RELEASE_VERSION
2566
2621
# --------------------
2567
# Adds --with/without-release-string and changes the PACKAGE and
2568
# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If
2569
# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also
2570
# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2622
# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2572
2624
AC_DEFUN([XORG_RELEASE_VERSION],[
2573
AC_ARG_WITH(release-version,
2574
AS_HELP_STRING([--with-release-version=STRING],
2575
[Use release version string in package name]),
2576
[RELEASE_VERSION="$withval"],
2577
[RELEASE_VERSION=""])
2578
if test "x$RELEASE_VERSION" != "x"; then
2579
PACKAGE="$PACKAGE-$RELEASE_VERSION"
2580
PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
2581
AC_MSG_NOTICE([Building with package name set to $PACKAGE])
2583
2625
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2584
2626
[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2585
2627
[Major version of this package])