aclocal.m4 revision fdb3d228
1fdb3d228Smrg# generated automatically by aclocal 1.7.9 -*- Autoconf -*- 2fdb3d228Smrg 3fdb3d228Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 4fdb3d228Smrg# Free Software Foundation, Inc. 5fdb3d228Smrg# This file is free software; the Free Software Foundation 6fdb3d228Smrg# gives unlimited permission to copy and/or distribute it, 7fdb3d228Smrg# with or without modifications, as long as this notice is preserved. 8fdb3d228Smrg 9fdb3d228Smrg# This program is distributed in the hope that it will be useful, 10fdb3d228Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11fdb3d228Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12fdb3d228Smrg# PARTICULAR PURPOSE. 13fdb3d228Smrg 14fdb3d228Smrg# Do all the work for Automake. -*- Autoconf -*- 15fdb3d228Smrg 16fdb3d228Smrg# This macro actually does too much some checks are only needed if 17fdb3d228Smrg# your package does certain things. But this isn't really a big deal. 18fdb3d228Smrg 19fdb3d228Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 20fdb3d228Smrg# Free Software Foundation, Inc. 21fdb3d228Smrg 22fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 23fdb3d228Smrg# it under the terms of the GNU General Public License as published by 24fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 25fdb3d228Smrg# any later version. 26fdb3d228Smrg 27fdb3d228Smrg# This program is distributed in the hope that it will be useful, 28fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 29fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30fdb3d228Smrg# GNU General Public License for more details. 31fdb3d228Smrg 32fdb3d228Smrg# You should have received a copy of the GNU General Public License 33fdb3d228Smrg# along with this program; if not, write to the Free Software 34fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 35fdb3d228Smrg# 02111-1307, USA. 36fdb3d228Smrg 37fdb3d228Smrg# serial 10 38fdb3d228Smrg 39fdb3d228SmrgAC_PREREQ([2.54]) 40fdb3d228Smrg 41fdb3d228Smrg# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow 42fdb3d228Smrg# the ones we care about. 43fdb3d228Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 44fdb3d228Smrg 45fdb3d228Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 46fdb3d228Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 47fdb3d228Smrg# ----------------------------------------------- 48fdb3d228Smrg# The call with PACKAGE and VERSION arguments is the old style 49fdb3d228Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 50fdb3d228Smrg# and VERSION should now be passed to AC_INIT and removed from 51fdb3d228Smrg# the call to AM_INIT_AUTOMAKE. 52fdb3d228Smrg# We support both call styles for the transition. After 53fdb3d228Smrg# the next Automake release, Autoconf can make the AC_INIT 54fdb3d228Smrg# arguments mandatory, and then we can depend on a new Autoconf 55fdb3d228Smrg# release and drop the old call support. 56fdb3d228SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 57fdb3d228Smrg[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 58fdb3d228Smrg AC_REQUIRE([AC_PROG_INSTALL])dnl 59fdb3d228Smrg# test to see if srcdir already configured 60fdb3d228Smrgif test "`cd $srcdir && pwd`" != "`pwd`" && 61fdb3d228Smrg test -f $srcdir/config.status; then 62fdb3d228Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 63fdb3d228Smrgfi 64fdb3d228Smrg 65fdb3d228Smrg# test whether we have cygpath 66fdb3d228Smrgif test -z "$CYGPATH_W"; then 67fdb3d228Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 68fdb3d228Smrg CYGPATH_W='cygpath -w' 69fdb3d228Smrg else 70fdb3d228Smrg CYGPATH_W=echo 71fdb3d228Smrg fi 72fdb3d228Smrgfi 73fdb3d228SmrgAC_SUBST([CYGPATH_W]) 74fdb3d228Smrg 75fdb3d228Smrg# Define the identity of the package. 76fdb3d228Smrgdnl Distinguish between old-style and new-style calls. 77fdb3d228Smrgm4_ifval([$2], 78fdb3d228Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 79fdb3d228Smrg AC_SUBST([PACKAGE], [$1])dnl 80fdb3d228Smrg AC_SUBST([VERSION], [$2])], 81fdb3d228Smrg[_AM_SET_OPTIONS([$1])dnl 82fdb3d228Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 83fdb3d228Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 84fdb3d228Smrg 85fdb3d228Smrg_AM_IF_OPTION([no-define],, 86fdb3d228Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 87fdb3d228Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 88fdb3d228Smrg 89fdb3d228Smrg# Some tools Automake needs. 90fdb3d228SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 91fdb3d228SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 92fdb3d228SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 93fdb3d228SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 94fdb3d228SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 95fdb3d228SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 96fdb3d228SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 97fdb3d228SmrgAM_MISSING_PROG(AMTAR, tar) 98fdb3d228SmrgAM_PROG_INSTALL_SH 99fdb3d228SmrgAM_PROG_INSTALL_STRIP 100fdb3d228Smrg# We need awk for the "check" target. The system "awk" is bad on 101fdb3d228Smrg# some platforms. 102fdb3d228SmrgAC_REQUIRE([AC_PROG_AWK])dnl 103fdb3d228SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 104fdb3d228SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 105fdb3d228Smrg 106fdb3d228Smrg_AM_IF_OPTION([no-dependencies],, 107fdb3d228Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 108fdb3d228Smrg [_AM_DEPENDENCIES(CC)], 109fdb3d228Smrg [define([AC_PROG_CC], 110fdb3d228Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 111fdb3d228SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 112fdb3d228Smrg [_AM_DEPENDENCIES(CXX)], 113fdb3d228Smrg [define([AC_PROG_CXX], 114fdb3d228Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 115fdb3d228Smrg]) 116fdb3d228Smrg]) 117fdb3d228Smrg 118fdb3d228Smrg 119fdb3d228Smrg# When config.status generates a header, we must update the stamp-h file. 120fdb3d228Smrg# This file resides in the same directory as the config header 121fdb3d228Smrg# that is generated. The stamp files are numbered to have different names. 122fdb3d228Smrg 123fdb3d228Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 124fdb3d228Smrg# loop where config.status creates the headers, so we can generate 125fdb3d228Smrg# our stamp files there. 126fdb3d228SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 127fdb3d228Smrg[# Compute $1's index in $config_headers. 128fdb3d228Smrg_am_stamp_count=1 129fdb3d228Smrgfor _am_header in $config_headers :; do 130fdb3d228Smrg case $_am_header in 131fdb3d228Smrg $1 | $1:* ) 132fdb3d228Smrg break ;; 133fdb3d228Smrg * ) 134fdb3d228Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 135fdb3d228Smrg esac 136fdb3d228Smrgdone 137fdb3d228Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) 138fdb3d228Smrg 139fdb3d228Smrg# Copyright 2002 Free Software Foundation, Inc. 140fdb3d228Smrg 141fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 142fdb3d228Smrg# it under the terms of the GNU General Public License as published by 143fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 144fdb3d228Smrg# any later version. 145fdb3d228Smrg 146fdb3d228Smrg# This program is distributed in the hope that it will be useful, 147fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 148fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 149fdb3d228Smrg# GNU General Public License for more details. 150fdb3d228Smrg 151fdb3d228Smrg# You should have received a copy of the GNU General Public License 152fdb3d228Smrg# along with this program; if not, write to the Free Software 153fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 154fdb3d228Smrg 155fdb3d228Smrg# AM_AUTOMAKE_VERSION(VERSION) 156fdb3d228Smrg# ---------------------------- 157fdb3d228Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 158fdb3d228Smrg# generated from the m4 files accompanying Automake X.Y. 159fdb3d228SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) 160fdb3d228Smrg 161fdb3d228Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 162fdb3d228Smrg# ------------------------------- 163fdb3d228Smrg# Call AM_AUTOMAKE_VERSION so it can be traced. 164fdb3d228Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. 165fdb3d228SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 166fdb3d228Smrg [AM_AUTOMAKE_VERSION([1.7.9])]) 167fdb3d228Smrg 168fdb3d228Smrg# Helper functions for option handling. -*- Autoconf -*- 169fdb3d228Smrg 170fdb3d228Smrg# Copyright 2001, 2002 Free Software Foundation, Inc. 171fdb3d228Smrg 172fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 173fdb3d228Smrg# it under the terms of the GNU General Public License as published by 174fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 175fdb3d228Smrg# any later version. 176fdb3d228Smrg 177fdb3d228Smrg# This program is distributed in the hope that it will be useful, 178fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 179fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 180fdb3d228Smrg# GNU General Public License for more details. 181fdb3d228Smrg 182fdb3d228Smrg# You should have received a copy of the GNU General Public License 183fdb3d228Smrg# along with this program; if not, write to the Free Software 184fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 185fdb3d228Smrg# 02111-1307, USA. 186fdb3d228Smrg 187fdb3d228Smrg# serial 2 188fdb3d228Smrg 189fdb3d228Smrg# _AM_MANGLE_OPTION(NAME) 190fdb3d228Smrg# ----------------------- 191fdb3d228SmrgAC_DEFUN([_AM_MANGLE_OPTION], 192fdb3d228Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 193fdb3d228Smrg 194fdb3d228Smrg# _AM_SET_OPTION(NAME) 195fdb3d228Smrg# ------------------------------ 196fdb3d228Smrg# Set option NAME. Presently that only means defining a flag for this option. 197fdb3d228SmrgAC_DEFUN([_AM_SET_OPTION], 198fdb3d228Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 199fdb3d228Smrg 200fdb3d228Smrg# _AM_SET_OPTIONS(OPTIONS) 201fdb3d228Smrg# ---------------------------------- 202fdb3d228Smrg# OPTIONS is a space-separated list of Automake options. 203fdb3d228SmrgAC_DEFUN([_AM_SET_OPTIONS], 204fdb3d228Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 205fdb3d228Smrg 206fdb3d228Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 207fdb3d228Smrg# ------------------------------------------- 208fdb3d228Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 209fdb3d228SmrgAC_DEFUN([_AM_IF_OPTION], 210fdb3d228Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 211fdb3d228Smrg 212fdb3d228Smrg# 213fdb3d228Smrg# Check to make sure that the build environment is sane. 214fdb3d228Smrg# 215fdb3d228Smrg 216fdb3d228Smrg# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. 217fdb3d228Smrg 218fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 219fdb3d228Smrg# it under the terms of the GNU General Public License as published by 220fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 221fdb3d228Smrg# any later version. 222fdb3d228Smrg 223fdb3d228Smrg# This program is distributed in the hope that it will be useful, 224fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 225fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 226fdb3d228Smrg# GNU General Public License for more details. 227fdb3d228Smrg 228fdb3d228Smrg# You should have received a copy of the GNU General Public License 229fdb3d228Smrg# along with this program; if not, write to the Free Software 230fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 231fdb3d228Smrg# 02111-1307, USA. 232fdb3d228Smrg 233fdb3d228Smrg# serial 3 234fdb3d228Smrg 235fdb3d228Smrg# AM_SANITY_CHECK 236fdb3d228Smrg# --------------- 237fdb3d228SmrgAC_DEFUN([AM_SANITY_CHECK], 238fdb3d228Smrg[AC_MSG_CHECKING([whether build environment is sane]) 239fdb3d228Smrg# Just in case 240fdb3d228Smrgsleep 1 241fdb3d228Smrgecho timestamp > conftest.file 242fdb3d228Smrg# Do `set' in a subshell so we don't clobber the current shell's 243fdb3d228Smrg# arguments. Must try -L first in case configure is actually a 244fdb3d228Smrg# symlink; some systems play weird games with the mod time of symlinks 245fdb3d228Smrg# (eg FreeBSD returns the mod time of the symlink's containing 246fdb3d228Smrg# directory). 247fdb3d228Smrgif ( 248fdb3d228Smrg set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` 249fdb3d228Smrg if test "$[*]" = "X"; then 250fdb3d228Smrg # -L didn't work. 251fdb3d228Smrg set X `ls -t $srcdir/configure conftest.file` 252fdb3d228Smrg fi 253fdb3d228Smrg rm -f conftest.file 254fdb3d228Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 255fdb3d228Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 256fdb3d228Smrg 257fdb3d228Smrg # If neither matched, then we have a broken ls. This can happen 258fdb3d228Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 259fdb3d228Smrg # broken ls alias from the environment. This has actually 260fdb3d228Smrg # happened. Such a system could not be considered "sane". 261fdb3d228Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 262fdb3d228Smrgalias in your environment]) 263fdb3d228Smrg fi 264fdb3d228Smrg 265fdb3d228Smrg test "$[2]" = conftest.file 266fdb3d228Smrg ) 267fdb3d228Smrgthen 268fdb3d228Smrg # Ok. 269fdb3d228Smrg : 270fdb3d228Smrgelse 271fdb3d228Smrg AC_MSG_ERROR([newly created file is older than distributed files! 272fdb3d228SmrgCheck your system clock]) 273fdb3d228Smrgfi 274fdb3d228SmrgAC_MSG_RESULT(yes)]) 275fdb3d228Smrg 276fdb3d228Smrg# -*- Autoconf -*- 277fdb3d228Smrg 278fdb3d228Smrg 279fdb3d228Smrg# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. 280fdb3d228Smrg 281fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 282fdb3d228Smrg# it under the terms of the GNU General Public License as published by 283fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 284fdb3d228Smrg# any later version. 285fdb3d228Smrg 286fdb3d228Smrg# This program is distributed in the hope that it will be useful, 287fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 288fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 289fdb3d228Smrg# GNU General Public License for more details. 290fdb3d228Smrg 291fdb3d228Smrg# You should have received a copy of the GNU General Public License 292fdb3d228Smrg# along with this program; if not, write to the Free Software 293fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 294fdb3d228Smrg# 02111-1307, USA. 295fdb3d228Smrg 296fdb3d228Smrg# serial 3 297fdb3d228Smrg 298fdb3d228Smrg# AM_MISSING_PROG(NAME, PROGRAM) 299fdb3d228Smrg# ------------------------------ 300fdb3d228SmrgAC_DEFUN([AM_MISSING_PROG], 301fdb3d228Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 302fdb3d228Smrg$1=${$1-"${am_missing_run}$2"} 303fdb3d228SmrgAC_SUBST($1)]) 304fdb3d228Smrg 305fdb3d228Smrg 306fdb3d228Smrg# AM_MISSING_HAS_RUN 307fdb3d228Smrg# ------------------ 308fdb3d228Smrg# Define MISSING if not defined so far and test if it supports --run. 309fdb3d228Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 310fdb3d228SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 311fdb3d228Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 312fdb3d228Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" 313fdb3d228Smrg# Use eval to expand $SHELL 314fdb3d228Smrgif eval "$MISSING --run true"; then 315fdb3d228Smrg am_missing_run="$MISSING --run " 316fdb3d228Smrgelse 317fdb3d228Smrg am_missing_run= 318fdb3d228Smrg AC_MSG_WARN([`missing' script is too old or missing]) 319fdb3d228Smrgfi 320fdb3d228Smrg]) 321fdb3d228Smrg 322fdb3d228Smrg# AM_AUX_DIR_EXPAND 323fdb3d228Smrg 324fdb3d228Smrg# Copyright 2001 Free Software Foundation, Inc. 325fdb3d228Smrg 326fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 327fdb3d228Smrg# it under the terms of the GNU General Public License as published by 328fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 329fdb3d228Smrg# any later version. 330fdb3d228Smrg 331fdb3d228Smrg# This program is distributed in the hope that it will be useful, 332fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 333fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 334fdb3d228Smrg# GNU General Public License for more details. 335fdb3d228Smrg 336fdb3d228Smrg# You should have received a copy of the GNU General Public License 337fdb3d228Smrg# along with this program; if not, write to the Free Software 338fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 339fdb3d228Smrg# 02111-1307, USA. 340fdb3d228Smrg 341fdb3d228Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 342fdb3d228Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 343fdb3d228Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 344fdb3d228Smrg# 345fdb3d228Smrg# Of course, Automake must honor this variable whenever it calls a 346fdb3d228Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 347fdb3d228Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 348fdb3d228Smrg# depending on how configure is run. This is pretty annoying, since 349fdb3d228Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 350fdb3d228Smrg# source directory, any form will work fine, but in subdirectories a 351fdb3d228Smrg# relative path needs to be adjusted first. 352fdb3d228Smrg# 353fdb3d228Smrg# $ac_aux_dir/missing 354fdb3d228Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 355fdb3d228Smrg# $top_srcdir/$ac_aux_dir/missing 356fdb3d228Smrg# fails if $ac_aux_dir is absolute, 357fdb3d228Smrg# fails when called from a subdirectory in a VPATH build with 358fdb3d228Smrg# a relative $ac_aux_dir 359fdb3d228Smrg# 360fdb3d228Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 361fdb3d228Smrg# are both prefixed by $srcdir. In an in-source build this is usually 362fdb3d228Smrg# harmless because $srcdir is `.', but things will broke when you 363fdb3d228Smrg# start a VPATH build or use an absolute $srcdir. 364fdb3d228Smrg# 365fdb3d228Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 366fdb3d228Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 367fdb3d228Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 368fdb3d228Smrg# and then we would define $MISSING as 369fdb3d228Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 370fdb3d228Smrg# This will work as long as MISSING is not called from configure, because 371fdb3d228Smrg# unfortunately $(top_srcdir) has no meaning in configure. 372fdb3d228Smrg# However there are other variables, like CC, which are often used in 373fdb3d228Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 374fdb3d228Smrg# 375fdb3d228Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 376fdb3d228Smrg# absolute PATH. The drawback is that using absolute paths prevent a 377fdb3d228Smrg# configured tree to be moved without reconfiguration. 378fdb3d228Smrg 379fdb3d228Smrg# Rely on autoconf to set up CDPATH properly. 380fdb3d228SmrgAC_PREREQ([2.50]) 381fdb3d228Smrg 382fdb3d228SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], [ 383fdb3d228Smrg# expand $ac_aux_dir to an absolute path 384fdb3d228Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 385fdb3d228Smrg]) 386fdb3d228Smrg 387fdb3d228Smrg# AM_PROG_INSTALL_SH 388fdb3d228Smrg# ------------------ 389fdb3d228Smrg# Define $install_sh. 390fdb3d228Smrg 391fdb3d228Smrg# Copyright 2001 Free Software Foundation, Inc. 392fdb3d228Smrg 393fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 394fdb3d228Smrg# it under the terms of the GNU General Public License as published by 395fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 396fdb3d228Smrg# any later version. 397fdb3d228Smrg 398fdb3d228Smrg# This program is distributed in the hope that it will be useful, 399fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 400fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 401fdb3d228Smrg# GNU General Public License for more details. 402fdb3d228Smrg 403fdb3d228Smrg# You should have received a copy of the GNU General Public License 404fdb3d228Smrg# along with this program; if not, write to the Free Software 405fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 406fdb3d228Smrg# 02111-1307, USA. 407fdb3d228Smrg 408fdb3d228SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 409fdb3d228Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 410fdb3d228Smrginstall_sh=${install_sh-"$am_aux_dir/install-sh"} 411fdb3d228SmrgAC_SUBST(install_sh)]) 412fdb3d228Smrg 413fdb3d228Smrg# AM_PROG_INSTALL_STRIP 414fdb3d228Smrg 415fdb3d228Smrg# Copyright 2001 Free Software Foundation, Inc. 416fdb3d228Smrg 417fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 418fdb3d228Smrg# it under the terms of the GNU General Public License as published by 419fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 420fdb3d228Smrg# any later version. 421fdb3d228Smrg 422fdb3d228Smrg# This program is distributed in the hope that it will be useful, 423fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 424fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 425fdb3d228Smrg# GNU General Public License for more details. 426fdb3d228Smrg 427fdb3d228Smrg# You should have received a copy of the GNU General Public License 428fdb3d228Smrg# along with this program; if not, write to the Free Software 429fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 430fdb3d228Smrg# 02111-1307, USA. 431fdb3d228Smrg 432fdb3d228Smrg# One issue with vendor `install' (even GNU) is that you can't 433fdb3d228Smrg# specify the program used to strip binaries. This is especially 434fdb3d228Smrg# annoying in cross-compiling environments, where the build's strip 435fdb3d228Smrg# is unlikely to handle the host's binaries. 436fdb3d228Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 437fdb3d228Smrg# always use install-sh in `make install-strip', and initialize 438fdb3d228Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 439fdb3d228SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 440fdb3d228Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 441fdb3d228Smrg# Installed binaries are usually stripped using `strip' when the user 442fdb3d228Smrg# run `make install-strip'. However `strip' might not be the right 443fdb3d228Smrg# tool to use in cross-compilation environments, therefore Automake 444fdb3d228Smrg# will honor the `STRIP' environment variable to overrule this program. 445fdb3d228Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 446fdb3d228Smrgif test "$cross_compiling" != no; then 447fdb3d228Smrg AC_CHECK_TOOL([STRIP], [strip], :) 448fdb3d228Smrgfi 449fdb3d228SmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" 450fdb3d228SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 451fdb3d228Smrg 452fdb3d228Smrg# -*- Autoconf -*- 453fdb3d228Smrg# Copyright (C) 2003 Free Software Foundation, Inc. 454fdb3d228Smrg 455fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 456fdb3d228Smrg# it under the terms of the GNU General Public License as published by 457fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 458fdb3d228Smrg# any later version. 459fdb3d228Smrg 460fdb3d228Smrg# This program is distributed in the hope that it will be useful, 461fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 462fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 463fdb3d228Smrg# GNU General Public License for more details. 464fdb3d228Smrg 465fdb3d228Smrg# You should have received a copy of the GNU General Public License 466fdb3d228Smrg# along with this program; if not, write to the Free Software 467fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 468fdb3d228Smrg# 02111-1307, USA. 469fdb3d228Smrg 470fdb3d228Smrg# serial 1 471fdb3d228Smrg 472fdb3d228Smrg# Check whether the underlying file-system supports filenames 473fdb3d228Smrg# with a leading dot. For instance MS-DOS doesn't. 474fdb3d228SmrgAC_DEFUN([AM_SET_LEADING_DOT], 475fdb3d228Smrg[rm -rf .tst 2>/dev/null 476fdb3d228Smrgmkdir .tst 2>/dev/null 477fdb3d228Smrgif test -d .tst; then 478fdb3d228Smrg am__leading_dot=. 479fdb3d228Smrgelse 480fdb3d228Smrg am__leading_dot=_ 481fdb3d228Smrgfi 482fdb3d228Smrgrmdir .tst 2>/dev/null 483fdb3d228SmrgAC_SUBST([am__leading_dot])]) 484fdb3d228Smrg 485fdb3d228Smrg# serial 5 -*- Autoconf -*- 486fdb3d228Smrg 487fdb3d228Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 488fdb3d228Smrg 489fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 490fdb3d228Smrg# it under the terms of the GNU General Public License as published by 491fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 492fdb3d228Smrg# any later version. 493fdb3d228Smrg 494fdb3d228Smrg# This program is distributed in the hope that it will be useful, 495fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 496fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 497fdb3d228Smrg# GNU General Public License for more details. 498fdb3d228Smrg 499fdb3d228Smrg# You should have received a copy of the GNU General Public License 500fdb3d228Smrg# along with this program; if not, write to the Free Software 501fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 502fdb3d228Smrg# 02111-1307, USA. 503fdb3d228Smrg 504fdb3d228Smrg 505fdb3d228Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 506fdb3d228Smrg# written in clear, in which case automake, when reading aclocal.m4, 507fdb3d228Smrg# will think it sees a *use*, and therefore will trigger all it's 508fdb3d228Smrg# C support machinery. Also note that it means that autoscan, seeing 509fdb3d228Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 510fdb3d228Smrg 511fdb3d228Smrg 512fdb3d228Smrg 513fdb3d228Smrg# _AM_DEPENDENCIES(NAME) 514fdb3d228Smrg# ---------------------- 515fdb3d228Smrg# See how the compiler implements dependency checking. 516fdb3d228Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 517fdb3d228Smrg# We try a few techniques and use that to set a single cache variable. 518fdb3d228Smrg# 519fdb3d228Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 520fdb3d228Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 521fdb3d228Smrg# dependency, and given that the user is not expected to run this macro, 522fdb3d228Smrg# just rely on AC_PROG_CC. 523fdb3d228SmrgAC_DEFUN([_AM_DEPENDENCIES], 524fdb3d228Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 525fdb3d228SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 526fdb3d228SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 527fdb3d228SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 528fdb3d228Smrg 529fdb3d228Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 530fdb3d228Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 531fdb3d228Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 532fdb3d228Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 533fdb3d228Smrg [depcc="$$1" am_compiler_list=]) 534fdb3d228Smrg 535fdb3d228SmrgAC_CACHE_CHECK([dependency style of $depcc], 536fdb3d228Smrg [am_cv_$1_dependencies_compiler_type], 537fdb3d228Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 538fdb3d228Smrg # We make a subdir and do the tests there. Otherwise we can end up 539fdb3d228Smrg # making bogus files that we don't know about and never remove. For 540fdb3d228Smrg # instance it was reported that on HP-UX the gcc test will end up 541fdb3d228Smrg # making a dummy file named `D' -- because `-MD' means `put the output 542fdb3d228Smrg # in D'. 543fdb3d228Smrg mkdir conftest.dir 544fdb3d228Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 545fdb3d228Smrg # using a relative directory. 546fdb3d228Smrg cp "$am_depcomp" conftest.dir 547fdb3d228Smrg cd conftest.dir 548fdb3d228Smrg # We will build objects and dependencies in a subdirectory because 549fdb3d228Smrg # it helps to detect inapplicable dependency modes. For instance 550fdb3d228Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 551fdb3d228Smrg # side effect of compilation, but ICC will put the dependencies in 552fdb3d228Smrg # the current directory while Tru64 will put them in the object 553fdb3d228Smrg # directory. 554fdb3d228Smrg mkdir sub 555fdb3d228Smrg 556fdb3d228Smrg am_cv_$1_dependencies_compiler_type=none 557fdb3d228Smrg if test "$am_compiler_list" = ""; then 558fdb3d228Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 559fdb3d228Smrg fi 560fdb3d228Smrg for depmode in $am_compiler_list; do 561fdb3d228Smrg # Setup a source with many dependencies, because some compilers 562fdb3d228Smrg # like to wrap large dependency lists on column 80 (with \), and 563fdb3d228Smrg # we should not choose a depcomp mode which is confused by this. 564fdb3d228Smrg # 565fdb3d228Smrg # We need to recreate these files for each test, as the compiler may 566fdb3d228Smrg # overwrite some of them when testing with obscure command lines. 567fdb3d228Smrg # This happens at least with the AIX C compiler. 568fdb3d228Smrg : > sub/conftest.c 569fdb3d228Smrg for i in 1 2 3 4 5 6; do 570fdb3d228Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 571fdb3d228Smrg : > sub/conftst$i.h 572fdb3d228Smrg done 573fdb3d228Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 574fdb3d228Smrg 575fdb3d228Smrg case $depmode in 576fdb3d228Smrg nosideeffect) 577fdb3d228Smrg # after this tag, mechanisms are not by side-effect, so they'll 578fdb3d228Smrg # only be used when explicitly requested 579fdb3d228Smrg if test "x$enable_dependency_tracking" = xyes; then 580fdb3d228Smrg continue 581fdb3d228Smrg else 582fdb3d228Smrg break 583fdb3d228Smrg fi 584fdb3d228Smrg ;; 585fdb3d228Smrg none) break ;; 586fdb3d228Smrg esac 587fdb3d228Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 588fdb3d228Smrg # mode. It turns out that the SunPro C++ compiler does not properly 589fdb3d228Smrg # handle `-M -o', and we need to detect this. 590fdb3d228Smrg if depmode=$depmode \ 591fdb3d228Smrg source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ 592fdb3d228Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 593fdb3d228Smrg $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ 594fdb3d228Smrg >/dev/null 2>conftest.err && 595fdb3d228Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 596fdb3d228Smrg grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && 597fdb3d228Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 598fdb3d228Smrg # icc doesn't choke on unknown options, it will just issue warnings 599fdb3d228Smrg # (even with -Werror). So we grep stderr for any message 600fdb3d228Smrg # that says an option was ignored. 601fdb3d228Smrg if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else 602fdb3d228Smrg am_cv_$1_dependencies_compiler_type=$depmode 603fdb3d228Smrg break 604fdb3d228Smrg fi 605fdb3d228Smrg fi 606fdb3d228Smrg done 607fdb3d228Smrg 608fdb3d228Smrg cd .. 609fdb3d228Smrg rm -rf conftest.dir 610fdb3d228Smrgelse 611fdb3d228Smrg am_cv_$1_dependencies_compiler_type=none 612fdb3d228Smrgfi 613fdb3d228Smrg]) 614fdb3d228SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 615fdb3d228SmrgAM_CONDITIONAL([am__fastdep$1], [ 616fdb3d228Smrg test "x$enable_dependency_tracking" != xno \ 617fdb3d228Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 618fdb3d228Smrg]) 619fdb3d228Smrg 620fdb3d228Smrg 621fdb3d228Smrg# AM_SET_DEPDIR 622fdb3d228Smrg# ------------- 623fdb3d228Smrg# Choose a directory name for dependency files. 624fdb3d228Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 625fdb3d228SmrgAC_DEFUN([AM_SET_DEPDIR], 626fdb3d228Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 627fdb3d228SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 628fdb3d228Smrg]) 629fdb3d228Smrg 630fdb3d228Smrg 631fdb3d228Smrg# AM_DEP_TRACK 632fdb3d228Smrg# ------------ 633fdb3d228SmrgAC_DEFUN([AM_DEP_TRACK], 634fdb3d228Smrg[AC_ARG_ENABLE(dependency-tracking, 635fdb3d228Smrg[ --disable-dependency-tracking Speeds up one-time builds 636fdb3d228Smrg --enable-dependency-tracking Do not reject slow dependency extractors]) 637fdb3d228Smrgif test "x$enable_dependency_tracking" != xno; then 638fdb3d228Smrg am_depcomp="$ac_aux_dir/depcomp" 639fdb3d228Smrg AMDEPBACKSLASH='\' 640fdb3d228Smrgfi 641fdb3d228SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 642fdb3d228SmrgAC_SUBST([AMDEPBACKSLASH]) 643fdb3d228Smrg]) 644fdb3d228Smrg 645fdb3d228Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 646fdb3d228Smrg 647fdb3d228Smrg# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 648fdb3d228Smrg 649fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 650fdb3d228Smrg# it under the terms of the GNU General Public License as published by 651fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 652fdb3d228Smrg# any later version. 653fdb3d228Smrg 654fdb3d228Smrg# This program is distributed in the hope that it will be useful, 655fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 656fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 657fdb3d228Smrg# GNU General Public License for more details. 658fdb3d228Smrg 659fdb3d228Smrg# You should have received a copy of the GNU General Public License 660fdb3d228Smrg# along with this program; if not, write to the Free Software 661fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 662fdb3d228Smrg# 02111-1307, USA. 663fdb3d228Smrg 664fdb3d228Smrg#serial 2 665fdb3d228Smrg 666fdb3d228Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 667fdb3d228Smrg# ------------------------------ 668fdb3d228SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 669fdb3d228Smrg[for mf in $CONFIG_FILES; do 670fdb3d228Smrg # Strip MF so we end up with the name of the file. 671fdb3d228Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 672fdb3d228Smrg # Check whether this is an Automake generated Makefile or not. 673fdb3d228Smrg # We used to match only the files named `Makefile.in', but 674fdb3d228Smrg # some people rename them; so instead we look at the file content. 675fdb3d228Smrg # Grep'ing the first line is not enough: some people post-process 676fdb3d228Smrg # each Makefile.in and add a new line on top of each file to say so. 677fdb3d228Smrg # So let's grep whole file. 678fdb3d228Smrg if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then 679fdb3d228Smrg dirpart=`AS_DIRNAME("$mf")` 680fdb3d228Smrg else 681fdb3d228Smrg continue 682fdb3d228Smrg fi 683fdb3d228Smrg grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue 684fdb3d228Smrg # Extract the definition of DEP_FILES from the Makefile without 685fdb3d228Smrg # running `make'. 686fdb3d228Smrg DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` 687fdb3d228Smrg test -z "$DEPDIR" && continue 688fdb3d228Smrg # When using ansi2knr, U may be empty or an underscore; expand it 689fdb3d228Smrg U=`sed -n -e '/^U = / s///p' < "$mf"` 690fdb3d228Smrg test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" 691fdb3d228Smrg # We invoke sed twice because it is the simplest approach to 692fdb3d228Smrg # changing $(DEPDIR) to its actual value in the expansion. 693fdb3d228Smrg for file in `sed -n -e ' 694fdb3d228Smrg /^DEP_FILES = .*\\\\$/ { 695fdb3d228Smrg s/^DEP_FILES = // 696fdb3d228Smrg :loop 697fdb3d228Smrg s/\\\\$// 698fdb3d228Smrg p 699fdb3d228Smrg n 700fdb3d228Smrg /\\\\$/ b loop 701fdb3d228Smrg p 702fdb3d228Smrg } 703fdb3d228Smrg /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ 704fdb3d228Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 705fdb3d228Smrg # Make sure the directory exists. 706fdb3d228Smrg test -f "$dirpart/$file" && continue 707fdb3d228Smrg fdir=`AS_DIRNAME(["$file"])` 708fdb3d228Smrg AS_MKDIR_P([$dirpart/$fdir]) 709fdb3d228Smrg # echo "creating $dirpart/$file" 710fdb3d228Smrg echo '# dummy' > "$dirpart/$file" 711fdb3d228Smrg done 712fdb3d228Smrgdone 713fdb3d228Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 714fdb3d228Smrg 715fdb3d228Smrg 716fdb3d228Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 717fdb3d228Smrg# ----------------------------- 718fdb3d228Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 719fdb3d228Smrg# 720fdb3d228Smrg# This code is only required when automatic dependency tracking 721fdb3d228Smrg# is enabled. FIXME. This creates each `.P' file that we will 722fdb3d228Smrg# need in order to bootstrap the dependency handling code. 723fdb3d228SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 724fdb3d228Smrg[AC_CONFIG_COMMANDS([depfiles], 725fdb3d228Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 726fdb3d228Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 727fdb3d228Smrg]) 728fdb3d228Smrg 729fdb3d228Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 730fdb3d228Smrg 731fdb3d228Smrg# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. 732fdb3d228Smrg 733fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 734fdb3d228Smrg# it under the terms of the GNU General Public License as published by 735fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 736fdb3d228Smrg# any later version. 737fdb3d228Smrg 738fdb3d228Smrg# This program is distributed in the hope that it will be useful, 739fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 740fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 741fdb3d228Smrg# GNU General Public License for more details. 742fdb3d228Smrg 743fdb3d228Smrg# You should have received a copy of the GNU General Public License 744fdb3d228Smrg# along with this program; if not, write to the Free Software 745fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 746fdb3d228Smrg# 02111-1307, USA. 747fdb3d228Smrg 748fdb3d228Smrg# serial 2 749fdb3d228Smrg 750fdb3d228Smrg# AM_MAKE_INCLUDE() 751fdb3d228Smrg# ----------------- 752fdb3d228Smrg# Check to see how make treats includes. 753fdb3d228SmrgAC_DEFUN([AM_MAKE_INCLUDE], 754fdb3d228Smrg[am_make=${MAKE-make} 755fdb3d228Smrgcat > confinc << 'END' 756fdb3d228Smrgam__doit: 757fdb3d228Smrg @echo done 758fdb3d228Smrg.PHONY: am__doit 759fdb3d228SmrgEND 760fdb3d228Smrg# If we don't find an include directive, just comment out the code. 761fdb3d228SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 762fdb3d228Smrgam__include="#" 763fdb3d228Smrgam__quote= 764fdb3d228Smrg_am_result=none 765fdb3d228Smrg# First try GNU make style include. 766fdb3d228Smrgecho "include confinc" > confmf 767fdb3d228Smrg# We grep out `Entering directory' and `Leaving directory' 768fdb3d228Smrg# messages which can occur if `w' ends up in MAKEFLAGS. 769fdb3d228Smrg# In particular we don't look at `^make:' because GNU make might 770fdb3d228Smrg# be invoked under some other name (usually "gmake"), in which 771fdb3d228Smrg# case it prints its new name instead of `make'. 772fdb3d228Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then 773fdb3d228Smrg am__include=include 774fdb3d228Smrg am__quote= 775fdb3d228Smrg _am_result=GNU 776fdb3d228Smrgfi 777fdb3d228Smrg# Now try BSD make style include. 778fdb3d228Smrgif test "$am__include" = "#"; then 779fdb3d228Smrg echo '.include "confinc"' > confmf 780fdb3d228Smrg if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then 781fdb3d228Smrg am__include=.include 782fdb3d228Smrg am__quote="\"" 783fdb3d228Smrg _am_result=BSD 784fdb3d228Smrg fi 785fdb3d228Smrgfi 786fdb3d228SmrgAC_SUBST([am__include]) 787fdb3d228SmrgAC_SUBST([am__quote]) 788fdb3d228SmrgAC_MSG_RESULT([$_am_result]) 789fdb3d228Smrgrm -f confinc confmf 790fdb3d228Smrg]) 791fdb3d228Smrg 792fdb3d228Smrg# AM_CONDITIONAL -*- Autoconf -*- 793fdb3d228Smrg 794fdb3d228Smrg# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. 795fdb3d228Smrg 796fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 797fdb3d228Smrg# it under the terms of the GNU General Public License as published by 798fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 799fdb3d228Smrg# any later version. 800fdb3d228Smrg 801fdb3d228Smrg# This program is distributed in the hope that it will be useful, 802fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 803fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 804fdb3d228Smrg# GNU General Public License for more details. 805fdb3d228Smrg 806fdb3d228Smrg# You should have received a copy of the GNU General Public License 807fdb3d228Smrg# along with this program; if not, write to the Free Software 808fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 809fdb3d228Smrg# 02111-1307, USA. 810fdb3d228Smrg 811fdb3d228Smrg# serial 5 812fdb3d228Smrg 813fdb3d228SmrgAC_PREREQ(2.52) 814fdb3d228Smrg 815fdb3d228Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 816fdb3d228Smrg# ------------------------------------- 817fdb3d228Smrg# Define a conditional. 818fdb3d228SmrgAC_DEFUN([AM_CONDITIONAL], 819fdb3d228Smrg[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 820fdb3d228Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 821fdb3d228SmrgAC_SUBST([$1_TRUE]) 822fdb3d228SmrgAC_SUBST([$1_FALSE]) 823fdb3d228Smrgif $2; then 824fdb3d228Smrg $1_TRUE= 825fdb3d228Smrg $1_FALSE='#' 826fdb3d228Smrgelse 827fdb3d228Smrg $1_TRUE='#' 828fdb3d228Smrg $1_FALSE= 829fdb3d228Smrgfi 830fdb3d228SmrgAC_CONFIG_COMMANDS_PRE( 831fdb3d228Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 832fdb3d228Smrg AC_MSG_ERROR([conditional "$1" was never defined. 833fdb3d228SmrgUsually this means the macro was only invoked conditionally.]) 834fdb3d228Smrgfi])]) 835fdb3d228Smrg 836fdb3d228Smrg# Add --enable-maintainer-mode option to configure. 837fdb3d228Smrg# From Jim Meyering 838fdb3d228Smrg 839fdb3d228Smrg# Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. 840fdb3d228Smrg 841fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 842fdb3d228Smrg# it under the terms of the GNU General Public License as published by 843fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 844fdb3d228Smrg# any later version. 845fdb3d228Smrg 846fdb3d228Smrg# This program is distributed in the hope that it will be useful, 847fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 848fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 849fdb3d228Smrg# GNU General Public License for more details. 850fdb3d228Smrg 851fdb3d228Smrg# You should have received a copy of the GNU General Public License 852fdb3d228Smrg# along with this program; if not, write to the Free Software 853fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 854fdb3d228Smrg# 02111-1307, USA. 855fdb3d228Smrg 856fdb3d228Smrg# serial 2 857fdb3d228Smrg 858fdb3d228SmrgAC_DEFUN([AM_MAINTAINER_MODE], 859fdb3d228Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) 860fdb3d228Smrg dnl maintainer-mode is disabled by default 861fdb3d228Smrg AC_ARG_ENABLE(maintainer-mode, 862fdb3d228Smrg[ --enable-maintainer-mode enable make rules and dependencies not useful 863fdb3d228Smrg (and sometimes confusing) to the casual installer], 864fdb3d228Smrg USE_MAINTAINER_MODE=$enableval, 865fdb3d228Smrg USE_MAINTAINER_MODE=no) 866fdb3d228Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 867fdb3d228Smrg AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) 868fdb3d228Smrg MAINT=$MAINTAINER_MODE_TRUE 869fdb3d228Smrg AC_SUBST(MAINT)dnl 870fdb3d228Smrg] 871fdb3d228Smrg) 872fdb3d228Smrg 873fdb3d228SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 874fdb3d228Smrg 875fdb3d228Smrg# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- 876fdb3d228Smrg 877fdb3d228Smrg# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. 878fdb3d228Smrg 879fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 880fdb3d228Smrg# it under the terms of the GNU General Public License as published by 881fdb3d228Smrg# the Free Software Foundation; either version 2, or (at your option) 882fdb3d228Smrg# any later version. 883fdb3d228Smrg 884fdb3d228Smrg# This program is distributed in the hope that it will be useful, 885fdb3d228Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 886fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 887fdb3d228Smrg# GNU General Public License for more details. 888fdb3d228Smrg 889fdb3d228Smrg# You should have received a copy of the GNU General Public License 890fdb3d228Smrg# along with this program; if not, write to the Free Software 891fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 892fdb3d228Smrg# 02111-1307, USA. 893fdb3d228Smrg 894fdb3d228SmrgAC_PREREQ([2.52]) 895fdb3d228Smrg 896fdb3d228Smrg# serial 6 897fdb3d228Smrg 898fdb3d228Smrg# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 899fdb3d228SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 900fdb3d228Smrg 901fdb3d228Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 902fdb3d228Smrg# 903fdb3d228Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 904fdb3d228Smrg# 905fdb3d228Smrg# This program is free software; you can redistribute it and/or modify 906fdb3d228Smrg# it under the terms of the GNU General Public License as published by 907fdb3d228Smrg# the Free Software Foundation; either version 2 of the License, or 908fdb3d228Smrg# (at your option) any later version. 909fdb3d228Smrg# 910fdb3d228Smrg# This program is distributed in the hope that it will be useful, but 911fdb3d228Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 912fdb3d228Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 913fdb3d228Smrg# General Public License for more details. 914fdb3d228Smrg# 915fdb3d228Smrg# You should have received a copy of the GNU General Public License 916fdb3d228Smrg# along with this program; if not, write to the Free Software 917fdb3d228Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 918fdb3d228Smrg# 919fdb3d228Smrg# As a special exception to the GNU General Public License, if you 920fdb3d228Smrg# distribute this file as part of a program that contains a 921fdb3d228Smrg# configuration script generated by Autoconf, you may include it under 922fdb3d228Smrg# the same distribution terms that you use for the rest of that program. 923fdb3d228Smrg 924fdb3d228Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 925fdb3d228Smrg# ---------------------------------- 926fdb3d228SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 927fdb3d228Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 928fdb3d228Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 929fdb3d228SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 930fdb3d228Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 931fdb3d228Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 932fdb3d228Smrgfi 933fdb3d228Smrgif test -n "$PKG_CONFIG"; then 934fdb3d228Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 935fdb3d228Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 936fdb3d228Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 937fdb3d228Smrg AC_MSG_RESULT([yes]) 938fdb3d228Smrg else 939fdb3d228Smrg AC_MSG_RESULT([no]) 940fdb3d228Smrg PKG_CONFIG="" 941fdb3d228Smrg fi 942fdb3d228Smrg 943fdb3d228Smrgfi[]dnl 944fdb3d228Smrg])# PKG_PROG_PKG_CONFIG 945fdb3d228Smrg 946fdb3d228Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 947fdb3d228Smrg# 948fdb3d228Smrg# Check to see whether a particular set of modules exists. Similar 949fdb3d228Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 950fdb3d228Smrg# 951fdb3d228Smrg# 952fdb3d228Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 953fdb3d228Smrg# this or PKG_CHECK_MODULES is called, or make sure to call 954fdb3d228Smrg# PKG_CHECK_EXISTS manually 955fdb3d228Smrg# -------------------------------------------------------------- 956fdb3d228SmrgAC_DEFUN([PKG_CHECK_EXISTS], 957fdb3d228Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 958fdb3d228Smrgif test -n "$PKG_CONFIG" && \ 959fdb3d228Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 960fdb3d228Smrg m4_ifval([$2], [$2], [:]) 961fdb3d228Smrgm4_ifvaln([$3], [else 962fdb3d228Smrg $3])dnl 963fdb3d228Smrgfi]) 964fdb3d228Smrg 965fdb3d228Smrg 966fdb3d228Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 967fdb3d228Smrg# --------------------------------------------- 968fdb3d228Smrgm4_define([_PKG_CONFIG], 969fdb3d228Smrg[if test -n "$PKG_CONFIG"; then 970fdb3d228Smrg if test -n "$$1"; then 971fdb3d228Smrg pkg_cv_[]$1="$$1" 972fdb3d228Smrg else 973fdb3d228Smrg PKG_CHECK_EXISTS([$3], 974fdb3d228Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 975fdb3d228Smrg [pkg_failed=yes]) 976fdb3d228Smrg fi 977fdb3d228Smrgelse 978fdb3d228Smrg pkg_failed=untried 979fdb3d228Smrgfi[]dnl 980fdb3d228Smrg])# _PKG_CONFIG 981fdb3d228Smrg 982fdb3d228Smrg# _PKG_SHORT_ERRORS_SUPPORTED 983fdb3d228Smrg# ----------------------------- 984fdb3d228SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 985fdb3d228Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 986fdb3d228Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 987fdb3d228Smrg _pkg_short_errors_supported=yes 988fdb3d228Smrgelse 989fdb3d228Smrg _pkg_short_errors_supported=no 990fdb3d228Smrgfi[]dnl 991fdb3d228Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 992fdb3d228Smrg 993fdb3d228Smrg 994fdb3d228Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 995fdb3d228Smrg# [ACTION-IF-NOT-FOUND]) 996fdb3d228Smrg# 997fdb3d228Smrg# 998fdb3d228Smrg# Note that if there is a possibility the first call to 999fdb3d228Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 1000fdb3d228Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 1001fdb3d228Smrg# 1002fdb3d228Smrg# 1003fdb3d228Smrg# -------------------------------------------------------------- 1004fdb3d228SmrgAC_DEFUN([PKG_CHECK_MODULES], 1005fdb3d228Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1006fdb3d228SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 1007fdb3d228SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 1008fdb3d228Smrg 1009fdb3d228Smrgpkg_failed=no 1010fdb3d228SmrgAC_MSG_CHECKING([for $1]) 1011fdb3d228Smrg 1012fdb3d228Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 1013fdb3d228Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 1014fdb3d228Smrg 1015fdb3d228Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 1016fdb3d228Smrgand $1[]_LIBS to avoid the need to call pkg-config. 1017fdb3d228SmrgSee the pkg-config man page for more details.]) 1018fdb3d228Smrg 1019fdb3d228Smrgif test $pkg_failed = yes; then 1020fdb3d228Smrg _PKG_SHORT_ERRORS_SUPPORTED 1021fdb3d228Smrg if test $_pkg_short_errors_supported = yes; then 1022fdb3d228Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` 1023fdb3d228Smrg else 1024fdb3d228Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` 1025fdb3d228Smrg fi 1026fdb3d228Smrg # Put the nasty error message in config.log where it belongs 1027fdb3d228Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 1028fdb3d228Smrg 1029fdb3d228Smrg ifelse([$4], , [AC_MSG_ERROR(dnl 1030fdb3d228Smrg[Package requirements ($2) were not met: 1031fdb3d228Smrg 1032fdb3d228Smrg$$1_PKG_ERRORS 1033fdb3d228Smrg 1034fdb3d228SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 1035fdb3d228Smrginstalled software in a non-standard prefix. 1036fdb3d228Smrg 1037fdb3d228Smrg_PKG_TEXT 1038fdb3d228Smrg])], 1039fdb3d228Smrg [$4]) 1040fdb3d228Smrgelif test $pkg_failed = untried; then 1041fdb3d228Smrg ifelse([$4], , [AC_MSG_FAILURE(dnl 1042fdb3d228Smrg[The pkg-config script could not be found or is too old. Make sure it 1043fdb3d228Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 1044fdb3d228Smrgpath to pkg-config. 1045fdb3d228Smrg 1046fdb3d228Smrg_PKG_TEXT 1047fdb3d228Smrg 1048fdb3d228SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], 1049fdb3d228Smrg [$4]) 1050fdb3d228Smrgelse 1051fdb3d228Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 1052fdb3d228Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 1053fdb3d228Smrg AC_MSG_RESULT([yes]) 1054fdb3d228Smrg ifelse([$3], , :, [$3]) 1055fdb3d228Smrgfi[]dnl 1056fdb3d228Smrg])# PKG_CHECK_MODULES 1057fdb3d228Smrg 1058fdb3d228Smrgdnl $Id: aclocal.m4,v 1.1.1.1 2008/07/30 04:27:20 mrg Exp $ 1059fdb3d228Smrgdnl 1060fdb3d228Smrgdnl Copyright 2005 Sun Microsystems, Inc. All rights reserved. 1061fdb3d228Smrgdnl 1062fdb3d228Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 1063fdb3d228Smrgdnl documentation for any purpose is hereby granted without fee, provided that 1064fdb3d228Smrgdnl the above copyright notice appear in all copies and that both that 1065fdb3d228Smrgdnl copyright notice and this permission notice appear in supporting 1066fdb3d228Smrgdnl documentation. 1067fdb3d228Smrgdnl 1068fdb3d228Smrgdnl The above copyright notice and this permission notice shall be included 1069fdb3d228Smrgdnl in all copies or substantial portions of the Software. 1070fdb3d228Smrgdnl 1071fdb3d228Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1072fdb3d228Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1073fdb3d228Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 1074fdb3d228Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 1075fdb3d228Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 1076fdb3d228Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 1077fdb3d228Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 1078fdb3d228Smrgdnl 1079fdb3d228Smrgdnl Except as contained in this notice, the name of the copyright holders shall 1080fdb3d228Smrgdnl not be used in advertising or otherwise to promote the sale, use or 1081fdb3d228Smrgdnl other dealings in this Software without prior written authorization 1082fdb3d228Smrgdnl from the copyright holders. 1083fdb3d228Smrgdnl 1084fdb3d228Smrg 1085fdb3d228Smrg# XORG_PROG_RAWCPP() 1086fdb3d228Smrg# ------------------ 1087fdb3d228Smrg# Find cpp program and necessary flags for use in pre-processing text files 1088fdb3d228Smrg# such as man pages and config files 1089fdb3d228SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 1090fdb3d228SmrgAC_REQUIRE([AC_PROG_CPP]) 1091fdb3d228SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 1092fdb3d228Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 1093fdb3d228Smrg 1094fdb3d228Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 1095fdb3d228Smrg# which is not the best choice for supporting other OS'es, but covers most 1096fdb3d228Smrg# of the ones we need for now. 1097fdb3d228SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 1098fdb3d228SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 1099fdb3d228Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1100fdb3d228Smrg AC_MSG_RESULT([no]) 1101fdb3d228Smrgelse 1102fdb3d228Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1103fdb3d228Smrg RAWCPPFLAGS=-undef 1104fdb3d228Smrg AC_MSG_RESULT([yes]) 1105fdb3d228Smrg else 1106fdb3d228Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 1107fdb3d228Smrg fi 1108fdb3d228Smrgfi 1109fdb3d228Smrgrm -f conftest.$ac_ext 1110fdb3d228Smrg 1111fdb3d228SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 1112fdb3d228SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 1113fdb3d228Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1114fdb3d228Smrg AC_MSG_RESULT([no]) 1115fdb3d228Smrgelse 1116fdb3d228Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1117fdb3d228Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 1118fdb3d228Smrg AC_MSG_RESULT([yes]) 1119fdb3d228Smrg else 1120fdb3d228Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 1121fdb3d228Smrg fi 1122fdb3d228Smrgfi 1123fdb3d228Smrgrm -f conftest.$ac_ext 1124fdb3d228SmrgAC_SUBST(RAWCPPFLAGS) 1125fdb3d228Smrg]) # XORG_PROG_RAWCPP 1126fdb3d228Smrg 1127fdb3d228Smrg# XORG_MANPAGE_SECTIONS() 1128fdb3d228Smrg# ----------------------- 1129fdb3d228Smrg# Determine which sections man pages go in for the different man page types 1130fdb3d228Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 1131fdb3d228Smrg# Not sure if there's any better way than just hardcoding by OS name. 1132fdb3d228Smrg# Override default settings by setting environment variables 1133fdb3d228Smrg 1134fdb3d228SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 1135fdb3d228SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 1136fdb3d228Smrg 1137fdb3d228Smrgif test x$APP_MAN_SUFFIX = x ; then 1138fdb3d228Smrg case $host_os in 1139fdb3d228Smrg linux*) APP_MAN_SUFFIX=1x ;; 1140fdb3d228Smrg *) APP_MAN_SUFFIX=1 ;; 1141fdb3d228Smrg esac 1142fdb3d228Smrgfi 1143fdb3d228Smrgif test x$APP_MAN_DIR = x ; then 1144fdb3d228Smrg case $host_os in 1145fdb3d228Smrg linux*) APP_MAN_DIR='$(mandir)/man1' ;; 1146fdb3d228Smrg *) APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;; 1147fdb3d228Smrg esac 1148fdb3d228Smrgfi 1149fdb3d228Smrg 1150fdb3d228Smrgif test x$LIB_MAN_SUFFIX = x ; then 1151fdb3d228Smrg case $host_os in 1152fdb3d228Smrg linux*) LIB_MAN_SUFFIX=3x ;; 1153fdb3d228Smrg *) LIB_MAN_SUFFIX=3 ;; 1154fdb3d228Smrg esac 1155fdb3d228Smrgfi 1156fdb3d228Smrgif test x$LIB_MAN_DIR = x ; then 1157fdb3d228Smrg case $host_os in 1158fdb3d228Smrg linux*) LIB_MAN_DIR='$(mandir)/man3' ;; 1159fdb3d228Smrg *) LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;; 1160fdb3d228Smrg esac 1161fdb3d228Smrgfi 1162fdb3d228Smrg 1163fdb3d228Smrgif test x$FILE_MAN_SUFFIX = x ; then 1164fdb3d228Smrg case $host_os in 1165fdb3d228Smrg linux*) FILE_MAN_SUFFIX=5x ;; 1166fdb3d228Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 1167fdb3d228Smrg *) FILE_MAN_SUFFIX=5 ;; 1168fdb3d228Smrg esac 1169fdb3d228Smrgfi 1170fdb3d228Smrgif test x$FILE_MAN_DIR = x ; then 1171fdb3d228Smrg case $host_os in 1172fdb3d228Smrg linux*) FILE_MAN_DIR='$(mandir)/man5' ;; 1173fdb3d228Smrg *) FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;; 1174fdb3d228Smrg esac 1175fdb3d228Smrgfi 1176fdb3d228Smrg 1177fdb3d228Smrg# In Imake's linux.cf, the misc man suffix & dir was only changed for 1178fdb3d228Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here 1179fdb3d228Smrgif test x$MISC_MAN_SUFFIX = x ; then 1180fdb3d228Smrg case $host_os in 1181fdb3d228Smrg# linux*) MISC_MAN_SUFFIX=7x ;; 1182fdb3d228Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 1183fdb3d228Smrg *) MISC_MAN_SUFFIX=7 ;; 1184fdb3d228Smrg esac 1185fdb3d228Smrgfi 1186fdb3d228Smrgif test x$MISC_MAN_DIR = x ; then 1187fdb3d228Smrg case $host_os in 1188fdb3d228Smrg# linux*) MISC_MAN_DIR='$(mandir)/man7' ;; 1189fdb3d228Smrg *) MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;; 1190fdb3d228Smrg esac 1191fdb3d228Smrgfi 1192fdb3d228Smrg 1193fdb3d228Smrg# In Imake's linux.cf, the driver man suffix & dir was only changed for 1194fdb3d228Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here 1195fdb3d228Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 1196fdb3d228Smrg case $host_os in 1197fdb3d228Smrg# linux*) DRIVER_MAN_SUFFIX=4x ;; 1198fdb3d228Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 1199fdb3d228Smrg *) DRIVER_MAN_SUFFIX=4 ;; 1200fdb3d228Smrg esac 1201fdb3d228Smrgfi 1202fdb3d228Smrgif test x$DRIVER_MAN_DIR = x ; then 1203fdb3d228Smrg case $host_os in 1204fdb3d228Smrg# linux*) DRIVER_MAN_DIR='$(mandir)/man4' ;; 1205fdb3d228Smrg *) DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;; 1206fdb3d228Smrg esac 1207fdb3d228Smrgfi 1208fdb3d228Smrg 1209fdb3d228Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 1210fdb3d228Smrg case $host_os in 1211fdb3d228Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 1212fdb3d228Smrg *) ADMIN_MAN_SUFFIX=8 ;; 1213fdb3d228Smrg esac 1214fdb3d228Smrgfi 1215fdb3d228Smrgif test x$ADMIN_MAN_DIR = x ; then 1216fdb3d228Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 1217fdb3d228Smrgfi 1218fdb3d228Smrg 1219fdb3d228Smrg 1220fdb3d228SmrgAC_SUBST([APP_MAN_SUFFIX]) 1221fdb3d228SmrgAC_SUBST([LIB_MAN_SUFFIX]) 1222fdb3d228SmrgAC_SUBST([FILE_MAN_SUFFIX]) 1223fdb3d228SmrgAC_SUBST([MISC_MAN_SUFFIX]) 1224fdb3d228SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 1225fdb3d228SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 1226fdb3d228SmrgAC_SUBST([APP_MAN_DIR]) 1227fdb3d228SmrgAC_SUBST([LIB_MAN_DIR]) 1228fdb3d228SmrgAC_SUBST([FILE_MAN_DIR]) 1229fdb3d228SmrgAC_SUBST([MISC_MAN_DIR]) 1230fdb3d228SmrgAC_SUBST([DRIVER_MAN_DIR]) 1231fdb3d228SmrgAC_SUBST([ADMIN_MAN_DIR]) 1232fdb3d228Smrg]) # XORG_MANPAGE_SECTIONS 1233fdb3d228Smrg 1234fdb3d228Smrg# XORG_CHECK_LINUXDOC 1235fdb3d228Smrg# ------------------- 1236fdb3d228Smrg# Defines the variable MAKE_TEXT if the necessary tools and 1237fdb3d228Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 1238fdb3d228Smrg# Whether or not the necessary tools and files are found can be checked 1239fdb3d228Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 1240fdb3d228SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 1241fdb3d228SmrgAC_CHECK_FILE( 1242fdb3d228Smrg [$prefix/share/X11/sgml/defs.ent], 1243fdb3d228Smrg [DEFS_ENT_PATH=$prefix/share/X11/sgml], 1244fdb3d228Smrg [DEFS_ENT_PATH=] 1245fdb3d228Smrg) 1246fdb3d228Smrg 1247fdb3d228SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 1248fdb3d228SmrgAC_PATH_PROG(PS2PDF, ps2pdf) 1249fdb3d228Smrg 1250fdb3d228SmrgAC_MSG_CHECKING([Whether to build documentation]) 1251fdb3d228Smrg 1252fdb3d228Smrgif test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then 1253fdb3d228Smrg BUILDDOC=yes 1254fdb3d228Smrgelse 1255fdb3d228Smrg BUILDDOC=no 1256fdb3d228Smrgfi 1257fdb3d228Smrg 1258fdb3d228SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 1259fdb3d228Smrg 1260fdb3d228SmrgAC_MSG_RESULT([$BUILDDOC]) 1261fdb3d228Smrg 1262fdb3d228SmrgAC_MSG_CHECKING([Whether to build pdf documentation]) 1263fdb3d228Smrg 1264fdb3d228Smrgif test x$PS2PDF != x ; then 1265fdb3d228Smrg BUILDPDFDOC=yes 1266fdb3d228Smrgelse 1267fdb3d228Smrg BUILDPDFDOC=no 1268fdb3d228Smrgfi 1269fdb3d228Smrg 1270fdb3d228SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1271fdb3d228Smrg 1272fdb3d228SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 1273fdb3d228Smrg 1274fdb3d228SmrgMAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" 1275fdb3d228SmrgMAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 1276fdb3d228SmrgMAKE_PDF="$PS2PDF" 1277fdb3d228SmrgMAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B html --split=0" 1278fdb3d228Smrg 1279fdb3d228SmrgAC_SUBST(MAKE_TEXT) 1280fdb3d228SmrgAC_SUBST(MAKE_PS) 1281fdb3d228SmrgAC_SUBST(MAKE_PDF) 1282fdb3d228SmrgAC_SUBST(MAKE_HTML) 1283fdb3d228Smrg]) # XORG_CHECK_LINUXDOC 1284fdb3d228Smrg 1285fdb3d228Smrg# XORG_CHECK_MALLOC_ZERO 1286fdb3d228Smrg# ---------------------- 1287fdb3d228Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 1288fdb3d228Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 1289fdb3d228Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 1290fdb3d228SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 1291fdb3d228SmrgAC_ARG_ENABLE(malloc0returnsnull, 1292fdb3d228Smrg AC_HELP_STRING([--enable-malloc0returnsnull], 1293fdb3d228Smrg [malloc(0) returns NULL (default: auto)]), 1294fdb3d228Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 1295fdb3d228Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 1296fdb3d228Smrg 1297fdb3d228SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 1298fdb3d228Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 1299fdb3d228Smrg AC_RUN_IFELSE([ 1300fdb3d228Smrgchar *malloc(); 1301fdb3d228Smrgchar *realloc(); 1302fdb3d228Smrgchar *calloc(); 1303fdb3d228Smrgmain() { 1304fdb3d228Smrg char *m0, *r0, *c0, *p; 1305fdb3d228Smrg m0 = malloc(0); 1306fdb3d228Smrg p = malloc(10); 1307fdb3d228Smrg r0 = realloc(p,0); 1308fdb3d228Smrg c0 = calloc(0); 1309fdb3d228Smrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 1310fdb3d228Smrg}], 1311fdb3d228Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 1312fdb3d228Smrg [MALLOC_ZERO_RETURNS_NULL=no]) 1313fdb3d228Smrgfi 1314fdb3d228SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 1315fdb3d228Smrg 1316fdb3d228Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 1317fdb3d228Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 1318fdb3d228Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 1319fdb3d228Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 1320fdb3d228Smrgelse 1321fdb3d228Smrg MALLOC_ZERO_CFLAGS="" 1322fdb3d228Smrg XMALLOC_ZERO_CFLAGS="" 1323fdb3d228Smrg XTMALLOC_ZERO_CFLAGS="" 1324fdb3d228Smrgfi 1325fdb3d228Smrg 1326fdb3d228SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 1327fdb3d228SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 1328fdb3d228SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 1329fdb3d228Smrg]) # XORG_CHECK_MALLOC_ZERO 1330fdb3d228Smrg 1331fdb3d228Smrgdnl Copyright 2005 Red Hat, Inc 1332fdb3d228Smrgdnl 1333fdb3d228Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 1334fdb3d228Smrgdnl documentation for any purpose is hereby granted without fee, provided that 1335fdb3d228Smrgdnl the above copyright notice appear in all copies and that both that 1336fdb3d228Smrgdnl copyright notice and this permission notice appear in supporting 1337fdb3d228Smrgdnl documentation. 1338fdb3d228Smrgdnl 1339fdb3d228Smrgdnl The above copyright notice and this permission notice shall be included 1340fdb3d228Smrgdnl in all copies or substantial portions of the Software. 1341fdb3d228Smrgdnl 1342fdb3d228Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1343fdb3d228Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1344fdb3d228Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 1345fdb3d228Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 1346fdb3d228Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 1347fdb3d228Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 1348fdb3d228Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 1349fdb3d228Smrgdnl 1350fdb3d228Smrgdnl Except as contained in this notice, the name of the copyright holders shall 1351fdb3d228Smrgdnl not be used in advertising or otherwise to promote the sale, use or 1352fdb3d228Smrgdnl other dealings in this Software without prior written authorization 1353fdb3d228Smrgdnl from the copyright holders. 1354fdb3d228Smrgdnl 1355fdb3d228Smrg 1356fdb3d228Smrg# XORG_RELEASE_VERSION 1357fdb3d228Smrg# -------------------- 1358fdb3d228Smrg# Adds --with/without-release-string and changes the PACKAGE and 1359fdb3d228Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If 1360fdb3d228Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. 1361fdb3d228Smrg 1362fdb3d228SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 1363fdb3d228Smrg AC_ARG_WITH(release-version, 1364fdb3d228Smrg AC_HELP_STRING([--with-release-version=STRING], 1365fdb3d228Smrg [Use release version string in package name]), 1366fdb3d228Smrg [RELEASE_VERSION="$withval"], 1367fdb3d228Smrg [RELEASE_VERSION=""]) 1368fdb3d228Smrg if test "x$RELEASE_VERSION" != "x"; then 1369fdb3d228Smrg PACKAGE="$PACKAGE-$RELEASE_VERSION" 1370fdb3d228Smrg PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" 1371fdb3d228Smrg AC_MSG_NOTICE([Building with package name set to $PACKAGE]) 1372fdb3d228Smrg fi 1373fdb3d228Smrg]) 1374fdb3d228Smrg 1375