1dnl aclocal.m4 generated automatically by aclocal 1.4 2 3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. 4dnl This file is free software; the Free Software Foundation 5dnl gives unlimited permission to copy and/or distribute it, 6dnl with or without modifications, as long as this notice is preserved. 7 8dnl This program is distributed in the hope that it will be useful, 9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without 10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A 11dnl PARTICULAR PURPOSE. 12 13dnl $Id: acinclude.m4,v 1.15 1998/05/23 14:54:53 joda Exp $ 14dnl 15dnl Only put things that for some reason can't live in the `cf' 16dnl directory in this file. 17dnl 18 19dnl $xId: misc.m4,v 1.1 1997/12/14 15:59:04 joda Exp $ 20dnl 21define(upcase,`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`)dnl 22 23# Like AC_CONFIG_HEADER, but automatically create stamp file. 24 25AC_DEFUN(AM_CONFIG_HEADER, 26[AC_PREREQ([2.12]) 27AC_CONFIG_HEADER([$1]) 28dnl When config.status generates a header, we must update the stamp-h file. 29dnl This file resides in the same directory as the config header 30dnl that is generated. We must strip everything past the first ":", 31dnl and everything past the last "/". 32AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl 33ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, 34<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, 35<<am_indx=1 36for am_file in <<$1>>; do 37 case " <<$>>CONFIG_HEADERS " in 38 *" <<$>>am_file "*<<)>> 39 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx 40 ;; 41 esac 42 am_indx=`expr "<<$>>am_indx" + 1` 43done<<>>dnl>>) 44changequote([,]))]) 45 46# Do all the work for Automake. This macro actually does too much -- 47# some checks are only needed if your package does certain things. 48# But this isn't really a big deal. 49 50# serial 1 51 52dnl Usage: 53dnl AM_INIT_AUTOMAKE(package,version, [no-define]) 54 55AC_DEFUN(AM_INIT_AUTOMAKE, 56[AC_REQUIRE([AC_PROG_INSTALL]) 57PACKAGE=[$1] 58AC_SUBST(PACKAGE) 59VERSION=[$2] 60AC_SUBST(VERSION) 61dnl test to see if srcdir already configured 62if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then 63 AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 64fi 65ifelse([$3],, 66AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 67AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) 68AC_REQUIRE([AM_SANITY_CHECK]) 69AC_REQUIRE([AC_ARG_PROGRAM]) 70dnl FIXME This is truly gross. 71missing_dir=`cd $ac_aux_dir && pwd` 72AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) 73AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) 74AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) 75AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) 76AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) 77AC_REQUIRE([AC_PROG_MAKE_SET])]) 78 79# 80# Check to make sure that the build environment is sane. 81# 82 83AC_DEFUN(AM_SANITY_CHECK, 84[AC_MSG_CHECKING([whether build environment is sane]) 85# Just in case 86sleep 1 87echo timestamp > conftestfile 88# Do `set' in a subshell so we don't clobber the current shell's 89# arguments. Must try -L first in case configure is actually a 90# symlink; some systems play weird games with the mod time of symlinks 91# (eg FreeBSD returns the mod time of the symlink's containing 92# directory). 93if ( 94 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` 95 if test "[$]*" = "X"; then 96 # -L didn't work. 97 set X `ls -t $srcdir/configure conftestfile` 98 fi 99 if test "[$]*" != "X $srcdir/configure conftestfile" \ 100 && test "[$]*" != "X conftestfile $srcdir/configure"; then 101 102 # If neither matched, then we have a broken ls. This can happen 103 # if, for instance, CONFIG_SHELL is bash and it inherits a 104 # broken ls alias from the environment. This has actually 105 # happened. Such a system could not be considered "sane". 106 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 107alias in your environment]) 108 fi 109 110 test "[$]2" = conftestfile 111 ) 112then 113 # Ok. 114 : 115else 116 AC_MSG_ERROR([newly created file is older than distributed files! 117Check your system clock]) 118fi 119rm -f conftest* 120AC_MSG_RESULT(yes)]) 121 122dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) 123dnl The program must properly implement --version. 124AC_DEFUN(AM_MISSING_PROG, 125[AC_MSG_CHECKING(for working $2) 126# Run test in a subshell; some versions of sh will print an error if 127# an executable is not found, even if stderr is redirected. 128# Redirect stdin to placate older versions of autoconf. Sigh. 129if ($2 --version) < /dev/null > /dev/null 2>&1; then 130 $1=$2 131 AC_MSG_RESULT(found) 132else 133 $1="$3/missing $2" 134 AC_MSG_RESULT(missing) 135fi 136AC_SUBST($1)]) 137 138 139dnl AM_PROG_LEX 140dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT 141AC_DEFUN(AM_PROG_LEX, 142[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) 143AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex") 144AC_PROG_LEX 145AC_DECL_YYTEXT]) 146 147dnl $Id: krb-prog-ln-s.m4,v 1.1 1997/12/14 15:59:01 joda Exp $ 148dnl 149dnl 150dnl Better test for ln -s, ln or cp 151dnl 152 153AC_DEFUN(AC_KRB_PROG_LN_S, 154[AC_MSG_CHECKING(for ln -s or something else) 155AC_CACHE_VAL(ac_cv_prog_LN_S, 156[rm -f conftestdata 157if ln -s X conftestdata 2>/dev/null 158then 159 rm -f conftestdata 160 ac_cv_prog_LN_S="ln -s" 161else 162 touch conftestdata1 163 if ln conftestdata1 conftestdata2; then 164 rm -f conftestdata* 165 ac_cv_prog_LN_S=ln 166 else 167 ac_cv_prog_LN_S=cp 168 fi 169fi])dnl 170LN_S="$ac_cv_prog_LN_S" 171AC_MSG_RESULT($ac_cv_prog_LN_S) 172AC_SUBST(LN_S)dnl 173]) 174 175 176dnl $Id: mips-abi.m4,v 1.4 1998/05/16 20:44:15 joda Exp $ 177dnl 178dnl 179dnl Check for MIPS/IRIX ABI flags. Sets $abi and $abilibdirext to some 180dnl value. 181 182AC_DEFUN(AC_MIPS_ABI, [ 183AC_ARG_WITH(mips_abi, 184[ --with-mips-abi=abi ABI to use for IRIX (32, n32, or 64)]) 185 186case "$host_os" in 187irix*) 188with_mips_abi="${with_mips_abi:-yes}" 189if test -n "$GCC"; then 190 191# GCC < 2.8 only supports the O32 ABI. GCC >= 2.8 has a flag to select 192# which ABI to use, but only supports (as of 2.8.1) the N32 and 64 ABIs. 193# 194# Default to N32, but if GCC doesn't grok -mabi=n32, we assume an old 195# GCC and revert back to O32. The same goes if O32 is asked for - old 196# GCCs doesn't like the -mabi option, and new GCCs can't output O32. 197# 198# Don't you just love *all* the different SGI ABIs? 199 200case "${with_mips_abi}" in 201 32|o32) abi='-mabi=32'; abilibdirext='' ;; 202 n32|yes) abi='-mabi=n32'; abilibdirext='32' ;; 203 64) abi='-mabi=64'; abilibdirext='64' ;; 204 no) abi=''; abilibdirext='';; 205 *) AC_ERROR("Invalid ABI specified") ;; 206esac 207if test -n "$abi" ; then 208ac_foo=krb_cv_gcc_`echo $abi | tr =- __` 209dnl 210dnl can't use AC_CACHE_CHECK here, since it doesn't quote CACHE-ID to 211dnl AC_MSG_RESULT 212dnl 213AC_MSG_CHECKING([if $CC supports the $abi option]) 214AC_CACHE_VAL($ac_foo, [ 215save_CFLAGS="$CFLAGS" 216CFLAGS="$CFLAGS $abi" 217AC_TRY_COMPILE(,int x;, eval $ac_foo=yes, eval $ac_foo=no) 218CFLAGS="$save_CFLAGS" 219]) 220ac_res=`eval echo \\\$$ac_foo` 221AC_MSG_RESULT($ac_res) 222if test $ac_res = no; then 223# Try to figure out why that failed... 224case $abi in 225 -mabi=32) 226 save_CFLAGS="$CFLAGS" 227 CFLAGS="$CFLAGS -mabi=n32" 228 AC_TRY_COMPILE(,int x;, ac_res=yes, ac_res=no) 229 CLAGS="$save_CFLAGS" 230 if test $ac_res = yes; then 231 # New GCC 232 AC_ERROR([$CC does not support the $with_mips_abi ABI]) 233 fi 234 # Old GCC 235 abi='' 236 abilibdirext='' 237 ;; 238 -mabi=n32|-mabi=64) 239 if test $with_mips_abi = yes; then 240 # Old GCC, default to O32 241 abi='' 242 abilibdirext='' 243 else 244 # Some broken GCC 245 AC_ERROR([$CC does not support the $with_mips_abi ABI]) 246 fi 247 ;; 248esac 249fi #if test $ac_res = no; then 250fi #if test -n "$abi" ; then 251else 252case "${with_mips_abi}" in 253 32|o32) abi='-32'; abilibdirext='' ;; 254 n32|yes) abi='-n32'; abilibdirext='32' ;; 255 64) abi='-64'; abilibdirext='64' ;; 256 no) abi=''; abilibdirext='';; 257 *) AC_ERROR("Invalid ABI specified") ;; 258esac 259fi #if test -n "$GCC"; then 260;; 261esac 262]) 263 264dnl 265dnl $Id: c-attribute.m4,v 1.2 1999/03/01 09:52:23 joda Exp $ 266dnl 267 268dnl 269dnl Test for __attribute__ 270dnl 271 272AC_DEFUN(AC_C___ATTRIBUTE__, [ 273AC_MSG_CHECKING(for __attribute__) 274AC_CACHE_VAL(ac_cv___attribute__, [ 275AC_TRY_COMPILE([ 276#include <stdlib.h> 277], 278[ 279static void foo(void) __attribute__ ((noreturn)); 280 281static void 282foo(void) 283{ 284 exit(1); 285} 286], 287ac_cv___attribute__=yes, 288ac_cv___attribute__=no)]) 289if test "$ac_cv___attribute__" = "yes"; then 290 AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__]) 291fi 292AC_MSG_RESULT($ac_cv___attribute__) 293]) 294 295 296 297# serial 25 AM_PROG_LIBTOOL 298AC_DEFUN(AM_PROG_LIBTOOL, 299[AC_REQUIRE([AM_ENABLE_SHARED])dnl 300AC_REQUIRE([AM_ENABLE_STATIC])dnl 301AC_REQUIRE([AC_CANONICAL_HOST])dnl 302AC_REQUIRE([AC_PROG_RANLIB])dnl 303AC_REQUIRE([AC_PROG_CC])dnl 304AC_REQUIRE([AM_PROG_LD])dnl 305AC_REQUIRE([AM_PROG_NM])dnl 306AC_REQUIRE([AC_PROG_LN_S])dnl 307dnl 308# Always use our own libtool. 309LIBTOOL='$(top_builddir)/libtool' 310AC_SUBST(LIBTOOL)dnl 311 312# Check for any special flags to pass to ltconfig. 313libtool_flags= 314test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" 315test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" 316test "$silent" = yes && libtool_flags="$libtool_flags --silent" 317test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" 318test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" 319 320# Some flags need to be propagated to the compiler or linker for good 321# libtool support. 322case "$host" in 323*-*-irix6*) 324 # Find out which ABI we are using. 325 echo '[#]line __oline__ "configure"' > conftest.$ac_ext 326 if AC_TRY_EVAL(ac_compile); then 327 case "`/usr/bin/file conftest.o`" in 328 *32-bit*) 329 LD="${LD-ld} -32" 330 ;; 331 *N32*) 332 LD="${LD-ld} -n32" 333 ;; 334 *64-bit*) 335 LD="${LD-ld} -64" 336 ;; 337 esac 338 fi 339 rm -rf conftest* 340 ;; 341 342*-*-sco3.2v5*) 343 # On SCO OpenServer 5, we need -belf to get full-featured binaries. 344 CFLAGS="$CFLAGS -belf" 345 ;; 346esac 347 348# Actually configure libtool. ac_aux_dir is where install-sh is found. 349CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ 350LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \ 351${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ 352$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ 353|| AC_MSG_ERROR([libtool configure failed]) 354 355# Redirect the config.log output again, so that the ltconfig log is not 356# clobbered by the next message. 357exec 5>>./config.log 358]) 359 360# AM_ENABLE_SHARED - implement the --enable-shared flag 361# Usage: AM_ENABLE_SHARED[(DEFAULT)] 362# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to 363# `yes'. 364AC_DEFUN(AM_ENABLE_SHARED, 365[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl 366AC_ARG_ENABLE(shared, 367changequote(<<, >>)dnl 368<< --enable-shared[=PKGS] build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT], 369changequote([, ])dnl 370[p=${PACKAGE-default} 371case "$enableval" in 372yes) enable_shared=yes ;; 373no) enable_shared=no ;; 374*) 375 enable_shared=no 376 # Look at the argument we got. We use all the common list separators. 377 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," 378 for pkg in $enableval; do 379 if test "X$pkg" = "X$p"; then 380 enable_shared=yes 381 fi 382 done 383 IFS="$ac_save_ifs" 384 ;; 385esac], 386enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl 387]) 388 389# AM_DISABLE_SHARED - set the default shared flag to --disable-shared 390AC_DEFUN(AM_DISABLE_SHARED, 391[AM_ENABLE_SHARED(no)]) 392 393# AM_DISABLE_STATIC - set the default static flag to --disable-static 394AC_DEFUN(AM_DISABLE_STATIC, 395[AM_ENABLE_STATIC(no)]) 396 397# AM_ENABLE_STATIC - implement the --enable-static flag 398# Usage: AM_ENABLE_STATIC[(DEFAULT)] 399# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to 400# `yes'. 401AC_DEFUN(AM_ENABLE_STATIC, 402[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl 403AC_ARG_ENABLE(static, 404changequote(<<, >>)dnl 405<< --enable-static[=PKGS] build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT], 406changequote([, ])dnl 407[p=${PACKAGE-default} 408case "$enableval" in 409yes) enable_static=yes ;; 410no) enable_static=no ;; 411*) 412 enable_static=no 413 # Look at the argument we got. We use all the common list separators. 414 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," 415 for pkg in $enableval; do 416 if test "X$pkg" = "X$p"; then 417 enable_static=yes 418 fi 419 done 420 IFS="$ac_save_ifs" 421 ;; 422esac], 423enable_static=AM_ENABLE_STATIC_DEFAULT)dnl 424]) 425 426 427# AM_PROG_LD - find the path to the GNU or non-GNU linker 428AC_DEFUN(AM_PROG_LD, 429[AC_ARG_WITH(gnu-ld, 430[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], 431test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) 432AC_REQUIRE([AC_PROG_CC]) 433ac_prog=ld 434if test "$ac_cv_prog_gcc" = yes; then 435 # Check if gcc -print-prog-name=ld gives a path. 436 AC_MSG_CHECKING([for ld used by GCC]) 437 ac_prog=`($CC -print-prog-name=ld) 2>&5` 438 case "$ac_prog" in 439 # Accept absolute paths. 440changequote(,)dnl 441 /* | [A-Za-z]:\\*) 442changequote([,])dnl 443 test -z "$LD" && LD="$ac_prog" 444 ;; 445 "") 446 # If it fails, then pretend we aren't using GCC. 447 ac_prog=ld 448 ;; 449 *) 450 # If it is relative, then search for the first ld in PATH. 451 with_gnu_ld=unknown 452 ;; 453 esac 454elif test "$with_gnu_ld" = yes; then 455 AC_MSG_CHECKING([for GNU ld]) 456else 457 AC_MSG_CHECKING([for non-GNU ld]) 458fi 459AC_CACHE_VAL(ac_cv_path_LD, 460[if test -z "$LD"; then 461 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" 462 for ac_dir in $PATH; do 463 test -z "$ac_dir" && ac_dir=. 464 if test -f "$ac_dir/$ac_prog"; then 465 ac_cv_path_LD="$ac_dir/$ac_prog" 466 # Check to see if the program is GNU ld. I'd rather use --version, 467 # but apparently some GNU ld's only accept -v. 468 # Break only if it was the GNU/non-GNU ld that we prefer. 469 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then 470 test "$with_gnu_ld" != no && break 471 else 472 test "$with_gnu_ld" != yes && break 473 fi 474 fi 475 done 476 IFS="$ac_save_ifs" 477else 478 ac_cv_path_LD="$LD" # Let the user override the test with a path. 479fi]) 480LD="$ac_cv_path_LD" 481if test -n "$LD"; then 482 AC_MSG_RESULT($LD) 483else 484 AC_MSG_RESULT(no) 485fi 486test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) 487AC_SUBST(LD) 488AM_PROG_LD_GNU 489]) 490 491AC_DEFUN(AM_PROG_LD_GNU, 492[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, 493[# I'd rather use --version here, but apparently some GNU ld's only accept -v. 494if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then 495 ac_cv_prog_gnu_ld=yes 496else 497 ac_cv_prog_gnu_ld=no 498fi]) 499]) 500 501# AM_PROG_NM - find the path to a BSD-compatible name lister 502AC_DEFUN(AM_PROG_NM, 503[AC_MSG_CHECKING([for BSD-compatible nm]) 504AC_CACHE_VAL(ac_cv_path_NM, 505[if test -n "$NM"; then 506 # Let the user override the test. 507 ac_cv_path_NM="$NM" 508else 509 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" 510 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do 511 test -z "$ac_dir" && ac_dir=. 512 if test -f $ac_dir/nm; then 513 # Check to see if the nm accepts a BSD-compat flag. 514 # Adding the `sed 1q' prevents false positives on HP-UX, which says: 515 # nm: unknown option "B" ignored 516 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then 517 ac_cv_path_NM="$ac_dir/nm -B" 518 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then 519 ac_cv_path_NM="$ac_dir/nm -p" 520 else 521 ac_cv_path_NM="$ac_dir/nm" 522 fi 523 break 524 fi 525 done 526 IFS="$ac_save_ifs" 527 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm 528fi]) 529NM="$ac_cv_path_NM" 530AC_MSG_RESULT([$NM]) 531AC_SUBST(NM) 532]) 533 534dnl $Id: wflags.m4,v 1.3 1999/03/11 12:11:41 joda Exp $ 535dnl 536dnl set WFLAGS 537 538AC_DEFUN(AC_WFLAGS,[ 539WFLAGS_NOUNUSED="" 540WFLAGS_NOIMPLICITINT="" 541if test -z "$WFLAGS" -a "$GCC" = "yes"; then 542 # -Wno-implicit-int for broken X11 headers 543 # leave these out for now: 544 # -Wcast-align doesn't work well on alpha osf/1 545 # -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast 546 # -Wmissing-declarations -Wnested-externs 547 WFLAGS="ifelse($#, 0,-Wall, $1)" 548 WFLAGS_NOUNUSED="-Wno-unused" 549 WFLAGS_NOIMPLICITINT="-Wno-implicit-int" 550fi 551AC_SUBST(WFLAGS)dnl 552AC_SUBST(WFLAGS_NOUNUSED)dnl 553AC_SUBST(WFLAGS_NOIMPLICITINT)dnl 554]) 555 556dnl $Id: test-package.m4,v 1.7 1999/04/19 13:33:05 assar Exp $ 557dnl 558dnl AC_TEST_PACKAGE_NEW(package,headers,libraries,extra libs,default locations) 559 560AC_DEFUN(AC_TEST_PACKAGE,[AC_TEST_PACKAGE_NEW($1,[#include <$2>],$4,,$5)]) 561 562AC_DEFUN(AC_TEST_PACKAGE_NEW,[ 563AC_ARG_WITH($1, 564[ --with-$1=dir use $1 in dir]) 565AC_ARG_WITH($1-lib, 566[ --with-$1-lib=dir use $1 libraries in dir], 567[if test "$withval" = "yes" -o "$withval" = "no"; then 568 AC_MSG_ERROR([No argument for --with-$1-lib]) 569elif test "X$with_$1" = "X"; then 570 with_$1=yes 571fi]) 572AC_ARG_WITH($1-include, 573[ --with-$1-include=dir use $1 headers in dir], 574[if test "$withval" = "yes" -o "$withval" = "no"; then 575 AC_MSG_ERROR([No argument for --with-$1-include]) 576elif test "X$with_$1" = "X"; then 577 with_$1=yes 578fi]) 579 580AC_MSG_CHECKING(for $1) 581 582case "$with_$1" in 583yes) ;; 584no) ;; 585"") ;; 586*) if test "$with_$1_include" = ""; then 587 with_$1_include="$with_$1/include" 588 fi 589 if test "$with_$1_lib" = ""; then 590 with_$1_lib="$with_$1/lib$abilibdirext" 591 fi 592 ;; 593esac 594header_dirs= 595lib_dirs= 596d='$5' 597for i in $d; do 598 header_dirs="$header_dirs $i/include" 599 lib_dirs="$lib_dirs $i/lib$abilibdirext" 600done 601 602case "$with_$1_include" in 603yes) ;; 604no) ;; 605*) header_dirs="$with_$1_include $header_dirs";; 606esac 607case "$with_$1_lib" in 608yes) ;; 609no) ;; 610*) lib_dirs="$with_$1_lib $lib_dirs";; 611esac 612 613save_CFLAGS="$CFLAGS" 614save_LIBS="$LIBS" 615ires= lres= 616for i in $header_dirs; do 617 CFLAGS="-I$i $save_CFLAGS" 618 AC_TRY_COMPILE([$2],,ires=$i;break) 619done 620for i in $lib_dirs; do 621 LIBS="-L$i $3 $4 $save_LIBS" 622 AC_TRY_LINK([$2],,lres=$i;break) 623done 624CFLAGS="$save_CFLAGS" 625LIBS="$save_LIBS" 626 627if test "$ires" -a "$lres" -a "$with_$1" != "no"; then 628 $1_includedir="$ires" 629 $1_libdir="$lres" 630 INCLUDE_$1="-I$$1_includedir" 631 LIB_$1="-L$$1_libdir $3" 632 AC_DEFINE_UNQUOTED(upcase($1),1,[Define if you have the $1 package.]) 633 with_$1=yes 634 AC_MSG_RESULT([headers $ires, libraries $lres]) 635else 636 INCLUDE_$1= 637 LIB_$1= 638 with_$1=no 639 AC_MSG_RESULT($with_$1) 640fi 641AC_SUBST(INCLUDE_$1) 642AC_SUBST(LIB_$1) 643]) 644 645dnl $Id: find-func.m4,v 1.1 1997/12/14 15:58:58 joda Exp $ 646dnl 647dnl AC_FIND_FUNC(func, libraries, includes, arguments) 648AC_DEFUN(AC_FIND_FUNC, [ 649AC_FIND_FUNC_NO_LIBS([$1], [$2], [$3], [$4]) 650if test -n "$LIB_$1"; then 651 LIBS="$LIB_$1 $LIBS" 652fi 653]) 654 655dnl $Id: find-func-no-libs.m4,v 1.5 1999/10/30 21:08:18 assar Exp $ 656dnl 657dnl 658dnl Look for function in any of the specified libraries 659dnl 660 661dnl AC_FIND_FUNC_NO_LIBS(func, libraries, includes, arguments, extra libs, extra args) 662AC_DEFUN(AC_FIND_FUNC_NO_LIBS, [ 663AC_FIND_FUNC_NO_LIBS2([$1], ["" $2], [$3], [$4], [$5], [$6])]) 664 665dnl $Id: find-func-no-libs2.m4,v 1.3 1999/10/30 21:09:53 assar Exp $ 666dnl 667dnl 668dnl Look for function in any of the specified libraries 669dnl 670 671dnl AC_FIND_FUNC_NO_LIBS2(func, libraries, includes, arguments, extra libs, extra args) 672AC_DEFUN(AC_FIND_FUNC_NO_LIBS2, [ 673 674AC_MSG_CHECKING([for $1]) 675AC_CACHE_VAL(ac_cv_funclib_$1, 676[ 677if eval "test \"\$ac_cv_func_$1\" != yes" ; then 678 ac_save_LIBS="$LIBS" 679 for ac_lib in $2; do 680 if test -n "$ac_lib"; then 681 ac_lib="-l$ac_lib" 682 else 683 ac_lib="" 684 fi 685 LIBS="$6 $ac_lib $5 $ac_save_LIBS" 686 AC_TRY_LINK([$3],[$1($4)],eval "if test -n \"$ac_lib\";then ac_cv_funclib_$1=$ac_lib; else ac_cv_funclib_$1=yes; fi";break) 687 done 688 eval "ac_cv_funclib_$1=\${ac_cv_funclib_$1-no}" 689 LIBS="$ac_save_LIBS" 690fi 691]) 692 693eval "ac_res=\$ac_cv_funclib_$1" 694 695dnl autoheader tricks *sigh* 696: << END 697@@@funcs="$funcs $1"@@@ 698@@@libs="$libs $2"@@@ 699END 700 701# $1 702eval "ac_tr_func=HAVE_[]upcase($1)" 703eval "ac_tr_lib=HAVE_LIB[]upcase($ac_res | sed -e 's/-l//')" 704eval "LIB_$1=$ac_res" 705 706case "$ac_res" in 707 yes) 708 eval "ac_cv_func_$1=yes" 709 eval "LIB_$1=" 710 AC_DEFINE_UNQUOTED($ac_tr_func) 711 AC_MSG_RESULT([yes]) 712 ;; 713 no) 714 eval "ac_cv_func_$1=no" 715 eval "LIB_$1=" 716 AC_MSG_RESULT([no]) 717 ;; 718 *) 719 eval "ac_cv_func_$1=yes" 720 eval "ac_cv_lib_`echo "$ac_res" | sed 's/-l//'`=yes" 721 AC_DEFINE_UNQUOTED($ac_tr_func) 722 AC_DEFINE_UNQUOTED($ac_tr_lib) 723 AC_MSG_RESULT([yes, in $ac_res]) 724 ;; 725esac 726AC_SUBST(LIB_$1) 727]) 728 729# Define a conditional. 730 731AC_DEFUN(AM_CONDITIONAL, 732[AC_SUBST($1_TRUE) 733AC_SUBST($1_FALSE) 734if $2; then 735 $1_TRUE= 736 $1_FALSE='#' 737else 738 $1_TRUE='#' 739 $1_FALSE= 740fi]) 741 742dnl $Id: osfc2.m4,v 1.2 1999/03/27 17:28:16 joda Exp $ 743dnl 744dnl enable OSF C2 stuff 745 746AC_DEFUN(AC_CHECK_OSFC2,[ 747AC_ARG_ENABLE(osfc2, 748[ --enable-osfc2 enable some OSF C2 support]) 749LIB_security= 750if test "$enable_osfc2" = yes; then 751 AC_DEFINE(HAVE_OSFC2, 1, [Define to enable basic OSF C2 support.]) 752 LIB_security=-lsecurity 753fi 754AC_SUBST(LIB_security) 755]) 756 757dnl $Id: check-man.m4,v 1.2 1999/03/21 14:30:50 joda Exp $ 758dnl check how to format manual pages 759dnl 760 761AC_DEFUN(AC_CHECK_MAN, 762[AC_PATH_PROG(NROFF, nroff) 763AC_PATH_PROG(GROFF, groff) 764AC_CACHE_CHECK(how to format man pages,ac_cv_sys_man_format, 765[cat > conftest.1 << END 766.Dd January 1, 1970 767.Dt CONFTEST 1 768.Sh NAME 769.Nm conftest 770.Nd 771foobar 772END 773 774if test "$NROFF" ; then 775 for i in "-mdoc" "-mandoc"; do 776 if "$NROFF" $i conftest.1 2> /dev/null | \ 777 grep Jan > /dev/null 2>&1 ; then 778 ac_cv_sys_man_format="$NROFF $i" 779 break 780 fi 781 done 782fi 783if test "$ac_cv_sys_man_format" = "" -a "$GROFF" ; then 784 for i in "-mdoc" "-mandoc"; do 785 if "$GROFF" -Tascii $i conftest.1 2> /dev/null | \ 786 grep Jan > /dev/null 2>&1 ; then 787 ac_cv_sys_man_format="$GROFF -Tascii $i" 788 break 789 fi 790 done 791fi 792if test "$ac_cv_sys_man_format"; then 793 ac_cv_sys_man_format="$ac_cv_sys_man_format \[$]< > \[$]@" 794fi 795]) 796if test "$ac_cv_sys_man_format"; then 797 CATMAN="$ac_cv_sys_man_format" 798 AC_SUBST(CATMAN) 799fi 800AM_CONDITIONAL(CATMAN, test "$CATMAN") 801AC_CACHE_CHECK(extension of pre-formatted manual pages,ac_cv_sys_catman_ext, 802[if grep _suffix /etc/man.conf > /dev/null 2>&1; then 803 ac_cv_sys_catman_ext=0 804else 805 ac_cv_sys_catman_ext=number 806fi 807]) 808if test "$ac_cv_sys_catman_ext" = number; then 809 CATMANEXT='$$ext' 810else 811 CATMANEXT=0 812fi 813AC_SUBST(CATMANEXT) 814 815]) 816dnl 817dnl $Id: krb-bigendian.m4,v 1.5 2000/01/08 10:34:44 assar Exp $ 818dnl 819 820dnl check if this computer is little or big-endian 821dnl if we can figure it out at compile-time then don't define the cpp symbol 822dnl otherwise test for it and define it. also allow options for overriding 823dnl it when cross-compiling 824 825AC_DEFUN(KRB_C_BIGENDIAN, [ 826AC_ARG_ENABLE(bigendian, 827[ --enable-bigendian the target is big endian], 828krb_cv_c_bigendian=yes) 829AC_ARG_ENABLE(littleendian, 830[ --enable-littleendian the target is little endian], 831krb_cv_c_bigendian=no) 832AC_CACHE_CHECK(whether byte order is known at compile time, 833krb_cv_c_bigendian_compile, 834[AC_TRY_COMPILE([ 835#include <sys/types.h> 836#include <sys/param.h>],[ 837#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN 838 bogus endian macros 839#endif], krb_cv_c_bigendian_compile=yes, krb_cv_c_bigendian_compile=no)]) 840if test "$krb_cv_c_bigendian_compile" = "no"; then 841 AC_CACHE_CHECK(whether byte ordering is bigendian, krb_cv_c_bigendian,[ 842 if test "$krb_cv_c_bigendian" = ""; then 843 krb_cv_c_bigendian=unknown 844 fi 845 AC_TRY_COMPILE([ 846#include <sys/types.h> 847#include <sys/param.h>],[ 848#if BYTE_ORDER != BIG_ENDIAN 849 not big endian 850#endif], krb_cv_c_bigendian=yes, krb_cv_c_bigendian=no) 851 if test "$krb_cv_c_bigendian" = "unknown"; then 852 AC_TRY_RUN([main () { 853 /* Are we little or big endian? From Harbison&Steele. */ 854 union 855 { 856 long l; 857 char c[sizeof (long)]; 858 } u; 859 u.l = 1; 860 exit (u.c[sizeof (long) - 1] == 1); 861 }], krb_cv_c_bigendian=no, krb_cv_c_bigendian=yes, 862 AC_MSG_ERROR([specify either --enable-bigendian or --enable-littleendian])) 863 fi 864 ]) 865 if test "$krb_cv_c_bigendian" = "yes"; then 866 AC_DEFINE(WORDS_BIGENDIAN, 1, [define if target is big endian])dnl 867 fi 868fi 869if test "$krb_cv_c_bigendian_compile" = "yes"; then 870 AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1, [define if sys/param.h defines the endiness])dnl 871fi 872]) 873 874dnl 875dnl See if there is any X11 present 876dnl 877dnl $Id: check-x.m4,v 1.2 1999/11/05 04:25:23 assar Exp $ 878 879AC_DEFUN(KRB_CHECK_X,[ 880AC_PATH_XTRA 881 882# try to figure out if we need any additional ld flags, like -R 883# and yes, the autoconf X test is utterly broken 884if test "$no_x" != yes; then 885 AC_CACHE_CHECK(for special X linker flags,krb_cv_sys_x_libs_rpath,[ 886 ac_save_libs="$LIBS" 887 ac_save_cflags="$CFLAGS" 888 CFLAGS="$CFLAGS $X_CFLAGS" 889 krb_cv_sys_x_libs_rpath="" 890 krb_cv_sys_x_libs="" 891 for rflag in "" "-R" "-R " "-rpath "; do 892 if test "$rflag" = ""; then 893 foo="$X_LIBS" 894 else 895 foo="" 896 for flag in $X_LIBS; do 897 case $flag in 898 -L*) 899 foo="$foo $flag `echo $flag | sed \"s/-L/$rflag/\"`" 900 ;; 901 *) 902 foo="$foo $flag" 903 ;; 904 esac 905 done 906 fi 907 LIBS="$ac_save_libs $foo $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" 908 AC_TRY_RUN([ 909 #include <X11/Xlib.h> 910 foo() 911 { 912 XOpenDisplay(NULL); 913 } 914 main() 915 { 916 return 0; 917 } 918 ], krb_cv_sys_x_libs_rpath="$rflag"; krb_cv_sys_x_libs="$foo"; break,:) 919 done 920 LIBS="$ac_save_libs" 921 CFLAGS="$ac_save_cflags" 922 ]) 923 X_LIBS="$krb_cv_sys_x_libs" 924fi 925]) 926 927dnl $Id: check-xau.m4,v 1.3 1999/05/14 01:17:06 assar Exp $ 928dnl 929dnl check for Xau{Read,Write}Auth and XauFileName 930dnl 931AC_DEFUN(AC_CHECK_XAU,[ 932save_CFLAGS="$CFLAGS" 933CFLAGS="$X_CFLAGS $CFLAGS" 934save_LIBS="$LIBS" 935dnl LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS $LIBS" 936LIBS="$X_PRE_LIBS $X_EXTRA_LIBS $LIBS" 937save_LDFLAGS="$LDFLAGS" 938LDFLAGS="$LDFLAGS $X_LIBS" 939 940 941AC_FIND_FUNC_NO_LIBS(XauWriteAuth, X11 Xau) 942ac_xxx="$LIBS" 943LIBS="$LIB_XauWriteAuth $LIBS" 944AC_FIND_FUNC_NO_LIBS(XauReadAuth, X11 Xau) 945LIBS="$LIB_XauReadAauth $LIBS" 946AC_FIND_FUNC_NO_LIBS(XauFileName, X11 Xau) 947LIBS="$ac_xxx" 948 949case "$ac_cv_funclib_XauWriteAuth" in 950yes) ;; 951no) ;; 952*) if test "$ac_cv_funclib_XauReadAuth" = yes; then 953 if test "$ac_cv_funclib_XauFileName" = yes; then 954 LIB_XauReadAuth="$LIB_XauWriteAuth" 955 else 956 LIB_XauReadAuth="$LIB_XauWriteAuth $LIB_XauFileName" 957 fi 958 else 959 if test "$ac_cv_funclib_XauFileName" = yes; then 960 LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth" 961 else 962 LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth $LIB_XauFileName" 963 fi 964 fi 965 ;; 966esac 967 968if test "$AUTOMAKE" != ""; then 969 AM_CONDITIONAL(NEED_WRITEAUTH, test "$ac_cv_func_XauWriteAuth" != "yes") 970else 971 AC_SUBST(NEED_WRITEAUTH_TRUE) 972 AC_SUBST(NEED_WRITEAUTH_FALSE) 973 if test "$ac_cv_func_XauWriteAuth" != "yes"; then 974 NEED_WRITEAUTH_TRUE= 975 NEED_WRITEAUTH_FALSE='#' 976 else 977 NEED_WRITEAUTH_TRUE='#' 978 NEED_WRITEAUTH_FALSE= 979 fi 980fi 981CFLAGS=$save_CFLAGS 982LIBS=$save_LIBS 983LDFLAGS=$save_LDFLAGS 984]) 985 986dnl $Id: check-type-extra.m4,v 1.2 1999/03/01 09:52:23 joda Exp $ 987dnl 988dnl ac_check_type + extra headers 989 990dnl AC_CHECK_TYPE_EXTRA(TYPE, DEFAULT, HEADERS) 991AC_DEFUN(AC_CHECK_TYPE_EXTRA, 992[AC_REQUIRE([AC_HEADER_STDC])dnl 993AC_MSG_CHECKING(for $1) 994AC_CACHE_VAL(ac_cv_type_$1, 995[AC_EGREP_CPP(dnl 996changequote(<<,>>)dnl 997<<$1[^a-zA-Z_0-9]>>dnl 998changequote([,]), [#include <sys/types.h> 999#if STDC_HEADERS 1000#include <stdlib.h> 1001#include <stddef.h> 1002#endif 1003$3], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl 1004AC_MSG_RESULT($ac_cv_type_$1) 1005if test $ac_cv_type_$1 = no; then 1006 AC_DEFINE($1, $2, [Define this to what the type $1 should be.]) 1007fi 1008]) 1009 1010dnl $Id: have-type.m4,v 1.5 1999/12/31 03:10:22 assar Exp $ 1011dnl 1012dnl check for existance of a type 1013 1014dnl AC_HAVE_TYPE(TYPE,INCLUDES) 1015AC_DEFUN(AC_HAVE_TYPE, [ 1016AC_REQUIRE([AC_HEADER_STDC]) 1017cv=`echo "$1" | sed 'y%./+- %__p__%'` 1018AC_MSG_CHECKING(for $1) 1019AC_CACHE_VAL([ac_cv_type_$cv], 1020AC_TRY_COMPILE( 1021[#include <sys/types.h> 1022#if STDC_HEADERS 1023#include <stdlib.h> 1024#include <stddef.h> 1025#endif 1026$2], 1027[$1 foo;], 1028eval "ac_cv_type_$cv=yes", 1029eval "ac_cv_type_$cv=no"))dnl 1030AC_MSG_RESULT(`eval echo \\$ac_cv_type_$cv`) 1031if test `eval echo \\$ac_cv_type_$cv` = yes; then 1032 ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'` 1033dnl autoheader tricks *sigh* 1034define(foo,translit($1, [ ], [_])) 1035: << END 1036@@@funcs="$funcs foo"@@@ 1037END 1038undefine([foo]) 1039 AC_DEFINE_UNQUOTED($ac_tr_hdr, 1) 1040fi 1041]) 1042 1043dnl 1044dnl $Id: check-netinet-ip-and-tcp.m4,v 1.2 1999/05/14 13:15:40 assar Exp $ 1045dnl 1046 1047dnl extra magic check for netinet/{ip.h,tcp.h} because on irix 6.5.3 1048dnl you have to include standards.h before including these files 1049 1050AC_DEFUN(CHECK_NETINET_IP_AND_TCP, 1051[ 1052AC_CHECK_HEADERS(standards.h) 1053for i in netinet/ip.h netinet/tcp.h; do 1054 1055cv=`echo "$i" | sed 'y%./+-%__p_%'` 1056 1057AC_MSG_CHECKING([for $i]) 1058AC_CACHE_VAL([ac_cv_header_$cv], 1059[AC_TRY_CPP([\ 1060#ifdef HAVE_STANDARDS_H 1061#include <standards.h> 1062#endif 1063#include <$i> 1064], 1065eval "ac_cv_header_$cv=yes", 1066eval "ac_cv_header_$cv=no")]) 1067AC_MSG_RESULT(`eval echo \\$ac_cv_header_$cv`) 1068changequote(, )dnl 1069if test `eval echo \\$ac_cv_header_$cv` = yes; then 1070 ac_tr_hdr=HAVE_`echo $i | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` 1071changequote([, ])dnl 1072 AC_DEFINE_UNQUOTED($ac_tr_hdr, 1) 1073fi 1074done 1075dnl autoheader tricks *sigh* 1076: << END 1077@@@headers="$headers netinet/ip.h netinet/tcp.h"@@@ 1078END 1079 1080]) 1081 1082dnl $Id: krb-ipv6.m4,v 1.8 2000/01/01 11:44:45 assar Exp $ 1083dnl 1084dnl test for IPv6 1085dnl 1086AC_DEFUN(AC_KRB_IPV6, [ 1087AC_ARG_WITH(ipv6, 1088[ --without-ipv6 do not enable IPv6 support],[ 1089if test "$withval" = "no"; then 1090 ac_cv_lib_ipv6=no 1091fi]) 1092AC_CACHE_VAL(ac_cv_lib_ipv6, 1093[dnl check for different v6 implementations (by itojun) 1094v6type=unknown 1095v6lib=none 1096 1097AC_MSG_CHECKING([ipv6 stack type]) 1098for i in v6d toshiba kame inria zeta linux; do 1099 case $i in 1100 v6d) 1101 AC_EGREP_CPP(yes, [dnl 1102#include </usr/local/v6/include/sys/types.h> 1103#ifdef __V6D__ 1104yes 1105#endif], 1106 [v6type=$i; v6lib=v6; 1107 v6libdir=/usr/local/v6/lib; 1108 CFLAGS="-I/usr/local/v6/include $CFLAGS"]) 1109 ;; 1110 toshiba) 1111 AC_EGREP_CPP(yes, [dnl 1112#include <sys/param.h> 1113#ifdef _TOSHIBA_INET6 1114yes 1115#endif], 1116 [v6type=$i; v6lib=inet6; 1117 v6libdir=/usr/local/v6/lib; 1118 CFLAGS="-DINET6 $CFLAGS"]) 1119 ;; 1120 kame) 1121 AC_EGREP_CPP(yes, [dnl 1122#include <netinet/in.h> 1123#ifdef __KAME__ 1124yes 1125#endif], 1126 [v6type=$i; v6lib=inet6; 1127 v6libdir=/usr/local/v6/lib; 1128 CFLAGS="-DINET6 $CFLAGS"]) 1129 ;; 1130 inria) 1131 AC_EGREP_CPP(yes, [dnl 1132#include <netinet/in.h> 1133#ifdef IPV6_INRIA_VERSION 1134yes 1135#endif], 1136 [v6type=$i; CFLAGS="-DINET6 $CFLAGS"]) 1137 ;; 1138 zeta) 1139 AC_EGREP_CPP(yes, [dnl 1140#include <sys/param.h> 1141#ifdef _ZETA_MINAMI_INET6 1142yes 1143#endif], 1144 [v6type=$i; v6lib=inet6; 1145 v6libdir=/usr/local/v6/lib; 1146 CFLAGS="-DINET6 $CFLAGS"]) 1147 ;; 1148 linux) 1149 if test -d /usr/inet6; then 1150 v6type=$i 1151 v6lib=inet6 1152 v6libdir=/usr/inet6 1153 CFLAGS="-DINET6 $CFLAGS" 1154 fi 1155 ;; 1156 esac 1157 if test "$v6type" != "unknown"; then 1158 break 1159 fi 1160done 1161AC_MSG_RESULT($v6type) 1162 1163if test "$v6lib" != "none"; then 1164 for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do 1165 if test -d $dir -a -f $dir/lib$v6lib.a; then 1166 LIBS="-L$dir -l$v6lib $LIBS" 1167 break 1168 fi 1169 done 1170fi 1171AC_TRY_LINK([ 1172#ifdef HAVE_SYS_TYPES_H 1173#include <sys/types.h> 1174#endif 1175#ifdef HAVE_SYS_SOCKET_H 1176#include <sys/socket.h> 1177#endif 1178#ifdef HAVE_NETINET_IN_H 1179#include <netinet/in.h> 1180#endif 1181#ifdef HAVE_NETINET_IN6_H 1182#include <netinet/in6.h> 1183#endif 1184], 1185[ 1186 struct sockaddr_in6 sin6; 1187 int s; 1188 1189 s = socket(AF_INET6, SOCK_DGRAM, 0); 1190 1191 sin6.sin6_family = AF_INET6; 1192 sin6.sin6_port = htons(17); 1193 sin6.sin6_addr = in6addr_any; 1194 bind(s, (struct sockaddr *)&sin6, sizeof(sin6)); 1195], 1196ac_cv_lib_ipv6=yes, 1197ac_cv_lib_ipv6=no)]) 1198AC_MSG_CHECKING(for IPv6) 1199AC_MSG_RESULT($ac_cv_lib_ipv6) 1200if test "$ac_cv_lib_ipv6" = yes; then 1201 AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPv6.]) 1202fi 1203]) 1204 1205dnl $Id: broken-snprintf.m4,v 1.3 1999/03/01 09:52:22 joda Exp $ 1206dnl 1207AC_DEFUN(AC_BROKEN_SNPRINTF, [ 1208AC_CACHE_CHECK(for working snprintf,ac_cv_func_snprintf_working, 1209ac_cv_func_snprintf_working=yes 1210AC_TRY_RUN([ 1211#include <stdio.h> 1212#include <string.h> 1213int main() 1214{ 1215changequote(`,')dnl 1216 char foo[3]; 1217changequote([,])dnl 1218 snprintf(foo, 2, "12"); 1219 return strcmp(foo, "1"); 1220}],:,ac_cv_func_snprintf_working=no,:)) 1221 1222if test "$ac_cv_func_snprintf_working" = yes; then 1223 AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [define if you have a working snprintf]) 1224fi 1225if test "$ac_cv_func_snprintf_working" = yes; then 1226AC_NEED_PROTO([#include <stdio.h>],snprintf) 1227fi 1228]) 1229 1230AC_DEFUN(AC_BROKEN_VSNPRINTF,[ 1231AC_CACHE_CHECK(for working vsnprintf,ac_cv_func_vsnprintf_working, 1232ac_cv_func_vsnprintf_working=yes 1233AC_TRY_RUN([ 1234#include <stdio.h> 1235#include <string.h> 1236#include <stdarg.h> 1237 1238int foo(int num, ...) 1239{ 1240changequote(`,')dnl 1241 char bar[3]; 1242changequote([,])dnl 1243 va_list arg; 1244 va_start(arg, num); 1245 vsnprintf(bar, 2, "%s", arg); 1246 va_end(arg); 1247 return strcmp(bar, "1"); 1248} 1249 1250 1251int main() 1252{ 1253 return foo(0, "12"); 1254}],:,ac_cv_func_vsnprintf_working=no,:)) 1255 1256if test "$ac_cv_func_vsnprintf_working" = yes; then 1257 AC_DEFINE_UNQUOTED(HAVE_VSNPRINTF, 1, [define if you have a working vsnprintf]) 1258fi 1259if test "$ac_cv_func_vsnprintf_working" = yes; then 1260AC_NEED_PROTO([#include <stdio.h>],vsnprintf) 1261fi 1262]) 1263 1264dnl $Id: need-proto.m4,v 1.2 1999/03/01 09:52:24 joda Exp $ 1265dnl 1266dnl 1267dnl Check if we need the prototype for a function 1268dnl 1269 1270dnl AC_NEED_PROTO(includes, function) 1271 1272AC_DEFUN(AC_NEED_PROTO, [ 1273if test "$ac_cv_func_$2+set" != set -o "$ac_cv_func_$2" = yes; then 1274AC_CACHE_CHECK([if $2 needs a prototype], ac_cv_func_$2_noproto, 1275AC_TRY_COMPILE([$1], 1276[struct foo { int foo; } xx; 1277extern int $2 (struct foo*); 1278$2(&xx); 1279], 1280eval "ac_cv_func_$2_noproto=yes", 1281eval "ac_cv_func_$2_noproto=no")) 1282define([foo], [NEED_]translit($2, [a-z], [A-Z])[_PROTO]) 1283if test "$ac_cv_func_$2_noproto" = yes; then 1284 AC_DEFINE(foo, 1, [define if the system is missing a prototype for $2()]) 1285fi 1286undefine([foo]) 1287fi 1288]) 1289 1290dnl $Id: broken-glob.m4,v 1.2 1999/03/01 09:52:15 joda Exp $ 1291dnl 1292dnl check for glob(3) 1293dnl 1294AC_DEFUN(AC_BROKEN_GLOB,[ 1295AC_CACHE_CHECK(for working glob, ac_cv_func_glob_working, 1296ac_cv_func_glob_working=yes 1297AC_TRY_LINK([ 1298#include <stdio.h> 1299#include <glob.h>],[ 1300glob(NULL, GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE, NULL, NULL); 1301],:,ac_cv_func_glob_working=no,:)) 1302 1303if test "$ac_cv_func_glob_working" = yes; then 1304 AC_DEFINE(HAVE_GLOB, 1, [define if you have a glob() that groks 1305 GLOB_BRACE, GLOB_NOCHECK, GLOB_QUOTE, and GLOB_TILDE]) 1306fi 1307if test "$ac_cv_func_glob_working" = yes; then 1308AC_NEED_PROTO([#include <stdio.h> 1309#include <glob.h>],glob) 1310fi 1311]) 1312 1313dnl 1314dnl $Id: krb-func-getlogin.m4,v 1.1 1999/07/13 17:45:30 assar Exp $ 1315dnl 1316dnl test for POSIX (broken) getlogin 1317dnl 1318 1319 1320AC_DEFUN(AC_FUNC_GETLOGIN, [ 1321AC_CHECK_FUNCS(getlogin setlogin) 1322if test "$ac_cv_func_getlogin" = yes; then 1323AC_CACHE_CHECK(if getlogin is posix, ac_cv_func_getlogin_posix, [ 1324if test "$ac_cv_func_getlogin" = yes -a "$ac_cv_func_setlogin" = yes; then 1325 ac_cv_func_getlogin_posix=no 1326else 1327 ac_cv_func_getlogin_posix=yes 1328fi 1329]) 1330if test "$ac_cv_func_getlogin_posix" = yes; then 1331 AC_DEFINE(POSIX_GETLOGIN, 1, [Define if getlogin has POSIX flavour (and not BSD).]) 1332fi 1333fi 1334]) 1335 1336dnl 1337dnl $Id: capabilities.m4,v 1.2 1999/09/01 11:02:26 joda Exp $ 1338dnl 1339 1340dnl 1341dnl Test SGI capabilities 1342dnl 1343 1344AC_DEFUN(KRB_CAPABILITIES,[ 1345 1346AC_CHECK_HEADERS(capability.h sys/capability.h) 1347 1348AC_CHECK_FUNCS(sgi_getcapabilitybyname cap_set_proc) 1349]) 1350 1351dnl $Id: check-getpwnam_r-posix.m4,v 1.2 1999/03/23 16:47:31 joda Exp $ 1352dnl 1353dnl check for getpwnam_r, and if it's posix or not 1354 1355AC_DEFUN(AC_CHECK_GETPWNAM_R_POSIX,[ 1356AC_FIND_FUNC_NO_LIBS(getpwnam_r,c_r) 1357if test "$ac_cv_func_getpwnam_r" = yes; then 1358 AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix, 1359 ac_libs="$LIBS" 1360 LIBS="$LIBS $LIB_getpwnam_r" 1361 AC_TRY_RUN([ 1362#include <pwd.h> 1363int main() 1364{ 1365 struct passwd pw, *pwd; 1366 return getpwnam_r("", &pw, NULL, 0, &pwd) < 0; 1367} 1368],ac_cv_func_getpwnam_r_posix=yes,ac_cv_func_getpwnam_r_posix=no,:) 1369LIBS="$ac_libs") 1370if test "$ac_cv_func_getpwnam_r_posix" = yes; then 1371 AC_DEFINE(POSIX_GETPWNAM_R, 1, [Define if getpwnam_r has POSIX flavour.]) 1372fi 1373fi 1374]) 1375dnl $Id: find-if-not-broken.m4,v 1.2 1998/03/16 22:16:27 joda Exp $ 1376dnl 1377dnl 1378dnl Mix between AC_FIND_FUNC and AC_BROKEN 1379dnl 1380 1381AC_DEFUN(AC_FIND_IF_NOT_BROKEN, 1382[AC_FIND_FUNC([$1], [$2], [$3], [$4]) 1383if eval "test \"$ac_cv_func_$1\" != yes"; then 1384LIBOBJS[]="$LIBOBJS $1.o" 1385fi 1386AC_SUBST(LIBOBJS)dnl 1387]) 1388 1389dnl $Id: broken.m4,v 1.3 1998/03/16 22:16:19 joda Exp $ 1390dnl 1391dnl 1392dnl Same as AC _REPLACE_FUNCS, just define HAVE_func if found in normal 1393dnl libraries 1394 1395AC_DEFUN(AC_BROKEN, 1396[for ac_func in $1 1397do 1398AC_CHECK_FUNC($ac_func, [ 1399ac_tr_func=HAVE_[]upcase($ac_func) 1400AC_DEFINE_UNQUOTED($ac_tr_func)],[LIBOBJS[]="$LIBOBJS ${ac_func}.o"]) 1401dnl autoheader tricks *sigh* 1402: << END 1403@@@funcs="$funcs $1"@@@ 1404END 1405done 1406AC_SUBST(LIBOBJS)dnl 1407]) 1408 1409dnl $Id: proto-compat.m4,v 1.3 1999/03/01 13:03:48 joda Exp $ 1410dnl 1411dnl 1412dnl Check if the prototype of a function is compatible with another one 1413dnl 1414 1415dnl AC_PROTO_COMPAT(includes, function, prototype) 1416 1417AC_DEFUN(AC_PROTO_COMPAT, [ 1418AC_CACHE_CHECK([if $2 is compatible with system prototype], 1419ac_cv_func_$2_proto_compat, 1420AC_TRY_COMPILE([$1], 1421[$3;], 1422eval "ac_cv_func_$2_proto_compat=yes", 1423eval "ac_cv_func_$2_proto_compat=no")) 1424define([foo], translit($2, [a-z], [A-Z])[_PROTO_COMPATIBLE]) 1425if test "$ac_cv_func_$2_proto_compat" = yes; then 1426 AC_DEFINE(foo, 1, [define if prototype of $2 is compatible with 1427 $3]) 1428fi 1429undefine([foo]) 1430]) 1431dnl $Id: check-var.m4,v 1.2 1999/03/01 09:52:23 joda Exp $ 1432dnl 1433dnl AC_CHECK_VAR(includes, variable) 1434AC_DEFUN(AC_CHECK_VAR, [ 1435AC_MSG_CHECKING(for $2) 1436AC_CACHE_VAL(ac_cv_var_$2, [ 1437AC_TRY_LINK([extern int $2; 1438int foo() { return $2; }], 1439 [foo()], 1440 ac_cv_var_$2=yes, ac_cv_var_$2=no) 1441]) 1442define([foo], [HAVE_]translit($2, [a-z], [A-Z])) 1443 1444AC_MSG_RESULT(`eval echo \\$ac_cv_var_$2`) 1445if test `eval echo \\$ac_cv_var_$2` = yes; then 1446 AC_DEFINE_UNQUOTED(foo, 1, [define if you have $2]) 1447 AC_CHECK_DECLARATION([$1],[$2]) 1448fi 1449undefine([foo]) 1450]) 1451 1452dnl $Id: check-declaration.m4,v 1.3 1999/03/01 13:03:08 joda Exp $ 1453dnl 1454dnl 1455dnl Check if we need the declaration of a variable 1456dnl 1457 1458dnl AC_HAVE_DECLARATION(includes, variable) 1459AC_DEFUN(AC_CHECK_DECLARATION, [ 1460AC_MSG_CHECKING([if $2 is properly declared]) 1461AC_CACHE_VAL(ac_cv_var_$2_declaration, [ 1462AC_TRY_COMPILE([$1 1463extern struct { int foo; } $2;], 1464[$2.foo = 1;], 1465eval "ac_cv_var_$2_declaration=no", 1466eval "ac_cv_var_$2_declaration=yes") 1467]) 1468 1469define(foo, [HAVE_]translit($2, [a-z], [A-Z])[_DECLARATION]) 1470 1471AC_MSG_RESULT($ac_cv_var_$2_declaration) 1472if eval "test \"\$ac_cv_var_$2_declaration\" = yes"; then 1473 AC_DEFINE(foo, 1, [define if your system declares $2]) 1474fi 1475undefine([foo]) 1476]) 1477 1478dnl $Id: have-struct-field.m4,v 1.6 1999/07/29 01:44:32 assar Exp $ 1479dnl 1480dnl check for fields in a structure 1481dnl 1482dnl AC_HAVE_STRUCT_FIELD(struct, field, headers) 1483 1484AC_DEFUN(AC_HAVE_STRUCT_FIELD, [ 1485define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_])) 1486AC_CACHE_CHECK([for $2 in $1], cache_val,[ 1487AC_TRY_COMPILE([$3],[$1 x; x.$2;], 1488cache_val=yes, 1489cache_val=no)]) 1490if test "$cache_val" = yes; then 1491 define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_])) 1492 AC_DEFINE(foo, 1, [Define if $1 has field $2.]) 1493 undefine([foo]) 1494fi 1495undefine([cache_val]) 1496]) 1497 1498dnl $Id: krb-struct-winsize.m4,v 1.2 1999/03/01 09:52:23 joda Exp $ 1499dnl 1500dnl 1501dnl Search for struct winsize 1502dnl 1503 1504AC_DEFUN(AC_KRB_STRUCT_WINSIZE, [ 1505AC_MSG_CHECKING(for struct winsize) 1506AC_CACHE_VAL(ac_cv_struct_winsize, [ 1507ac_cv_struct_winsize=no 1508for i in sys/termios.h sys/ioctl.h; do 1509AC_EGREP_HEADER( 1510changequote(, )dnl 1511struct[ ]*winsize,dnl 1512changequote([,])dnl 1513$i, ac_cv_struct_winsize=yes; break)dnl 1514done 1515]) 1516if test "$ac_cv_struct_winsize" = "yes"; then 1517 AC_DEFINE(HAVE_STRUCT_WINSIZE, 1, [define if struct winsize is declared in sys/termios.h]) 1518fi 1519AC_MSG_RESULT($ac_cv_struct_winsize) 1520AC_EGREP_HEADER(ws_xpixel, termios.h, 1521 AC_DEFINE(HAVE_WS_XPIXEL, 1, [define if struct winsize has ws_xpixel])) 1522AC_EGREP_HEADER(ws_ypixel, termios.h, 1523 AC_DEFINE(HAVE_WS_YPIXEL, 1, [define if struct winsize has ws_ypixel])) 1524]) 1525 1526dnl $Id: krb-struct-spwd.m4,v 1.3 1999/07/13 21:04:11 assar Exp $ 1527dnl 1528dnl Test for `struct spwd' 1529 1530AC_DEFUN(AC_KRB_STRUCT_SPWD, [ 1531AC_MSG_CHECKING(for struct spwd) 1532AC_CACHE_VAL(ac_cv_struct_spwd, [ 1533AC_TRY_COMPILE( 1534[#include <pwd.h> 1535#ifdef HAVE_SHADOW_H 1536#include <shadow.h> 1537#endif], 1538[struct spwd foo;], 1539ac_cv_struct_spwd=yes, 1540ac_cv_struct_spwd=no) 1541]) 1542AC_MSG_RESULT($ac_cv_struct_spwd) 1543 1544if test "$ac_cv_struct_spwd" = "yes"; then 1545 AC_DEFINE(HAVE_STRUCT_SPWD, 1, [define if you have struct spwd]) 1546fi 1547]) 1548 1549dnl $Id: grok-type.m4,v 1.4 1999/11/29 11:16:48 joda Exp $ 1550dnl 1551AC_DEFUN(AC_GROK_TYPE, [ 1552AC_CACHE_VAL(ac_cv_type_$1, 1553AC_TRY_COMPILE([ 1554#ifdef HAVE_INTTYPES_H 1555#include <inttypes.h> 1556#endif 1557#ifdef HAVE_SYS_TYPES_H 1558#include <sys/types.h> 1559#endif 1560#ifdef HAVE_SYS_BITYPES_H 1561#include <sys/bitypes.h> 1562#endif 1563#ifdef HAVE_BIND_BITYPES_H 1564#include <bind/bitypes.h> 1565#endif 1566#ifdef HAVE_NETINET_IN6_MACHTYPES_H 1567#include <netinet/in6_machtypes.h> 1568#endif 1569], 1570$i x; 1571, 1572eval ac_cv_type_$1=yes, 1573eval ac_cv_type_$1=no))]) 1574 1575AC_DEFUN(AC_GROK_TYPES, [ 1576for i in $1; do 1577 AC_MSG_CHECKING(for $i) 1578 AC_GROK_TYPE($i) 1579 eval ac_res=\$ac_cv_type_$i 1580 if test "$ac_res" = yes; then 1581 type=HAVE_[]upcase($i) 1582 AC_DEFINE_UNQUOTED($type) 1583 fi 1584 AC_MSG_RESULT($ac_res) 1585done 1586]) 1587 1588dnl $Id: auth-modules.m4,v 1.1 1999/03/21 13:48:00 joda Exp $ 1589dnl 1590dnl Figure what authentication modules should be built 1591 1592AC_DEFUN(AC_AUTH_MODULES,[ 1593AC_MSG_CHECKING(which authentication modules should be built) 1594 1595LIB_AUTH_SUBDIRS= 1596 1597if test "$ac_cv_header_siad_h" = yes; then 1598 LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS sia" 1599fi 1600 1601if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_shared" = yes; then 1602 LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS pam" 1603fi 1604 1605case "${host}" in 1606changequote(,)dnl 1607*-*-irix[56]*) LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS afskauthlib" ;; 1608changequote([,])dnl 1609esac 1610 1611AC_MSG_RESULT($LIB_AUTH_SUBDIRS) 1612 1613AC_SUBST(LIB_AUTH_SUBDIRS)dnl 1614]) 1615 1616