1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790
|
dnl Taylor UUCP configuration file
dnl This should be processed with autoconf to produce a configure script.
dnl Copyright (c) 1992, 1993, 1994, 1995, 2002 Ian Lance Taylor
dnl
AC_REVISION([$Id: configure.in,v 1.99 2002/03/07 17:56:41 ian Rel $])
AC_INIT(policy.h)
AM_INIT_AUTOMAKE(uucp, 1.07)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
dnl
AC_ARG_WITH(user,
[ --with-user=USERNAME user ID for programs; default uucp],
[OWNER=${withval}],
[OWNER="uucp"])
AC_DEFINE_UNQUOTED(OWNER, "$OWNER", [user ID for programs; normally uucp])
AC_SUBST(OWNER)
dnl
AC_ARG_WITH(newconfigdir,
[ --with-newconfigdir=DIRNAME new config file directory; default PREFIX/conf/uucp],
[NEWCONFIGDIR=${withval}],
[NEWCONFIGDIR='${prefix}/conf/uucp'])
AC_SUBST(NEWCONFIGDIR)
dnl
AC_ARG_WITH(oldconfigdir,
[ --with-oldconfigdir=DIRNAME old config file directory; default /usr/lib/uucp],
[OLDCONFIGDIR=${withval}],
[OLDCONFIGDIR="/usr/lib/uucp"])
AC_SUBST(OLDCONFIGDIR)
dnl
AC_PREFIX_PROGRAM(gcc)
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
dnl
build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
AC_ARG_ENABLE(build-warnings,
[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
[case "${enableval}" in
yes) ;;
no) build_warnings="-w";;
,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
build_warnings="${build_warnings} ${t}";;
*,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
build_warnings="${t} ${build_warnings}";;
*) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
esac
if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
echo "Setting warning flags = $build_warnings" 6>&1
fi])dnl
WARN_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
WARN_CFLAGS="${build_warnings}"
fi
AC_SUBST(WARN_CFLAGS)
dnl
dnl AR was added to the Makefiles to allow building on funny systems.
dnl Adding it here allows the environment value of AR at configure time to
dnl be cached in config.status and in the Makefiles.
AR=${AR-ar}
AC_SUBST(AR)
AC_PROG_RANLIB
AC_ISC_POSIX
AC_MINIX
AC_AIX
AC_CHECK_LIB(sun, getpwnam)
AC_C_CONST
AC_MSG_CHECKING([for prototypes])
AC_CACHE_VAL(uucp_cv_c_prototypes,
[AC_TRY_COMPILE([extern int foo (short);
int foo(short i) { return i; }],
[int i;],
uucp_cv_c_prototypes=yes, uucp_cv_c_prototypes=no)])
AC_MSG_RESULT($uucp_cv_c_prototypes)
if test $uucp_cv_c_prototypes = yes; then
AC_DEFINE(HAVE_PROTOTYPES, 1, [Whether the compiler supports prototypes])
fi
dnl
AC_SYS_INTERPRETER
POUNDBANG=$ac_cv_sys_interpreter
AC_SUBST(POUNDBANG)
dnl
AC_MSG_CHECKING(for echo)
if (PATH= echo test) 2>/dev/null | grep test >/dev/null 2>&1; then
echo_program='"echo"'
AC_MSG_RESULT(shell builtin)
elif test -s /bin/echo; then
echo_program="/bin/echo"
AC_MSG_RESULT(/bin/echo)
else
AC_MSG_RESULT(not found)
fi
AC_DEFINE_UNQUOTED([ECHO_PROGRAM], $echo_program,
[echo program--if shell builtin, use "echo"])
AC_PROG_LN_S
dnl
AC_CHECK_HEADERS(stddef.h stdarg.h string.h strings.h unistd.h stdlib.h)
AC_CHECK_HEADERS(limits.h time.h sys/wait.h sys/ioctl.h memory.h termios.h)
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h sys/times.h libc.h)
AC_CHECK_HEADERS(sysexits.h poll.h tiuser.h xti.h sys/tli.h stropts.h ftw.h)
AC_CHECK_HEADERS(glob.h sys/param.h sys/types.tcp.h sys/mount.h sys/vfs.h)
AC_CHECK_HEADERS(sys/filsys.h sys/statfs.h sys/dustat.h sys/fs_types.h ustat.h)
AC_CHECK_HEADERS(sys/statvfs.h sys/termiox.h)
dnl
# Under Next 3.2 <dirent.h> apparently does not define struct dirent
# by default.
AC_MSG_CHECKING([for dirent.h])
AC_CACHE_VAL(uucp_cv_header_dirent_h,
[AC_TRY_COMPILE([#include <dirent.h>],
[struct dirent s;],
uucp_cv_header_dirent_h=yes, uucp_cv_header_dirent_h=no)])
AC_MSG_RESULT($uucp_cv_header_dirent_h)
if test $uucp_cv_header_dirent_h = yes; then
AC_DEFINE(HAVE_DIRENT_H, 1,
[Whether you have a <dirent.h> which defines struct direct])
fi
dnl
# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
# by default.
AC_MSG_CHECKING([for utime.h])
AC_CACHE_VAL(uucp_cv_header_utime_h,
[AC_TRY_COMPILE([#include <sys/types.h>
#if HAVE_TIME_H
#include <time.h>
#endif
#include <utime.h>],
[struct utimbuf s;],
uucp_cv_header_utime_h=yes, uucp_cv_header_utime_h=no)])
AC_MSG_RESULT($uucp_cv_header_utime_h)
if test $uucp_cv_header_utime_h = yes; then
AC_DEFINE(HAVE_UTIME_H, 1,
[Whether you have a <utime.h> which defines struct utimbuf])
fi
dnl
AC_MSG_CHECKING([for sys/select.h])
AC_CACHE_VAL(uucp_cv_header_sys_select_h,
[AC_TRY_COMPILE([#include <sys/select.h>
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif],
[int i;],
uucp_cv_header_sys_select_h=yes, uucp_cv_header_sys_select_h=no)])
AC_MSG_RESULT($uucp_cv_header_sys_select_h)
if test $uucp_cv_header_sys_select_h = yes; then
AC_DEFINE(HAVE_SYS_SELECT_H, 1,
[Whether you have <sys/select.h>])
fi
dnl
AC_HEADER_MAJOR
dnl
AC_TYPE_SIGNAL
dnl
AC_HEADER_STAT
dnl
AC_HEADER_TIME
AC_STRUCT_TM
dnl
AC_MSG_CHECKING([whether termios.h and sys/ioctl.h may both be included])
AC_CACHE_VAL(uucp_cv_header_termios_and_ioctl,
[AC_TRY_COMPILE([#include <termios.h>
#include <sys/ioctl.h>],
[int i;],
uucp_cv_header_termios_and_ioctl=yes, uucp_cv_header_termios_and_ioctl=no)])
AC_MSG_RESULT($uucp_cv_header_termios_and_ioctl)
if test $uucp_cv_header_termios_and_ioctl = yes; then
AC_DEFINE(HAVE_TERMIOS_AND_SYS_IOCTL_H, 1,
[Whether <termios.h> and <sys/ioctl.h> may both be included])
fi
dnl
AC_MSG_CHECKING(for CBREAK)
AC_CACHE_VAL(uucp_cv_decl_cbreak,
[AC_TRY_COMPILE([#include <sgtty.h>], [int i = CBREAK;],
uucp_cv_decl_cbreak=yes, uucp_cv_decl_cbreak=no)])
AC_MSG_RESULT($uucp_cv_decl_cbreak)
if test $uucp_cv_decl_cbreak = yes; then
AC_DEFINE(HAVE_CBREAK, 1, [Whether CBREAK is defined])
fi
dnl
AC_MSG_CHECKING(for pid_t in sys/types.h)
AC_CACHE_VAL(uucp_cv_decl_pid_t,
[AC_TRY_COMPILE([#include <sys/types.h>], [pid_t x;],
uucp_cv_decl_pid_t=yes, uucp_cv_decl_pid_t=no)])
AC_MSG_RESULT($uucp_cv_decl_pid_t)
if test $uucp_cv_decl_pid_t = no; then
AC_DEFINE(PID_T, int, [Type to use for pid_t if not defined--typically int])
fi
dnl
AC_MSG_CHECKING(for uid_t in sys/types.h)
AC_CACHE_VAL(uucp_cv_decl_uid_t,
[AC_TRY_COMPILE([#include <sys/types.h>], [uid_t x;],
uucp_cv_decl_uid_t=yes, uucp_cv_decl_uid_t=no)])
AC_MSG_RESULT($uucp_cv_decl_uid_t)
if test $uucp_cv_decl_uid_t = no; then
AC_DEFINE(UID_T, int, [Type to use for uid_t if not defined--typically int])
fi
dnl
AC_MSG_CHECKING(for gid_t in sys/types.h)
AC_CACHE_VAL(uucp_cv_decl_gid_t,
[AC_TRY_COMPILE([#include <sys/types.h>], [gid_t x;],
uucp_cv_decl_gid_t=yes, uucp_cv_decl_gid_t=no)])
AC_MSG_RESULT($uucp_cv_decl_gid_t)
if test $uucp_cv_decl_gid_t = no; then
AC_DEFINE(GID_T, int, [Type to use for gid_t if not defined--typically int])
fi
dnl
AC_MSG_CHECKING(for off_t in sys/types.h)
AC_CACHE_VAL(uucp_cv_decl_off_t,
[AC_TRY_COMPILE([#include <sys/types.h>], [off_t x;],
uucp_cv_decl_off_t=yes, uucp_cv_decl_off_t=no)])
AC_MSG_RESULT($uucp_cv_decl_off_t)
if test $uucp_cv_decl_off_t = no; then
AC_DEFINE(OFF_T, long,
[Type to use for off_t if not defined--typically long])
fi
dnl
dnl On SCO 3.2.2 sig_atomic_t is in <sys/types.h> but not <signal.h>.
AC_MSG_CHECKING(for sig_atomic_t in signal.h)
AC_CACHE_VAL(uucp_cv_decl_sig_atomic_t_signal_h,
[AC_TRY_COMPILE([#include <signal.h>], [sig_atomic_t x;],
uucp_cv_decl_sig_atomic_t_signal_h=yes,
uucp_cv_decl_sig_atomic_t_signal_h=no)])
AC_MSG_RESULT($uucp_cv_decl_sig_atomic_t_signal_h)
if test $uucp_cv_decl_sig_atomic_t_signal_h = yes; then
AC_DEFINE([HAVE_SIG_ATOMIC_T_IN_SIGNAL_H], 1,
[Whether sig_atomic_t is defined in <signal.h>])
fi
dnl
AC_MSG_CHECKING(for sig_atomic_t in sys/types.h)
AC_CACHE_VAL(uucp_cv_decl_sig_atomic_t_types_h,
[AC_TRY_COMPILE([#include <sys/types.h>], [sig_atomic_t x;],
uucp_cv_decl_sig_atomic_t_types_h=yes,
uucp_cv_decl_sig_atomic_t_types_h=no)])
AC_MSG_RESULT($uucp_cv_decl_sig_atomic_t_types_h)
if test $uucp_cv_decl_sig_atomic_t_types_h = yes; then
AC_DEFINE([HAVE_SIG_ATOMIC_T_IN_TYPES_H], 1,
[Whether sig_atomic_t is defined in <types.h>])
fi
dnl
if test $ac_cv_header_stddef_h = yes; then
AC_MSG_CHECKING(for size_t in stddef.h)
AC_CACHE_VAL(uucp_cv_decl_size_t_stddef_h,
[AC_TRY_COMPILE([#include <stddef.h>], [size_t x;],
uucp_cv_decl_size_t_stddef_h=yes, uucp_cv_decl_size_t_stddef_h=no)])
AC_MSG_RESULT($uucp_cv_decl_size_t_stddef_h)
if test $uucp_cv_decl_size_t_stddef_h = yes; then
AC_DEFINE([HAVE_SIZE_T_IN_STDDEF_H], 1,
[Whether size_t is defined in <stddef.h>])
fi
fi
dnl
AC_MSG_CHECKING(for size_t in sys/types.h)
AC_CACHE_VAL(uucp_cv_decl_size_t_types_h,
[AC_TRY_COMPILE([#include <sys/types.h>], [size_t x;],
uucp_cv_decl_size_t_types_h=yes, uucp_cv_decl_size_t_types_h=no)])
AC_MSG_RESULT($uucp_cv_decl_size_t_types_h)
if test $uucp_cv_decl_size_t_types_h = yes; then
AC_DEFINE([HAVE_SIZE_T_IN_TYPES_H], 1,
[Whether size_t is defined in <types.h>])
fi
dnl
AC_MSG_CHECKING(for time_t in time.h)
AC_CACHE_VAL(uucp_cv_decl_time_t_time_h,
[AC_TRY_COMPILE([#include <time.h>], [time_t i;],
uucp_cv_decl_time_t_time_h=yes, uucp_cv_decl_time_t_time_h=no)])
AC_MSG_RESULT($uucp_cv_decl_time_t_time_h)
if test $uucp_cv_decl_time_t_time_h = yes; then
AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
[Whether time_t is defined in <time.h>])
fi
dnl
AC_MSG_CHECKING(time_t in sys/types.h)
AC_CACHE_VAL(uucp_cv_decl_time_t_types_h,
[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
uucp_cv_decl_time_t_types_h=yes, uucp_cv_decl_time_t_types_h=no)])
AC_MSG_RESULT($uucp_cv_decl_time_t_types_h)
if test $uucp_cv_decl_time_t_types_h = yes; then
AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
[Whether time_t is defined in <types.h>])
fi
dnl
AC_MSG_CHECKING(for void)
AC_CACHE_VAL(uucp_cv_c_void,
[AC_TRY_COMPILE([], [extern void foo (); (void) exit (0);],
uucp_cv_c_void=yes, uucp_cv_c_void=no)])
AC_MSG_RESULT($uucp_cv_c_void)
if test $uucp_cv_c_void = yes; then
AC_DEFINE([HAVE_VOID], 1, [Whether the compiler supports void])
fi
dnl
AC_MSG_CHECKING(for unsigned char)
AC_CACHE_VAL(uucp_cv_c_unsigned_char,
[AC_TRY_COMPILE([], [unsigned char i = (unsigned char) -1;],
uucp_cv_c_unsigned_char=yes, uucp_cv_c_unsigned_char=no)])
AC_MSG_RESULT($uucp_cv_c_unsigned_char)
if test $uucp_cv_c_unsigned_char = yes; then
AC_DEFINE([HAVE_UNSIGNED_CHAR], 1,
[Whether the compiler supports unsigned char])
fi
dnl
AC_MSG_CHECKING(for errno declaration)
AC_CACHE_VAL(uucp_cv_decl_errno,
[AC_TRY_COMPILE([#include <errno.h>], [int i = errno; errno = 1;],
uucp_cv_decl_errno=yes, uucp_cv_decl_errno=no)])
AC_MSG_RESULT($uucp_cv_decl_errno)
if test $uucp_cv_decl_errno = yes; then
AC_DEFINE([HAVE_ERRNO_DECLARATION], 1,
[Whether errno is declared in <errno.h>])
fi
dnl
AC_MSG_CHECKING(for TXADDCD)
AC_CACHE_VAL(uucp_cv_txaddcd,
[AC_TRY_COMPILE([#include <sys/ioctl.h>], [int i = (int) TXADDCD;],
uucp_cv_txaddcd=yes, uucp_cv_txaddcd=no)])
AC_MSG_RESULT($uucp_cv_txaddcd)
if test $uucp_cv_txaddcd = yes; then
AC_DEFINE([HAVE_TXADDCD], 1, [Whether TXADDCD is defined])
fi
dnl
dnl On some systems, memset, memcmp, and memcpy must be called with
dnl the right number of arguments.
AC_MSG_CHECKING(for memset)
AC_CACHE_VAL(ac_cv_func_memset,
[AC_TRY_LINK([], [ char *i; int j, k; memset(i, j, k); ],
ac_cv_func_memset=yes, ac_cv_func_memset=no)])
AC_MSG_RESULT($ac_cv_func_memset)
if test $ac_cv_func_memset = yes; then
AC_DEFINE([HAVE_MEMSET], 1, [Whether you have memset])
fi
dnl
AC_MSG_CHECKING(for memcmp)
AC_CACHE_VAL(ac_cv_func_memcmp,
[AC_TRY_LINK([], [ char *i, *j; int k; memcmp(i, j, k); ],
ac_cv_func_memcmp=yes, ac_cv_func_memcmp=no)])
AC_MSG_RESULT($ac_cv_func_memcmp)
if test $ac_cv_func_memcmp = yes; then
AC_DEFINE([HAVE_MEMCMP], 1, [Whether you have memcmp])
fi
dnl
AC_MSG_CHECKING(for memcpy)
AC_CACHE_VAL(ac_cv_func_memcpy,
[AC_TRY_LINK([], [ char *i, *j; int k; memcpy(i, j, k); ],
ac_cv_func_memcpy=yes, ac_cv_func_memcpy=no)])
AC_MSG_RESULT($ac_cv_func_memcpy)
if test $ac_cv_func_memcpy = yes; then
AC_DEFINE([HAVE_MEMCPY], 1, [Whether you have memcpy])
fi
dnl
undefine([index])
AC_CHECK_FUNCS(memchr bcopy bcmp bzero)
AC_CHECK_FUNCS(strchr strrchr index rindex strerror strtol strtoul strstr)
AC_CHECK_FUNCS(strdup strcasecmp strncasecmp stricmp strnicmp)
AC_CHECK_FUNCS(bsearch vfprintf)
AC_CHECK_FUNCS(remove ftruncate ltrunc rename opendir dup2 waitpid wait4)
AC_CHECK_FUNCS(sigsetjmp setret sigaction sigvec sigset)
AC_CHECK_FUNCS(sigprocmask sigblock sighold getdtablesize sysconf)
AC_CHECK_FUNCS(setpgrp setsid setreuid seteuid gethostname uname)
AC_CHECK_FUNCS(gettimeofday ftw glob dev_info getaddrinfo)
dnl
dnl Check for getline, but try to avoid inappropriate getline
dnl functions found on ISC and HP/UX by also checking for getdelim;
dnl the version of getline we want is normally implemented by calling
dnl getdelim.
AC_CHECK_FUNC(getdelim,
[AC_CHECK_FUNC(getline,
[AC_DEFINE(HAVE_GETLINE, 1, [Define if you have the getline function.])],
[LIBOBJS="$LIBOBJS getlin.o"])],
[LIBOBJS="$LIBOBJS getlin.o"])
dnl
dnl Check for the SCO buggy ftime; the code can cope with the bug,
dnl though it would prefer not to, so if we're cross-configuring we
dnl accept that ftime exists.
AC_CHECK_FUNC(ftime,
[AC_MSG_CHECKING(that ftime works correctly)
AC_CACHE_VAL(uucp_cv_sys_ftime_ok,
[AC_TRY_RUN([
#include <sys/types.h>
#include <sys/timeb.h>
main ()
{
struct timeb s, slast;
int c = 0;
ftime (&slast);
while (c < 10)
{
ftime (&s);
if (s.time < slast.time
|| (s.time == slast.time && s.millitm < slast.millitm))
exit (1);
if (s.time != slast.time)
++c;
slast.time = s.time;
slast.millitm = s.millitm;
}
exit (0);
}
],
uucp_cv_sys_ftime_ok=yes,
uucp_cv_sys_ftime_ok=no,
uucp_cv_sys_ftime_ok=runtime)])
case $uucp_cv_sys_ftime_ok in
yes) AC_MSG_RESULT(yes) ;;
no) AC_MSG_RESULT(no)
AC_MSG_WARN(ftime seems to be buggy) ;;
runtime) AC_MSG_RESULT(will check at run time) ;;
esac
])
if test $uucp_cv_sys_ftime_ok = yes || test $uucp_cv_sys_ftime_ok = runtime; then
AC_DEFINE(HAVE_FTIME, 1, [Whether you have ftime])
fi
dnl
AC_CHECK_FUNCS(times)
AC_CHECK_FUNCS(napms nap usleep poll select)
if test $ac_cv_func_napms != yes \
&& test $ac_cv_func_nap != yes \
&& test $ac_cv_func_usleep != yes \
&& test $ac_cv_func_poll != yes \
&& test $ac_cv_func_select != yes; then
AC_MSG_WARN(No way to sleep for less than one second)
AC_MSG_WARN(\p in chat scripts will sleep for a full second)
fi
dnl
AC_CHECK_FUNCS(getgrent)
dnl
case $LIBS in
*-lnsl*) ;;
*) AC_CHECK_LIB(nsl_s, main) ;;
esac
case $LIBS in
*-lnsl*) ;;
*) AC_CHECK_LIB(nsl, main) ;;
esac
case $LIBS in
*-lsocket*) ;;
*) AC_CHECK_LIB(socket, socket) ;;
esac
case $LIBS in
*-lxti*) ;;
*) AC_CHECK_LIB(xti, t_open);;
esac
AC_CHECK_FUNCS(socket t_open)
dnl
AC_CHECK_FUNCS(getcwd getwd)
if test $ac_cv_func_getcwd != yes \
&& test $ac_cv_func_getwd != yes; then
UNIXOBJS="$UNIXOBJS getcwd.o"
if test -s /bin/pwd; then
AC_DEFINE([PWD_PROGRAM], "/bin/pwd", [Program to print working directory])
fi
fi
dnl
AC_CHECK_FUNCS(mkdir)
AM_CONDITIONAL(HAVE_MKDIR, [test $ac_cv_func_mkdir = yes])
if test $ac_cv_func_mkdir != yes; then
UNIXOBJS="$UNIXOBJS mkdir.o"
if test -s /bin/mkdir; then
AC_DEFINE([MKDIR_PROGRAM], "/bin/mkdir", [Program to make a directory])
fi
fi
dnl
AC_CHECK_FUNCS(rmdir)
if test $ac_cv_func_rmdir != yes; then
UNIXOBJS="$UNIXOBJS rmdir.o"
if test -s /bin/rmdir; then
AC_DEFINE([RMDIR_PROGRAM], "/bin/rmdir", [Program to remove a directory])
fi
fi
dnl
dnl Figure out which functions we need from lib subdirectory
if test $ac_cv_func_bsearch != yes; then
LIBOBJS="$LIBOBJS bsrch.o"
fi
if test $ac_cv_func_bzero != yes \
&& test $ac_cv_func_memset != yes; then
LIBOBJS="$LIBOBJS bzero.o"
fi
if test $ac_cv_func_memchr != yes; then
LIBOBJS="$LIBOBJS memchr.o"
fi
if test $ac_cv_func_memcmp != yes \
&& test $ac_cv_func_bcmp != yes; then
LIBOBJS="$LIBOBJS memcmp.o"
fi
if test $ac_cv_func_memcpy != yes \
&& test $ac_cv_func_bcopy != yes; then
LIBOBJS="$LIBOBJS memcpy.o"
fi
if test $ac_cv_func_strcasecmp != yes \
&& test $ac_cv_func_stricmp != yes; then
LIBOBJS="$LIBOBJS strcas.o"
fi
if test $ac_cv_func_strchr != yes \
&& test $ac_cv_func_index != yes; then
LIBOBJS="$LIBOBJS strchr.o"
fi
if test $ac_cv_func_strdup != yes; then
LIBOBJS="$LIBOBJS strdup.o"
fi
if test $ac_cv_func_strncasecmp != yes \
&& test $ac_cv_func_strnicmp != yes; then
LIBOBJS="$LIBOBJS strncs.o"
fi
if test $ac_cv_func_strrchr != yes \
&& test $ac_cv_func_rindex != yes; then
LIBOBJS="$LIBOBJS strrch.o"
fi
if test $ac_cv_func_strstr != yes; then
LIBOBJS="$LIBOBJS strstr.o"
fi
if test $ac_cv_func_strtol != yes; then
LIBOBJS="$LIBOBJS strtol.o"
fi
if test $ac_cv_func_strtoul != yes; then
LIBOBJS="$LIBOBJS strtou.o"
fi
AC_SUBST(LIBOBJS)dnl
dnl Figure out which functions we need from unix subdirectory
if test $ac_cv_func_opendir != yes; then
UNIXOBJS="$UNIXOBJS dirent.o"
fi
if test $ac_cv_func_dup2 != yes; then
UNIXOBJS="$UNIXOBJS dup2.o"
fi
if test $ac_cv_func_ftw != yes; then
UNIXOBJS="$UNIXOBJS ftw.o"
fi
if test $ac_cv_func_remove != yes; then
UNIXOBJS="$UNIXOBJS remove.o"
fi
if test $ac_cv_func_rename != yes; then
UNIXOBJS="$UNIXOBJS rename.o"
fi
if test $ac_cv_func_strerror != yes; then
UNIXOBJS="$UNIXOBJS strerr.o"
fi
AC_SUBST(UNIXOBJS)
dnl
if test $ac_cv_func_sigvec = yes; then
AC_MSG_CHECKING(for sv_flags)
AC_CACHE_VAL(uucp_cv_struct_sv_flags,
[AC_TRY_COMPILE([#include <signal.h>], [struct sigvec s; s.sv_flags = 0;],
uucp_cv_struct_sv_flags=yes, uucp_cv_struct_sv_flags=no)])
AC_MSG_RESULT($uucp_cv_struct_sv_flags)
if test $uucp_cv_struct_sv_flags = yes; then
AC_DEFINE([HAVE_SIGVEC_SV_FLAGS], 1,
[Whether struct sigvec has sv_flags member])
fi
fi
dnl The filesystem info code is from the GNU fileutils 3.12 package.
AC_CHECKING(how to get filesystem space usage)
space=no
# Here we'll compromise a little (and perform only the link test)
# since it seems there are no variants of the statvfs function.
if test $space = no; then
# SVR4
AC_CHECK_FUNCS(statvfs)
if test $ac_cv_func_statvfs = yes; then
space=yes
AC_DEFINE(STAT_STATVFS, 1, [Whether you have statvfs])
fi
fi
if test $space = no; then
# DEC Alpha running OSF/1
AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
AC_CACHE_VAL(uucp_cv_sys_stat_statfs3_osf1,
[AC_TRY_RUN([
#include <sys/param.h>
#include <sys/types.h>
#include <sys/mount.h>
main ()
{
struct statfs fsd;
fsd.f_fsize = 0;
exit (statfs (".", &fsd, sizeof (struct statfs)));
}],
uucp_cv_sys_stat_statfs3_osf1=yes,
uucp_cv_sys_stat_statfs3_osf1=no,
uucp_cv_sys_stat_statfs3_osf1=no)])
AC_MSG_RESULT($uucp_cv_sys_stat_statfs3_osf1)
if test $uucp_cv_sys_stat_statfs3_osf1 = yes; then
space=yes
AC_DEFINE(STAT_STATFS3_OSF1, 1, [Whether you have 3 argument statfs])
fi
fi
if test $space = no; then
# AIX
AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
member (AIX, 4.3BSD)])
AC_CACHE_VAL(uucp_cv_sys_stat_statfs2_bsize,
[AC_TRY_RUN([
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
main ()
{
struct statfs fsd;
fsd.f_bsize = 0;
exit (statfs (".", &fsd));
}],
uucp_cv_sys_stat_statfs2_bsize=yes,
uucp_cv_sys_stat_statfs2_bsize=no,
uucp_cv_sys_stat_statfs2_bsize=no)])
AC_MSG_RESULT($uucp_cv_sys_stat_statfs2_bsize)
if test $uucp_cv_sys_stat_statfs2_bsize = yes; then
space=yes
AC_DEFINE(STAT_STATFS2_BSIZE, 1,
[Whether you have two argument statfs with bsize])
fi
fi
if test $space = no; then
# SVR3
AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
AC_CACHE_VAL(uucp_cv_sys_stat_statfs4,
[AC_TRY_RUN([#include <sys/types.h>
#include <sys/statfs.h>
main ()
{
struct statfs fsd;
exit (statfs (".", &fsd, sizeof fsd, 0));
}],
uucp_cv_sys_stat_statfs4=yes,
uucp_cv_sys_stat_statfs4=no,
uucp_cv_sys_stat_statfs4=no)])
AC_MSG_RESULT($uucp_cv_sys_stat_statfs4)
if test $uucp_cv_sys_stat_statfs4 = yes; then
space=yes
AC_DEFINE(STAT_STATFS4, 1, [Whether you have four argument statfs])
fi
fi
if test $space = no; then
# 4.4BSD and NetBSD
AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
member (4.4BSD and NetBSD)])
AC_CACHE_VAL(uucp_cv_sys_stat_statfs2_fsize,
[AC_TRY_RUN([#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
main ()
{
struct statfs fsd;
fsd.f_fsize = 0;
exit (statfs (".", &fsd));
}],
uucp_cv_sys_stat_statfs2_fsize=yes,
uucp_cv_sys_stat_statfs2_fsize=no,
uucp_cv_sys_stat_statfs2_fsize=no)])
AC_MSG_RESULT($uucp_cv_sys_stat_statfs2_fsize)
if test $uucp_cv_sys_stat_statfs2_fsize = yes; then
space=yes
AC_DEFINE(STAT_STATFS2_FSIZE, 1,
[Whether you have two argument statfs with fsize])
fi
fi
if test $space = no; then
# Ultrix
AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
AC_CACHE_VAL(uucp_cv_sys_stat_fs_data,
[AC_TRY_RUN([#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#ifdef HAVE_SYS_FS_TYPES_H
#include <sys/fs_types.h>
#endif
main ()
{
struct fs_data fsd;
/* Ultrix's statfs returns 1 for success,
0 for not mounted, -1 for failure. */
exit (statfs (".", &fsd) != 1);
}],
uucp_cv_sys_stat_fs_data=yes,
uucp_cv_sys_stat_fs_data=no,
uucp_cv_sys_stat_fs_data=no)])
AC_MSG_RESULT($uucp_cv_sys_stat_fs_data)
if test $uucp_cv_sys_stat_fs_data = yes; then
space=yes
AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
[Whether you have two argument statfs with fd_req])
fi
fi
if test $space = no; then
AC_CHECK_FUNCS(ustat)
if test $ac_cv_func_ustat = yes; then
space=yes
AC_DEFINE(STAT_USTAT, 1, [Whether you have ustat])
fi
fi
if test $space = no; then
# QNX
AC_CHECK_FUNCS(disk_space)
if test $ac_cv_func_disk_space = yes; then
space=yes
AC_DEFINE(STAT_DISK_SPACE, 1, [Whether you have disk_space])
fi
fi
dnl See whether we can make an extern declaration
AC_DEFUN(UUCP_CHECK_DECLARATION,
[AC_MSG_CHECKING(for $1 declared as $2)
AC_CACHE_VAL(uucp_cv_decl_$1,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#ifdef HAVE_LIBC_H
#include <libc.h>
#endif
#ifdef HAVE_SYS_TIMES_H
#include <sys/times.h>
#endif
extern $2 $1 ();], [int i = 0;],
eval "uucp_cv_decl_$1=yes", eval "uucp_cv_decl_$1=no")])
if eval "test \"`echo '$uucp_cv_decl_'$1`\" = yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(translit($1, [a-z], [A-Z])_DECLARATION_OK, 1,
[Whether $1 is declared as $2])
else
AC_MSG_RESULT(no)
fi
])
dnl
UUCP_CHECK_DECLARATION(times, long)
UUCP_CHECK_DECLARATION(getpwnam, struct passwd *)
UUCP_CHECK_DECLARATION(getpwuid, struct passwd *)
UUCP_CHECK_DECLARATION(getgrent, struct group *)
dnl
AC_MSG_CHECKING(for BSD setpgrp)
AC_CACHE_VAL(uucp_cv_decl_setpgrp,
[AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif],
[getpgrp (0); setpgrp (0, 0);],
uucp_cv_decl_setpgrp=yes, uucp_cv_decl_setpgrp=no)])
AC_MSG_RESULT($uucp_cv_decl_setpgrp)
if test $uucp_cv_decl_setpgrp = yes; then
AC_DEFINE([HAVE_BSD_PGRP], 1, [Whether you have BSD style setpgrp])
fi
dnl
AC_MSG_CHECKING(for union wait)
AC_CACHE_VAL(uucp_cv_struct_wait,
[AC_TRY_COMPILE([#include <sys/wait.h>
#ifndef WIFEXITED
#define WIFEXITED(u) ((u).w_termsig == 0)
#endif],
[union wait u; if (WIFEXITED (u)) wait (&u);],
uucp_cv_struct_wait=yes, uucp_cv_struct_wait=no)])
AC_MSG_RESULT($uucp_cv_struct_wait)
if test $uucp_cv_struct_wait = yes; then
AC_DEFINE([HAVE_UNION_WAIT], 1, [Whether you have union wait])
fi
dnl
AC_MSG_CHECKING(for struct sockaddr_storage)
AC_CACHE_VAL(uucp_cv_struct_sockaddrstorage,
[AC_TRY_COMPILE([#include <sys/socket.h>],
[struct sockaddr_storage s;],
uucp_cv_struct_sockaddrstorage=yes, uucp_cv_struct_sockaddrstorage=no)])
AC_MSG_RESULT($uucp_cv_struct_sockaddrstorage)
if test $uucp_cv_struct_sockaddrstorage = yes; then
AC_DEFINE([HAVE_STRUCT_SOCKADDR_STORAGE], 1,
[Whether you have struct sockaddr_storage])
fi
dnl
if test "$cross_compiling" = yes; then
AC_DEFINE([HAVE_LONG_FILE_NAMES], [0])
AC_DEFINE([HAVE_RESTARTABLE_SYSCALLS], [-1])
else
AC_SYS_RESTARTABLE_SYSCALLS
AC_SYS_LONG_FILE_NAMES
fi
dnl
AC_OUTPUT(Makefile uuconf/Makefile lib/Makefile unix/Makefile)
|