aclocal.m4 revision 6ea72052
16ea72052Smrg# generated automatically by aclocal 1.7.9 -*- Autoconf -*- 26ea72052Smrg 36ea72052Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 46ea72052Smrg# Free Software Foundation, Inc. 56ea72052Smrg# This file is free software; the Free Software Foundation 66ea72052Smrg# gives unlimited permission to copy and/or distribute it, 76ea72052Smrg# with or without modifications, as long as this notice is preserved. 86ea72052Smrg 96ea72052Smrg# This program is distributed in the hope that it will be useful, 106ea72052Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 116ea72052Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 126ea72052Smrg# PARTICULAR PURPOSE. 136ea72052Smrg 146ea72052Smrg# Do all the work for Automake. -*- Autoconf -*- 156ea72052Smrg 166ea72052Smrg# This macro actually does too much some checks are only needed if 176ea72052Smrg# your package does certain things. But this isn't really a big deal. 186ea72052Smrg 196ea72052Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 206ea72052Smrg# Free Software Foundation, Inc. 216ea72052Smrg 226ea72052Smrg# This program is free software; you can redistribute it and/or modify 236ea72052Smrg# it under the terms of the GNU General Public License as published by 246ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 256ea72052Smrg# any later version. 266ea72052Smrg 276ea72052Smrg# This program is distributed in the hope that it will be useful, 286ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 296ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 306ea72052Smrg# GNU General Public License for more details. 316ea72052Smrg 326ea72052Smrg# You should have received a copy of the GNU General Public License 336ea72052Smrg# along with this program; if not, write to the Free Software 346ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 356ea72052Smrg# 02111-1307, USA. 366ea72052Smrg 376ea72052Smrg# serial 10 386ea72052Smrg 396ea72052SmrgAC_PREREQ([2.54]) 406ea72052Smrg 416ea72052Smrg# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow 426ea72052Smrg# the ones we care about. 436ea72052Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 446ea72052Smrg 456ea72052Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 466ea72052Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 476ea72052Smrg# ----------------------------------------------- 486ea72052Smrg# The call with PACKAGE and VERSION arguments is the old style 496ea72052Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 506ea72052Smrg# and VERSION should now be passed to AC_INIT and removed from 516ea72052Smrg# the call to AM_INIT_AUTOMAKE. 526ea72052Smrg# We support both call styles for the transition. After 536ea72052Smrg# the next Automake release, Autoconf can make the AC_INIT 546ea72052Smrg# arguments mandatory, and then we can depend on a new Autoconf 556ea72052Smrg# release and drop the old call support. 566ea72052SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 576ea72052Smrg[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 586ea72052Smrg AC_REQUIRE([AC_PROG_INSTALL])dnl 596ea72052Smrg# test to see if srcdir already configured 606ea72052Smrgif test "`cd $srcdir && pwd`" != "`pwd`" && 616ea72052Smrg test -f $srcdir/config.status; then 626ea72052Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 636ea72052Smrgfi 646ea72052Smrg 656ea72052Smrg# test whether we have cygpath 666ea72052Smrgif test -z "$CYGPATH_W"; then 676ea72052Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 686ea72052Smrg CYGPATH_W='cygpath -w' 696ea72052Smrg else 706ea72052Smrg CYGPATH_W=echo 716ea72052Smrg fi 726ea72052Smrgfi 736ea72052SmrgAC_SUBST([CYGPATH_W]) 746ea72052Smrg 756ea72052Smrg# Define the identity of the package. 766ea72052Smrgdnl Distinguish between old-style and new-style calls. 776ea72052Smrgm4_ifval([$2], 786ea72052Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 796ea72052Smrg AC_SUBST([PACKAGE], [$1])dnl 806ea72052Smrg AC_SUBST([VERSION], [$2])], 816ea72052Smrg[_AM_SET_OPTIONS([$1])dnl 826ea72052Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 836ea72052Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 846ea72052Smrg 856ea72052Smrg_AM_IF_OPTION([no-define],, 866ea72052Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 876ea72052Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 886ea72052Smrg 896ea72052Smrg# Some tools Automake needs. 906ea72052SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 916ea72052SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 926ea72052SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 936ea72052SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 946ea72052SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 956ea72052SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 966ea72052SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 976ea72052SmrgAM_MISSING_PROG(AMTAR, tar) 986ea72052SmrgAM_PROG_INSTALL_SH 996ea72052SmrgAM_PROG_INSTALL_STRIP 1006ea72052Smrg# We need awk for the "check" target. The system "awk" is bad on 1016ea72052Smrg# some platforms. 1026ea72052SmrgAC_REQUIRE([AC_PROG_AWK])dnl 1036ea72052SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 1046ea72052SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 1056ea72052Smrg 1066ea72052Smrg_AM_IF_OPTION([no-dependencies],, 1076ea72052Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 1086ea72052Smrg [_AM_DEPENDENCIES(CC)], 1096ea72052Smrg [define([AC_PROG_CC], 1106ea72052Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 1116ea72052SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 1126ea72052Smrg [_AM_DEPENDENCIES(CXX)], 1136ea72052Smrg [define([AC_PROG_CXX], 1146ea72052Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 1156ea72052Smrg]) 1166ea72052Smrg]) 1176ea72052Smrg 1186ea72052Smrg 1196ea72052Smrg# When config.status generates a header, we must update the stamp-h file. 1206ea72052Smrg# This file resides in the same directory as the config header 1216ea72052Smrg# that is generated. The stamp files are numbered to have different names. 1226ea72052Smrg 1236ea72052Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 1246ea72052Smrg# loop where config.status creates the headers, so we can generate 1256ea72052Smrg# our stamp files there. 1266ea72052SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 1276ea72052Smrg[# Compute $1's index in $config_headers. 1286ea72052Smrg_am_stamp_count=1 1296ea72052Smrgfor _am_header in $config_headers :; do 1306ea72052Smrg case $_am_header in 1316ea72052Smrg $1 | $1:* ) 1326ea72052Smrg break ;; 1336ea72052Smrg * ) 1346ea72052Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 1356ea72052Smrg esac 1366ea72052Smrgdone 1376ea72052Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) 1386ea72052Smrg 1396ea72052Smrg# Copyright 2002 Free Software Foundation, Inc. 1406ea72052Smrg 1416ea72052Smrg# This program is free software; you can redistribute it and/or modify 1426ea72052Smrg# it under the terms of the GNU General Public License as published by 1436ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 1446ea72052Smrg# any later version. 1456ea72052Smrg 1466ea72052Smrg# This program is distributed in the hope that it will be useful, 1476ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 1486ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1496ea72052Smrg# GNU General Public License for more details. 1506ea72052Smrg 1516ea72052Smrg# You should have received a copy of the GNU General Public License 1526ea72052Smrg# along with this program; if not, write to the Free Software 1536ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 1546ea72052Smrg 1556ea72052Smrg# AM_AUTOMAKE_VERSION(VERSION) 1566ea72052Smrg# ---------------------------- 1576ea72052Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 1586ea72052Smrg# generated from the m4 files accompanying Automake X.Y. 1596ea72052SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) 1606ea72052Smrg 1616ea72052Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 1626ea72052Smrg# ------------------------------- 1636ea72052Smrg# Call AM_AUTOMAKE_VERSION so it can be traced. 1646ea72052Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. 1656ea72052SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 1666ea72052Smrg [AM_AUTOMAKE_VERSION([1.7.9])]) 1676ea72052Smrg 1686ea72052Smrg# Helper functions for option handling. -*- Autoconf -*- 1696ea72052Smrg 1706ea72052Smrg# Copyright 2001, 2002 Free Software Foundation, Inc. 1716ea72052Smrg 1726ea72052Smrg# This program is free software; you can redistribute it and/or modify 1736ea72052Smrg# it under the terms of the GNU General Public License as published by 1746ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 1756ea72052Smrg# any later version. 1766ea72052Smrg 1776ea72052Smrg# This program is distributed in the hope that it will be useful, 1786ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 1796ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1806ea72052Smrg# GNU General Public License for more details. 1816ea72052Smrg 1826ea72052Smrg# You should have received a copy of the GNU General Public License 1836ea72052Smrg# along with this program; if not, write to the Free Software 1846ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 1856ea72052Smrg# 02111-1307, USA. 1866ea72052Smrg 1876ea72052Smrg# serial 2 1886ea72052Smrg 1896ea72052Smrg# _AM_MANGLE_OPTION(NAME) 1906ea72052Smrg# ----------------------- 1916ea72052SmrgAC_DEFUN([_AM_MANGLE_OPTION], 1926ea72052Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 1936ea72052Smrg 1946ea72052Smrg# _AM_SET_OPTION(NAME) 1956ea72052Smrg# ------------------------------ 1966ea72052Smrg# Set option NAME. Presently that only means defining a flag for this option. 1976ea72052SmrgAC_DEFUN([_AM_SET_OPTION], 1986ea72052Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 1996ea72052Smrg 2006ea72052Smrg# _AM_SET_OPTIONS(OPTIONS) 2016ea72052Smrg# ---------------------------------- 2026ea72052Smrg# OPTIONS is a space-separated list of Automake options. 2036ea72052SmrgAC_DEFUN([_AM_SET_OPTIONS], 2046ea72052Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 2056ea72052Smrg 2066ea72052Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 2076ea72052Smrg# ------------------------------------------- 2086ea72052Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 2096ea72052SmrgAC_DEFUN([_AM_IF_OPTION], 2106ea72052Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 2116ea72052Smrg 2126ea72052Smrg# 2136ea72052Smrg# Check to make sure that the build environment is sane. 2146ea72052Smrg# 2156ea72052Smrg 2166ea72052Smrg# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. 2176ea72052Smrg 2186ea72052Smrg# This program is free software; you can redistribute it and/or modify 2196ea72052Smrg# it under the terms of the GNU General Public License as published by 2206ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 2216ea72052Smrg# any later version. 2226ea72052Smrg 2236ea72052Smrg# This program is distributed in the hope that it will be useful, 2246ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 2256ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2266ea72052Smrg# GNU General Public License for more details. 2276ea72052Smrg 2286ea72052Smrg# You should have received a copy of the GNU General Public License 2296ea72052Smrg# along with this program; if not, write to the Free Software 2306ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 2316ea72052Smrg# 02111-1307, USA. 2326ea72052Smrg 2336ea72052Smrg# serial 3 2346ea72052Smrg 2356ea72052Smrg# AM_SANITY_CHECK 2366ea72052Smrg# --------------- 2376ea72052SmrgAC_DEFUN([AM_SANITY_CHECK], 2386ea72052Smrg[AC_MSG_CHECKING([whether build environment is sane]) 2396ea72052Smrg# Just in case 2406ea72052Smrgsleep 1 2416ea72052Smrgecho timestamp > conftest.file 2426ea72052Smrg# Do `set' in a subshell so we don't clobber the current shell's 2436ea72052Smrg# arguments. Must try -L first in case configure is actually a 2446ea72052Smrg# symlink; some systems play weird games with the mod time of symlinks 2456ea72052Smrg# (eg FreeBSD returns the mod time of the symlink's containing 2466ea72052Smrg# directory). 2476ea72052Smrgif ( 2486ea72052Smrg set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` 2496ea72052Smrg if test "$[*]" = "X"; then 2506ea72052Smrg # -L didn't work. 2516ea72052Smrg set X `ls -t $srcdir/configure conftest.file` 2526ea72052Smrg fi 2536ea72052Smrg rm -f conftest.file 2546ea72052Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 2556ea72052Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 2566ea72052Smrg 2576ea72052Smrg # If neither matched, then we have a broken ls. This can happen 2586ea72052Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 2596ea72052Smrg # broken ls alias from the environment. This has actually 2606ea72052Smrg # happened. Such a system could not be considered "sane". 2616ea72052Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 2626ea72052Smrgalias in your environment]) 2636ea72052Smrg fi 2646ea72052Smrg 2656ea72052Smrg test "$[2]" = conftest.file 2666ea72052Smrg ) 2676ea72052Smrgthen 2686ea72052Smrg # Ok. 2696ea72052Smrg : 2706ea72052Smrgelse 2716ea72052Smrg AC_MSG_ERROR([newly created file is older than distributed files! 2726ea72052SmrgCheck your system clock]) 2736ea72052Smrgfi 2746ea72052SmrgAC_MSG_RESULT(yes)]) 2756ea72052Smrg 2766ea72052Smrg# -*- Autoconf -*- 2776ea72052Smrg 2786ea72052Smrg 2796ea72052Smrg# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. 2806ea72052Smrg 2816ea72052Smrg# This program is free software; you can redistribute it and/or modify 2826ea72052Smrg# it under the terms of the GNU General Public License as published by 2836ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 2846ea72052Smrg# any later version. 2856ea72052Smrg 2866ea72052Smrg# This program is distributed in the hope that it will be useful, 2876ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 2886ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2896ea72052Smrg# GNU General Public License for more details. 2906ea72052Smrg 2916ea72052Smrg# You should have received a copy of the GNU General Public License 2926ea72052Smrg# along with this program; if not, write to the Free Software 2936ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 2946ea72052Smrg# 02111-1307, USA. 2956ea72052Smrg 2966ea72052Smrg# serial 3 2976ea72052Smrg 2986ea72052Smrg# AM_MISSING_PROG(NAME, PROGRAM) 2996ea72052Smrg# ------------------------------ 3006ea72052SmrgAC_DEFUN([AM_MISSING_PROG], 3016ea72052Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 3026ea72052Smrg$1=${$1-"${am_missing_run}$2"} 3036ea72052SmrgAC_SUBST($1)]) 3046ea72052Smrg 3056ea72052Smrg 3066ea72052Smrg# AM_MISSING_HAS_RUN 3076ea72052Smrg# ------------------ 3086ea72052Smrg# Define MISSING if not defined so far and test if it supports --run. 3096ea72052Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 3106ea72052SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 3116ea72052Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 3126ea72052Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" 3136ea72052Smrg# Use eval to expand $SHELL 3146ea72052Smrgif eval "$MISSING --run true"; then 3156ea72052Smrg am_missing_run="$MISSING --run " 3166ea72052Smrgelse 3176ea72052Smrg am_missing_run= 3186ea72052Smrg AC_MSG_WARN([`missing' script is too old or missing]) 3196ea72052Smrgfi 3206ea72052Smrg]) 3216ea72052Smrg 3226ea72052Smrg# AM_AUX_DIR_EXPAND 3236ea72052Smrg 3246ea72052Smrg# Copyright 2001 Free Software Foundation, Inc. 3256ea72052Smrg 3266ea72052Smrg# This program is free software; you can redistribute it and/or modify 3276ea72052Smrg# it under the terms of the GNU General Public License as published by 3286ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 3296ea72052Smrg# any later version. 3306ea72052Smrg 3316ea72052Smrg# This program is distributed in the hope that it will be useful, 3326ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 3336ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 3346ea72052Smrg# GNU General Public License for more details. 3356ea72052Smrg 3366ea72052Smrg# You should have received a copy of the GNU General Public License 3376ea72052Smrg# along with this program; if not, write to the Free Software 3386ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 3396ea72052Smrg# 02111-1307, USA. 3406ea72052Smrg 3416ea72052Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 3426ea72052Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 3436ea72052Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 3446ea72052Smrg# 3456ea72052Smrg# Of course, Automake must honor this variable whenever it calls a 3466ea72052Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 3476ea72052Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 3486ea72052Smrg# depending on how configure is run. This is pretty annoying, since 3496ea72052Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 3506ea72052Smrg# source directory, any form will work fine, but in subdirectories a 3516ea72052Smrg# relative path needs to be adjusted first. 3526ea72052Smrg# 3536ea72052Smrg# $ac_aux_dir/missing 3546ea72052Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 3556ea72052Smrg# $top_srcdir/$ac_aux_dir/missing 3566ea72052Smrg# fails if $ac_aux_dir is absolute, 3576ea72052Smrg# fails when called from a subdirectory in a VPATH build with 3586ea72052Smrg# a relative $ac_aux_dir 3596ea72052Smrg# 3606ea72052Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 3616ea72052Smrg# are both prefixed by $srcdir. In an in-source build this is usually 3626ea72052Smrg# harmless because $srcdir is `.', but things will broke when you 3636ea72052Smrg# start a VPATH build or use an absolute $srcdir. 3646ea72052Smrg# 3656ea72052Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 3666ea72052Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 3676ea72052Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 3686ea72052Smrg# and then we would define $MISSING as 3696ea72052Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 3706ea72052Smrg# This will work as long as MISSING is not called from configure, because 3716ea72052Smrg# unfortunately $(top_srcdir) has no meaning in configure. 3726ea72052Smrg# However there are other variables, like CC, which are often used in 3736ea72052Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 3746ea72052Smrg# 3756ea72052Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 3766ea72052Smrg# absolute PATH. The drawback is that using absolute paths prevent a 3776ea72052Smrg# configured tree to be moved without reconfiguration. 3786ea72052Smrg 3796ea72052Smrg# Rely on autoconf to set up CDPATH properly. 3806ea72052SmrgAC_PREREQ([2.50]) 3816ea72052Smrg 3826ea72052SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], [ 3836ea72052Smrg# expand $ac_aux_dir to an absolute path 3846ea72052Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 3856ea72052Smrg]) 3866ea72052Smrg 3876ea72052Smrg# AM_PROG_INSTALL_SH 3886ea72052Smrg# ------------------ 3896ea72052Smrg# Define $install_sh. 3906ea72052Smrg 3916ea72052Smrg# Copyright 2001 Free Software Foundation, Inc. 3926ea72052Smrg 3936ea72052Smrg# This program is free software; you can redistribute it and/or modify 3946ea72052Smrg# it under the terms of the GNU General Public License as published by 3956ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 3966ea72052Smrg# any later version. 3976ea72052Smrg 3986ea72052Smrg# This program is distributed in the hope that it will be useful, 3996ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 4006ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 4016ea72052Smrg# GNU General Public License for more details. 4026ea72052Smrg 4036ea72052Smrg# You should have received a copy of the GNU General Public License 4046ea72052Smrg# along with this program; if not, write to the Free Software 4056ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 4066ea72052Smrg# 02111-1307, USA. 4076ea72052Smrg 4086ea72052SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 4096ea72052Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 4106ea72052Smrginstall_sh=${install_sh-"$am_aux_dir/install-sh"} 4116ea72052SmrgAC_SUBST(install_sh)]) 4126ea72052Smrg 4136ea72052Smrg# AM_PROG_INSTALL_STRIP 4146ea72052Smrg 4156ea72052Smrg# Copyright 2001 Free Software Foundation, Inc. 4166ea72052Smrg 4176ea72052Smrg# This program is free software; you can redistribute it and/or modify 4186ea72052Smrg# it under the terms of the GNU General Public License as published by 4196ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 4206ea72052Smrg# any later version. 4216ea72052Smrg 4226ea72052Smrg# This program is distributed in the hope that it will be useful, 4236ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 4246ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 4256ea72052Smrg# GNU General Public License for more details. 4266ea72052Smrg 4276ea72052Smrg# You should have received a copy of the GNU General Public License 4286ea72052Smrg# along with this program; if not, write to the Free Software 4296ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 4306ea72052Smrg# 02111-1307, USA. 4316ea72052Smrg 4326ea72052Smrg# One issue with vendor `install' (even GNU) is that you can't 4336ea72052Smrg# specify the program used to strip binaries. This is especially 4346ea72052Smrg# annoying in cross-compiling environments, where the build's strip 4356ea72052Smrg# is unlikely to handle the host's binaries. 4366ea72052Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 4376ea72052Smrg# always use install-sh in `make install-strip', and initialize 4386ea72052Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 4396ea72052SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 4406ea72052Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 4416ea72052Smrg# Installed binaries are usually stripped using `strip' when the user 4426ea72052Smrg# run `make install-strip'. However `strip' might not be the right 4436ea72052Smrg# tool to use in cross-compilation environments, therefore Automake 4446ea72052Smrg# will honor the `STRIP' environment variable to overrule this program. 4456ea72052Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 4466ea72052Smrgif test "$cross_compiling" != no; then 4476ea72052Smrg AC_CHECK_TOOL([STRIP], [strip], :) 4486ea72052Smrgfi 4496ea72052SmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" 4506ea72052SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 4516ea72052Smrg 4526ea72052Smrg# -*- Autoconf -*- 4536ea72052Smrg# Copyright (C) 2003 Free Software Foundation, Inc. 4546ea72052Smrg 4556ea72052Smrg# This program is free software; you can redistribute it and/or modify 4566ea72052Smrg# it under the terms of the GNU General Public License as published by 4576ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 4586ea72052Smrg# any later version. 4596ea72052Smrg 4606ea72052Smrg# This program is distributed in the hope that it will be useful, 4616ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 4626ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 4636ea72052Smrg# GNU General Public License for more details. 4646ea72052Smrg 4656ea72052Smrg# You should have received a copy of the GNU General Public License 4666ea72052Smrg# along with this program; if not, write to the Free Software 4676ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 4686ea72052Smrg# 02111-1307, USA. 4696ea72052Smrg 4706ea72052Smrg# serial 1 4716ea72052Smrg 4726ea72052Smrg# Check whether the underlying file-system supports filenames 4736ea72052Smrg# with a leading dot. For instance MS-DOS doesn't. 4746ea72052SmrgAC_DEFUN([AM_SET_LEADING_DOT], 4756ea72052Smrg[rm -rf .tst 2>/dev/null 4766ea72052Smrgmkdir .tst 2>/dev/null 4776ea72052Smrgif test -d .tst; then 4786ea72052Smrg am__leading_dot=. 4796ea72052Smrgelse 4806ea72052Smrg am__leading_dot=_ 4816ea72052Smrgfi 4826ea72052Smrgrmdir .tst 2>/dev/null 4836ea72052SmrgAC_SUBST([am__leading_dot])]) 4846ea72052Smrg 4856ea72052Smrg# serial 5 -*- Autoconf -*- 4866ea72052Smrg 4876ea72052Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 4886ea72052Smrg 4896ea72052Smrg# This program is free software; you can redistribute it and/or modify 4906ea72052Smrg# it under the terms of the GNU General Public License as published by 4916ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 4926ea72052Smrg# any later version. 4936ea72052Smrg 4946ea72052Smrg# This program is distributed in the hope that it will be useful, 4956ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 4966ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 4976ea72052Smrg# GNU General Public License for more details. 4986ea72052Smrg 4996ea72052Smrg# You should have received a copy of the GNU General Public License 5006ea72052Smrg# along with this program; if not, write to the Free Software 5016ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 5026ea72052Smrg# 02111-1307, USA. 5036ea72052Smrg 5046ea72052Smrg 5056ea72052Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 5066ea72052Smrg# written in clear, in which case automake, when reading aclocal.m4, 5076ea72052Smrg# will think it sees a *use*, and therefore will trigger all it's 5086ea72052Smrg# C support machinery. Also note that it means that autoscan, seeing 5096ea72052Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 5106ea72052Smrg 5116ea72052Smrg 5126ea72052Smrg 5136ea72052Smrg# _AM_DEPENDENCIES(NAME) 5146ea72052Smrg# ---------------------- 5156ea72052Smrg# See how the compiler implements dependency checking. 5166ea72052Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 5176ea72052Smrg# We try a few techniques and use that to set a single cache variable. 5186ea72052Smrg# 5196ea72052Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 5206ea72052Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 5216ea72052Smrg# dependency, and given that the user is not expected to run this macro, 5226ea72052Smrg# just rely on AC_PROG_CC. 5236ea72052SmrgAC_DEFUN([_AM_DEPENDENCIES], 5246ea72052Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 5256ea72052SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 5266ea72052SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 5276ea72052SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 5286ea72052Smrg 5296ea72052Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 5306ea72052Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 5316ea72052Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 5326ea72052Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 5336ea72052Smrg [depcc="$$1" am_compiler_list=]) 5346ea72052Smrg 5356ea72052SmrgAC_CACHE_CHECK([dependency style of $depcc], 5366ea72052Smrg [am_cv_$1_dependencies_compiler_type], 5376ea72052Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 5386ea72052Smrg # We make a subdir and do the tests there. Otherwise we can end up 5396ea72052Smrg # making bogus files that we don't know about and never remove. For 5406ea72052Smrg # instance it was reported that on HP-UX the gcc test will end up 5416ea72052Smrg # making a dummy file named `D' -- because `-MD' means `put the output 5426ea72052Smrg # in D'. 5436ea72052Smrg mkdir conftest.dir 5446ea72052Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 5456ea72052Smrg # using a relative directory. 5466ea72052Smrg cp "$am_depcomp" conftest.dir 5476ea72052Smrg cd conftest.dir 5486ea72052Smrg # We will build objects and dependencies in a subdirectory because 5496ea72052Smrg # it helps to detect inapplicable dependency modes. For instance 5506ea72052Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 5516ea72052Smrg # side effect of compilation, but ICC will put the dependencies in 5526ea72052Smrg # the current directory while Tru64 will put them in the object 5536ea72052Smrg # directory. 5546ea72052Smrg mkdir sub 5556ea72052Smrg 5566ea72052Smrg am_cv_$1_dependencies_compiler_type=none 5576ea72052Smrg if test "$am_compiler_list" = ""; then 5586ea72052Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 5596ea72052Smrg fi 5606ea72052Smrg for depmode in $am_compiler_list; do 5616ea72052Smrg # Setup a source with many dependencies, because some compilers 5626ea72052Smrg # like to wrap large dependency lists on column 80 (with \), and 5636ea72052Smrg # we should not choose a depcomp mode which is confused by this. 5646ea72052Smrg # 5656ea72052Smrg # We need to recreate these files for each test, as the compiler may 5666ea72052Smrg # overwrite some of them when testing with obscure command lines. 5676ea72052Smrg # This happens at least with the AIX C compiler. 5686ea72052Smrg : > sub/conftest.c 5696ea72052Smrg for i in 1 2 3 4 5 6; do 5706ea72052Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 5716ea72052Smrg : > sub/conftst$i.h 5726ea72052Smrg done 5736ea72052Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 5746ea72052Smrg 5756ea72052Smrg case $depmode in 5766ea72052Smrg nosideeffect) 5776ea72052Smrg # after this tag, mechanisms are not by side-effect, so they'll 5786ea72052Smrg # only be used when explicitly requested 5796ea72052Smrg if test "x$enable_dependency_tracking" = xyes; then 5806ea72052Smrg continue 5816ea72052Smrg else 5826ea72052Smrg break 5836ea72052Smrg fi 5846ea72052Smrg ;; 5856ea72052Smrg none) break ;; 5866ea72052Smrg esac 5876ea72052Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 5886ea72052Smrg # mode. It turns out that the SunPro C++ compiler does not properly 5896ea72052Smrg # handle `-M -o', and we need to detect this. 5906ea72052Smrg if depmode=$depmode \ 5916ea72052Smrg source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ 5926ea72052Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 5936ea72052Smrg $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ 5946ea72052Smrg >/dev/null 2>conftest.err && 5956ea72052Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 5966ea72052Smrg grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && 5976ea72052Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 5986ea72052Smrg # icc doesn't choke on unknown options, it will just issue warnings 5996ea72052Smrg # (even with -Werror). So we grep stderr for any message 6006ea72052Smrg # that says an option was ignored. 6016ea72052Smrg if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else 6026ea72052Smrg am_cv_$1_dependencies_compiler_type=$depmode 6036ea72052Smrg break 6046ea72052Smrg fi 6056ea72052Smrg fi 6066ea72052Smrg done 6076ea72052Smrg 6086ea72052Smrg cd .. 6096ea72052Smrg rm -rf conftest.dir 6106ea72052Smrgelse 6116ea72052Smrg am_cv_$1_dependencies_compiler_type=none 6126ea72052Smrgfi 6136ea72052Smrg]) 6146ea72052SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 6156ea72052SmrgAM_CONDITIONAL([am__fastdep$1], [ 6166ea72052Smrg test "x$enable_dependency_tracking" != xno \ 6176ea72052Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 6186ea72052Smrg]) 6196ea72052Smrg 6206ea72052Smrg 6216ea72052Smrg# AM_SET_DEPDIR 6226ea72052Smrg# ------------- 6236ea72052Smrg# Choose a directory name for dependency files. 6246ea72052Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 6256ea72052SmrgAC_DEFUN([AM_SET_DEPDIR], 6266ea72052Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 6276ea72052SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 6286ea72052Smrg]) 6296ea72052Smrg 6306ea72052Smrg 6316ea72052Smrg# AM_DEP_TRACK 6326ea72052Smrg# ------------ 6336ea72052SmrgAC_DEFUN([AM_DEP_TRACK], 6346ea72052Smrg[AC_ARG_ENABLE(dependency-tracking, 6356ea72052Smrg[ --disable-dependency-tracking Speeds up one-time builds 6366ea72052Smrg --enable-dependency-tracking Do not reject slow dependency extractors]) 6376ea72052Smrgif test "x$enable_dependency_tracking" != xno; then 6386ea72052Smrg am_depcomp="$ac_aux_dir/depcomp" 6396ea72052Smrg AMDEPBACKSLASH='\' 6406ea72052Smrgfi 6416ea72052SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 6426ea72052SmrgAC_SUBST([AMDEPBACKSLASH]) 6436ea72052Smrg]) 6446ea72052Smrg 6456ea72052Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 6466ea72052Smrg 6476ea72052Smrg# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 6486ea72052Smrg 6496ea72052Smrg# This program is free software; you can redistribute it and/or modify 6506ea72052Smrg# it under the terms of the GNU General Public License as published by 6516ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 6526ea72052Smrg# any later version. 6536ea72052Smrg 6546ea72052Smrg# This program is distributed in the hope that it will be useful, 6556ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 6566ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 6576ea72052Smrg# GNU General Public License for more details. 6586ea72052Smrg 6596ea72052Smrg# You should have received a copy of the GNU General Public License 6606ea72052Smrg# along with this program; if not, write to the Free Software 6616ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 6626ea72052Smrg# 02111-1307, USA. 6636ea72052Smrg 6646ea72052Smrg#serial 2 6656ea72052Smrg 6666ea72052Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 6676ea72052Smrg# ------------------------------ 6686ea72052SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 6696ea72052Smrg[for mf in $CONFIG_FILES; do 6706ea72052Smrg # Strip MF so we end up with the name of the file. 6716ea72052Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 6726ea72052Smrg # Check whether this is an Automake generated Makefile or not. 6736ea72052Smrg # We used to match only the files named `Makefile.in', but 6746ea72052Smrg # some people rename them; so instead we look at the file content. 6756ea72052Smrg # Grep'ing the first line is not enough: some people post-process 6766ea72052Smrg # each Makefile.in and add a new line on top of each file to say so. 6776ea72052Smrg # So let's grep whole file. 6786ea72052Smrg if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then 6796ea72052Smrg dirpart=`AS_DIRNAME("$mf")` 6806ea72052Smrg else 6816ea72052Smrg continue 6826ea72052Smrg fi 6836ea72052Smrg grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue 6846ea72052Smrg # Extract the definition of DEP_FILES from the Makefile without 6856ea72052Smrg # running `make'. 6866ea72052Smrg DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` 6876ea72052Smrg test -z "$DEPDIR" && continue 6886ea72052Smrg # When using ansi2knr, U may be empty or an underscore; expand it 6896ea72052Smrg U=`sed -n -e '/^U = / s///p' < "$mf"` 6906ea72052Smrg test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" 6916ea72052Smrg # We invoke sed twice because it is the simplest approach to 6926ea72052Smrg # changing $(DEPDIR) to its actual value in the expansion. 6936ea72052Smrg for file in `sed -n -e ' 6946ea72052Smrg /^DEP_FILES = .*\\\\$/ { 6956ea72052Smrg s/^DEP_FILES = // 6966ea72052Smrg :loop 6976ea72052Smrg s/\\\\$// 6986ea72052Smrg p 6996ea72052Smrg n 7006ea72052Smrg /\\\\$/ b loop 7016ea72052Smrg p 7026ea72052Smrg } 7036ea72052Smrg /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ 7046ea72052Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 7056ea72052Smrg # Make sure the directory exists. 7066ea72052Smrg test -f "$dirpart/$file" && continue 7076ea72052Smrg fdir=`AS_DIRNAME(["$file"])` 7086ea72052Smrg AS_MKDIR_P([$dirpart/$fdir]) 7096ea72052Smrg # echo "creating $dirpart/$file" 7106ea72052Smrg echo '# dummy' > "$dirpart/$file" 7116ea72052Smrg done 7126ea72052Smrgdone 7136ea72052Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 7146ea72052Smrg 7156ea72052Smrg 7166ea72052Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 7176ea72052Smrg# ----------------------------- 7186ea72052Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 7196ea72052Smrg# 7206ea72052Smrg# This code is only required when automatic dependency tracking 7216ea72052Smrg# is enabled. FIXME. This creates each `.P' file that we will 7226ea72052Smrg# need in order to bootstrap the dependency handling code. 7236ea72052SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 7246ea72052Smrg[AC_CONFIG_COMMANDS([depfiles], 7256ea72052Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 7266ea72052Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 7276ea72052Smrg]) 7286ea72052Smrg 7296ea72052Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 7306ea72052Smrg 7316ea72052Smrg# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. 7326ea72052Smrg 7336ea72052Smrg# This program is free software; you can redistribute it and/or modify 7346ea72052Smrg# it under the terms of the GNU General Public License as published by 7356ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 7366ea72052Smrg# any later version. 7376ea72052Smrg 7386ea72052Smrg# This program is distributed in the hope that it will be useful, 7396ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 7406ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 7416ea72052Smrg# GNU General Public License for more details. 7426ea72052Smrg 7436ea72052Smrg# You should have received a copy of the GNU General Public License 7446ea72052Smrg# along with this program; if not, write to the Free Software 7456ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 7466ea72052Smrg# 02111-1307, USA. 7476ea72052Smrg 7486ea72052Smrg# serial 2 7496ea72052Smrg 7506ea72052Smrg# AM_MAKE_INCLUDE() 7516ea72052Smrg# ----------------- 7526ea72052Smrg# Check to see how make treats includes. 7536ea72052SmrgAC_DEFUN([AM_MAKE_INCLUDE], 7546ea72052Smrg[am_make=${MAKE-make} 7556ea72052Smrgcat > confinc << 'END' 7566ea72052Smrgam__doit: 7576ea72052Smrg @echo done 7586ea72052Smrg.PHONY: am__doit 7596ea72052SmrgEND 7606ea72052Smrg# If we don't find an include directive, just comment out the code. 7616ea72052SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 7626ea72052Smrgam__include="#" 7636ea72052Smrgam__quote= 7646ea72052Smrg_am_result=none 7656ea72052Smrg# First try GNU make style include. 7666ea72052Smrgecho "include confinc" > confmf 7676ea72052Smrg# We grep out `Entering directory' and `Leaving directory' 7686ea72052Smrg# messages which can occur if `w' ends up in MAKEFLAGS. 7696ea72052Smrg# In particular we don't look at `^make:' because GNU make might 7706ea72052Smrg# be invoked under some other name (usually "gmake"), in which 7716ea72052Smrg# case it prints its new name instead of `make'. 7726ea72052Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then 7736ea72052Smrg am__include=include 7746ea72052Smrg am__quote= 7756ea72052Smrg _am_result=GNU 7766ea72052Smrgfi 7776ea72052Smrg# Now try BSD make style include. 7786ea72052Smrgif test "$am__include" = "#"; then 7796ea72052Smrg echo '.include "confinc"' > confmf 7806ea72052Smrg if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then 7816ea72052Smrg am__include=.include 7826ea72052Smrg am__quote="\"" 7836ea72052Smrg _am_result=BSD 7846ea72052Smrg fi 7856ea72052Smrgfi 7866ea72052SmrgAC_SUBST([am__include]) 7876ea72052SmrgAC_SUBST([am__quote]) 7886ea72052SmrgAC_MSG_RESULT([$_am_result]) 7896ea72052Smrgrm -f confinc confmf 7906ea72052Smrg]) 7916ea72052Smrg 7926ea72052Smrg# AM_CONDITIONAL -*- Autoconf -*- 7936ea72052Smrg 7946ea72052Smrg# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. 7956ea72052Smrg 7966ea72052Smrg# This program is free software; you can redistribute it and/or modify 7976ea72052Smrg# it under the terms of the GNU General Public License as published by 7986ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 7996ea72052Smrg# any later version. 8006ea72052Smrg 8016ea72052Smrg# This program is distributed in the hope that it will be useful, 8026ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 8036ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 8046ea72052Smrg# GNU General Public License for more details. 8056ea72052Smrg 8066ea72052Smrg# You should have received a copy of the GNU General Public License 8076ea72052Smrg# along with this program; if not, write to the Free Software 8086ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 8096ea72052Smrg# 02111-1307, USA. 8106ea72052Smrg 8116ea72052Smrg# serial 5 8126ea72052Smrg 8136ea72052SmrgAC_PREREQ(2.52) 8146ea72052Smrg 8156ea72052Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 8166ea72052Smrg# ------------------------------------- 8176ea72052Smrg# Define a conditional. 8186ea72052SmrgAC_DEFUN([AM_CONDITIONAL], 8196ea72052Smrg[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 8206ea72052Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 8216ea72052SmrgAC_SUBST([$1_TRUE]) 8226ea72052SmrgAC_SUBST([$1_FALSE]) 8236ea72052Smrgif $2; then 8246ea72052Smrg $1_TRUE= 8256ea72052Smrg $1_FALSE='#' 8266ea72052Smrgelse 8276ea72052Smrg $1_TRUE='#' 8286ea72052Smrg $1_FALSE= 8296ea72052Smrgfi 8306ea72052SmrgAC_CONFIG_COMMANDS_PRE( 8316ea72052Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 8326ea72052Smrg AC_MSG_ERROR([conditional "$1" was never defined. 8336ea72052SmrgUsually this means the macro was only invoked conditionally.]) 8346ea72052Smrgfi])]) 8356ea72052Smrg 8366ea72052Smrg# Add --enable-maintainer-mode option to configure. 8376ea72052Smrg# From Jim Meyering 8386ea72052Smrg 8396ea72052Smrg# Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. 8406ea72052Smrg 8416ea72052Smrg# This program is free software; you can redistribute it and/or modify 8426ea72052Smrg# it under the terms of the GNU General Public License as published by 8436ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 8446ea72052Smrg# any later version. 8456ea72052Smrg 8466ea72052Smrg# This program is distributed in the hope that it will be useful, 8476ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 8486ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 8496ea72052Smrg# GNU General Public License for more details. 8506ea72052Smrg 8516ea72052Smrg# You should have received a copy of the GNU General Public License 8526ea72052Smrg# along with this program; if not, write to the Free Software 8536ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 8546ea72052Smrg# 02111-1307, USA. 8556ea72052Smrg 8566ea72052Smrg# serial 2 8576ea72052Smrg 8586ea72052SmrgAC_DEFUN([AM_MAINTAINER_MODE], 8596ea72052Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) 8606ea72052Smrg dnl maintainer-mode is disabled by default 8616ea72052Smrg AC_ARG_ENABLE(maintainer-mode, 8626ea72052Smrg[ --enable-maintainer-mode enable make rules and dependencies not useful 8636ea72052Smrg (and sometimes confusing) to the casual installer], 8646ea72052Smrg USE_MAINTAINER_MODE=$enableval, 8656ea72052Smrg USE_MAINTAINER_MODE=no) 8666ea72052Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 8676ea72052Smrg AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) 8686ea72052Smrg MAINT=$MAINTAINER_MODE_TRUE 8696ea72052Smrg AC_SUBST(MAINT)dnl 8706ea72052Smrg] 8716ea72052Smrg) 8726ea72052Smrg 8736ea72052SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 8746ea72052Smrg 8756ea72052Smrg# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- 8766ea72052Smrg 8776ea72052Smrg# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. 8786ea72052Smrg 8796ea72052Smrg# This program is free software; you can redistribute it and/or modify 8806ea72052Smrg# it under the terms of the GNU General Public License as published by 8816ea72052Smrg# the Free Software Foundation; either version 2, or (at your option) 8826ea72052Smrg# any later version. 8836ea72052Smrg 8846ea72052Smrg# This program is distributed in the hope that it will be useful, 8856ea72052Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 8866ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 8876ea72052Smrg# GNU General Public License for more details. 8886ea72052Smrg 8896ea72052Smrg# You should have received a copy of the GNU General Public License 8906ea72052Smrg# along with this program; if not, write to the Free Software 8916ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 8926ea72052Smrg# 02111-1307, USA. 8936ea72052Smrg 8946ea72052SmrgAC_PREREQ([2.52]) 8956ea72052Smrg 8966ea72052Smrg# serial 6 8976ea72052Smrg 8986ea72052Smrg# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 8996ea72052SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 9006ea72052Smrg 9016ea72052Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 9026ea72052Smrg# 9036ea72052Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 9046ea72052Smrg# 9056ea72052Smrg# This program is free software; you can redistribute it and/or modify 9066ea72052Smrg# it under the terms of the GNU General Public License as published by 9076ea72052Smrg# the Free Software Foundation; either version 2 of the License, or 9086ea72052Smrg# (at your option) any later version. 9096ea72052Smrg# 9106ea72052Smrg# This program is distributed in the hope that it will be useful, but 9116ea72052Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 9126ea72052Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 9136ea72052Smrg# General Public License for more details. 9146ea72052Smrg# 9156ea72052Smrg# You should have received a copy of the GNU General Public License 9166ea72052Smrg# along with this program; if not, write to the Free Software 9176ea72052Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 9186ea72052Smrg# 9196ea72052Smrg# As a special exception to the GNU General Public License, if you 9206ea72052Smrg# distribute this file as part of a program that contains a 9216ea72052Smrg# configuration script generated by Autoconf, you may include it under 9226ea72052Smrg# the same distribution terms that you use for the rest of that program. 9236ea72052Smrg 9246ea72052Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 9256ea72052Smrg# ---------------------------------- 9266ea72052SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 9276ea72052Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 9286ea72052Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 9296ea72052SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 9306ea72052Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 9316ea72052Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 9326ea72052Smrgfi 9336ea72052Smrgif test -n "$PKG_CONFIG"; then 9346ea72052Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 9356ea72052Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 9366ea72052Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 9376ea72052Smrg AC_MSG_RESULT([yes]) 9386ea72052Smrg else 9396ea72052Smrg AC_MSG_RESULT([no]) 9406ea72052Smrg PKG_CONFIG="" 9416ea72052Smrg fi 9426ea72052Smrg 9436ea72052Smrgfi[]dnl 9446ea72052Smrg])# PKG_PROG_PKG_CONFIG 9456ea72052Smrg 9466ea72052Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 9476ea72052Smrg# 9486ea72052Smrg# Check to see whether a particular set of modules exists. Similar 9496ea72052Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 9506ea72052Smrg# 9516ea72052Smrg# 9526ea72052Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 9536ea72052Smrg# this or PKG_CHECK_MODULES is called, or make sure to call 9546ea72052Smrg# PKG_CHECK_EXISTS manually 9556ea72052Smrg# -------------------------------------------------------------- 9566ea72052SmrgAC_DEFUN([PKG_CHECK_EXISTS], 9576ea72052Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 9586ea72052Smrgif test -n "$PKG_CONFIG" && \ 9596ea72052Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 9606ea72052Smrg m4_ifval([$2], [$2], [:]) 9616ea72052Smrgm4_ifvaln([$3], [else 9626ea72052Smrg $3])dnl 9636ea72052Smrgfi]) 9646ea72052Smrg 9656ea72052Smrg 9666ea72052Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 9676ea72052Smrg# --------------------------------------------- 9686ea72052Smrgm4_define([_PKG_CONFIG], 9696ea72052Smrg[if test -n "$PKG_CONFIG"; then 9706ea72052Smrg if test -n "$$1"; then 9716ea72052Smrg pkg_cv_[]$1="$$1" 9726ea72052Smrg else 9736ea72052Smrg PKG_CHECK_EXISTS([$3], 9746ea72052Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 9756ea72052Smrg [pkg_failed=yes]) 9766ea72052Smrg fi 9776ea72052Smrgelse 9786ea72052Smrg pkg_failed=untried 9796ea72052Smrgfi[]dnl 9806ea72052Smrg])# _PKG_CONFIG 9816ea72052Smrg 9826ea72052Smrg# _PKG_SHORT_ERRORS_SUPPORTED 9836ea72052Smrg# ----------------------------- 9846ea72052SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 9856ea72052Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 9866ea72052Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 9876ea72052Smrg _pkg_short_errors_supported=yes 9886ea72052Smrgelse 9896ea72052Smrg _pkg_short_errors_supported=no 9906ea72052Smrgfi[]dnl 9916ea72052Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 9926ea72052Smrg 9936ea72052Smrg 9946ea72052Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 9956ea72052Smrg# [ACTION-IF-NOT-FOUND]) 9966ea72052Smrg# 9976ea72052Smrg# 9986ea72052Smrg# Note that if there is a possibility the first call to 9996ea72052Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 10006ea72052Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 10016ea72052Smrg# 10026ea72052Smrg# 10036ea72052Smrg# -------------------------------------------------------------- 10046ea72052SmrgAC_DEFUN([PKG_CHECK_MODULES], 10056ea72052Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 10066ea72052SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 10076ea72052SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 10086ea72052Smrg 10096ea72052Smrgpkg_failed=no 10106ea72052SmrgAC_MSG_CHECKING([for $1]) 10116ea72052Smrg 10126ea72052Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 10136ea72052Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 10146ea72052Smrg 10156ea72052Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 10166ea72052Smrgand $1[]_LIBS to avoid the need to call pkg-config. 10176ea72052SmrgSee the pkg-config man page for more details.]) 10186ea72052Smrg 10196ea72052Smrgif test $pkg_failed = yes; then 10206ea72052Smrg _PKG_SHORT_ERRORS_SUPPORTED 10216ea72052Smrg if test $_pkg_short_errors_supported = yes; then 10226ea72052Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` 10236ea72052Smrg else 10246ea72052Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` 10256ea72052Smrg fi 10266ea72052Smrg # Put the nasty error message in config.log where it belongs 10276ea72052Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 10286ea72052Smrg 10296ea72052Smrg ifelse([$4], , [AC_MSG_ERROR(dnl 10306ea72052Smrg[Package requirements ($2) were not met: 10316ea72052Smrg 10326ea72052Smrg$$1_PKG_ERRORS 10336ea72052Smrg 10346ea72052SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 10356ea72052Smrginstalled software in a non-standard prefix. 10366ea72052Smrg 10376ea72052Smrg_PKG_TEXT 10386ea72052Smrg])], 10396ea72052Smrg [$4]) 10406ea72052Smrgelif test $pkg_failed = untried; then 10416ea72052Smrg ifelse([$4], , [AC_MSG_FAILURE(dnl 10426ea72052Smrg[The pkg-config script could not be found or is too old. Make sure it 10436ea72052Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 10446ea72052Smrgpath to pkg-config. 10456ea72052Smrg 10466ea72052Smrg_PKG_TEXT 10476ea72052Smrg 10486ea72052SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], 10496ea72052Smrg [$4]) 10506ea72052Smrgelse 10516ea72052Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 10526ea72052Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 10536ea72052Smrg AC_MSG_RESULT([yes]) 10546ea72052Smrg ifelse([$3], , :, [$3]) 10556ea72052Smrgfi[]dnl 10566ea72052Smrg])# PKG_CHECK_MODULES 10576ea72052Smrg 10586ea72052Smrgdnl $Id: aclocal.m4,v 1.1.1.1 2008/07/30 04:08:32 mrg Exp $ 10596ea72052Smrgdnl 10606ea72052Smrgdnl Copyright 2005 Sun Microsystems, Inc. All rights reserved. 10616ea72052Smrgdnl 10626ea72052Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 10636ea72052Smrgdnl documentation for any purpose is hereby granted without fee, provided that 10646ea72052Smrgdnl the above copyright notice appear in all copies and that both that 10656ea72052Smrgdnl copyright notice and this permission notice appear in supporting 10666ea72052Smrgdnl documentation. 10676ea72052Smrgdnl 10686ea72052Smrgdnl The above copyright notice and this permission notice shall be included 10696ea72052Smrgdnl in all copies or substantial portions of the Software. 10706ea72052Smrgdnl 10716ea72052Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 10726ea72052Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 10736ea72052Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 10746ea72052Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 10756ea72052Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 10766ea72052Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 10776ea72052Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 10786ea72052Smrgdnl 10796ea72052Smrgdnl Except as contained in this notice, the name of the copyright holders shall 10806ea72052Smrgdnl not be used in advertising or otherwise to promote the sale, use or 10816ea72052Smrgdnl other dealings in this Software without prior written authorization 10826ea72052Smrgdnl from the copyright holders. 10836ea72052Smrgdnl 10846ea72052Smrg 10856ea72052Smrg# XORG_PROG_RAWCPP() 10866ea72052Smrg# ------------------ 10876ea72052Smrg# Find cpp program and necessary flags for use in pre-processing text files 10886ea72052Smrg# such as man pages and config files 10896ea72052SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 10906ea72052SmrgAC_REQUIRE([AC_PROG_CPP]) 10916ea72052SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 10926ea72052Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 10936ea72052Smrg 10946ea72052Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 10956ea72052Smrg# which is not the best choice for supporting other OS'es, but covers most 10966ea72052Smrg# of the ones we need for now. 10976ea72052SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 10986ea72052SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 10996ea72052Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 11006ea72052Smrg AC_MSG_RESULT([no]) 11016ea72052Smrgelse 11026ea72052Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 11036ea72052Smrg RAWCPPFLAGS=-undef 11046ea72052Smrg AC_MSG_RESULT([yes]) 11056ea72052Smrg else 11066ea72052Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 11076ea72052Smrg fi 11086ea72052Smrgfi 11096ea72052Smrgrm -f conftest.$ac_ext 11106ea72052Smrg 11116ea72052SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 11126ea72052SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 11136ea72052Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 11146ea72052Smrg AC_MSG_RESULT([no]) 11156ea72052Smrgelse 11166ea72052Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 11176ea72052Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 11186ea72052Smrg AC_MSG_RESULT([yes]) 11196ea72052Smrg else 11206ea72052Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 11216ea72052Smrg fi 11226ea72052Smrgfi 11236ea72052Smrgrm -f conftest.$ac_ext 11246ea72052SmrgAC_SUBST(RAWCPPFLAGS) 11256ea72052Smrg]) # XORG_PROG_RAWCPP 11266ea72052Smrg 11276ea72052Smrg# XORG_MANPAGE_SECTIONS() 11286ea72052Smrg# ----------------------- 11296ea72052Smrg# Determine which sections man pages go in for the different man page types 11306ea72052Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 11316ea72052Smrg# Not sure if there's any better way than just hardcoding by OS name. 11326ea72052Smrg# Override default settings by setting environment variables 11336ea72052Smrg 11346ea72052SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 11356ea72052SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 11366ea72052Smrg 11376ea72052Smrgif test x$APP_MAN_SUFFIX = x ; then 11386ea72052Smrg case $host_os in 11396ea72052Smrg linux*) APP_MAN_SUFFIX=1x ;; 11406ea72052Smrg *) APP_MAN_SUFFIX=1 ;; 11416ea72052Smrg esac 11426ea72052Smrgfi 11436ea72052Smrgif test x$APP_MAN_DIR = x ; then 11446ea72052Smrg case $host_os in 11456ea72052Smrg linux*) APP_MAN_DIR='$(mandir)/man1' ;; 11466ea72052Smrg *) APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;; 11476ea72052Smrg esac 11486ea72052Smrgfi 11496ea72052Smrg 11506ea72052Smrgif test x$LIB_MAN_SUFFIX = x ; then 11516ea72052Smrg case $host_os in 11526ea72052Smrg linux*) LIB_MAN_SUFFIX=3x ;; 11536ea72052Smrg *) LIB_MAN_SUFFIX=3 ;; 11546ea72052Smrg esac 11556ea72052Smrgfi 11566ea72052Smrgif test x$LIB_MAN_DIR = x ; then 11576ea72052Smrg case $host_os in 11586ea72052Smrg linux*) LIB_MAN_DIR='$(mandir)/man3' ;; 11596ea72052Smrg *) LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;; 11606ea72052Smrg esac 11616ea72052Smrgfi 11626ea72052Smrg 11636ea72052Smrgif test x$FILE_MAN_SUFFIX = x ; then 11646ea72052Smrg case $host_os in 11656ea72052Smrg linux*) FILE_MAN_SUFFIX=5x ;; 11666ea72052Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 11676ea72052Smrg *) FILE_MAN_SUFFIX=5 ;; 11686ea72052Smrg esac 11696ea72052Smrgfi 11706ea72052Smrgif test x$FILE_MAN_DIR = x ; then 11716ea72052Smrg case $host_os in 11726ea72052Smrg linux*) FILE_MAN_DIR='$(mandir)/man5' ;; 11736ea72052Smrg *) FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;; 11746ea72052Smrg esac 11756ea72052Smrgfi 11766ea72052Smrg 11776ea72052Smrg# In Imake's linux.cf, the misc man suffix & dir was only changed for 11786ea72052Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here 11796ea72052Smrgif test x$MISC_MAN_SUFFIX = x ; then 11806ea72052Smrg case $host_os in 11816ea72052Smrg# linux*) MISC_MAN_SUFFIX=7x ;; 11826ea72052Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 11836ea72052Smrg *) MISC_MAN_SUFFIX=7 ;; 11846ea72052Smrg esac 11856ea72052Smrgfi 11866ea72052Smrgif test x$MISC_MAN_DIR = x ; then 11876ea72052Smrg case $host_os in 11886ea72052Smrg# linux*) MISC_MAN_DIR='$(mandir)/man7' ;; 11896ea72052Smrg *) MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;; 11906ea72052Smrg esac 11916ea72052Smrgfi 11926ea72052Smrg 11936ea72052Smrg# In Imake's linux.cf, the driver man suffix & dir was only changed for 11946ea72052Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here 11956ea72052Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 11966ea72052Smrg case $host_os in 11976ea72052Smrg# linux*) DRIVER_MAN_SUFFIX=4x ;; 11986ea72052Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 11996ea72052Smrg *) DRIVER_MAN_SUFFIX=4 ;; 12006ea72052Smrg esac 12016ea72052Smrgfi 12026ea72052Smrgif test x$DRIVER_MAN_DIR = x ; then 12036ea72052Smrg case $host_os in 12046ea72052Smrg# linux*) DRIVER_MAN_DIR='$(mandir)/man4' ;; 12056ea72052Smrg *) DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;; 12066ea72052Smrg esac 12076ea72052Smrgfi 12086ea72052Smrg 12096ea72052Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 12106ea72052Smrg case $host_os in 12116ea72052Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 12126ea72052Smrg *) ADMIN_MAN_SUFFIX=8 ;; 12136ea72052Smrg esac 12146ea72052Smrgfi 12156ea72052Smrgif test x$ADMIN_MAN_DIR = x ; then 12166ea72052Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 12176ea72052Smrgfi 12186ea72052Smrg 12196ea72052Smrg 12206ea72052SmrgAC_SUBST([APP_MAN_SUFFIX]) 12216ea72052SmrgAC_SUBST([LIB_MAN_SUFFIX]) 12226ea72052SmrgAC_SUBST([FILE_MAN_SUFFIX]) 12236ea72052SmrgAC_SUBST([MISC_MAN_SUFFIX]) 12246ea72052SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 12256ea72052SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 12266ea72052SmrgAC_SUBST([APP_MAN_DIR]) 12276ea72052SmrgAC_SUBST([LIB_MAN_DIR]) 12286ea72052SmrgAC_SUBST([FILE_MAN_DIR]) 12296ea72052SmrgAC_SUBST([MISC_MAN_DIR]) 12306ea72052SmrgAC_SUBST([DRIVER_MAN_DIR]) 12316ea72052SmrgAC_SUBST([ADMIN_MAN_DIR]) 12326ea72052Smrg]) # XORG_MANPAGE_SECTIONS 12336ea72052Smrg 12346ea72052Smrg# XORG_CHECK_LINUXDOC 12356ea72052Smrg# ------------------- 12366ea72052Smrg# Defines the variable MAKE_TEXT if the necessary tools and 12376ea72052Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 12386ea72052Smrg# Whether or not the necessary tools and files are found can be checked 12396ea72052Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 12406ea72052SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 12416ea72052SmrgAC_CHECK_FILE( 12426ea72052Smrg [$prefix/share/X11/sgml/defs.ent], 12436ea72052Smrg [DEFS_ENT_PATH=$prefix/share/X11/sgml], 12446ea72052Smrg [DEFS_ENT_PATH=] 12456ea72052Smrg) 12466ea72052Smrg 12476ea72052SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 12486ea72052SmrgAC_PATH_PROG(PS2PDF, ps2pdf) 12496ea72052Smrg 12506ea72052SmrgAC_MSG_CHECKING([Whether to build documentation]) 12516ea72052Smrg 12526ea72052Smrgif test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then 12536ea72052Smrg BUILDDOC=yes 12546ea72052Smrgelse 12556ea72052Smrg BUILDDOC=no 12566ea72052Smrgfi 12576ea72052Smrg 12586ea72052SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 12596ea72052Smrg 12606ea72052SmrgAC_MSG_RESULT([$BUILDDOC]) 12616ea72052Smrg 12626ea72052SmrgAC_MSG_CHECKING([Whether to build pdf documentation]) 12636ea72052Smrg 12646ea72052Smrgif test x$PS2PDF != x ; then 12656ea72052Smrg BUILDPDFDOC=yes 12666ea72052Smrgelse 12676ea72052Smrg BUILDPDFDOC=no 12686ea72052Smrgfi 12696ea72052Smrg 12706ea72052SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 12716ea72052Smrg 12726ea72052SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 12736ea72052Smrg 12746ea72052SmrgMAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" 12756ea72052SmrgMAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 12766ea72052SmrgMAKE_PDF="$PS2PDF" 12776ea72052SmrgMAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B html --split=0" 12786ea72052Smrg 12796ea72052SmrgAC_SUBST(MAKE_TEXT) 12806ea72052SmrgAC_SUBST(MAKE_PS) 12816ea72052SmrgAC_SUBST(MAKE_PDF) 12826ea72052SmrgAC_SUBST(MAKE_HTML) 12836ea72052Smrg]) # XORG_CHECK_LINUXDOC 12846ea72052Smrg 12856ea72052Smrg# XORG_CHECK_MALLOC_ZERO 12866ea72052Smrg# ---------------------- 12876ea72052Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 12886ea72052Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 12896ea72052Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 12906ea72052SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 12916ea72052SmrgAC_ARG_ENABLE(malloc0returnsnull, 12926ea72052Smrg AC_HELP_STRING([--enable-malloc0returnsnull], 12936ea72052Smrg [malloc(0) returns NULL (default: auto)]), 12946ea72052Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 12956ea72052Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 12966ea72052Smrg 12976ea72052SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 12986ea72052Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 12996ea72052Smrg AC_RUN_IFELSE([ 13006ea72052Smrgchar *malloc(); 13016ea72052Smrgchar *realloc(); 13026ea72052Smrgchar *calloc(); 13036ea72052Smrgmain() { 13046ea72052Smrg char *m0, *r0, *c0, *p; 13056ea72052Smrg m0 = malloc(0); 13066ea72052Smrg p = malloc(10); 13076ea72052Smrg r0 = realloc(p,0); 13086ea72052Smrg c0 = calloc(0); 13096ea72052Smrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 13106ea72052Smrg}], 13116ea72052Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 13126ea72052Smrg [MALLOC_ZERO_RETURNS_NULL=no]) 13136ea72052Smrgfi 13146ea72052SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 13156ea72052Smrg 13166ea72052Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 13176ea72052Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 13186ea72052Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 13196ea72052Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 13206ea72052Smrgelse 13216ea72052Smrg MALLOC_ZERO_CFLAGS="" 13226ea72052Smrg XMALLOC_ZERO_CFLAGS="" 13236ea72052Smrg XTMALLOC_ZERO_CFLAGS="" 13246ea72052Smrgfi 13256ea72052Smrg 13266ea72052SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 13276ea72052SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 13286ea72052SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 13296ea72052Smrg]) # XORG_CHECK_MALLOC_ZERO 13306ea72052Smrg 13316ea72052Smrgdnl Copyright 2005 Red Hat, Inc 13326ea72052Smrgdnl 13336ea72052Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 13346ea72052Smrgdnl documentation for any purpose is hereby granted without fee, provided that 13356ea72052Smrgdnl the above copyright notice appear in all copies and that both that 13366ea72052Smrgdnl copyright notice and this permission notice appear in supporting 13376ea72052Smrgdnl documentation. 13386ea72052Smrgdnl 13396ea72052Smrgdnl The above copyright notice and this permission notice shall be included 13406ea72052Smrgdnl in all copies or substantial portions of the Software. 13416ea72052Smrgdnl 13426ea72052Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 13436ea72052Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 13446ea72052Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 13456ea72052Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 13466ea72052Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 13476ea72052Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 13486ea72052Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 13496ea72052Smrgdnl 13506ea72052Smrgdnl Except as contained in this notice, the name of the copyright holders shall 13516ea72052Smrgdnl not be used in advertising or otherwise to promote the sale, use or 13526ea72052Smrgdnl other dealings in this Software without prior written authorization 13536ea72052Smrgdnl from the copyright holders. 13546ea72052Smrgdnl 13556ea72052Smrg 13566ea72052Smrg# XORG_RELEASE_VERSION 13576ea72052Smrg# -------------------- 13586ea72052Smrg# Adds --with/without-release-string and changes the PACKAGE and 13596ea72052Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If 13606ea72052Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. 13616ea72052Smrg 13626ea72052SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 13636ea72052Smrg AC_ARG_WITH(release-version, 13646ea72052Smrg AC_HELP_STRING([--with-release-version=STRING], 13656ea72052Smrg [Use release version string in package name]), 13666ea72052Smrg [RELEASE_VERSION="$withval"], 13676ea72052Smrg [RELEASE_VERSION=""]) 13686ea72052Smrg if test "x$RELEASE_VERSION" != "x"; then 13696ea72052Smrg PACKAGE="$PACKAGE-$RELEASE_VERSION" 13706ea72052Smrg PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" 13716ea72052Smrg AC_MSG_NOTICE([Building with package name set to $PACKAGE]) 13726ea72052Smrg fi 13736ea72052Smrg]) 13746ea72052Smrg 1375