aclocal.m4 revision 264fa531
1264fa531Smrg# generated automatically by aclocal 1.7.9 -*- Autoconf -*- 2264fa531Smrg 3264fa531Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 4264fa531Smrg# Free Software Foundation, Inc. 5264fa531Smrg# This file is free software; the Free Software Foundation 6264fa531Smrg# gives unlimited permission to copy and/or distribute it, 7264fa531Smrg# with or without modifications, as long as this notice is preserved. 8264fa531Smrg 9264fa531Smrg# This program is distributed in the hope that it will be useful, 10264fa531Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11264fa531Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12264fa531Smrg# PARTICULAR PURPOSE. 13264fa531Smrg 14264fa531Smrg# Do all the work for Automake. -*- Autoconf -*- 15264fa531Smrg 16264fa531Smrg# This macro actually does too much some checks are only needed if 17264fa531Smrg# your package does certain things. But this isn't really a big deal. 18264fa531Smrg 19264fa531Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 20264fa531Smrg# Free Software Foundation, Inc. 21264fa531Smrg 22264fa531Smrg# This program is free software; you can redistribute it and/or modify 23264fa531Smrg# it under the terms of the GNU General Public License as published by 24264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 25264fa531Smrg# any later version. 26264fa531Smrg 27264fa531Smrg# This program is distributed in the hope that it will be useful, 28264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 29264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30264fa531Smrg# GNU General Public License for more details. 31264fa531Smrg 32264fa531Smrg# You should have received a copy of the GNU General Public License 33264fa531Smrg# along with this program; if not, write to the Free Software 34264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 35264fa531Smrg# 02111-1307, USA. 36264fa531Smrg 37264fa531Smrg# serial 10 38264fa531Smrg 39264fa531SmrgAC_PREREQ([2.54]) 40264fa531Smrg 41264fa531Smrg# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow 42264fa531Smrg# the ones we care about. 43264fa531Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 44264fa531Smrg 45264fa531Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 46264fa531Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 47264fa531Smrg# ----------------------------------------------- 48264fa531Smrg# The call with PACKAGE and VERSION arguments is the old style 49264fa531Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 50264fa531Smrg# and VERSION should now be passed to AC_INIT and removed from 51264fa531Smrg# the call to AM_INIT_AUTOMAKE. 52264fa531Smrg# We support both call styles for the transition. After 53264fa531Smrg# the next Automake release, Autoconf can make the AC_INIT 54264fa531Smrg# arguments mandatory, and then we can depend on a new Autoconf 55264fa531Smrg# release and drop the old call support. 56264fa531SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 57264fa531Smrg[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 58264fa531Smrg AC_REQUIRE([AC_PROG_INSTALL])dnl 59264fa531Smrg# test to see if srcdir already configured 60264fa531Smrgif test "`cd $srcdir && pwd`" != "`pwd`" && 61264fa531Smrg test -f $srcdir/config.status; then 62264fa531Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 63264fa531Smrgfi 64264fa531Smrg 65264fa531Smrg# test whether we have cygpath 66264fa531Smrgif test -z "$CYGPATH_W"; then 67264fa531Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 68264fa531Smrg CYGPATH_W='cygpath -w' 69264fa531Smrg else 70264fa531Smrg CYGPATH_W=echo 71264fa531Smrg fi 72264fa531Smrgfi 73264fa531SmrgAC_SUBST([CYGPATH_W]) 74264fa531Smrg 75264fa531Smrg# Define the identity of the package. 76264fa531Smrgdnl Distinguish between old-style and new-style calls. 77264fa531Smrgm4_ifval([$2], 78264fa531Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 79264fa531Smrg AC_SUBST([PACKAGE], [$1])dnl 80264fa531Smrg AC_SUBST([VERSION], [$2])], 81264fa531Smrg[_AM_SET_OPTIONS([$1])dnl 82264fa531Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 83264fa531Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 84264fa531Smrg 85264fa531Smrg_AM_IF_OPTION([no-define],, 86264fa531Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 87264fa531Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 88264fa531Smrg 89264fa531Smrg# Some tools Automake needs. 90264fa531SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 91264fa531SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 92264fa531SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 93264fa531SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 94264fa531SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 95264fa531SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 96264fa531SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 97264fa531SmrgAM_MISSING_PROG(AMTAR, tar) 98264fa531SmrgAM_PROG_INSTALL_SH 99264fa531SmrgAM_PROG_INSTALL_STRIP 100264fa531Smrg# We need awk for the "check" target. The system "awk" is bad on 101264fa531Smrg# some platforms. 102264fa531SmrgAC_REQUIRE([AC_PROG_AWK])dnl 103264fa531SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 104264fa531SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 105264fa531Smrg 106264fa531Smrg_AM_IF_OPTION([no-dependencies],, 107264fa531Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 108264fa531Smrg [_AM_DEPENDENCIES(CC)], 109264fa531Smrg [define([AC_PROG_CC], 110264fa531Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 111264fa531SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 112264fa531Smrg [_AM_DEPENDENCIES(CXX)], 113264fa531Smrg [define([AC_PROG_CXX], 114264fa531Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 115264fa531Smrg]) 116264fa531Smrg]) 117264fa531Smrg 118264fa531Smrg 119264fa531Smrg# When config.status generates a header, we must update the stamp-h file. 120264fa531Smrg# This file resides in the same directory as the config header 121264fa531Smrg# that is generated. The stamp files are numbered to have different names. 122264fa531Smrg 123264fa531Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 124264fa531Smrg# loop where config.status creates the headers, so we can generate 125264fa531Smrg# our stamp files there. 126264fa531SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 127264fa531Smrg[# Compute $1's index in $config_headers. 128264fa531Smrg_am_stamp_count=1 129264fa531Smrgfor _am_header in $config_headers :; do 130264fa531Smrg case $_am_header in 131264fa531Smrg $1 | $1:* ) 132264fa531Smrg break ;; 133264fa531Smrg * ) 134264fa531Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 135264fa531Smrg esac 136264fa531Smrgdone 137264fa531Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) 138264fa531Smrg 139264fa531Smrg# Copyright 2002 Free Software Foundation, Inc. 140264fa531Smrg 141264fa531Smrg# This program is free software; you can redistribute it and/or modify 142264fa531Smrg# it under the terms of the GNU General Public License as published by 143264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 144264fa531Smrg# any later version. 145264fa531Smrg 146264fa531Smrg# This program is distributed in the hope that it will be useful, 147264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 148264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 149264fa531Smrg# GNU General Public License for more details. 150264fa531Smrg 151264fa531Smrg# You should have received a copy of the GNU General Public License 152264fa531Smrg# along with this program; if not, write to the Free Software 153264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 154264fa531Smrg 155264fa531Smrg# AM_AUTOMAKE_VERSION(VERSION) 156264fa531Smrg# ---------------------------- 157264fa531Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 158264fa531Smrg# generated from the m4 files accompanying Automake X.Y. 159264fa531SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) 160264fa531Smrg 161264fa531Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 162264fa531Smrg# ------------------------------- 163264fa531Smrg# Call AM_AUTOMAKE_VERSION so it can be traced. 164264fa531Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. 165264fa531SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 166264fa531Smrg [AM_AUTOMAKE_VERSION([1.7.9])]) 167264fa531Smrg 168264fa531Smrg# Helper functions for option handling. -*- Autoconf -*- 169264fa531Smrg 170264fa531Smrg# Copyright 2001, 2002 Free Software Foundation, Inc. 171264fa531Smrg 172264fa531Smrg# This program is free software; you can redistribute it and/or modify 173264fa531Smrg# it under the terms of the GNU General Public License as published by 174264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 175264fa531Smrg# any later version. 176264fa531Smrg 177264fa531Smrg# This program is distributed in the hope that it will be useful, 178264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 179264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 180264fa531Smrg# GNU General Public License for more details. 181264fa531Smrg 182264fa531Smrg# You should have received a copy of the GNU General Public License 183264fa531Smrg# along with this program; if not, write to the Free Software 184264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 185264fa531Smrg# 02111-1307, USA. 186264fa531Smrg 187264fa531Smrg# serial 2 188264fa531Smrg 189264fa531Smrg# _AM_MANGLE_OPTION(NAME) 190264fa531Smrg# ----------------------- 191264fa531SmrgAC_DEFUN([_AM_MANGLE_OPTION], 192264fa531Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 193264fa531Smrg 194264fa531Smrg# _AM_SET_OPTION(NAME) 195264fa531Smrg# ------------------------------ 196264fa531Smrg# Set option NAME. Presently that only means defining a flag for this option. 197264fa531SmrgAC_DEFUN([_AM_SET_OPTION], 198264fa531Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 199264fa531Smrg 200264fa531Smrg# _AM_SET_OPTIONS(OPTIONS) 201264fa531Smrg# ---------------------------------- 202264fa531Smrg# OPTIONS is a space-separated list of Automake options. 203264fa531SmrgAC_DEFUN([_AM_SET_OPTIONS], 204264fa531Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 205264fa531Smrg 206264fa531Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 207264fa531Smrg# ------------------------------------------- 208264fa531Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 209264fa531SmrgAC_DEFUN([_AM_IF_OPTION], 210264fa531Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 211264fa531Smrg 212264fa531Smrg# 213264fa531Smrg# Check to make sure that the build environment is sane. 214264fa531Smrg# 215264fa531Smrg 216264fa531Smrg# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. 217264fa531Smrg 218264fa531Smrg# This program is free software; you can redistribute it and/or modify 219264fa531Smrg# it under the terms of the GNU General Public License as published by 220264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 221264fa531Smrg# any later version. 222264fa531Smrg 223264fa531Smrg# This program is distributed in the hope that it will be useful, 224264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 225264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 226264fa531Smrg# GNU General Public License for more details. 227264fa531Smrg 228264fa531Smrg# You should have received a copy of the GNU General Public License 229264fa531Smrg# along with this program; if not, write to the Free Software 230264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 231264fa531Smrg# 02111-1307, USA. 232264fa531Smrg 233264fa531Smrg# serial 3 234264fa531Smrg 235264fa531Smrg# AM_SANITY_CHECK 236264fa531Smrg# --------------- 237264fa531SmrgAC_DEFUN([AM_SANITY_CHECK], 238264fa531Smrg[AC_MSG_CHECKING([whether build environment is sane]) 239264fa531Smrg# Just in case 240264fa531Smrgsleep 1 241264fa531Smrgecho timestamp > conftest.file 242264fa531Smrg# Do `set' in a subshell so we don't clobber the current shell's 243264fa531Smrg# arguments. Must try -L first in case configure is actually a 244264fa531Smrg# symlink; some systems play weird games with the mod time of symlinks 245264fa531Smrg# (eg FreeBSD returns the mod time of the symlink's containing 246264fa531Smrg# directory). 247264fa531Smrgif ( 248264fa531Smrg set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` 249264fa531Smrg if test "$[*]" = "X"; then 250264fa531Smrg # -L didn't work. 251264fa531Smrg set X `ls -t $srcdir/configure conftest.file` 252264fa531Smrg fi 253264fa531Smrg rm -f conftest.file 254264fa531Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 255264fa531Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 256264fa531Smrg 257264fa531Smrg # If neither matched, then we have a broken ls. This can happen 258264fa531Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 259264fa531Smrg # broken ls alias from the environment. This has actually 260264fa531Smrg # happened. Such a system could not be considered "sane". 261264fa531Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 262264fa531Smrgalias in your environment]) 263264fa531Smrg fi 264264fa531Smrg 265264fa531Smrg test "$[2]" = conftest.file 266264fa531Smrg ) 267264fa531Smrgthen 268264fa531Smrg # Ok. 269264fa531Smrg : 270264fa531Smrgelse 271264fa531Smrg AC_MSG_ERROR([newly created file is older than distributed files! 272264fa531SmrgCheck your system clock]) 273264fa531Smrgfi 274264fa531SmrgAC_MSG_RESULT(yes)]) 275264fa531Smrg 276264fa531Smrg# -*- Autoconf -*- 277264fa531Smrg 278264fa531Smrg 279264fa531Smrg# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. 280264fa531Smrg 281264fa531Smrg# This program is free software; you can redistribute it and/or modify 282264fa531Smrg# it under the terms of the GNU General Public License as published by 283264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 284264fa531Smrg# any later version. 285264fa531Smrg 286264fa531Smrg# This program is distributed in the hope that it will be useful, 287264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 288264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 289264fa531Smrg# GNU General Public License for more details. 290264fa531Smrg 291264fa531Smrg# You should have received a copy of the GNU General Public License 292264fa531Smrg# along with this program; if not, write to the Free Software 293264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 294264fa531Smrg# 02111-1307, USA. 295264fa531Smrg 296264fa531Smrg# serial 3 297264fa531Smrg 298264fa531Smrg# AM_MISSING_PROG(NAME, PROGRAM) 299264fa531Smrg# ------------------------------ 300264fa531SmrgAC_DEFUN([AM_MISSING_PROG], 301264fa531Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 302264fa531Smrg$1=${$1-"${am_missing_run}$2"} 303264fa531SmrgAC_SUBST($1)]) 304264fa531Smrg 305264fa531Smrg 306264fa531Smrg# AM_MISSING_HAS_RUN 307264fa531Smrg# ------------------ 308264fa531Smrg# Define MISSING if not defined so far and test if it supports --run. 309264fa531Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 310264fa531SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 311264fa531Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 312264fa531Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" 313264fa531Smrg# Use eval to expand $SHELL 314264fa531Smrgif eval "$MISSING --run true"; then 315264fa531Smrg am_missing_run="$MISSING --run " 316264fa531Smrgelse 317264fa531Smrg am_missing_run= 318264fa531Smrg AC_MSG_WARN([`missing' script is too old or missing]) 319264fa531Smrgfi 320264fa531Smrg]) 321264fa531Smrg 322264fa531Smrg# AM_AUX_DIR_EXPAND 323264fa531Smrg 324264fa531Smrg# Copyright 2001 Free Software Foundation, Inc. 325264fa531Smrg 326264fa531Smrg# This program is free software; you can redistribute it and/or modify 327264fa531Smrg# it under the terms of the GNU General Public License as published by 328264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 329264fa531Smrg# any later version. 330264fa531Smrg 331264fa531Smrg# This program is distributed in the hope that it will be useful, 332264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 333264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 334264fa531Smrg# GNU General Public License for more details. 335264fa531Smrg 336264fa531Smrg# You should have received a copy of the GNU General Public License 337264fa531Smrg# along with this program; if not, write to the Free Software 338264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 339264fa531Smrg# 02111-1307, USA. 340264fa531Smrg 341264fa531Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 342264fa531Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 343264fa531Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 344264fa531Smrg# 345264fa531Smrg# Of course, Automake must honor this variable whenever it calls a 346264fa531Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 347264fa531Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 348264fa531Smrg# depending on how configure is run. This is pretty annoying, since 349264fa531Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 350264fa531Smrg# source directory, any form will work fine, but in subdirectories a 351264fa531Smrg# relative path needs to be adjusted first. 352264fa531Smrg# 353264fa531Smrg# $ac_aux_dir/missing 354264fa531Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 355264fa531Smrg# $top_srcdir/$ac_aux_dir/missing 356264fa531Smrg# fails if $ac_aux_dir is absolute, 357264fa531Smrg# fails when called from a subdirectory in a VPATH build with 358264fa531Smrg# a relative $ac_aux_dir 359264fa531Smrg# 360264fa531Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 361264fa531Smrg# are both prefixed by $srcdir. In an in-source build this is usually 362264fa531Smrg# harmless because $srcdir is `.', but things will broke when you 363264fa531Smrg# start a VPATH build or use an absolute $srcdir. 364264fa531Smrg# 365264fa531Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 366264fa531Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 367264fa531Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 368264fa531Smrg# and then we would define $MISSING as 369264fa531Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 370264fa531Smrg# This will work as long as MISSING is not called from configure, because 371264fa531Smrg# unfortunately $(top_srcdir) has no meaning in configure. 372264fa531Smrg# However there are other variables, like CC, which are often used in 373264fa531Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 374264fa531Smrg# 375264fa531Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 376264fa531Smrg# absolute PATH. The drawback is that using absolute paths prevent a 377264fa531Smrg# configured tree to be moved without reconfiguration. 378264fa531Smrg 379264fa531Smrg# Rely on autoconf to set up CDPATH properly. 380264fa531SmrgAC_PREREQ([2.50]) 381264fa531Smrg 382264fa531SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], [ 383264fa531Smrg# expand $ac_aux_dir to an absolute path 384264fa531Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 385264fa531Smrg]) 386264fa531Smrg 387264fa531Smrg# AM_PROG_INSTALL_SH 388264fa531Smrg# ------------------ 389264fa531Smrg# Define $install_sh. 390264fa531Smrg 391264fa531Smrg# Copyright 2001 Free Software Foundation, Inc. 392264fa531Smrg 393264fa531Smrg# This program is free software; you can redistribute it and/or modify 394264fa531Smrg# it under the terms of the GNU General Public License as published by 395264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 396264fa531Smrg# any later version. 397264fa531Smrg 398264fa531Smrg# This program is distributed in the hope that it will be useful, 399264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 400264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 401264fa531Smrg# GNU General Public License for more details. 402264fa531Smrg 403264fa531Smrg# You should have received a copy of the GNU General Public License 404264fa531Smrg# along with this program; if not, write to the Free Software 405264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 406264fa531Smrg# 02111-1307, USA. 407264fa531Smrg 408264fa531SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 409264fa531Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 410264fa531Smrginstall_sh=${install_sh-"$am_aux_dir/install-sh"} 411264fa531SmrgAC_SUBST(install_sh)]) 412264fa531Smrg 413264fa531Smrg# AM_PROG_INSTALL_STRIP 414264fa531Smrg 415264fa531Smrg# Copyright 2001 Free Software Foundation, Inc. 416264fa531Smrg 417264fa531Smrg# This program is free software; you can redistribute it and/or modify 418264fa531Smrg# it under the terms of the GNU General Public License as published by 419264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 420264fa531Smrg# any later version. 421264fa531Smrg 422264fa531Smrg# This program is distributed in the hope that it will be useful, 423264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 424264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 425264fa531Smrg# GNU General Public License for more details. 426264fa531Smrg 427264fa531Smrg# You should have received a copy of the GNU General Public License 428264fa531Smrg# along with this program; if not, write to the Free Software 429264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 430264fa531Smrg# 02111-1307, USA. 431264fa531Smrg 432264fa531Smrg# One issue with vendor `install' (even GNU) is that you can't 433264fa531Smrg# specify the program used to strip binaries. This is especially 434264fa531Smrg# annoying in cross-compiling environments, where the build's strip 435264fa531Smrg# is unlikely to handle the host's binaries. 436264fa531Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 437264fa531Smrg# always use install-sh in `make install-strip', and initialize 438264fa531Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 439264fa531SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 440264fa531Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 441264fa531Smrg# Installed binaries are usually stripped using `strip' when the user 442264fa531Smrg# run `make install-strip'. However `strip' might not be the right 443264fa531Smrg# tool to use in cross-compilation environments, therefore Automake 444264fa531Smrg# will honor the `STRIP' environment variable to overrule this program. 445264fa531Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 446264fa531Smrgif test "$cross_compiling" != no; then 447264fa531Smrg AC_CHECK_TOOL([STRIP], [strip], :) 448264fa531Smrgfi 449264fa531SmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" 450264fa531SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 451264fa531Smrg 452264fa531Smrg# -*- Autoconf -*- 453264fa531Smrg# Copyright (C) 2003 Free Software Foundation, Inc. 454264fa531Smrg 455264fa531Smrg# This program is free software; you can redistribute it and/or modify 456264fa531Smrg# it under the terms of the GNU General Public License as published by 457264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 458264fa531Smrg# any later version. 459264fa531Smrg 460264fa531Smrg# This program is distributed in the hope that it will be useful, 461264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 462264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 463264fa531Smrg# GNU General Public License for more details. 464264fa531Smrg 465264fa531Smrg# You should have received a copy of the GNU General Public License 466264fa531Smrg# along with this program; if not, write to the Free Software 467264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 468264fa531Smrg# 02111-1307, USA. 469264fa531Smrg 470264fa531Smrg# serial 1 471264fa531Smrg 472264fa531Smrg# Check whether the underlying file-system supports filenames 473264fa531Smrg# with a leading dot. For instance MS-DOS doesn't. 474264fa531SmrgAC_DEFUN([AM_SET_LEADING_DOT], 475264fa531Smrg[rm -rf .tst 2>/dev/null 476264fa531Smrgmkdir .tst 2>/dev/null 477264fa531Smrgif test -d .tst; then 478264fa531Smrg am__leading_dot=. 479264fa531Smrgelse 480264fa531Smrg am__leading_dot=_ 481264fa531Smrgfi 482264fa531Smrgrmdir .tst 2>/dev/null 483264fa531SmrgAC_SUBST([am__leading_dot])]) 484264fa531Smrg 485264fa531Smrg# serial 5 -*- Autoconf -*- 486264fa531Smrg 487264fa531Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 488264fa531Smrg 489264fa531Smrg# This program is free software; you can redistribute it and/or modify 490264fa531Smrg# it under the terms of the GNU General Public License as published by 491264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 492264fa531Smrg# any later version. 493264fa531Smrg 494264fa531Smrg# This program is distributed in the hope that it will be useful, 495264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 496264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 497264fa531Smrg# GNU General Public License for more details. 498264fa531Smrg 499264fa531Smrg# You should have received a copy of the GNU General Public License 500264fa531Smrg# along with this program; if not, write to the Free Software 501264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 502264fa531Smrg# 02111-1307, USA. 503264fa531Smrg 504264fa531Smrg 505264fa531Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 506264fa531Smrg# written in clear, in which case automake, when reading aclocal.m4, 507264fa531Smrg# will think it sees a *use*, and therefore will trigger all it's 508264fa531Smrg# C support machinery. Also note that it means that autoscan, seeing 509264fa531Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 510264fa531Smrg 511264fa531Smrg 512264fa531Smrg 513264fa531Smrg# _AM_DEPENDENCIES(NAME) 514264fa531Smrg# ---------------------- 515264fa531Smrg# See how the compiler implements dependency checking. 516264fa531Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 517264fa531Smrg# We try a few techniques and use that to set a single cache variable. 518264fa531Smrg# 519264fa531Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 520264fa531Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 521264fa531Smrg# dependency, and given that the user is not expected to run this macro, 522264fa531Smrg# just rely on AC_PROG_CC. 523264fa531SmrgAC_DEFUN([_AM_DEPENDENCIES], 524264fa531Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 525264fa531SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 526264fa531SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 527264fa531SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 528264fa531Smrg 529264fa531Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 530264fa531Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 531264fa531Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 532264fa531Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 533264fa531Smrg [depcc="$$1" am_compiler_list=]) 534264fa531Smrg 535264fa531SmrgAC_CACHE_CHECK([dependency style of $depcc], 536264fa531Smrg [am_cv_$1_dependencies_compiler_type], 537264fa531Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 538264fa531Smrg # We make a subdir and do the tests there. Otherwise we can end up 539264fa531Smrg # making bogus files that we don't know about and never remove. For 540264fa531Smrg # instance it was reported that on HP-UX the gcc test will end up 541264fa531Smrg # making a dummy file named `D' -- because `-MD' means `put the output 542264fa531Smrg # in D'. 543264fa531Smrg mkdir conftest.dir 544264fa531Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 545264fa531Smrg # using a relative directory. 546264fa531Smrg cp "$am_depcomp" conftest.dir 547264fa531Smrg cd conftest.dir 548264fa531Smrg # We will build objects and dependencies in a subdirectory because 549264fa531Smrg # it helps to detect inapplicable dependency modes. For instance 550264fa531Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 551264fa531Smrg # side effect of compilation, but ICC will put the dependencies in 552264fa531Smrg # the current directory while Tru64 will put them in the object 553264fa531Smrg # directory. 554264fa531Smrg mkdir sub 555264fa531Smrg 556264fa531Smrg am_cv_$1_dependencies_compiler_type=none 557264fa531Smrg if test "$am_compiler_list" = ""; then 558264fa531Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 559264fa531Smrg fi 560264fa531Smrg for depmode in $am_compiler_list; do 561264fa531Smrg # Setup a source with many dependencies, because some compilers 562264fa531Smrg # like to wrap large dependency lists on column 80 (with \), and 563264fa531Smrg # we should not choose a depcomp mode which is confused by this. 564264fa531Smrg # 565264fa531Smrg # We need to recreate these files for each test, as the compiler may 566264fa531Smrg # overwrite some of them when testing with obscure command lines. 567264fa531Smrg # This happens at least with the AIX C compiler. 568264fa531Smrg : > sub/conftest.c 569264fa531Smrg for i in 1 2 3 4 5 6; do 570264fa531Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 571264fa531Smrg : > sub/conftst$i.h 572264fa531Smrg done 573264fa531Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 574264fa531Smrg 575264fa531Smrg case $depmode in 576264fa531Smrg nosideeffect) 577264fa531Smrg # after this tag, mechanisms are not by side-effect, so they'll 578264fa531Smrg # only be used when explicitly requested 579264fa531Smrg if test "x$enable_dependency_tracking" = xyes; then 580264fa531Smrg continue 581264fa531Smrg else 582264fa531Smrg break 583264fa531Smrg fi 584264fa531Smrg ;; 585264fa531Smrg none) break ;; 586264fa531Smrg esac 587264fa531Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 588264fa531Smrg # mode. It turns out that the SunPro C++ compiler does not properly 589264fa531Smrg # handle `-M -o', and we need to detect this. 590264fa531Smrg if depmode=$depmode \ 591264fa531Smrg source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ 592264fa531Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 593264fa531Smrg $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ 594264fa531Smrg >/dev/null 2>conftest.err && 595264fa531Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 596264fa531Smrg grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && 597264fa531Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 598264fa531Smrg # icc doesn't choke on unknown options, it will just issue warnings 599264fa531Smrg # (even with -Werror). So we grep stderr for any message 600264fa531Smrg # that says an option was ignored. 601264fa531Smrg if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else 602264fa531Smrg am_cv_$1_dependencies_compiler_type=$depmode 603264fa531Smrg break 604264fa531Smrg fi 605264fa531Smrg fi 606264fa531Smrg done 607264fa531Smrg 608264fa531Smrg cd .. 609264fa531Smrg rm -rf conftest.dir 610264fa531Smrgelse 611264fa531Smrg am_cv_$1_dependencies_compiler_type=none 612264fa531Smrgfi 613264fa531Smrg]) 614264fa531SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 615264fa531SmrgAM_CONDITIONAL([am__fastdep$1], [ 616264fa531Smrg test "x$enable_dependency_tracking" != xno \ 617264fa531Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 618264fa531Smrg]) 619264fa531Smrg 620264fa531Smrg 621264fa531Smrg# AM_SET_DEPDIR 622264fa531Smrg# ------------- 623264fa531Smrg# Choose a directory name for dependency files. 624264fa531Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 625264fa531SmrgAC_DEFUN([AM_SET_DEPDIR], 626264fa531Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 627264fa531SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 628264fa531Smrg]) 629264fa531Smrg 630264fa531Smrg 631264fa531Smrg# AM_DEP_TRACK 632264fa531Smrg# ------------ 633264fa531SmrgAC_DEFUN([AM_DEP_TRACK], 634264fa531Smrg[AC_ARG_ENABLE(dependency-tracking, 635264fa531Smrg[ --disable-dependency-tracking Speeds up one-time builds 636264fa531Smrg --enable-dependency-tracking Do not reject slow dependency extractors]) 637264fa531Smrgif test "x$enable_dependency_tracking" != xno; then 638264fa531Smrg am_depcomp="$ac_aux_dir/depcomp" 639264fa531Smrg AMDEPBACKSLASH='\' 640264fa531Smrgfi 641264fa531SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 642264fa531SmrgAC_SUBST([AMDEPBACKSLASH]) 643264fa531Smrg]) 644264fa531Smrg 645264fa531Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 646264fa531Smrg 647264fa531Smrg# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 648264fa531Smrg 649264fa531Smrg# This program is free software; you can redistribute it and/or modify 650264fa531Smrg# it under the terms of the GNU General Public License as published by 651264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 652264fa531Smrg# any later version. 653264fa531Smrg 654264fa531Smrg# This program is distributed in the hope that it will be useful, 655264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 656264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 657264fa531Smrg# GNU General Public License for more details. 658264fa531Smrg 659264fa531Smrg# You should have received a copy of the GNU General Public License 660264fa531Smrg# along with this program; if not, write to the Free Software 661264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 662264fa531Smrg# 02111-1307, USA. 663264fa531Smrg 664264fa531Smrg#serial 2 665264fa531Smrg 666264fa531Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 667264fa531Smrg# ------------------------------ 668264fa531SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 669264fa531Smrg[for mf in $CONFIG_FILES; do 670264fa531Smrg # Strip MF so we end up with the name of the file. 671264fa531Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 672264fa531Smrg # Check whether this is an Automake generated Makefile or not. 673264fa531Smrg # We used to match only the files named `Makefile.in', but 674264fa531Smrg # some people rename them; so instead we look at the file content. 675264fa531Smrg # Grep'ing the first line is not enough: some people post-process 676264fa531Smrg # each Makefile.in and add a new line on top of each file to say so. 677264fa531Smrg # So let's grep whole file. 678264fa531Smrg if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then 679264fa531Smrg dirpart=`AS_DIRNAME("$mf")` 680264fa531Smrg else 681264fa531Smrg continue 682264fa531Smrg fi 683264fa531Smrg grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue 684264fa531Smrg # Extract the definition of DEP_FILES from the Makefile without 685264fa531Smrg # running `make'. 686264fa531Smrg DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` 687264fa531Smrg test -z "$DEPDIR" && continue 688264fa531Smrg # When using ansi2knr, U may be empty or an underscore; expand it 689264fa531Smrg U=`sed -n -e '/^U = / s///p' < "$mf"` 690264fa531Smrg test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" 691264fa531Smrg # We invoke sed twice because it is the simplest approach to 692264fa531Smrg # changing $(DEPDIR) to its actual value in the expansion. 693264fa531Smrg for file in `sed -n -e ' 694264fa531Smrg /^DEP_FILES = .*\\\\$/ { 695264fa531Smrg s/^DEP_FILES = // 696264fa531Smrg :loop 697264fa531Smrg s/\\\\$// 698264fa531Smrg p 699264fa531Smrg n 700264fa531Smrg /\\\\$/ b loop 701264fa531Smrg p 702264fa531Smrg } 703264fa531Smrg /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ 704264fa531Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 705264fa531Smrg # Make sure the directory exists. 706264fa531Smrg test -f "$dirpart/$file" && continue 707264fa531Smrg fdir=`AS_DIRNAME(["$file"])` 708264fa531Smrg AS_MKDIR_P([$dirpart/$fdir]) 709264fa531Smrg # echo "creating $dirpart/$file" 710264fa531Smrg echo '# dummy' > "$dirpart/$file" 711264fa531Smrg done 712264fa531Smrgdone 713264fa531Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 714264fa531Smrg 715264fa531Smrg 716264fa531Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 717264fa531Smrg# ----------------------------- 718264fa531Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 719264fa531Smrg# 720264fa531Smrg# This code is only required when automatic dependency tracking 721264fa531Smrg# is enabled. FIXME. This creates each `.P' file that we will 722264fa531Smrg# need in order to bootstrap the dependency handling code. 723264fa531SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 724264fa531Smrg[AC_CONFIG_COMMANDS([depfiles], 725264fa531Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 726264fa531Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 727264fa531Smrg]) 728264fa531Smrg 729264fa531Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 730264fa531Smrg 731264fa531Smrg# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. 732264fa531Smrg 733264fa531Smrg# This program is free software; you can redistribute it and/or modify 734264fa531Smrg# it under the terms of the GNU General Public License as published by 735264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 736264fa531Smrg# any later version. 737264fa531Smrg 738264fa531Smrg# This program is distributed in the hope that it will be useful, 739264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 740264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 741264fa531Smrg# GNU General Public License for more details. 742264fa531Smrg 743264fa531Smrg# You should have received a copy of the GNU General Public License 744264fa531Smrg# along with this program; if not, write to the Free Software 745264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 746264fa531Smrg# 02111-1307, USA. 747264fa531Smrg 748264fa531Smrg# serial 2 749264fa531Smrg 750264fa531Smrg# AM_MAKE_INCLUDE() 751264fa531Smrg# ----------------- 752264fa531Smrg# Check to see how make treats includes. 753264fa531SmrgAC_DEFUN([AM_MAKE_INCLUDE], 754264fa531Smrg[am_make=${MAKE-make} 755264fa531Smrgcat > confinc << 'END' 756264fa531Smrgam__doit: 757264fa531Smrg @echo done 758264fa531Smrg.PHONY: am__doit 759264fa531SmrgEND 760264fa531Smrg# If we don't find an include directive, just comment out the code. 761264fa531SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 762264fa531Smrgam__include="#" 763264fa531Smrgam__quote= 764264fa531Smrg_am_result=none 765264fa531Smrg# First try GNU make style include. 766264fa531Smrgecho "include confinc" > confmf 767264fa531Smrg# We grep out `Entering directory' and `Leaving directory' 768264fa531Smrg# messages which can occur if `w' ends up in MAKEFLAGS. 769264fa531Smrg# In particular we don't look at `^make:' because GNU make might 770264fa531Smrg# be invoked under some other name (usually "gmake"), in which 771264fa531Smrg# case it prints its new name instead of `make'. 772264fa531Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then 773264fa531Smrg am__include=include 774264fa531Smrg am__quote= 775264fa531Smrg _am_result=GNU 776264fa531Smrgfi 777264fa531Smrg# Now try BSD make style include. 778264fa531Smrgif test "$am__include" = "#"; then 779264fa531Smrg echo '.include "confinc"' > confmf 780264fa531Smrg if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then 781264fa531Smrg am__include=.include 782264fa531Smrg am__quote="\"" 783264fa531Smrg _am_result=BSD 784264fa531Smrg fi 785264fa531Smrgfi 786264fa531SmrgAC_SUBST([am__include]) 787264fa531SmrgAC_SUBST([am__quote]) 788264fa531SmrgAC_MSG_RESULT([$_am_result]) 789264fa531Smrgrm -f confinc confmf 790264fa531Smrg]) 791264fa531Smrg 792264fa531Smrg# AM_CONDITIONAL -*- Autoconf -*- 793264fa531Smrg 794264fa531Smrg# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. 795264fa531Smrg 796264fa531Smrg# This program is free software; you can redistribute it and/or modify 797264fa531Smrg# it under the terms of the GNU General Public License as published by 798264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 799264fa531Smrg# any later version. 800264fa531Smrg 801264fa531Smrg# This program is distributed in the hope that it will be useful, 802264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 803264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 804264fa531Smrg# GNU General Public License for more details. 805264fa531Smrg 806264fa531Smrg# You should have received a copy of the GNU General Public License 807264fa531Smrg# along with this program; if not, write to the Free Software 808264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 809264fa531Smrg# 02111-1307, USA. 810264fa531Smrg 811264fa531Smrg# serial 5 812264fa531Smrg 813264fa531SmrgAC_PREREQ(2.52) 814264fa531Smrg 815264fa531Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 816264fa531Smrg# ------------------------------------- 817264fa531Smrg# Define a conditional. 818264fa531SmrgAC_DEFUN([AM_CONDITIONAL], 819264fa531Smrg[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 820264fa531Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 821264fa531SmrgAC_SUBST([$1_TRUE]) 822264fa531SmrgAC_SUBST([$1_FALSE]) 823264fa531Smrgif $2; then 824264fa531Smrg $1_TRUE= 825264fa531Smrg $1_FALSE='#' 826264fa531Smrgelse 827264fa531Smrg $1_TRUE='#' 828264fa531Smrg $1_FALSE= 829264fa531Smrgfi 830264fa531SmrgAC_CONFIG_COMMANDS_PRE( 831264fa531Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 832264fa531Smrg AC_MSG_ERROR([conditional "$1" was never defined. 833264fa531SmrgUsually this means the macro was only invoked conditionally.]) 834264fa531Smrgfi])]) 835264fa531Smrg 836264fa531Smrg# Add --enable-maintainer-mode option to configure. 837264fa531Smrg# From Jim Meyering 838264fa531Smrg 839264fa531Smrg# Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. 840264fa531Smrg 841264fa531Smrg# This program is free software; you can redistribute it and/or modify 842264fa531Smrg# it under the terms of the GNU General Public License as published by 843264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 844264fa531Smrg# any later version. 845264fa531Smrg 846264fa531Smrg# This program is distributed in the hope that it will be useful, 847264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 848264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 849264fa531Smrg# GNU General Public License for more details. 850264fa531Smrg 851264fa531Smrg# You should have received a copy of the GNU General Public License 852264fa531Smrg# along with this program; if not, write to the Free Software 853264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 854264fa531Smrg# 02111-1307, USA. 855264fa531Smrg 856264fa531Smrg# serial 2 857264fa531Smrg 858264fa531SmrgAC_DEFUN([AM_MAINTAINER_MODE], 859264fa531Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) 860264fa531Smrg dnl maintainer-mode is disabled by default 861264fa531Smrg AC_ARG_ENABLE(maintainer-mode, 862264fa531Smrg[ --enable-maintainer-mode enable make rules and dependencies not useful 863264fa531Smrg (and sometimes confusing) to the casual installer], 864264fa531Smrg USE_MAINTAINER_MODE=$enableval, 865264fa531Smrg USE_MAINTAINER_MODE=no) 866264fa531Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 867264fa531Smrg AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) 868264fa531Smrg MAINT=$MAINTAINER_MODE_TRUE 869264fa531Smrg AC_SUBST(MAINT)dnl 870264fa531Smrg] 871264fa531Smrg) 872264fa531Smrg 873264fa531SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 874264fa531Smrg 875264fa531Smrg# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- 876264fa531Smrg 877264fa531Smrg# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. 878264fa531Smrg 879264fa531Smrg# This program is free software; you can redistribute it and/or modify 880264fa531Smrg# it under the terms of the GNU General Public License as published by 881264fa531Smrg# the Free Software Foundation; either version 2, or (at your option) 882264fa531Smrg# any later version. 883264fa531Smrg 884264fa531Smrg# This program is distributed in the hope that it will be useful, 885264fa531Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 886264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 887264fa531Smrg# GNU General Public License for more details. 888264fa531Smrg 889264fa531Smrg# You should have received a copy of the GNU General Public License 890264fa531Smrg# along with this program; if not, write to the Free Software 891264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 892264fa531Smrg# 02111-1307, USA. 893264fa531Smrg 894264fa531SmrgAC_PREREQ([2.52]) 895264fa531Smrg 896264fa531Smrg# serial 6 897264fa531Smrg 898264fa531Smrg# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 899264fa531SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 900264fa531Smrg 901264fa531Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 902264fa531Smrg# 903264fa531Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 904264fa531Smrg# 905264fa531Smrg# This program is free software; you can redistribute it and/or modify 906264fa531Smrg# it under the terms of the GNU General Public License as published by 907264fa531Smrg# the Free Software Foundation; either version 2 of the License, or 908264fa531Smrg# (at your option) any later version. 909264fa531Smrg# 910264fa531Smrg# This program is distributed in the hope that it will be useful, but 911264fa531Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 912264fa531Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 913264fa531Smrg# General Public License for more details. 914264fa531Smrg# 915264fa531Smrg# You should have received a copy of the GNU General Public License 916264fa531Smrg# along with this program; if not, write to the Free Software 917264fa531Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 918264fa531Smrg# 919264fa531Smrg# As a special exception to the GNU General Public License, if you 920264fa531Smrg# distribute this file as part of a program that contains a 921264fa531Smrg# configuration script generated by Autoconf, you may include it under 922264fa531Smrg# the same distribution terms that you use for the rest of that program. 923264fa531Smrg 924264fa531Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 925264fa531Smrg# ---------------------------------- 926264fa531SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 927264fa531Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 928264fa531Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 929264fa531SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 930264fa531Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 931264fa531Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 932264fa531Smrgfi 933264fa531Smrgif test -n "$PKG_CONFIG"; then 934264fa531Smrg _pkg_min_version=m4_ifval([$1], [$1], [0.9.0]) 935264fa531Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 936264fa531Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 937264fa531Smrg AC_MSG_RESULT([yes]) 938264fa531Smrg else 939264fa531Smrg AC_MSG_RESULT([no]) 940264fa531Smrg PKG_CONFIG="" 941264fa531Smrg fi 942264fa531Smrg 943264fa531Smrgfi[]dnl 944264fa531Smrg])# PKG_PROG_PKG_CONFIG 945264fa531Smrg 946264fa531Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 947264fa531Smrg# 948264fa531Smrg# Check to see whether a particular set of modules exists. Similar 949264fa531Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 950264fa531Smrg# 951264fa531Smrg# 952264fa531Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 953264fa531Smrg# this or PKG_CHECK_MODULES is called, or make sure to call 954264fa531Smrg# PKG_CHECK_EXISTS manually 955264fa531Smrg# -------------------------------------------------------------- 956264fa531SmrgAC_DEFUN([PKG_CHECK_EXISTS], 957264fa531Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 958264fa531Smrgif test -n "$PKG_CONFIG" && \ 959264fa531Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 960264fa531Smrg m4_ifval([$2], [$2], [:]) 961264fa531Smrgm4_ifvaln([$3], [else 962264fa531Smrg $3])dnl 963264fa531Smrgfi]) 964264fa531Smrg 965264fa531Smrg 966264fa531Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 967264fa531Smrg# --------------------------------------------- 968264fa531Smrgm4_define([_PKG_CONFIG], 969264fa531Smrg[if test -n "$PKG_CONFIG"; then 970264fa531Smrg PKG_CHECK_EXISTS([$3], 971264fa531Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 972264fa531Smrg [pkg_failed=yes]) 973264fa531Smrgelse 974264fa531Smrg pkg_failed=untried 975264fa531Smrgfi[]dnl 976264fa531Smrg])# _PKG_CONFIG 977264fa531Smrg 978264fa531Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 979264fa531Smrg# [ACTION-IF-NOT-FOUND]) 980264fa531Smrg# 981264fa531Smrg# 982264fa531Smrg# Note that if there is a possibility the first call to 983264fa531Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 984264fa531Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 985264fa531Smrg# 986264fa531Smrg# 987264fa531Smrg# -------------------------------------------------------------- 988264fa531SmrgAC_DEFUN([PKG_CHECK_MODULES], 989264fa531Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 990264fa531SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 991264fa531SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 992264fa531Smrg 993264fa531Smrgpkg_failed=no 994264fa531SmrgAC_MSG_CHECKING([for $1]) 995264fa531Smrg 996264fa531Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 997264fa531Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 998264fa531Smrg 999264fa531Smrgif test $pkg_failed = yes; then 1000264fa531Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` 1001264fa531Smrg # Put the nasty error message in config.log where it belongs 1002264fa531Smrg echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD 1003264fa531Smrg 1004264fa531Smrg ifelse([$4], , [AC_MSG_ERROR(dnl 1005264fa531Smrg[Package requirements ($2) were not met. 1006264fa531SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 1007264fa531Smrginstalled software in a non-standard prefix. 1008264fa531Smrg 1009264fa531SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables 1010264fa531Smrgto avoid the need to call pkg-config. See the pkg-config man page for 1011264fa531Smrgmore details.])], 1012264fa531Smrg [$4]) 1013264fa531Smrgelif test $pkg_failed = untried; then 1014264fa531Smrg ifelse([$4], , [AC_MSG_FAILURE(dnl 1015264fa531Smrg[The pkg-config script could not be found or is too old. Make sure it 1016264fa531Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 1017264fa531Smrgpath to pkg-config. 1018264fa531Smrg 1019264fa531SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables 1020264fa531Smrgto avoid the need to call pkg-config. See the pkg-config man page for 1021264fa531Smrgmore details. 1022264fa531Smrg 1023264fa531SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], 1024264fa531Smrg [$4]) 1025264fa531Smrgelse 1026264fa531Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 1027264fa531Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 1028264fa531Smrg AC_MSG_RESULT([yes]) 1029264fa531Smrg ifelse([$3], , :, [$3]) 1030264fa531Smrgfi[]dnl 1031264fa531Smrg])# PKG_CHECK_MODULES 1032264fa531Smrg 1033264fa531Smrgdnl $Id: aclocal.m4,v 1.1.1.1 2008/07/30 04:12:25 mrg Exp $ 1034264fa531Smrgdnl 1035264fa531Smrgdnl Copyright 2005 Sun Microsystems, Inc. All rights reserved. 1036264fa531Smrgdnl 1037264fa531Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 1038264fa531Smrgdnl documentation for any purpose is hereby granted without fee, provided that 1039264fa531Smrgdnl the above copyright notice appear in all copies and that both that 1040264fa531Smrgdnl copyright notice and this permission notice appear in supporting 1041264fa531Smrgdnl documentation. 1042264fa531Smrgdnl 1043264fa531Smrgdnl The above copyright notice and this permission notice shall be included 1044264fa531Smrgdnl in all copies or substantial portions of the Software. 1045264fa531Smrgdnl 1046264fa531Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1047264fa531Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1048264fa531Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 1049264fa531Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 1050264fa531Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 1051264fa531Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 1052264fa531Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 1053264fa531Smrgdnl 1054264fa531Smrgdnl Except as contained in this notice, the name of the copyright holders shall 1055264fa531Smrgdnl not be used in advertising or otherwise to promote the sale, use or 1056264fa531Smrgdnl other dealings in this Software without prior written authorization 1057264fa531Smrgdnl from the copyright holders. 1058264fa531Smrgdnl 1059264fa531Smrg 1060264fa531Smrg# XORG_PROG_RAWCPP() 1061264fa531Smrg# ------------------ 1062264fa531Smrg# Find cpp program and necessary flags for use in pre-processing text files 1063264fa531Smrg# such as man pages and config files 1064264fa531SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 1065264fa531SmrgAC_REQUIRE([AC_PROG_CPP]) 1066264fa531SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 1067264fa531Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 1068264fa531Smrg 1069264fa531Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 1070264fa531Smrg# which is not the best choice for supporting other OS'es, but covers most 1071264fa531Smrg# of the ones we need for now. 1072264fa531SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 1073264fa531SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 1074264fa531Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1075264fa531Smrg AC_MSG_RESULT([no]) 1076264fa531Smrgelse 1077264fa531Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1078264fa531Smrg RAWCPPFLAGS=-undef 1079264fa531Smrg AC_MSG_RESULT([yes]) 1080264fa531Smrg else 1081264fa531Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 1082264fa531Smrg fi 1083264fa531Smrgfi 1084264fa531Smrgrm -f conftest.$ac_ext 1085264fa531Smrg 1086264fa531SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 1087264fa531SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 1088264fa531Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1089264fa531Smrg AC_MSG_RESULT([no]) 1090264fa531Smrgelse 1091264fa531Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1092264fa531Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 1093264fa531Smrg AC_MSG_RESULT([yes]) 1094264fa531Smrg else 1095264fa531Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 1096264fa531Smrg fi 1097264fa531Smrgfi 1098264fa531Smrgrm -f conftest.$ac_ext 1099264fa531SmrgAC_SUBST(RAWCPPFLAGS) 1100264fa531Smrg]) # XORG_PROG_RAWCPP 1101264fa531Smrg 1102264fa531Smrg# XORG_MANPAGE_SECTIONS() 1103264fa531Smrg# ----------------------- 1104264fa531Smrg# Determine which sections man pages go in for the different man page types 1105264fa531Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 1106264fa531Smrg# Not sure if there's any better way than just hardcoding by OS name. 1107264fa531Smrg# Override default settings by setting environment variables 1108264fa531Smrg 1109264fa531SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 1110264fa531SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 1111264fa531Smrg 1112264fa531Smrgif test x$APP_MAN_SUFFIX = x ; then 1113264fa531Smrg case $host_os in 1114264fa531Smrg linux*) APP_MAN_SUFFIX=1x ;; 1115264fa531Smrg *) APP_MAN_SUFFIX=1 ;; 1116264fa531Smrg esac 1117264fa531Smrgfi 1118264fa531Smrgif test x$APP_MAN_DIR = x ; then 1119264fa531Smrg case $host_os in 1120264fa531Smrg linux*) APP_MAN_DIR='$(mandir)/man1' ;; 1121264fa531Smrg *) APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;; 1122264fa531Smrg esac 1123264fa531Smrgfi 1124264fa531Smrg 1125264fa531Smrgif test x$LIB_MAN_SUFFIX = x ; then 1126264fa531Smrg case $host_os in 1127264fa531Smrg linux*) LIB_MAN_SUFFIX=3x ;; 1128264fa531Smrg *) LIB_MAN_SUFFIX=3 ;; 1129264fa531Smrg esac 1130264fa531Smrgfi 1131264fa531Smrgif test x$LIB_MAN_DIR = x ; then 1132264fa531Smrg case $host_os in 1133264fa531Smrg linux*) LIB_MAN_DIR='$(mandir)/man3' ;; 1134264fa531Smrg *) LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;; 1135264fa531Smrg esac 1136264fa531Smrgfi 1137264fa531Smrg 1138264fa531Smrgif test x$FILE_MAN_SUFFIX = x ; then 1139264fa531Smrg case $host_os in 1140264fa531Smrg linux*) FILE_MAN_SUFFIX=5x ;; 1141264fa531Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 1142264fa531Smrg *) FILE_MAN_SUFFIX=5 ;; 1143264fa531Smrg esac 1144264fa531Smrgfi 1145264fa531Smrgif test x$FILE_MAN_DIR = x ; then 1146264fa531Smrg case $host_os in 1147264fa531Smrg linux*) FILE_MAN_DIR='$(mandir)/man5' ;; 1148264fa531Smrg *) FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;; 1149264fa531Smrg esac 1150264fa531Smrgfi 1151264fa531Smrg 1152264fa531Smrg# In Imake's linux.cf, the misc man suffix & dir was only changed for 1153264fa531Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here 1154264fa531Smrgif test x$MISC_MAN_SUFFIX = x ; then 1155264fa531Smrg case $host_os in 1156264fa531Smrg# linux*) MISC_MAN_SUFFIX=7x ;; 1157264fa531Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 1158264fa531Smrg *) MISC_MAN_SUFFIX=7 ;; 1159264fa531Smrg esac 1160264fa531Smrgfi 1161264fa531Smrgif test x$MISC_MAN_DIR = x ; then 1162264fa531Smrg case $host_os in 1163264fa531Smrg# linux*) MISC_MAN_DIR='$(mandir)/man7' ;; 1164264fa531Smrg *) MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;; 1165264fa531Smrg esac 1166264fa531Smrgfi 1167264fa531Smrg 1168264fa531Smrg# In Imake's linux.cf, the driver man suffix & dir was only changed for 1169264fa531Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here 1170264fa531Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 1171264fa531Smrg case $host_os in 1172264fa531Smrg# linux*) DRIVER_MAN_SUFFIX=4x ;; 1173264fa531Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 1174264fa531Smrg *) DRIVER_MAN_SUFFIX=4 ;; 1175264fa531Smrg esac 1176264fa531Smrgfi 1177264fa531Smrgif test x$DRIVER_MAN_DIR = x ; then 1178264fa531Smrg case $host_os in 1179264fa531Smrg# linux*) DRIVER_MAN_DIR='$(mandir)/man4' ;; 1180264fa531Smrg *) DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;; 1181264fa531Smrg esac 1182264fa531Smrgfi 1183264fa531Smrg 1184264fa531Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 1185264fa531Smrg case $host_os in 1186264fa531Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 1187264fa531Smrg *) ADMIN_MAN_SUFFIX=8 ;; 1188264fa531Smrg esac 1189264fa531Smrgfi 1190264fa531Smrgif test x$ADMIN_MAN_DIR = x ; then 1191264fa531Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 1192264fa531Smrgfi 1193264fa531Smrg 1194264fa531Smrg 1195264fa531SmrgAC_SUBST([APP_MAN_SUFFIX]) 1196264fa531SmrgAC_SUBST([LIB_MAN_SUFFIX]) 1197264fa531SmrgAC_SUBST([FILE_MAN_SUFFIX]) 1198264fa531SmrgAC_SUBST([MISC_MAN_SUFFIX]) 1199264fa531SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 1200264fa531SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 1201264fa531SmrgAC_SUBST([APP_MAN_DIR]) 1202264fa531SmrgAC_SUBST([LIB_MAN_DIR]) 1203264fa531SmrgAC_SUBST([FILE_MAN_DIR]) 1204264fa531SmrgAC_SUBST([MISC_MAN_DIR]) 1205264fa531SmrgAC_SUBST([DRIVER_MAN_DIR]) 1206264fa531SmrgAC_SUBST([ADMIN_MAN_DIR]) 1207264fa531Smrg]) # XORG_MANPAGE_SECTIONS 1208264fa531Smrg 1209264fa531Smrg# XORG_CHECK_LINUXDOC 1210264fa531Smrg# ------------------- 1211264fa531Smrg# Defines the variable MAKE_TEXT if the necessary tools and 1212264fa531Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 1213264fa531Smrg# Whether or not the necessary tools and files are found can be checked 1214264fa531Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 1215264fa531SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 1216264fa531SmrgAC_CHECK_FILE( 1217264fa531Smrg [$prefix/share/X11/sgml/defs.ent], 1218264fa531Smrg [DEFS_ENT_PATH=$prefix/share/X11/sgml], 1219264fa531Smrg [DEFS_ENT_PATH=] 1220264fa531Smrg) 1221264fa531Smrg 1222264fa531SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 1223264fa531SmrgAC_PATH_PROG(PS2PDF, ps2pdf) 1224264fa531Smrg 1225264fa531SmrgAC_MSG_CHECKING([Whether to build documentation]) 1226264fa531Smrg 1227264fa531Smrgif test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then 1228264fa531Smrg BUILDDOC=yes 1229264fa531Smrgelse 1230264fa531Smrg BUILDDOC=no 1231264fa531Smrgfi 1232264fa531Smrg 1233264fa531SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 1234264fa531Smrg 1235264fa531SmrgAC_MSG_RESULT([$BUILDDOC]) 1236264fa531Smrg 1237264fa531SmrgAC_MSG_CHECKING([Whether to build pdf documentation]) 1238264fa531Smrg 1239264fa531Smrgif test x$PS2PDF != x ; then 1240264fa531Smrg BUILDPDFDOC=yes 1241264fa531Smrgelse 1242264fa531Smrg BUILDPDFDOC=no 1243264fa531Smrgfi 1244264fa531Smrg 1245264fa531SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1246264fa531Smrg 1247264fa531SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 1248264fa531Smrg 1249264fa531SmrgMAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" 1250264fa531SmrgMAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 1251264fa531SmrgMAKE_PDF="$PS2PDF" 1252264fa531SmrgMAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B html --split=0" 1253264fa531Smrg 1254264fa531SmrgAC_SUBST(MAKE_TEXT) 1255264fa531SmrgAC_SUBST(MAKE_PS) 1256264fa531SmrgAC_SUBST(MAKE_PDF) 1257264fa531SmrgAC_SUBST(MAKE_HTML) 1258264fa531Smrg]) # XORG_CHECK_LINUXDOC 1259264fa531Smrg 1260264fa531Smrg# XORG_CHECK_MALLOC_ZERO 1261264fa531Smrg# ---------------------- 1262264fa531Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 1263264fa531Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 1264264fa531Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 1265264fa531SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 1266264fa531SmrgAC_ARG_ENABLE(malloc0returnsnull, 1267264fa531Smrg AC_HELP_STRING([--enable-malloc0returnsnull], 1268264fa531Smrg [malloc(0) returns NULL (default: auto)]), 1269264fa531Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 1270264fa531Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 1271264fa531Smrg 1272264fa531SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 1273264fa531Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 1274264fa531Smrg AC_RUN_IFELSE([ 1275264fa531Smrgchar *malloc(); 1276264fa531Smrgchar *realloc(); 1277264fa531Smrgchar *calloc(); 1278264fa531Smrgmain() { 1279264fa531Smrg char *m0, *r0, *c0, *p; 1280264fa531Smrg m0 = malloc(0); 1281264fa531Smrg p = malloc(10); 1282264fa531Smrg r0 = realloc(p,0); 1283264fa531Smrg c0 = calloc(0); 1284264fa531Smrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 1285264fa531Smrg}], 1286264fa531Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 1287264fa531Smrg [MALLOC_ZERO_RETURNS_NULL=no]) 1288264fa531Smrgfi 1289264fa531SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 1290264fa531Smrg 1291264fa531Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 1292264fa531Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 1293264fa531Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 1294264fa531Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 1295264fa531Smrgelse 1296264fa531Smrg MALLOC_ZERO_CFLAGS="" 1297264fa531Smrg XMALLOC_ZERO_CFLAGS="" 1298264fa531Smrg XTMALLOC_ZERO_CFLAGS="" 1299264fa531Smrgfi 1300264fa531Smrg 1301264fa531SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 1302264fa531SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 1303264fa531SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 1304264fa531Smrg]) # XORG_CHECK_MALLOC_ZERO 1305264fa531Smrg 1306264fa531Smrgdnl Copyright 2005 Red Hat, Inc 1307264fa531Smrgdnl 1308264fa531Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 1309264fa531Smrgdnl documentation for any purpose is hereby granted without fee, provided that 1310264fa531Smrgdnl the above copyright notice appear in all copies and that both that 1311264fa531Smrgdnl copyright notice and this permission notice appear in supporting 1312264fa531Smrgdnl documentation. 1313264fa531Smrgdnl 1314264fa531Smrgdnl The above copyright notice and this permission notice shall be included 1315264fa531Smrgdnl in all copies or substantial portions of the Software. 1316264fa531Smrgdnl 1317264fa531Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1318264fa531Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1319264fa531Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 1320264fa531Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 1321264fa531Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 1322264fa531Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 1323264fa531Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 1324264fa531Smrgdnl 1325264fa531Smrgdnl Except as contained in this notice, the name of the copyright holders shall 1326264fa531Smrgdnl not be used in advertising or otherwise to promote the sale, use or 1327264fa531Smrgdnl other dealings in this Software without prior written authorization 1328264fa531Smrgdnl from the copyright holders. 1329264fa531Smrgdnl 1330264fa531Smrg 1331264fa531Smrg# XORG_RELEASE_VERSION 1332264fa531Smrg# -------------------- 1333264fa531Smrg# Adds --with/without-release-string and changes the PACKAGE and 1334264fa531Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If 1335264fa531Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. 1336264fa531Smrg 1337264fa531SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 1338264fa531Smrg AC_ARG_WITH(release-version, 1339264fa531Smrg AC_HELP_STRING([--with-release-version=STRING], 1340264fa531Smrg [Use release version string in package name]), 1341264fa531Smrg [RELEASE_VERSION="$withval"], 1342264fa531Smrg [RELEASE_VERSION=""]) 1343264fa531Smrg if test "x$RELEASE_VERSION" != "x"; then 1344264fa531Smrg PACKAGE="$PACKAGE-$RELEASE_VERSION" 1345264fa531Smrg PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" 1346264fa531Smrg AC_MSG_NOTICE([Building with package name set to $PACKAGE]) 1347264fa531Smrg fi 1348264fa531Smrg]) 1349264fa531Smrg 1350