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 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070
|
dnl process this file with GNU autoconf to produce a configure script.
dnl
dnl Patrick Powell Fri Jul 7 21:08:48 PDT 1995
dnl configure.in,v 3.30 1998/03/29 18:46:07 papowell Exp
AC_INIT(Makefile.in)
AC_CONFIG_AUX_DIR(.)
AC_CANONICAL_SYSTEM
AC_CONFIG_HEADER(config.h)
PACKAGE=ifhp
VERSION=3.3.10
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
ALL_LINGUAS="fr"
AC_PREFIX_DEFAULT(/usr/local)
AC_SUBST(INSTALL)
AC_SUBST(INSTALL_MAN)
AC_SUBST(SHELL)
AC_SUBST(CPP)
AC_SUBST(CFLAGS)
AC_SUBST(LDCC)
AC_PATH_PROG(PERL,perl)dnl
AC_SUBST(PERL)dnl
dnl ----------------------------------------------------------------------------
dnl ----------- C compiler checks -----------------------------------------
AC_PROG_CC
if test $ac_cv_prog_gcc = yes; then
cat >conftest.c <<EOF
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
yes;
#endif
EOF
if ${CC-cc} -E conftest.c | egrep yes >/dev/null 2>&1; then
gcc -v
echo "WARNING: gcc -O (version 2.4.5 and below) produces incorrect code"
echo " for lpd.c and other large routines."
CFLAGS="`echo ${CFLAGS} | sed s/-O//`"
fi;
CFLAGS="${CFLAGS} -Wall"
echo "using CFLAGS=${CFLAGS}"
fi;
dnl ----------------------------------------------------------------------------
dnl
dnl Allow the user to specify where the "administrative" commands (lpc,
dnl checkpc, et. al. -- commands designed to be run more often by an admin
dnl than by a normal user) should be installed.
dnl
dnl Default: ${bindir} for backward compability. I personally feel it should
dnl default to ${sbindir} :-)
dnl
dnl comment out the AC_MSG_CHECKING and the AC_MSG_RESULT below if you don't
dnl want the user informed during the configure process where stuff is going
dnl
AC_MSG_CHECKING(directory where to install the ifhp.conf file)
AC_ARG_WITH(configfile,
[ --with-configfile=path ifhp.conf explicit locations, override defaults],
CONFIG_FILE=$withval,
)
AC_MSG_RESULT($CONFIG_FILE)
AC_SUBST(CONFIG_FILE)
AC_MSG_CHECKING(where to install the ifhp executables)
AC_ARG_WITH(filterdir,
[ --with-filterdir=DIR where to install ifhp executables, default \${libexecdir}/filters)],
FILTERDIR=$withval,
)
AC_MSG_RESULT($FILTERDIR)
AC_SUBST(FILTERDIR)
dnl ------------ OS Checks --------------------------------------------------
AC_ISC_POSIX
AC_MINIX
AC_AIX
changequote(, )dnl
version=`echo $target_os | sed -e 's/[^0-9][^0-9]*//' -e 's/\.//g'`; export version
osword=`echo $target_os | sed -e 's/[0-9].*//'`; export osword
changequote([, ])dnl
echo "Target is $target, arch $target_cpu, os $target_os, version $version"
AC_DEFINE_UNQUOTED(ARCHITECTURE,"$target_cpu")
LDCC="$CC"
checklibs=
case $target_os in
linux* )
no_resolv_lib=yes;
;;
bsdi* )
LDCC=shlicc
;;
unicos* )
checklibs=no
;;
irix6* )
checklibs=no
AC_DEFINE_UNQUOTED(IRIX,$version)
LIBS="$LIBS -lcurses"
;;
irix5* )
checklibs=no
AC_DEFINE(HAVE_BROKEN_TIOCEXCL)
AC_DEFINE(SVR4)
AC_DEFINE_UNQUOTED(IRIX,$version)
LIBS="$LIBS -lcurses"
;;
irix* )
checklibs=no
AC_DEFINE_UNQUOTED(IRIX,$version)
LIBS="$LIBS -ltermcap"
;;
solaris* )
AC_DEFINE(SVR4)
if test $version -lt 100 ; then
version=`expr $version \* 10 `;
echo "using version $version";
fi;
no_resolv_lib=yes;
AC_DEFINE_UNQUOTED(SOLARIS,$version)
;;
hpux* )
AC_DEFINE(_HPUX_SOURCE)
CFLAGS="$CFLAGS -D_HPUX_SOURCE=1"
AC_DEFINE_UNQUOTED(HPUX,$version)
if test $ac_cv_prog_gcc != yes; then
echo "HP UX and not using GCC, adding -Aa flag for compilation";
CFLAGS="$CFLAGS -Aa";
fi;
;;
sunos* )
AC_DEFINE_UNQUOTED(SUNOS,$version)
;;
osf* )
checklibs=no
echo "OSF"
AC_DEFINE_UNQUOTED(DECALPHA,$version)
if test $ac_cv_prog_gcc != yes; then
echo "DECO OS and not using GCC, adding -std flag for compilation";
CFLAGS="$CFLAGS -std";
fi
;;
esac
dnl if egrep _HPUX_SOURCE /usr/include/sys/types.h > /dev/null 2>&1 ; then
dnl # HP/UX support (kludgety kludge!)
dnl AC_DEFINE(_HPUX_SOURCE)
dnl CFLAGS="$CFLAGS -D_HPUX_SOURCE=1"
dnl fi
dnl these must be before anything that links.
dnl check to see if we suppress probing for libraries
dnl this is done by using the checklibs variable
if test -z "$checklibs"; then
dnl BSDI uses this for setproctitle
AC_CHECK_LIB(util, setproctitle, [LIBS="$LIBS -lutil"])
dnl A/UX uses this...
AC_CHECK_LIB(posix, getpwent, [LIBS="$LIBS -lposix"])
dnl use old-style shared libs if we have 'em.
AC_CHECK_LIB(socket_s, socket, [LIBS="$LIBS -lsocket_s"; have_socket=1], ,-lnsl)
if test -z "$have_socket"; then
AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"], , -lnsl)
fi
AC_CHECK_LIB(nsl_s, gethostbyaddr, [LIBS="$LIBS -lnsl_s"; have_nsl=1])
if test -z "$have_nsl"; then
AC_CHECK_LIB(nsl, gethostbyaddr, [LIBS="$LIBS -lnsl"])
fi
AC_CHECK_LIB(net_s, gethostbyaddr, [LIBS="$LIBS -lnet_s"; have_net=1])
if test -z "$have_net"; then
AC_CHECK_LIB(net, gethostbyaddr, [LIBS="$LIBS -lnet"])
fi
dnl IRIX 4 uses these... NIS calls, shared C lib
AC_CHECK_LIB(sun, getpwnam, [LIBS="$LIBS -lsun"])
AC_CHECK_LIB(c_s, atoi, [LIBS="$LIBS -lc_s"])
dnl BIND library may be needed, need to force this first
if test -z "$no_resolv_lib"; then
AC_CHECK_FUNC(inet_ntop,name2=yes)
if test -z "$name2" ; then
AC_CHECK_LIB(resolv, inet_ntop, [LIBS="$LIBS -lresolv";name2=yes])
fi;
AC_CHECK_FUNC(_res,[have_res=1])
fi
dnl Kerberos V
AC_CHECK_LIB(krb5, krb5_init_context,
[LIBS="$LIBS -lkrb5 -lcrypto -lcom_err"], , -lcrypto -lcom_err)
dnl this should solve problems of missing termlib, termcap
dnl libraries. Note that there may be some conflicts if both
dnl termcap and termlib are both included, but this is not
dnl supposed to be the case - only one will get resolved
TERMLIB=
dnl first we check for LINUX
AC_CHECK_LIB(ncurses, tgetent, [LIBS="$LIBS -lncurses"; TERMLIB=yes])
if test -z "$TERMLIB" ; then
AC_CHECK_LIB(termlib, tgetent, [LIBS="$LIBS -ltermlib"; TERMLIB=yes])
fi;
if test -z "$TERMLIB" ; then
AC_CHECK_LIB(termcap, tgetent, [LIBS="$LIBS -ltermcap"; TERMLIB=yes])
fi;
if test -z "$TERMLIB" ; then
AC_CHECK_LIB(curses, tgetent, [LIBS="$LIBS -lcurses"; TERMLIB=yes])
fi;
fi
if test -n "$have_res"; then
AC_DEFINE(HAVE_RES)
fi;
dnl **** end library checks
dnl **** force libraries for some odd systems the the above did not find
case $target_os in
mips-sni* )
LIBS="$LIBS -lcurses";
;;
esac
AC_C_CONST
AC_C_INLINE
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
dnl typedefs:
AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_TYPE_SIZE_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_CHECK_TYPE(quad_t,NONE)
dnl ----------------------------------------------------------------------------
dnl headers:
AC_CHECK_HEADERS(ctype.h)
AC_CHECK_HEADERS(sys/types.h)
AC_CHECK_HEADERS(a.out.h a_out.h aouthdr.h ar.h arpa/inet.h arpa/nameser.h)
AC_CHECK_HEADERS(assert.h com_err.h compat.h ctype.h curses.h dirent.h)
AC_CHECK_HEADERS(errno.h exechdr.h fcntl.h filehdr.h grp.h krb5.h)
AC_CHECK_HEADERS(limits.h locale.h machine/vmparam.h malloc.h memory.h)
AC_CHECK_HEADERS(ncurses.h ndir.h)
AC_CHECK_HEADERS(netdb.h netinet/in.h nlist.h pwd.h reloc.h resolv.h)
AC_CHECK_HEADERS(setjmp.h sgs.h sgtty.h signal.h stab.h stdarg.h)
AC_CHECK_HEADERS(stdio.h stdlib.h string.h strings.h sys/dir.h sys/exec.h)
AC_CHECK_HEADERS(sys/exechdr.h sys/fcntl.h sys/file.h sys/ioctl.h sys/loader.h)
AC_CHECK_HEADERS(sys/mount.h sys/ndir.h sys/param.h sys/pstat.h sys/resource.h)
AC_CHECK_HEADERS(sys/select.h sys/socket.h sys/stat.h sys/statfs.h sys/statvfs.h)
AC_CHECK_HEADERS(sys/syslog.h sys/systeminfo.h sys/termio.h sys/termiox.h)
AC_CHECK_HEADERS(sys/time.h sys/ttold.h)
AC_CHECK_HEADERS(sys/ttycom.h sys/utsname.h sys/vfs.h sys/wait.h syslog.h)
AC_CHECK_HEADERS(term.h termcap.h termio.h termios.h time.h unistd.h)
AC_CHECK_HEADERS(utsname.h varargs.h vmparam.h)
dnl ----------------------------------------------------------------------------
dnl function checks:
AC_CHECK_FUNCS(cfsetispeed fcntl flock gethostbyname2 getdtablesize)
AC_CHECK_FUNCS(gethostname getrlimit inet_aton inet_ntop inet_pton)
AC_CHECK_FUNCS(innetgr killpg lockf mkstemp)
AC_CHECK_FUNCS(mktemp openlog random rand seteuid setlocale setpgid setproctitle)
AC_CHECK_FUNCS(setresuid setreuid setsid sigaction)
AC_CHECK_FUNCS(sigprocmask siglongjmp socketpair strcasecmp)
AC_CHECK_FUNCS(strchr strdup strerror strncasecmp sysconf sysinfo)
AC_CHECK_FUNCS(tcflush tcsetattr uname wait3 waitpid)
if test ! "$ac_cv_func_setreuid" = yes -a ! "$ac_cv_func_seteuid" = yes -a ! "$ac_cv_func_setresuid" = yes; then
echo "WARNING: missing setreuid(), seteuid(), and setresuid()"
fi
AC_FUNC_VFORK
AC_FUNC_VPRINTF
dnl ----------------------------------------------------------------------------
AC_MSG_CHECKING(how to manipulate tty attributes)
AC_CACHE_VAL(ac_cv_struct_term,
[
if test "$ac_cv_header_termios_h" = yes; then
ac_cv_struct_term=termios
fi
if test "$ac_cv_header_sys_termios_h" = yes; then
ac_cv_struct_term=termios
fi
dnl test to see if we need to compile
if test -z "$ac_cv_struct_term" ; then
AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_TERMIO_H
#include <termio.h>
#endif
#ifdef HAVE_SYS_TERMIO_H
#include <sys/termio.h>
#endif],[struct termio t;t.c_iflag = 0],
ac_cv_struct_term=termio)
fi
dnl now you have determined if you have termio
if test -z "$ac_cv_struct_term" ; then
AC_TRY_COMPILE([#include <sgtty.h>],[
struct sgttyb s;s.sg_flags = 0],
ac_cv_struct_term=sgttyb)
fi
if test -z "$ac_cv_struct_term" ; then
ac_cv_struct_term=UNDEFINED
fi
])
AC_MSG_RESULT(using $ac_cv_struct_term)
if test "$ac_cv_struct_term" = "sgttyb"; then
AC_DEFINE(USE_SGTTYB)
AC_DEFINE(USE_STTY,SGTTYB)
fi
if test "$ac_cv_struct_term" = "termio"; then
AC_DEFINE(USE_TERMIO)
AC_DEFINE(USE_STTY,TERMIO)
fi
if test "$ac_cv_struct_term" = "termios"; then
AC_DEFINE(USE_TERMIOS)
AC_DEFINE(USE_STTY,TERMIOS)
if test "$ac_cv_header_sys_termiox_h" = yes; then
AC_DEFINE(USE_TERMIOX)
fi
fi
dnl ----------------------------------------------------------------------------
AC_MSG_CHECKING(checking for struct exec)
AC_CACHE_VAL(ac_cv_struct_exec,
[
ac_cv_struct_exec=no
if test "$ac_cv_header_a_out_h" != no ; then
AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <sys/types.h>
#include <a.out.h>],[struct exec b; b.a_text = 0],
ac_cv_struct_exec=yes, ac_cv_struct_exec=no )
fi
])
AC_MSG_RESULT($ac_cv_struct_exec)
if test $ac_cv_struct_exec = yes; then
AC_DEFINE(HAVE_STRUCT_EXEC)
fi
dnl ----------------------------------------------------------------------------
dnl test to see if stdlib.h defines random
AC_MSG_CHECKING(checking whether stdlib.h defines random)
AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <stdlib.h>
],[extern char *random(int c)],
ac_cv_stdlib_random=no, ac_cv_stdlib_random=yes)
AC_MSG_RESULT($ac_cv_stdlib_random)
if test $ac_cv_stdlib_random = yes; then
AC_DEFINE(STDLIB_DEFINES_RANDOM)
fi
dnl ----------------------------------------------------------------------------
dnl test to see if long long is defined
AC_MSG_CHECKING(checking for long long)
AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <sys/types.h>
],[long long x; x = 0],
ac_cv_long_long=yes, ac_cv_long_long=no)
AC_MSG_RESULT($ac_cv_long_long)
if test $ac_cv_long_long = yes; then
AC_DEFINE(HAVE_LONG_LONG)
fi
dnl ----------------------------------------------------------------------------
AC_MSG_CHECKING(how to get filesystem free space)
AC_CACHE_VAL(ac_cv_struct_fstype,
[
fstype=
dnl do this check if statvfs is a valid function
if test "$ac_cv_func_statvfs" != no ; then #{
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/param.h>
#ifdef HAVE_SYS_STATVFS_H
# include <sys/statvfs.h>
#endif
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h>
#endif
#ifdef HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif],[struct statvfs s; statvfs ("/", &s); return(s.f_bavail+s.f_bsize)],
fstype=statvfs)
fi #}
dnl do these checks if statfs is a valid function
if test "$ac_cv_func_statfs" != no ; then #{
if test -z "$fstype" ; then #{
AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <sys/types.h>
#include <sys/param.h>
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_STATVFS_H
# include <sys/statvfs.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h>
#endif
#ifdef HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif],[struct fs_data s; return(s.fd_bfree+s.fd_bsize)],
fstype=Ultrix-statfs)
fi #}
if test -z "$fstype" ; then #{
AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <sys/types.h>
#include <sys/param.h>
#ifdef HAVE_SYS_STATFS_H
#include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif],[struct statfs s; return(s.f_bavail+s.f_bsize)],
fstype=statfs)
fi # }
if test -z "$fstype" ; then # {
AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <sys/types.h>
#include <sys/param.h>
#ifdef HAVE_SYS_STATFS_H
#include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif],[struct statfs s; return(s.f_bfree+s.f_bsize)],
fstype=SVR3-statfs)
fi # }
fi # }
if test -z "$fstype" ; then
echo "cannot find a valid statfs-like structure!"
fstype=UNKNOWN
fi
ac_cv_struct_fstype=$fstype
])
AC_MSG_RESULT(using $ac_cv_struct_fstype)
if test "$ac_cv_struct_fstype" = SVR3-statfs; then
AC_DEFINE(USE_STATFS_TYPE,SVR3_STATFS)
fi
if test "$ac_cv_struct_fstype" = Ultrix-statfs; then
AC_DEFINE(USE_STATFS_TYPE,ULTRIX_STATFS)
fi
if test "$ac_cv_struct_fstype" = statfs; then
AC_DEFINE(USE_STATFS_TYPE,STATFS)
fi
if test "$ac_cv_struct_fstype" = statvfs; then
AC_DEFINE(USE_STATFS_TYPE,STATVFS)
fi
dnl ----------------------------------------------------------------------------
dnl
AC_MSG_CHECKING(for errno declaration)
AC_CACHE_VAL(ac_cv_decl_errno,
[AC_TRY_COMPILE([
#include <errno.h>
#include <stdio.h>],[printf("%d",errno);],
ac_cv_decl_errno=yes, ac_cv_decl_errno=no)
])
AC_MSG_RESULT($ac_cv_decl_errno)
if test $ac_cv_decl_errno = yes; then
AC_DEFINE(HAVE_ERRNO_DECL)
fi;
AC_MSG_CHECKING(for sys_nerr)
AC_CACHE_VAL(ac_cv_decl_sys_nerr,
[AC_TRY_LINK(,[extern int sys_nerr; return (sys_nerr);],
ac_cv_decl_sys_nerr=yes, ac_cv_decl_sys_nerr=no)
])
AC_MSG_RESULT($ac_cv_decl_sys_nerr)
if test $ac_cv_decl_sys_nerr = yes; then
AC_DEFINE(HAVE_SYS_NERR)
fi;
AC_MSG_CHECKING(for sys_nerr declaration)
AC_CACHE_VAL(ac_cv_decl_sys_nerr_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif],[printf("%d",sys_nerr);],
ac_cv_decl_sys_nerr_def=yes, ac_cv_decl_sys_nerr_def=no)
])
AC_MSG_RESULT($ac_cv_decl_sys_nerr_def)
if test $ac_cv_decl_sys_nerr_def = yes; then
AC_DEFINE(HAVE_SYS_NERR_DEF)
fi
AC_MSG_CHECKING(for sys_errlist array)
AC_CACHE_VAL(ac_cv_decl_sys_errlist,
[AC_TRY_LINK(,[extern char *sys_errlist[];
sys_errlist[0];],
ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)
])
AC_MSG_RESULT($ac_cv_decl_sys_errlist)
if test $ac_cv_decl_sys_errlist = yes; then
AC_DEFINE(HAVE_SYS_ERRLIST)
fi
AC_MSG_CHECKING(for sys_errlist declaration)
AC_CACHE_VAL(ac_cv_decl_sys_errlist_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <stdio.h>
#include <errno.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif],[printf("%s",sys_errlist[0]);],
ac_cv_decl_sys_errlist_def=yes, ac_cv_decl_sys_errlist_def=no)
])
AC_MSG_RESULT($ac_cv_decl_sys_errlist_def)
if test $ac_cv_decl_sys_errlist_def = yes; then
AC_DEFINE(HAVE_SYS_ERRLIST_DEF)
fi
AC_MSG_CHECKING(for setproctitle declaration)
AC_CACHE_VAL(ac_cv_decl_setproctitle_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <stdio.h>
#include <errno.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif],[printf("%s",(char *)setproctitle);],
ac_cv_decl_setproctitle_def=yes, ac_cv_decl_setproctitle_def=no)
])
AC_MSG_RESULT($ac_cv_decl_setproctitle_def)
if test $ac_cv_decl_setproctitle_def = yes; then
AC_DEFINE(HAVE_SETPROCTITLE_DEF)
fi
dnl ----------------------------------------------------------------------------
dnl sys_siglist array (list of signals)
AC_MSG_CHECKING(for sys_siglist array)
AC_CACHE_VAL(ac_cv_decl_sys_siglist,
[AC_TRY_LINK(,[extern char *sys_siglist[]; printf("%s",sys_siglist[0]);],
ac_cv_decl_sys_siglist=yes, ac_cv_decl_sys_siglist=no)
])
AC_MSG_RESULT($ac_cv_decl_sys_siglist)
if test $ac_cv_decl_sys_siglist = yes; then
AC_DEFINE(HAVE_SYS_SIGLIST)
fi
AC_MSG_CHECKING(for sys_siglist declaration)
AC_CACHE_VAL(ac_cv_decl_sys_siglist_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <stdio.h>
#include <sys/types.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>],[printf("%s",sys_siglist[0]);],
ac_cv_decl_sys_siglist_def=yes, ac_cv_decl_sys_siglist_def=no)
])
AC_MSG_RESULT($ac_cv_decl_sys_siglist_def)
if test $ac_cv_decl_sys_siglist_def = yes; then
AC_DEFINE(HAVE_SYS_SIGLIST_DEF)
fi
dnl ----------------------------------------------------------------------------
dnl check to see if you have getpgrp(0) or getpgrp()
dnl
dnl POSIX `getpgrp(void)' define HAVE_GETPGRP_0
dnl BSD `getpgrp(int)' - takes 0 as argument
dnl define HAVE_GETPGRP_0 0
dnl check to see if you have getpgrp(0) or getpgrp()
AC_MSG_CHECKING(for getprgp() or getpgrp(0) form)
AC_CACHE_VAL(ac_cv_func_getpgrp_0,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif],[getpgrp(0);],
ac_cv_func_getpgrp_0=getpgrp_0, ac_cv_func_getpgrp_0=getpgrp)
])
AC_MSG_RESULT($ac_cv_func_getpgrp_0)
if test "$ac_cv_func_getpgrp_0" = getpgrp_0; then
AC_DEFINE(HAVE_GETPGRP_0,0)
else
AC_DEFINE(HAVE_GETPGRP_0,)
fi
dnl ----------------------------------------------------------------------------
dnl check to see if you have setpgrp(n,m) or setpgrp()
AC_MSG_CHECKING(for setprgp form)
AC_CACHE_VAL(ac_cv_func_setpgrp_0,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
],[setpgrp(0,0);],
ac_cv_func_setpgrp_0=setpgrp_0, ac_cv_func_setpgrp_0=setpgrp)
])
AC_MSG_RESULT($ac_cv_func_setpgrp_0)
if test $ac_cv_func_setpgrp_0 = setpgrp_0; then
AC_DEFINE(HAVE_SETPGRP_0)
fi
dnl ----------------------------------------------------------------------------
dnl just for (really) backwards compatibility
dnl we really try not to use union wait -- it's heinously unportable.
dnl nicked this check from Tcl as well. ;)
dnl
dnl The check below checks whether <sys/wait.h> defines the type
dnl "union wait" correctly. It's needed because of weirdness in
dnl HP-UX where "union wait" is defined in both the BSD and SYS-V
dnl environments. Checking the usability of WIFEXITED seems to do
dnl the trick.
AC_MSG_CHECKING(for obsolete union wait compatibility)
AC_CACHE_VAL(ac_cv_unionwait,
[
AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <sys/types.h>
#include <sys/wait.h>], [union wait x;WIFEXITED(x);],
ac_cv_unionwait=yes, ac_cv_unionwait=no)
])
AC_MSG_RESULT($ac_cv_unionwait)
if test $ac_cv_unionwait = yes; then
AC_DEFINE(HAVE_UNION_WAIT)
fi
dnl ----------------------------------------------------------------------------
dnl Would you believe the gethostname declarations are broken on some machines
dnl ----------------------------------------------------------------------------
AC_MSG_CHECKING(for gethostname declaration)
AC_CACHE_VAL(ac_cv_decl_gethostname_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif],[printf("%d",gethostname);],
ac_cv_decl_gethostname_def=yes, ac_cv_decl_gethostname_def=no)
])
AC_MSG_RESULT($ac_cv_decl_gethostname_def)
if test $ac_cv_decl_gethostname_def = yes; then
AC_DEFINE(HAVE_GETHOSTNAME_DEF)
fi
dnl ----------------------------------------------------------------------------
dnl ----------------------------------------------------------------------------
dnl tgetent definitions are missing
dnl ----------------------------------------------------------------------------
AC_MSG_CHECKING(for tgetent declaration)
AC_CACHE_VAL(ac_cv_decl_tgetent_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#if defined(SOLARIS)
#include <curses.h>
#endif
#ifdef HAVE_TERM_H
#include <term.h>
#endif
#ifdef HAVE_TERMIO_H
#include <termio.h>
#endif
#ifdef HAVE_TERMCAP_H
#include <termcap.h>
#endif
],[printf("%d",tgetent);],
ac_cv_decl_tgetent_def=yes, ac_cv_decl_tgetent_def=no)
if test $ac_cv_decl_tgetent_def != yes; then
AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_CURSES_H
#include <curses.h>
#endif],[printf("%d",tgetent);],
ac_cv_decl_tgetent_def=yes, ac_cv_decl_tgetent_def=no)
fi
])
AC_MSG_RESULT($ac_cv_decl_tgetent_def)
if test $ac_cv_decl_tgetent_def = yes; then
AC_DEFINE(HAVE_TGETENT_DEF)
fi
dnl tgetstr definitions are missing
dnl ----------------------------------------------------------------------------
AC_MSG_CHECKING(for tgetstr declaration)
AC_CACHE_VAL(ac_cv_decl_tgetstr_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#if defined(SOLARIS)
#include <curses.h>
#endif
#ifdef HAVE_TERM_H
#include <term.h>
#endif
#ifdef HAVE_TERMIO_H
#include <termio.h>
#endif
#ifdef HAVE_TERMCAP_H
#include <termcap.h>
#endif
],[printf("%d",tgetstr);],
ac_cv_decl_tgetstr_def=yes, ac_cv_decl_tgetstr_def=no)
if test $ac_cv_decl_tgetstr_def != yes; then
AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_CURSES_H
#include <curses.h>
#endif],[printf("%d",tgetstr);],
ac_cv_decl_tgetstr_def=yes, ac_cv_decl_tgetstr_def=no)
fi
])
AC_MSG_RESULT($ac_cv_decl_tgetstr_def)
if test $ac_cv_decl_tgetstr_def = yes; then
AC_DEFINE(HAVE_TGETSTR_DEF)
fi
dnl ----------------------------------------------------------------------------
dnl innetgr() declarations missing
dnl ----------------------------------------------------------------------------
AC_MSG_CHECKING(for innetgr declaration)
AC_CACHE_VAL(ac_cv_decl_innetgr_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif],[printf("%d",innetgr);],
ac_cv_decl_innetgr_def=yes, ac_cv_decl_innetgr_def=no)
])
AC_MSG_RESULT($ac_cv_decl_innetgr_def)
if test $ac_cv_decl_innetgr_def = yes; then
AC_DEFINE(HAVE_INNETGR_DEF)
fi
dnl ----------------------------------------------------------------------------
dnl openlog() declarations missing
dnl ----------------------------------------------------------------------------
AC_MSG_CHECKING(for openlog declaration)
AC_CACHE_VAL(ac_cv_decl_openlog_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif],[printf("%d",openlog);],
ac_cv_decl_openlog_def=yes, ac_cv_decl_openlog_def=no)
])
AC_MSG_RESULT($ac_cv_decl_openlog_def)
if test $ac_cv_decl_openlog_def = yes; then
AC_DEFINE(HAVE_OPENLOG_DEF)
fi
dnl ----------------------------------------------------------------------------
dnl syslog() declarations missing
dnl ----------------------------------------------------------------------------
AC_MSG_CHECKING(for syslog declaration)
AC_CACHE_VAL(ac_cv_decl_syslog_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif],[printf("%d",syslog);],
ac_cv_decl_syslog_def=yes, ac_cv_decl_syslog_def=no)
])
AC_MSG_RESULT($ac_cv_decl_syslog_def)
if test $ac_cv_decl_syslog_def = yes; then
AC_DEFINE(HAVE_SYSLOG_DEF)
fi
dnl ----------------------------------------------------------------------------
dnl IPV6 - check for structure declarations
dnl ----------------------------------------------------------------------------
AC_MSG_CHECKING(for struct in6_addr declaration)
AC_CACHE_VAL(ac_cv_decl_in6_addr_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],[struct in6_addr v;],
ac_cv_decl_in6_addr_def=yes, ac_cv_decl_in6_addr_def=no)
])
AC_MSG_RESULT($ac_cv_decl_in6_addr_def)
if test $ac_cv_decl_in6_addr_def = yes; then
AC_DEFINE(IN6_ADDR)
fi
AC_MSG_CHECKING(for struct in_addr6 declaration (LINUX))
AC_CACHE_VAL(ac_cv_decl_in_addr6_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],[struct in_addr6 v;],
ac_cv_decl_in_addr6_def=yes, ac_cv_decl_in_addr6_def=no)
])
AC_MSG_RESULT($ac_cv_decl_in_addr6_def)
if test "$ac_cv_decl_in_addr6_def" = yes; then
AC_DEFINE(IN_ADDR6)
fi
dnl ----------------------------------------------------------------------------
dnl struct stat can have a st_mtime_nsec field
dnl ----------------------------------------------------------------------------
AC_MSG_CHECKING(for struct stat has mtimespec.ts_nsec or mtimespec.ts_nsec)
AC_CACHE_VAL(ac_cv_decl_st_mtime_nsec_def,
[AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <sys/types.h>
#if defined(HAVE_SYS_TIME_H)
#include <sys/time.h>
#endif
#include <sys/stat.h>],[struct stat statb; statb.st_mtimespec.ts_nsec;],
ac_cv_decl_st_mtime_nsec_def=st_mtimespec.ts_nsec)
])
if test -z "$ac_cv_decl_st_mtime_nsec_def" ; then #{
AC_TRY_COMPILE([
#include <sys/types.h>
#if defined(HAVE_SYS_TIME_H)
#include <sys/time.h>
#endif
#include <sys/stat.h>],[struct stat statb; statb.st_mtime_nsec;],
ac_cv_decl_st_mtime_nsec_def=st_mtime_nsec )
fi #}
if test -z "$ac_cv_decl_st_mtime_nsec_def" ; then #{
AC_TRY_COMPILE([
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <sys/types.h>
#if defined(HAVE_SYS_TIME_H)
#include <sys/time.h>
#endif
#include <sys/stat.h>],[struct stat statb; statb.st_mtim.tv_nsec;],
ac_cv_decl_st_mtime_nsec_def=st_mtim.tv_nsec )
fi #}
if test -z "$ac_cv_decl_st_mtime_nsec_def"; then
ac_cv_decl_st_mtime_nsec_def=no
fi
AC_MSG_RESULT($ac_cv_decl_st_mtime_nsec_def)
if test ! "$ac_cv_decl_st_mtime_nsec_def" = no; then
AC_DEFINE_UNQUOTED(ST_MTIME_NSEC,$ac_cv_decl_st_mtime_nsec_def)
fi
dnl ----------------------------------------------------------------------------
dnl make stuff:
AC_DEFINE_UNQUOTED(OSNAME,$osword)
AC_DEFINE_UNQUOTED(OSVERSION,$version)
AC_PROG_INSTALL
AC_CHECK_PROG(INSTALL_MAN,auxman,auxman,[$INSTALL -m 644])
AC_PROG_RANLIB
AC_PROG_MAKE_SET
dnl ----------------- force this to be Bourne Shell for now ---------------
AC_MSG_CHECKING(for shell)
SHELL=/bin/sh
AC_MSG_RESULT(using $SHELL (FORCED))
dnl ----------------- Option for enabling GNU gettext --------------------
AM_GNU_GETTEXT
test "$USE_NLS" = yes && LIBS="$LIBS $INTLLIBS"
dnl ----------------- GCC Compilation ----------------------------------
AC_OUTPUT(
Makefile src/Makefile man/Makefile fonts/Makefile
Makefile.bsd src/Makefile.bsd man/Makefile.bsd fonts/Makefile.bsd
HOWTO/Makefile HOWTO/Makefile.bsd
)
|