"Fossies" - the Fresh Open Source Software Archive

Member "schily-2021-09-18/autoconf/configure.in" (16 Aug 2021, 33409 Bytes) of package /linux/privat/schily-2021-09-18.tar.bz2:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes reports for "configure.in": 2021-08-14_vs_2021-09-18 or 2021-07-29_vs_2021-09-18.

    1 dnl @(#)configure.in	1.309 21/08/16 Copyright 1998-2021 J. Schilling
    2 dnl Process this file with autoconf to produce a configure script.
    3 AC_REVISION(1.309)dnl
    4 
    5 dnl AC_INIT(xconfig.h.in)
    6 AC_INIT(config.guess)
    7 AC_CONFIG_HEADER(xconfig.h)
    8 AC_CANONICAL_HOST
    9 
   10 dnl Checks for programs.
   11 AC_SHELL_BASH
   12 AC_BIN_SHELL_BASH
   13 AC_SHELL_CE_BROKEN
   14 AC_BIN_SHELL_CE_BROKEN
   15 AC_BIN_SHELL_BOSH
   16 AC_OPT_SCHILY_BIN_SHELL_BOSH
   17 dnl CC=${CC-cc}
   18 dnl AC_PROG_CC
   19 AC_CHECK_PROG(CC, cc, cc, gcc)	dnl we default to cc not gcc
   20 dnl The cross compile concepts from GNU autoconf are not usable.
   21 dnl We permit to execute test programs on a remote machine while
   22 dnl running "configure" in a cross compile environment.
   23 AC_PROG_CC			dnl now check for cross compiling
   24 dnl cross_compiling=remote	dnl disable GNU cross compile "defaults"
   25 dnl rmtcall="$CONFIG_RMTCALL"	dnl enable script for remote execution
   26 dnl remote execution of test programs may be set up with:
   27 dnl CONFIG_RMTCALL=script-path
   28 dnl and
   29 dnl CONFIG_RMTHOST=host or CONFIG_RMTHOST=user@host
   30 dnl If AC_PROG_CC detects a cross compiler and CONFIG_RMTCALL is set, then
   31 dnl all test programs are automatically transferred to the test machine
   32 dnl and run on that machine.
   33 AC_REMOTE_PARMS			dnl check for correct remote parameters
   34 AC_OBJEXT
   35 AC_EXEEXT
   36 AC_PROG_CPP
   37 AC_PROG_CPPX
   38 AC_SUN_CC64_OPT
   39 AC_HP_CC_ANSI_OPT
   40 AC_HP_CC_OPT_OPT
   41 AC_HP_CC_GPROF_OPT
   42 dnl AC_PROG_INSTALL
   43 AC_PROG_RANLIB
   44 AC_PROG_MAKE_SET
   45 AC_CHECK_PROGS(YACC, yacc 'bison -y' byacc, noyacc)
   46 AC_CHECK_PROGS(BISON, bison, nobison)
   47 #
   48 # We need both tsort/lorder or none of them
   49 #
   50 AC_PATH_PROG(LORDER, lorder, echo, $PATH:/usr/ccs/bin)
   51 if test "$LORDER" = echo; then
   52 	TSORT=cat
   53 else
   54 	AC_PATH_PROG(TSORT, tsort, cat, $PATH:/usr/ccs/bin)
   55 	if test "$TSORT" = cat; then
   56 		LORDER=echo
   57 	fi
   58 fi
   59 
   60 #
   61 # patch(1) needs the PATH to ed(1) and red(1)
   62 #
   63 AC_PATH_PROG(path_ed, ed, false, $PATH)
   64 AC_PATH_PROG(path_red, red, $path_ed, $PATH)
   65 if test "$cross_compiling" = remote ; then
   66 path_ed=/bin/ed
   67 path_red=/bin/red
   68 AC_MSG_RESULT(cross compiling is not yet supported using /bin/ed and /bin/red)
   69 fi
   70 AC_DEFINE_UNQUOTED_STRING(CNF_PATH_ED,$path_ed)
   71 AC_DEFINE_UNQUOTED_STRING(CNF_PATH_RED,$path_red)
   72 
   73 dnl Checks for header files.
   74 AC_HEADER_STDC
   75 AC_CHECK_HEADERS(stdarg.h stdlib.h string.h float.h)	dnl AC_HEADER_STDC in particular
   76 AC_HEADER_INTTYPES
   77 AC_HEADER_STDINT
   78 ac_xsave_LIBS="$LIBS"
   79 LIBS=""
   80 AC_HEADER_DIRENT
   81 lib_dir="$LIBS"
   82 LIBS="$ac_xsave_LIBS"
   83 AC_HEADER_STAT
   84 AC_HEADER_TIME
   85 AC_HEADER_SYS_WAIT
   86 dnl check whether select() needs sys/select.h
   87 AC_HEADER_SYS_SELECT
   88 dnl check whether select() needs sys/socket.h (BeOS)
   89 AC_HEADER_SELECT2
   90 AC_CHECK_HEADERS(ar.h)
   91 AC_CHECK_HEADERS(assert.h)
   92 AC_CHECK_HEADERS(stdio.h varargs.h stdarg.h stdlib.h stddef.h string.h strings.h unistd.h fcntl.h io.h sys/file.h)
   93 AC_CHECK_HEADERS(conio.h)
   94 AC_CHECK_HEADERS(getopt.h)
   95 AC_CHECK_HEADERS(limits.h)
   96 AC_CHECK_HEADERS(a.out.h aouthdr.h elf.h)
   97 AC_CHECK_HEADERS(sysexits.h)
   98 AC_CHECK_HEADERS(malloc.h posix/malloc.h sgtty.h termios.h termio.h)
   99 AC_CHECK_HEADERS(pwd.h grp.h sys/acl.h aclutils.h acllib.h acl/libacl.h)
  100 AC_CHECK_HEADERS(signal.h siginfo.h sys/siginfo.h ucontext.h)
  101 AC_CHECK_HEADERS(shadow.h syslog.h)
  102 AC_CHECK_HEADERS(sys/time.h sys/times.h utime.h sys/utime.h sys/ioctl.h sys/filio.h sys/param.h sys/systeminfo.h sys/sysctl.h)
  103 AC_CHECK_HEADERS(sys/loadavg.h)
  104 AC_CHECK_HEADERS(sys/syscall.h)
  105 AC_CHECK_HEADERS(mach/machine.h)
  106 AC_CHECK_HEADERS(mntent.h sys/mntent.h sys/mnttab.h sys/mount.h)
  107 AC_CHECK_HEADERS(sys/fork.h vfork.h wait.h sys/wait.h sys/resource.h sys/dbx_plugin.h procfs.h sys/procfs.h libproc.h)
  108 AC_CHECK_HEADERS(ulimit.h)
  109 AC_CHECK_HEADERS(process.h)
  110 AC_CHECK_HEADERS(sys/utsname.h sys/priocntl.h sys/rtpriocntl.h sys/procset.h sys/auxv.h)
  111 AC_CHECK_HEADERS(sys/mtio.h sys/tape.h sys/mman.h linux/pg.h camlib.h)
  112 AC_CHECK_HEADERS(sys/shm.h sys/sem.h sys/ipc.h semaphore.h)
  113 AC_CHECK_HEADERS(sys/dkio.h sys/dklabel.h sun/dkio.h sun/dklabel.h)
  114 AC_CHECK_HEADERS(sys/types.h sys/stat.h types.h stat.h)
  115 AC_CHECK_HEADERS(sys/stypes.h sys/filedesc.h)
  116 AC_CHECK_HEADERS(sys/acct.h)
  117 AC_CHECK_HEADERS(sys/mkdev.h sys/sysmacros.h)
  118 AC_CHECK_HEADERS(poll.h sys/poll.h sys/select.h)
  119 AC_CHECK_HEADERS(netdb.h arpa/aixrcmds.h sys/socket.h netinet/in.h stropts.h)
  120 AC_CHECK_HEADERS(ieeefp.h fp.h)
  121 AC_CHECK_HEADERS(values.h float.h math.h)
  122 AC_CHECK_HEADERS(arpa/inet.h)
  123 AC_CHECK_HEADERS(rpc/rpc.h)
  124 AC_CHECK_HEADERS(bsd/dev/scsireg.h)
  125 dnl Check for HP-UX sys/bsdtty.h (needed for TIOCGPGRP)
  126 AC_CHECK_HEADERS(sys/bsdtty.h)
  127 dnl Check for Linux kernel definitions
  128 AC_CHECK_HEADERS(scsi/scsi.h scsi/sg.h linux/scsi.h linux.sg.h)
  129 AC_CHECK_HEADERS(linux/types.h linux/gfp.h asm/types.h)
  130 AC_CHECK_HEADERS(sys/capability.h)
  131 AC_CHECK_HEADERS(selinux/selinux.h)
  132 dnl Check for BeOS kernel definitions (e.g. B_PAGE_SIZE)
  133 AC_CHECK_HEADERS(OS.h)
  134 dnl needed for newer OS/2 versions of EMX
  135 AC_CHECK_HEADERS(os2.h)
  136 AC_CHECK_HEADERS(os2me.h)
  137 dnl Check for MS-Win's junkyard
  138 AC_CHECK_HEADERS(windows.h)
  139 dnl Check for moving Linux targets caused by missing concepts
  140 AC_CHECK_HEADERS(linux/fs.h ext2fs/ext2_fs.h)
  141 dnl Check for Linux Extended File Attributes definitions
  142 AC_CHECK_HEADERS(sys/xattr.h)
  143 AC_CHECK_HEADERS(attr/xattr.h)
  144 dnl Check for Mas OS X ac, av, env delarations
  145 AC_CHECK_HEADERS(crt_externs.h)
  146 AC_CHECK_HEADERS(fnmatch.h)
  147 AC_CHECK_HEADERS(libintl.h locale.h langinfo.h nl_types.h)
  148 AC_CHECK_HEADERS(ctype.h wctype.h wchar.h iconv.h)
  149 AC_CHECK_HEADERS(priv.h sys/priv.h)
  150 AC_CHECK_HEADERS(exec_attr.h secdb.h)
  151 AC_CHECK_HEADERS(direct.h)
  152 AC_CHECK_HEADERS(pthread.h thread.h)
  153 AC_CHECK_HEADERS(libgen.h)
  154 AC_CHECK_HEADERS(regex.h regexp.h regexpr.h)
  155 AC_CHECK_HEADERS(dlfcn.h link.h dl.h libelf.h)
  156 AC_CHECK_HEADERS(ranlib.h)
  157 AC_CHECK_HEADERS(expat.h)
  158 
  159 dnl from aclocal.m4 (uses AC_TRY_COMPILE)
  160 AC_HEADER_MAKEDEV
  161 
  162 dnl don't use GNU original
  163 dnl from GNU acspecific.m4 (uses AC_CHECK_HEADER)
  164 dnl AC_HEADER_MAJOR
  165 
  166 AC_CHECK_MINOR_BITS
  167 AC_CHECK_MINOR_NONCONTIG
  168 
  169 AC_HEADER_USG_STDIO
  170 AC_HEADER_ERRNO_DEF
  171 AC_HEADER_ENVIRON_DEF
  172 AC_HEADER_SYS_SIGLIST_DEF
  173 AC_WNOWAIT_WAITPID
  174 
  175 dnl Checks for typedefs, structures, and compiler characteristics.
  176 AC_C_CONST
  177 AC_C_BIGENDIAN
  178 AC_C_BITFIELDS
  179 AC_C_STRINGIZE
  180 AC_C_INLINE
  181 AC_C_NOINLINE
  182 AC_TYPE_SIGNAL
  183 AC_TYPE_GETGROUPS
  184 AC_TYPE_LONGLONG
  185 AC_TYPE___INT64
  186 AC_TYPE_LONGDOUBLE
  187 AC_TYPE_PROTOTYPES
  188 dnl AC_USER_MALLOC must be past AC_CHECK_FUNCS(strdup)
  189 AC_DYN_ARRAYS
  190 AC_PRAGMA_WEAK
  191 AC_SIGSTKSZ_CONST
  192 
  193 dnl This is a hack to compile two files and to check whether a weak alias from
  194 dnl one file can be seen in another file. The reason for this test is to detect
  195 dnl a bug on Cygwin that causes waek symbols to become "local" symbols that
  196 dnl are useless because they would be invisible for other parts of the code.
  197 
  198 if test $ac_cv_pragma_weak = yes; then
  199 AC_TRY_COMPILE2([#pragma weak weakname = conffunc],[],[true],[true])
  200 ac_save_LIBS="$LIBS"
  201 LIBS="conftest2.$ac_cv_objext"
  202 AC_CACHE_CHECK([if linker allows pragma weak], ac_cv_link_weak,
  203                 [AC_TRY_LINK([extern int weakname();],
  204 [return weakname();],
  205                 [ac_cv_link_weak=yes],
  206                 [ac_cv_link_weak=no])])
  207 LIBS="$ac_save_LIBS"
  208 if test $ac_cv_link_weak = yes; then
  209   AC_DEFINE(HAVE_LINK_WEAK)
  210 fi
  211 rm -f conftest2.*
  212 fi
  213 
  214 AC_TYPE_UID_T
  215 AC_TYPE_SIZE_T
  216 AC_CHECK_TYPE(ssize_t, int)
  217 AC_CHECK_TYPE(ptrdiff_t, int)
  218 AC_TYPE_PID_T
  219 AC_TYPE_OFF_T
  220 AC_TYPE_MODE_T
  221 AC_TYPE_TIME_T
  222 AC_CHECK_TYPE(caddr_t, char *)
  223 AC_CHECK_TYPE(daddr_t, long)
  224 AC_CHECK_TYPE(dev_t, unsigned short)
  225 AC_CHECK_TYPE(major_t, dev_t)
  226 AC_CHECK_TYPE(minor_t, dev_t)
  227 AC_CHECK_TYPE(ino_t, unsigned long)
  228 AC_CHECK_TYPE(nlink_t, unsigned long)
  229 AC_CHECK_TYPE(blksize_t, long)
  230 AC_CHECK_TYPE(blkcnt_t, Intmax_t)
  231 AC_TYPE_CLOCK_T
  232 AC_TYPE_SOCKLEN_T
  233 AC_HAVE_TYPE([#include <sys/frame.h>], greg_t)
  234 AC_HAVE_TYPE([#include <sys/resource.h>], rlim_t)
  235 dnl NetBSD-5 has an idtype_t that is in conflict with POSIX
  236 dnl AC_HAVE_TYPE([#include <sys/wait.h>], idtype_t)
  237 AC_TYPE_IDTYPE_T
  238 AC_HAVE_TYPE([#include <sys/wait.h>], siginfo_t)
  239 AC_TYPE_STACK_T
  240 AC_TYPE_SIGINFO_T
  241 
  242 dnl These types are present on all UNIX systems but should be avoided
  243 dnl for portability.
  244 dnl On Apollo/Domain OS we don't have them....
  245 dnl Better include <utypes.h> and use Uchar, Uint & Ulong
  246 AC_CHECK_TYPE(u_char, unsigned char)
  247 AC_CHECK_TYPE(u_short, unsigned short)
  248 AC_CHECK_TYPE(u_int, unsigned int)
  249 AC_CHECK_TYPE(u_long, unsigned long)
  250 
  251 AC_INCL_CHECK_TYPE(
  252 [#ifdef	HAVE_INTTYPES_H
  253 #include <inttypes.h>
  254 #endif
  255 #ifdef	HAVE_STDINT_H
  256 #include <stdint.h>
  257 #endif
  258 ], int8_t, Int8_t)
  259 
  260 AC_INCL_CHECK_TYPE(
  261 [#ifdef	HAVE_INTTYPES_H
  262 #include <inttypes.h>
  263 #endif
  264 #ifdef	HAVE_STDINT_H
  265 #include <stdint.h>
  266 #endif
  267 ], int16_t, Int16_t)
  268 
  269 AC_INCL_CHECK_TYPE(
  270 [#ifdef	HAVE_INTTYPES_H
  271 #include <inttypes.h>
  272 #endif
  273 #ifdef	HAVE_STDINT_H
  274 #include <stdint.h>
  275 #endif
  276 ], int32_t, Int32_t)
  277 
  278 AC_INCL_CHECK_TYPE(
  279 [#ifdef	HAVE_INTTYPES_H
  280 #include <inttypes.h>
  281 #endif
  282 #ifdef	HAVE_STDINT_H
  283 #include <stdint.h>
  284 #endif
  285 ], int64_t, Int64_t)
  286 
  287 AC_INCL_CHECK_TYPE(
  288 [#ifdef	HAVE_INTTYPES_H
  289 #include <inttypes.h>
  290 #endif
  291 #ifdef	HAVE_STDINT_H
  292 #include <stdint.h>
  293 #endif
  294 ], intmax_t, Intmax_t)
  295 
  296 AC_INCL_CHECK_TYPE(
  297 [#ifdef	HAVE_INTTYPES_H
  298 #include <inttypes.h>
  299 #endif
  300 #ifdef	HAVE_STDINT_H
  301 #include <stdint.h>
  302 #endif
  303 ], intptr_t, Intptr_t)
  304 
  305 AC_INCL_CHECK_TYPE(
  306 [#ifdef	HAVE_INTTYPES_H
  307 #include <inttypes.h>
  308 #endif
  309 #ifdef	HAVE_STDINT_H
  310 #include <stdint.h>
  311 #endif
  312 ], uint8_t, UInt8_t)
  313 
  314 AC_INCL_CHECK_TYPE(
  315 [#ifdef	HAVE_INTTYPES_H
  316 #include <inttypes.h>
  317 #endif
  318 #ifdef	HAVE_STDINT_H
  319 #include <stdint.h>
  320 #endif
  321 ], uint16_t, UInt16_t)
  322 
  323 AC_INCL_CHECK_TYPE(
  324 [#ifdef	HAVE_INTTYPES_H
  325 #include <inttypes.h>
  326 #endif
  327 #ifdef	HAVE_STDINT_H
  328 #include <stdint.h>
  329 #endif
  330 ], uint32_t, UInt32_t)
  331 
  332 AC_INCL_CHECK_TYPE(
  333 [#ifdef	HAVE_INTTYPES_H
  334 #include <inttypes.h>
  335 #endif
  336 #ifdef	HAVE_STDINT_H
  337 #include <stdint.h>
  338 #endif
  339 ], uint64_t, UInt64_t)
  340 
  341 AC_INCL_CHECK_TYPE(
  342 [#ifdef	HAVE_INTTYPES_H
  343 #include <inttypes.h>
  344 #endif
  345 #ifdef	HAVE_STDINT_H
  346 #include <stdint.h>
  347 #endif
  348 ], uintmax_t, UIntmax_t)
  349 
  350 AC_INCL_CHECK_TYPE(
  351 [#ifdef	HAVE_INTTYPES_H
  352 #include <inttypes.h>
  353 #endif
  354 #ifdef	HAVE_STDINT_H
  355 #include <stdint.h>
  356 #endif
  357 ], uintptr_t, UIntptr_t)
  358 
  359 AC_INCL_CHECK_TYPE(
  360 [#ifdef	HAVE_WCHAR_H
  361 #include <wchar.h>
  362 #endif
  363 #ifdef	HAVE_WCTYPE_H
  364 #include <wctype.h>
  365 #endif
  366 ], wctype_t, int)
  367 
  368 AC_INCL_CHECK_TYPE(
  369 [#ifdef	HAVE_WCHAR_H
  370 #include <wchar.h>
  371 #endif
  372 #ifdef	HAVE_WCTYPE_H
  373 #include <wctype.h>
  374 #endif
  375 #include <sys/types.h>
  376 ], wint_t, int)
  377 
  378 AC_INCL_CHECK_TYPE(
  379 [#ifdef	HAVE_WCHAR_H
  380 #include <wchar.h>
  381 #endif
  382 #ifdef	HAVE_WCTYPE_H
  383 #include <wctype.h>
  384 #endif
  385 ], mbstate_t, int)
  386 
  387 AC_INCL_CHECK_TYPE(
  388 #ifdef	HAVE_SYS_STAT_H
  389 [#include <sys/stat.h>
  390 #endif
  391 #ifdef	HAVE_STAT_H
  392 #include <stat.h>
  393 #endif
  394 ], timestruc_t, struct timespec)
  395 
  396 AC_CHECK_SIZEOF(char)
  397 AC_CHECK_SIZEOF(short int)
  398 AC_CHECK_SIZEOF(int)
  399 AC_CHECK_SIZEOF(long int)
  400 AC_CHECK_SIZEOF(long long)
  401 AC_CHECK_SIZEOF(__int64)
  402 AC_CHECK_SIZEOF(char *)
  403 
  404 AC_CHECK_SIZEOF(unsigned char)
  405 AC_CHECK_SIZEOF(unsigned short int)
  406 AC_CHECK_SIZEOF(unsigned int)
  407 AC_CHECK_SIZEOF(unsigned long int)
  408 AC_CHECK_SIZEOF(unsigned long long)
  409 AC_CHECK_SIZEOF(unsigned __int64)
  410 AC_CHECK_SIZEOF(unsigned char *)
  411 AC_CHECK_SIZEOF(float)
  412 AC_CHECK_SIZEOF(double)
  413 AC_CHECK_SIZEOF(long double)
  414 
  415 AC_CHECK_SIZEOF(size_t)
  416 AC_CHECK_SIZEOF(ssize_t)
  417 AC_CHECK_SIZEOF(ptrdiff_t)
  418 
  419 AC_CHECK_SIZEOF(mode_t)
  420 AC_CHECK_SIZEOF(uid_t)
  421 AC_CHECK_SIZEOF(gid_t)
  422 AC_CHECK_SIZEOF(pid_t)
  423 
  424 AC_CHECK_SIZEOF(dev_t)
  425 AC_CHECK_SIZEOF(major_t)
  426 AC_CHECK_SIZEOF(minor_t)
  427 
  428 dnl This call must be past AC_CHECK_SIZEOF(long int)
  429 AC_CHECK_SIZE_TIME_T
  430 AC_CHECK_SIZE_WCHAR
  431 AC_CHECK_SIZE_WCHAR_T
  432 
  433 dnl # AC_TYPE_SIZE_T_		# Defines HAVE_SIZE_T / NO_SIZE_T
  434 AC_TYPE_CHAR
  435 AC_TYPE_VA_LIST
  436 AC_HEADER_FILE__FLAGS
  437 AC_HEADER_FILE__IO_BUF_BASE
  438 AC_STRUCT_TIMEVAL
  439 AC_STRUCT_TIMEZONE
  440 AC_STRUCT_TIMESPEC
  441 AC_STRUCT_MTGET_TYPE
  442 AC_STRUCT_MTGET_MODEL
  443 AC_STRUCT_MTGET_DSREG
  444 AC_STRUCT_MTGET_DSREG1
  445 AC_STRUCT_MTGET_DSREG2
  446 AC_STRUCT_MTGET_GSTAT
  447 AC_STRUCT_MTGET_ERREG
  448 AC_STRUCT_MTGET_RESID
  449 AC_STRUCT_MTGET_FILENO
  450 AC_STRUCT_MTGET_BLKNO
  451 AC_STRUCT_MTGET_FLAGS
  452 AC_STRUCT_MTGET_BF
  453 AC_STRUCT_RUSAGE
  454 AC_STRUCT_SI_UTIME
  455 AC_STRUCT_SOCKADDR_STORAGE
  456 AC_STRUCT_UNION_SEMUN
  457 AC_STRUCT_UNION_WAIT
  458 AC_USE_STRUCT_UNION_WAIT
  459 AC_STRUCT_ST_SPARE1
  460 AC_STRUCT_ST_ATIMENSEC
  461 AC_STRUCT_ST_ATIME_N
  462 AC_STRUCT_ST_NSEC
  463 AC_STRUCT_ST__TIM
  464 AC_STRUCT_ST_ATIMESPEC
  465 AC_STRUCT_ST_BLKSIZE
  466 AC_STRUCT_ST_BLOCKS
  467 AC_STRUCT_ST_FSTYPE
  468 AC_STRUCT_ST_ACLCNT
  469 AC_STRUCT_ST_RDEV
  470 AC_STRUCT_ST_FLAG
  471 AC_STRUCT_ST_FLAGS
  472 AC_STRUCT_DIRENT_D_INO
  473 AC_STRUCT_DIRENT_D_TYPE
  474 AC_STRUCT_DIR_DD_FD
  475 AC_STRUCT_UTSNAME_ARCH
  476 AC_STRUCT_UTSNAME_PROCESSOR
  477 AC_STRUCT_UTSNAME_SYSNAME_HOST
  478 AC_STRUCT_UTSNAME_RELEASE_HOST
  479 AC_STRUCT_UTSNAME_VERSION_HOST
  480 AC_STRUCT_PW_PASSWD
  481 
  482 dnl Check whether iconv() uses const char ** arguments
  483 AC_ICONV_CONST
  484 
  485 dnl Check whether we are able to get the address of a function
  486 dnl or whether the symbol is declared and usable as rhs
  487 AC_CHECK_DECLARE([
  488 #include <sys/types.h>
  489 #include <sys/stat.h>], stat)
  490 AC_CHECK_DECLARE([
  491 #include <sys/types.h>
  492 #include <sys/stat.h>], lstat)
  493 
  494 dnl Checks for library functions.
  495 AC_FUNC_WAIT3
  496 AC_FUNC_MLOCK
  497 AC_FUNC_MLOCKALL
  498 AC_FUNC_VA_COPY
  499 AC_FUNC__VA_COPY
  500 AC_FUNC_ECVT
  501 AC_FUNC_FCVT
  502 AC_FUNC_GCVT
  503 AC_FUNC_DTOA
  504 AC_FUNC_DTOA_R
  505 AC_FUNC_GETPAGESIZE
  506 jsAC_FUNC_MMAP
  507 AC_MMAP_SIZEP
  508 AC_FUNC_SMMAP
  509 AC_FUNC_SHMGET
  510 AC_FUNC_ALLOCA
  511 AC_FUNC_QUOTAIOCTL
  512 AC_FUNC_FCNTL_LOCKF
  513 AC_FUNC_UNAME
  514 AC_CHECK_FUNCS(execl)
  515 AC_FUNC_VFORK
  516 AC_FUNC_SYS_SIGLIST
  517 AC_FUNC_BSD_GETPGRP
  518 AC_FUNC_BSD_SETPGRP
  519 AC_FUNC_C99_ISINF
  520 AC_FUNC_C99_ISNAN
  521 AC_FUNC_SIGSETJMP
  522 AC_FUNC_SIGLONGJMP
  523 AC_FUNC_PRINTF_J
  524 AC_FUNC_PRINTF_Z
  525 AC_FUNC_PRINTF_LL
  526 AC_FUNC_REALLOC_NULL
  527 AC_FUNC_WAITID
  528 AC_CHECK_FUNCS(access eaccess euidaccess)
  529 AC_CHECK_FUNCS(memchr memcmp memcpy memccpy memmove memset)
  530 AC_CHECK_FUNCS(brk sbrk strerror nice flock lockf fchdir statvfs quotactl)
  531 AC_CHECK_FUNCS(realpath resolvepath)
  532 AC_CHECK_FUNCS(dup dup2)
  533 AC_CHECK_FUNCS(getcwd shmat semget)
  534 AC_CHECK_FUNCS(lstat readlink symlink link rename mkfifo mknod)
  535 AC_CHECK_FUNCS(setreuid setresuid seteuid setuid)
  536 AC_CHECK_FUNCS(setregid setresgid setegid setgid)
  537 AC_CHECK_FUNCS(getuid geteuid getgid getegid)
  538 AC_CHECK_FUNCS(getpid getppid)
  539 AC_CHECK_FUNCS(getpgid setpgid getsid setsid)
  540 AC_CHECK_FUNCS(getpgrp setpgrp)
  541 AC_CHECK_FUNCS(getpwnam getpwent getpwuid setpwent endpwent)
  542 AC_CHECK_FUNCS(getgrnam getgrent getgrgid setgrent endgrent)
  543 dnl			getspwnam() on HP-UX is in libsec.a
  544 AC_CHECK_FUNCS(getspnam getspwnam)
  545 AC_CHECK_FUNCS(getlogin)
  546 dnl Cannot simply include "waitid" here as the so called POSIX compliant
  547 dnl Mac OS X comes with a completely broken waitid() implementation.
  548 AC_CHECK_FUNCS(sync fsync fork forkx vforkx forkall forkallx wait wait4 wait6 waitpid getrusage getrlimit setrlimit ulimit)
  549 AC_CHECK_FUNCS(execl execle execlp execv execve execvp)
  550 AC_CHECK_FUNCS(spawnl spawnle spawnlp spawnlpe)
  551 AC_CHECK_FUNCS(spawnv spawnve spawnvp spawnvpe)
  552 AC_CHECK_FUNCS(cwait)
  553 AC_CHECK_FUNCS(getexecname)
  554 AC_CHECK_FUNCS(getprogname setprogname)
  555 AC_CHECK_FUNCS(proc_pidpath getauxval elf_aux_info)
  556 AC_CHECK_FUNCS(getloadavg)
  557 AC_CHECK_FUNCS(gethostid gethostname getdomainname getdtablesize)
  558 AC_CHECK_FUNCS(gettimeofday settimeofday time stime gethrtime)
  559 AC_CHECK_FUNCS(ftime tzset mktime gmtime localtime timegm timelocal)
  560 AC_CHECK_FUNCS(ctime cftime ascftime strftime)
  561 AC_CHECK_FUNCS(poll select isastream)
  562 AC_CHECK_FUNCS(chown fchown lchown chmod fchmod lchmod times utime utimes futimes lutimes)
  563 AC_CHECK_FUNCS(utimens lutimens)
  564 AC_CHECK_FUNCS(futimens utimensat)
  565 AC_CHECK_FUNCS(ioctl fcntl)
  566 dnl AC_CHECK_FUNCS(ecvt fcvt gcvt)
  567 AC_CHECK_FUNCS(qecvt qfcvt qgcvt)
  568 AC_CHECK_FUNCS(_qecvt _qfcvt _qgcvt)
  569 AC_CHECK_FUNCS(_qecvt_r _qfcvt_r _qgcvt_r)
  570 AC_CHECK_FUNCS(_ldecvt _ldfcvt _ldgcvt)
  571 AC_CHECK_FUNCS(ecvt_r fcvt_r gcvt_r)
  572 AC_CHECK_FUNCS(_ldecvt_r _ldfcvt_r _ldgcvt_r)
  573 AC_CHECK_FUNCS(econvert fconvert gconvert)
  574 AC_CHECK_FUNCS(qeconvert qfconvert qgconvert)
  575 AC_CHECK_FUNCS(isinf isnan)
  576 AC_CHECK_FUNCS(getc_unlocked getchar_unlocked putc_unlocked putchar_unlocked)
  577 AC_CHECK_FUNCS(flockfile funlockfile ftrylockfile)
  578 AC_CHECK_FUNCS(rand drand48)
  579 AC_CHECK_FUNCS(strtol strtoll strtoul strtoull strtod)
  580 AC_CHECK_FUNCS(setpriority DosSetPriority)
  581 AC_CHECK_FUNCS(DosAllocSharedMem)
  582 AC_CHECK_FUNCS(getdelim)
  583 AC_CHECK_FUNCS(seekdir fdopendir)
  584 dnl These are POSIX.1 functions (syscalls on Solaris)
  585 AC_CHECK_FUNCS(openat fstatat fchownat futimesat renameat unlinkat)
  586 dnl This is a library function for the Solaris extended attr interface
  587 AC_CHECK_FUNCS(attropen)
  588 dnl This appeared on Solaris 11 Build 63
  589 AC_CHECK_FUNCS(__accessat)
  590 dnl This appeared not yet in POSIX
  591 AC_CHECK_FUNCS(accessat)
  592 dnl This are POSIX extensions not found on Solaris 10
  593 AC_CHECK_FUNCS(mkdirat faccessat fchmodat linkat mkfifoat mknodat readlinkat symlinkat)
  594 AC_CHECK_FUNCS(pipe _pipe)
  595 AC_CHECK_FUNCS(popen pclose _popen _pclose)
  596 AC_CHECK_FUNCS(closefrom)
  597 AC_CHECK_FUNCS(strsignal str2sig sig2str)
  598 AC_CHECK_FUNCS(kill killpg)
  599 AC_CHECK_FUNCS(signal sighold sigrelse sigignore sigpause sigprocmask sigsetmask sigset sigaltstack sigblock)
  600 AC_CHECK_FUNCS(alarm sleep usleep yield)
  601 AC_CHECK_FUNCS(atexit on_exit)
  602 dnl tcgetattr and tcsetattr are a inline functions in termios.h on Android
  603 AC_CHECK_DFUNC([
  604 #ifdef	HAVE_TERMIOS_H
  605 #include <termios.h>
  606 #endif
  607 ], tcgetattr)
  608 AC_CHECK_DFUNC([
  609 #ifdef	HAVE_TERMIOS_H
  610 #include <termios.h>
  611 #endif
  612 ], tcsetattr)
  613 AC_CHECK_FUNCS(tcgetpgrp tcsetpgrp tcgetsid)
  614 AC_CHECK_FUNCS(getenv putenv setenv unsetenv)
  615 AC_CHECK_FUNCS(snprintf strcasecmp strncasecmp)
  616 AC_CHECK_FUNCS(vprintf vfprintf vsprintf vsnprintf)
  617 
  618 AC_CHECK_DFUNCS([
  619 #ifdef	HAVE_STRING_H
  620 #include <string.h>
  621 #endif
  622 ], strcat strncat strcmp strncmp strcpy strlcat strlcpy strncpy strdup strndup strlen strnlen strchr strrchr strstr strspn strcspn)
  623 AC_CHECK_DFUNCS([
  624 #ifdef	HAVE_WCHAR_H
  625 #include <wchar.h>
  626 #endif
  627 ], wcscat wcsncat wcscmp wcsncmp wcscpy wcslcat wcslcpy wcsncpy wcsdup wcsndup wcslen wcsnlen wcschr wcsrchr wcsstr wcsspn wcscspn)
  628 
  629 AC_CHECK_FUNCS(wcwidth wcswidth wctype iswctype wcstol wcstoll wcstoul wcstoull)
  630 AC_CHECK_FUNCS(fgetws)
  631 AC_CHECK_FUNCS(basename dirname)
  632 AC_CHECK_FUNCS(pathconf fpathconf lpathconf)
  633 AC_CHECK_FUNCS(malloc calloc valloc realloc memalign posix_memalign)
  634 AC_CHECK_FUNCS(madvise)
  635 AC_CHECK_FUNCS(mktemp mkstemp)
  636 AC_CHECK_FUNCS(chflags fchflags fflagstostr strtofflags)
  637 AC_CHECK_FUNCS(fnmatch)
  638 AC_CHECK_FUNCS(truncate ftruncate)
  639 AC_CHECK_FUNCS(getppriv setppriv priv_set)
  640 AC_CHECK_FUNCS(issetugid)
  641 AC_CHECK_FUNCS(getroles privbit_set)
  642 AC_CHECK_FUNCS(setlocale localeconv nl_langinfo)
  643 AC_CHECK_FUNCS(setbuf setvbuf)
  644 AC_CHECK_FUNCS(clone_area create_area delete_area)
  645 
  646 dnl The official POSIX rule is not to define "new" interfaces that
  647 dnl are in conflict with older interfaces of the same name.
  648 dnl Our interfaces fexec*() have been defined and published in 1982.
  649 dnl The new POSIX interfaces define a different interface and the
  650 dnl new POSIX interfaces even use names that are not compatible with
  651 dnl POSIX rules. The new POSIX interfaces in question should be called
  652 dnl fdexec*() to follow the rules of other similar POSIX functions.
  653 dnl
  654 dnl We use AC_RCHECK_FUNCS() because some Linux distros define a
  655 dnl fexecve() that returns ENOSYS an AC_CHECK_FUNCS() would return FALSE
  656 dnl
  657 echo Checking for POSIX violations by the POSIX.1-2008 standard:
  658 AC_RCHECK_FUNCS(fexecl fexecle fexecv fexecve)
  659 AC_RCHECK_FUNCS(fspawnv fspawnl fspawnv_nowait)
  660 
  661 dnl A similar problem exists with the new POSIX.1-2008 interfaces 
  662 dnl getline() and fgetline(). These interfaces are also incompatible
  663 dnl with our interfaces defined in 1982.
  664 AC_RCHECK_FUNCS(getline fgetline)
  665 echo End of tests for POSIX violations by the POSIX.1-2008 standard.
  666 
  667 dnl Check whether a symbol is either defined in an include file or
  668 dnl otherwise usable (e.g. as function)
  669 AC_CHECK_DFUNC([#include <dirent.h>], dirfd)
  670 
  671 AC_CHECK_DFUNC([
  672 #ifdef	HAVE_WCHAR_H
  673 #include <wchar.h>
  674 #endif
  675 #ifdef	HAVE_WCTYPE_H
  676 #include <wctype.h>
  677 #endif
  678 ], iswprint)
  679 
  680 AC_CHECK_DFUNC([
  681 #ifdef	HAVE_WCHAR_H
  682 #include <wchar.h>
  683 #endif
  684 #ifdef	HAVE_WCTYPE_H
  685 #include <wctype.h>
  686 #endif
  687 ], iswblank)
  688 
  689 AC_CHECK_DFUNC([
  690 #ifdef	HAVE_CTYPE_H
  691 #include <ctype.h>
  692 #endif
  693 ], isblank)
  694 
  695 AC_CHECK_DFUNC([
  696 #ifdef	HAVE_WCHAR_H
  697 #include <wchar.h>
  698 #endif
  699 #ifdef	HAVE_WCTYPE_H
  700 #include <wctype.h>
  701 #endif
  702 ], mbsinit)
  703 
  704 AC_CHECK_DFUNC([
  705 #ifdef	HAVE_STDLIB_H
  706 #include <stdlib.h>
  707 #endif
  708 ], mbtowc)
  709 
  710 AC_CHECK_DFUNC([
  711 #ifdef	HAVE_STDLIB_H
  712 #include <stdlib.h>
  713 #endif
  714 ], wctomb)
  715 
  716 AC_CHECK_DFUNC([
  717 #ifdef	HAVE_WCHAR_H
  718 #include <wchar.h>
  719 #endif
  720 #ifdef	HAVE_WCTYPE_H
  721 #include <wctype.h>
  722 #endif
  723 ], mbrtowc)
  724 
  725 AC_CHECK_DFUNC([
  726 #ifdef	HAVE_WCHAR_H
  727 #include <wchar.h>
  728 #endif
  729 #ifdef	HAVE_WCTYPE_H
  730 #include <wctype.h>
  731 #endif
  732 ], wcrtomb)
  733 
  734 AC_CHECK_DFUNC([#include <ieeefp.h>], finite)
  735 AC_CHECK_DFUNC([#include <ieeefp.h>], isnand)
  736 
  737 dnl Checks for typedefs, structures, and compiler characteristics.
  738 dnl that need results from the AC_CHECK_FUNCS() calls.
  739 AC_USER_MALLOC
  740 dnl AC_USER_XCVT test macro does not yet work
  741 AC_VAR_TIMEZONE
  742 AC_VAR_TIMEZONE_DEF
  743 AC_VAR___PROGNAME
  744 AC_VAR___PROGNAME_FULL
  745 
  746 dnl Checks for OS characteristics.
  747 AC_HARD_SYMLINKS
  748 AC_LINK_NOFOLLOW
  749 AC_ACCESS_E_OK
  750 AC_FNMATCH_IGNORECASE
  751 
  752 dnl Need to check this in default compilation mode to find out
  753 dnl whether this platform supports both functions by default too.
  754 dnl We cannot use the standard tests because they would find
  755 dnl that fseeko()/ftello() are present in small file mode on
  756 dnl Limnux while there is no prototype for these functions.
  757 AC_SMALL_FSEEKO
  758 AC_SMALL_FTELLO
  759 
  760 AC_CHECK_LIB(c, dlopen, lib_dl="",
  761   [AC_CHECK_LIB(dl, dlopen, lib_dl="-ldl")])
  762 ac_save_LIBS="$LIBS"
  763 LIBS="$LIBS $lib_dl"
  764 AC_CHECK_FUNCS(dlopen dlclose dlsym dlerror dlinfo)
  765 AC_CHECK_FUNCS(shl_load shl_unload shl_gethandle)
  766 LIBS="$ac_save_LIBS"
  767 if test ."$lib_dl" = .""; then
  768 	AC_DEFINE(HAVE_DLOPEN_IN_LIBC)
  769 fi
  770 
  771 AC_CHECK_DFUNCS([
  772 #ifdef	HAVE_WINDOWS_H
  773 #undef	u_char
  774 #undef	u_short
  775 #undef	u_int
  776 #undef	u_long
  777 #include <windows.h>
  778 #endif
  779 ], LoadLibrary FreeLibrary GetProcAddress)
  780 
  781 dnl ??? AC_CHECK_LIB(socket, socket, lib_socket="-lsocket")
  782 dnl
  783 ac_save_LIBS="$LIBS"
  784 AC_CHECK_LIB(c, socket, lib_socket="",
  785   [AC_CHECK_LIB(socket, socket, lib_socket="-lsocket")])
  786 LIBS="$ac_save_LIBS"
  787 AC_CHECK_LIB(c, gethostbyname, lib_nsl="",
  788   [AC_CHECK_LIB(nsl, gethostbyname, lib_nsl="-lnsl",
  789     [AC_CHECK_LIB(network, gethostbyname, lib_nsl="-lnetwork")])])
  790 LIBS="$ac_save_LIBS"
  791 LIBS="$LIBS $lib_nsl $lib_socket"
  792 AC_CHECK_FUNCS(rcmd socket socketpair)
  793 AC_CHECK_FUNCS(getservbyname inet_ntoa)
  794 AC_CHECK_FUNCS(getaddrinfo getnameinfo)
  795 AC_CHECK_FUNCS(host2netname netname2host)
  796 LIBS="$ac_save_LIBS"
  797 
  798 ac_save_LIBS="$LIBS"
  799 AC_CHECK_LIB(c, res_init, lib_resolv="",
  800   [AC_CHECK_LIB(resolv, res_init, lib_resolv="-lresolv")])
  801 LIBS="$ac_save_LIBS"
  802 if test ."$lib_resolv" = .""; then
  803 	AC_DEFINE(HAVE_RESOLV_IN_LIBC)
  804 fi
  805 
  806 dnl Check for largefile support
  807 dnl Do this last to make sure that no large file definition
  808 dnl in confdefs.h will modify our results
  809 AC_SYS_LARGEFILE
  810 dnl Warning do not run this test. it interferes with the test
  811 dnl AC_CHECK_FUNCS(fseeko ftello) from above.
  812 dnl The test AC_HAVE_LARGEFILES will check whether ftello/fseeko
  813 dnl are available in Large File mode
  814 dnl AC_FUNC_FSEEKO
  815 AC_HAVE_LARGEFILES
  816 
  817 AC_DEFINE_UNQUOTED_STRING(HOST_ALIAS,$host_alias)
  818 AC_DEFINE_UNQUOTED_STRING(HOST_SUB,$host)
  819 AC_DEFINE_UNQUOTED_STRING(HOST_CPU,$host_cpu)
  820 AC_DEFINE_UNQUOTED_STRING(HOST_VENDOR,$host_vendor)
  821 AC_DEFINE_UNQUOTED_STRING(HOST_OS,$host_os)
  822 
  823 dnl AC_CHECK_LIB(crypt, crypt, lib_crypt="-lcrypt")
  824 
  825 AC_CHECK_LIB(c, crypt, lib_crypt="",
  826   [AC_CHECK_LIB(crypt, crypt, lib_crypt="-lcrypt")])
  827 if test ."$lib_crypt" = .""; then
  828 	AC_DEFINE(HAVE_CRYPT_IN_LIBC)
  829 fi
  830 
  831 ac_save_LIBS="$LIBS"
  832 LIBS="$LIBS $lib_crypt"
  833 AC_CHECK_FUNCS(crypt)
  834 LIBS="$ac_save_LIBS"
  835 
  836 AC_CHECK_ILIB([#include <libintl.h>], c, gettext, lib_intl="",
  837   [AC_CHECK_ILIB([#include <libintl.h>], intl, gettext, lib_intl="-lintl")])
  838 if test ."$lib_intl" = .""; then
  839 	AC_DEFINE(HAVE_GETTEXT_IN_LIBC)
  840 fi
  841 
  842 ac_save_LIBS="$LIBS"
  843 LIBS="$LIBS $lib_intl"
  844 AC_CHECK_DFUNC([#include <libintl.h>], gettext)
  845 LIBS="$ac_save_LIBS"
  846 
  847 AC_CHECK_ILIB([#include <iconv.h>], c, iconv_open, lib_iconv="",
  848     [AC_CHECK_ILIB([#include <iconv.h>], iconv, iconv_open, lib_iconv="-liconv")])
  849 if test ."$lib_iconv" = .""; then
  850 	AC_DEFINE(HAVE_ICONV_IN_LIBC)
  851 fi
  852 
  853 ac_save_LIBS="$LIBS"
  854 LIBS="$LIBS $lib_iconv"
  855 AC_CHECK_DFUNC([#include <iconv.h>], iconv)
  856 AC_CHECK_DFUNC([#include <iconv.h>], iconv_open)
  857 AC_CHECK_DFUNC([#include <iconv.h>], iconv_close)
  858 dnl GNU libiconv on Linux and Cygwin may make "configure" fail :-(
  859 AC_CHECK_DFUNC([#include <iconv.h>], libiconv)
  860 AC_CHECK_DFUNC([#include <iconv.h>], libiconv_open)
  861 AC_CHECK_DFUNC([#include <iconv.h>], libiconv_close)
  862 LIBS="$ac_save_LIBS"
  863 
  864 AC_CHECK_LIB(c, XML_Parse, lib_expat="",
  865   [AC_CHECK_LIB(expat, XML_Parse, lib_expat="-lexpat")])
  866 if test ."$lib_expat" = ."" -a "$ac_cv_lib_c_XML_Parse" = yes ; then
  867 	AC_DEFINE(HAVE_EXPAT_IN_LIBC)
  868 fi
  869 ac_save_LIBS="$LIBS"
  870 LIBS="$LIBS $lib_expat"
  871 AC_CHECK_FUNCS(XML_Parse)
  872 LIBS="$ac_save_LIBS"
  873 
  874 if test "$CC" = cl.exe; then
  875 	echo configure does not yet support library checks for cl.exe:
  876 	echo checking for SCardEstablishContext in -lwinscard... we know it is present
  877 	lib_pcsc="-lwinscard"
  878 	AC_DEFINE(HAVE_SCARDESTABLISHCONTEXT)
  879 else
  880 	AC_CHECK_LIB(c, SCardEstablishContext, lib_pcsc="",
  881 	  [AC_CHECK_LIB(winscard, SCardEstablishContext, lib_pcsc="-lwinscard",
  882 	  [AC_CHECK_LIB(pcsclite, SCardEstablishContext, lib_pcsc="-lpcsclite")])])
  883 	if test ."$lib_pcsc" = ."" -a "$ac_cv_lib_c_SCardEstablishContext" = yes ; then
  884 		AC_DEFINE(HAVE_PCSC_IN_LIBC)
  885 	fi
  886 	ac_save_LIBS="$LIBS"
  887 	LIBS="$LIBS $lib_pcsc"
  888 	AC_CHECK_FUNCS(SCardEstablishContext)
  889 	LIBS="$ac_save_LIBS"
  890 fi
  891 
  892 if test "$CC" = cl.exe; then
  893 	echo configure does not yet support library checks for cl.exe:
  894 	echo checking for CRYPTO_free in -llibeay32... we know it is present
  895 	echo checking for SSL_free in -lssleay32... we know it is present
  896 	lib_crypto="-llibeay32"
  897 	lib_ssl="-lssleay32"
  898 else
  899 	AC_CHECK_LIB(c, CRYPTO_free, lib_crypto="",
  900 	  [AC_CHECK_LIB(crypto, CRYPTO_free, lib_crypto="-lcrypto")])
  901 	if test ."$lib_crypto" = ."" -a "$ac_cv_lib_c_CRYPTO_free" = yes ; then
  902 		AC_DEFINE(HAVE_CRYPTO_IN_LIBC)
  903 	fi
  904 	ac_save_LIBS="$LIBS"
  905 	LIBS="$LIBS $lib_crypto"
  906 	AC_CHECK_FUNCS(CRYPTO_free)
  907 	LIBS="$ac_save_LIBS"
  908 	AC_CHECK_LIB(c, SSL_free, lib_ssl="",
  909 	  [AC_CHECK_LIB(ssl, SSL_free, lib_ssl="-lssl")])
  910 	if test ."$lib_ssl" = ."" -a "$ac_cv_lib_c_SSL_free" = yes ; then
  911 		AC_DEFINE(HAVE_SSL_IN_LIBC)
  912 	fi
  913 	ac_save_LIBS="$LIBS"
  914 	LIBS="$LIBS $lib_ssl"
  915 	AC_CHECK_FUNCS(SSL_free)
  916 	LIBS="$ac_save_LIBS"
  917 fi
  918 
  919 if test $ac_cv_header_camlib_h = yes; then
  920   scsi_lib=-lcam
  921   lib_scsi=-lcam
  922 fi
  923 
  924 if test "$ac_cv_header_sys_acl_h" = yes; then
  925 
  926   AC_CHECKING(for withdrawn Posix draft Access Control List support)
  927   AC_CHECK_LIB(acl, acl_get_file, lib_acl="-lacl")
  928   AC_CHECK_LIB(pacl, acl_get_file, lib_acl="-lpacl")
  929 
  930 	dnl If $lib_acl is nonempty, save it in $lib_acl_test
  931 	
  932 	if test ".$lib_acl" != .; then
  933 		lib_acl_test="$lib_acl"
  934 	fi
  935 
  936   ac_save_LIBS="$LIBS"
  937   LIBS="$LIBS $lib_acl"
  938   AC_CHECK_FUNCS(acl_get_file acl_set_file acl_from_text acl_to_text acl_free acl_delete_def_file)
  939   AC_CHECK_FUNCS(acl_extended_file)
  940   AC_CHECK_FUNCS(acl_get_entry)
  941   AC_CHECK_FUNCS(acl_to_text_np acl_get_brand_np acl_is_trivial_np acl_strip_np)
  942   LIBS="$ac_save_LIBS"
  943 
  944   AC_CHECKING(for Solaris UFS Access Control List support)
  945   AC_CHECK_LIB(sec, acltotext, lib_acl="-lsec")
  946   ac_save_LIBS="$LIBS"
  947   LIBS="$LIBS $lib_acl"
  948   AC_CHECK_FUNCS(acl facl aclfromtext acltotext)
  949 
  950   AC_CHECKING(for NFSv4 Access Control List support)
  951   dnl These functions support NFSv4 ACLs
  952   dnl Do not check for acl_free because of a name clash with the withdrawn POSIX draft
  953   AC_CHECK_FUNCS(acl_get acl_set facl_get facl_set acl_fromtext acl_totext)
  954   LIBS="$ac_save_LIBS"
  955 
  956   dnl On Solaris, there is no need for lib_acl_test as acl(2) is in -libc
  957 
  958   AC_CHECKING(for HP-UX Access Control List support)
  959   AC_CHECK_FUNCS(getacl fgetacl setacl fsetacl strtoacl acltostr cpacl fcpacl chownacl setaclentry fsetaclentry)
  960 
  961   dnl XXX lib_acl_test: How do we test for ACLs on HP-UX?
  962 
  963 fi
  964 
  965 if test "$ac_cv_header_attr_xattr_h" = yes || test "$ac_cv_header_sys_xattr_h" = yes; then
  966   AC_CHECKING(for Linux flavor Extended Attribute support)
  967   AC_CHECK_LIB(c, getxattr, lib_rt="",
  968 	[AC_CHECK_LIB(attr, getxattr, lib_attr="-lattr")])
  969   ac_save_LIBS="$LIBS"
  970   LIBS="$LIBS $lib_attr"
  971   AC_CHECK_FUNCS(getxattr setxattr listxattr lgetxattr lsetxattr llistxattr)
  972   LIBS="$ac_save_LIBS"
  973 fi
  974 
  975 AC_CHECKING(for RBAC support)
  976 AC_CHECK_LIB(secdb, getuserattr, lib_secdb="-lsecdb")
  977 ac_save_LIBS="$LIBS"
  978 LIBS="$LIBS $lib_secdb"
  979 AC_CHECK_FUNCS(getauthattr getuserattr getexecattr getprofattr)
  980 LIBS="$ac_save_LIBS"
  981 
  982 AC_CHECKING(for gmatch() support)
  983 AC_CHECK_LIB(gen, gmatch, lib_gen="-lgen")
  984 ac_save_LIBS="$LIBS"
  985 LIBS="$LIBS $lib_gen"
  986 AC_CHECK_FUNCS(gmatch)
  987 LIBS="$ac_save_LIBS"
  988 
  989 AC_CHECKING(for ELF support)
  990 AC_CHECK_LIB(elf, elf_begin, lib_elf="-lelf")
  991 ac_save_LIBS="$LIBS"
  992 LIBS="$LIBS $lib_elf"
  993 AC_CHECK_FUNCS(elf_begin)
  994 LIBS="$ac_save_LIBS"
  995 
  996 AC_CHECK_FUNCS(thr_yield)
  997 
  998 dnl AC_CHECK_LIB(c, sem_post, lib_sem="",
  999 dnl   [AC_CHECK_LIB(pthread, sem_post, lib_sem="-lpthread")])
 1000 dnl ac_save_LIBS="$LIBS"
 1001 dnl LIBS="$LIBS $lib_sem"
 1002 dnl AC_CHECK_FUNCS(sem_post)
 1003 dnl LIBS="$ac_save_LIBS"
 1004 
 1005 AC_CHECK_LIB(c, pthread_create, lib_pthread="",
 1006   [AC_CHECK_LIB(pthread, pthread_create, lib_pthread="-lpthread")])
 1007 
 1008 ac_save_LIBS="$LIBS"
 1009 LIBS="$LIBS $lib_pthread"
 1010 AC_CHECK_FUNCS(pthread_create pthread_kill)
 1011 AC_CHECK_FUNCS(pthread_mutex_lock pthread_cond_wait pthread_spin_lock)
 1012 LIBS="$ac_save_LIBS"
 1013 
 1014 AC_CHECK_LIB(c, clock_gettime, lib_rt="",
 1015   [AC_CHECK_LIB(rt, clock_gettime, lib_rt="-lrt",
 1016   [AC_CHECK_LIB(posix4, clock_gettime, lib_rt="-lposix4")])])
 1017 if test ."$lib_rt" = .""; then
 1018 	AC_DEFINE(HAVE_CLOCK_GETTIME_IN_LIBC)
 1019 fi
 1020 
 1021 ac_save_LIBS="$LIBS"
 1022 LIBS="$LIBS $lib_rt"
 1023 AC_CHECK_FUNCS(clock_gettime clock_settime clock_getres)
 1024 AC_CHECK_FUNCS(sched_getparam sched_setparam sched_getscheduler sched_setscheduler)
 1025 AC_CHECK_FUNCS(sched_yield)
 1026 AC_CHECK_FUNCS(nanosleep)
 1027 LIBS="$ac_save_LIBS"
 1028 
 1029 AC_CHECK_LIB(cap, cap_get_proc, lib_cap="-lcap")
 1030 ac_save_LIBS="$LIBS"
 1031 LIBS="$LIBS $lib_cap"
 1032 AC_CHECK_FUNCS(cap_get_proc cap_set_proc cap_set_flag cap_clear_flag)
 1033 LIBS="$ac_save_LIBS"
 1034 
 1035 if test "$ac_cv_header_selinux_selinux_h" = yes; then
 1036 	AC_CHECKING(for SELinux support)
 1037 	ac_save_LIBS="$LIBS"
 1038 	LIBS="$LIBS $lib_attr"
 1039 	AC_CHECK_LIB(selinux, is_selinux_enabled, lib_selinux="-lselinux")
 1040 	LIBS="$ac_save_LIBS"
 1041 	LIBS="$LIBS $lib_selinux $lib_attr"
 1042 	AC_CHECK_FUNCS(is_selinux_enabled)
 1043 	LIBS="$ac_save_LIBS"
 1044 fi
 1045 
 1046 dnl Misc OS checks.
 1047 dnl
 1048 dnl WARNING: AC_CHECK_FILES uses "test -r file" and bash on Haiku returns wrong results
 1049 dnl for /dev/stdin /dev/stdout /dev/stderr /dev/fd/0 /dev/fd/1 /dev/fd/2
 1050 dnl For this reason, we rather use AC_STAT_FILES
 1051 dnl AC_CHECK_FILES(/dev/tty /dev/null /dev/zero)
 1052 dnl AC_CHECK_FILES(/dev/stdin /dev/stdout /dev/stderr)
 1053 dnl AC_CHECK_FILES(/dev/fd/0 /dev/fd/1 /dev/fd/2)
 1054 dnl AC_CHECK_FILES(/usr/src/linux/include)
 1055 
 1056 AC_STAT_FILES(/dev/tty /dev/null /dev/zero)
 1057 AC_STAT_FILES(/dev/stdin /dev/stdout /dev/stderr)
 1058 AC_STAT_FILES(/dev/fd/0 /dev/fd/1 /dev/fd/2)
 1059 AC_STAT_FILES(/usr/src/linux/include)
 1060 
 1061 AC_STAT_SYMLINK_FILES(/bin)
 1062 AC_STAT_FILES(/bin/sh /usr/bin/sh /usr/xpg4/bin/sh /bin/posix/sh /opt/schily/xpg4/bin/sh)
 1063 
 1064 dnl Checks for OS madness.
 1065 UNAME=`uname || true`
 1066 
 1067 if test ."$UNAME" = .Linux; then
 1068 
 1069 dnl Linux madness tests:
 1070 
 1071 AC_BROKEN_LINUX_EXT2_FS_H
 1072 AC_BROKEN_SRC_LINUX_EXT2_FS_H
 1073 if test .$ac_cv_broken_linux_ext2_fs_h = .no -o .$ac_cv_broken_src_linux_ext2_fs_h = .no; then
 1074 	#
 1075 	# If either /usr/include/linux/ex2_fs.h works or
 1076 	# /usr/src/linux/include/linux/ex2_fs.h works, we will
 1077 	# #define HAVE_USABLE_LINUX_EXT2_FS_H
 1078 	#
 1079 	# If HAVE_USABLE_LINUX_EXT2_FS_H is defined, a simple
 1080 	# #include <linux/ex2_fs.h> will work.
 1081 	#
 1082 	ac_cv_usable_linux_ext2_fs_h=yes
 1083 	AC_DEFINE(HAVE_USABLE_LINUX_EXT2_FS_H)
 1084 else
 1085 	ac_cv_usable_linux_ext2_fs_h=no
 1086 fi
 1087 AC_BROKEN_SCSI_SCSI_H
 1088 AC_BROKEN_SRC_SCSI_SCSI_H
 1089 AC_BROKEN_SCSI_SG_H
 1090 AC_BROKEN_SRC_SCSI_SG_H
 1091 
 1092 if test .$ac_cv_broken_src_scsi_scsi_h = .yes; then
 1093 	may_linux_src_include=no
 1094 fi
 1095 if test .$ac_cv_broken_src_linux_ext2_fs_h = .yes; then
 1096 	may_linux_src_include=no
 1097 fi
 1098 if test .$ac_cv_file__usr_src_linux_include = .yes; then # only warn if there is /usr/src/linux/include
 1099 if test .$may_linux_src_include = .no; then
 1100 	echo
 1101 	echo "Warning: *** /usr/src/linux/include contains broken include files ***"
 1102 	echo "Warning: *** /usr/src/linux/include is not used this reason ***"
 1103 	echo "Warning: This may result in the inability to use recent Linux kernel interfaces" 
 1104 	echo
 1105 fi
 1106 fi
 1107 if test .$ac_cv_header_ext2fs_ext2_fs_h = .no; then # only if there is no <ext2fs/ext2_fs.h>
 1108 if test .$ac_cv_usable_linux_ext2_fs_h = .no; then
 1109 	echo
 1110 	echo "Warning: *** linux/ext2_fs.h is not usable at all ***"
 1111 	echo "Warning: *** This makes it impossible to support Linux file flags ***"
 1112 	echo "You may try to compile using 'make COPTX=-DTRY_EXT2_FS'"
 1113 	echo
 1114 	echo "Better install the ext2 developer package"
 1115 	echo
 1116 	sleep 10
 1117 fi
 1118 fi	# <ext2fs/ext2_fs.h> was missing
 1119 fi	# Linux only tests
 1120 
 1121 AC_SUBST(may_linux_src_include)
 1122 
 1123 AC_SUBST(largefile_cc_opt)
 1124 AC_SUBST(sun_cc64_opt)
 1125 AC_SUBST(hp_cc_ansi_opt)
 1126 AC_SUBST(hp_cc_opt_opt)
 1127 AC_SUBST(hp_cc_gprof_opt)
 1128 
 1129 AC_SUBST(lib_crypt)
 1130 AC_SUBST(lib_resolv)
 1131 AC_SUBST(lib_intl)
 1132 AC_SUBST(lib_iconv)
 1133 AC_SUBST(lib_expat)
 1134 AC_SUBST(lib_pcsc)
 1135 AC_SUBST(lib_crypto)
 1136 AC_SUBST(lib_ssl)
 1137 AC_SUBST(lib_nsl)
 1138 AC_SUBST(scsi_lib)
 1139 AC_SUBST(lib_scsi)
 1140 AC_SUBST(lib_acl)
 1141 AC_SUBST(lib_acl_test)
 1142 AC_SUBST(lib_attr)
 1143 AC_SUBST(lib_secdb)
 1144 AC_SUBST(lib_gen)
 1145 AC_SUBST(lib_elf)
 1146 AC_SUBST(lib_pthread)
 1147 AC_SUBST(lib_rt)
 1148 AC_SUBST(lib_dl)
 1149 AC_SUBST(lib_dir)
 1150 AC_SUBST(lib_cap)
 1151 AC_SUBST(lib_selinux)
 1152 
 1153 AC_OUTPUT(rules.cnf)