diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/configure.in b/configure.in index 5531360..ed744ea 100644 --- a/configure.in +++ b/configure.in @@ -120,10 +120,6 @@ case $ac_sys_system/$ac_sys_release in # even though select is a POSIX function. Reported by J. Ribbens. OpenBSD/2.* | OpenBSD/3.@<:@012@:>@) define_xopen_source=no;; - # On FreeBSD 5.0, chroot and setgroups are not declared if _XOPEN_SOURCE - # is define. Reported by M. Recht. - FreeBSD/5.0*) - define_xopen_source=no;; esac if test $define_xopen_source = yes @@ -1740,13 +1736,13 @@ fi AC_MSG_RESULT(MACHDEP_OBJS) # checks for library functions -AC_CHECK_FUNCS(alarm chown clock confstr ctermid ctermid_r execv \ +AC_CHECK_FUNCS(alarm chown clock confstr ctermid execv \ fchdir flock fork fsync fdatasync fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getpeername getpgid getpid getpwent getwd \ hstrerror inet_pton kill killpg lchown lstat mkfifo mknod mktime \ mremap nice pathconf pause plock poll pthread_init \ putenv readlink \ - select setegid seteuid setgid setgroups \ + select setegid seteuid setgid \ setlocale setregid setreuid setsid setpgid setuid setvbuf snprintf \ sigaction siginterrupt sigrelse strftime strptime \ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ @@ -1773,6 +1769,33 @@ AC_TRY_COMPILE([#include <unistd.h>], void *x=symlink, AC_MSG_RESULT(no) ) +# On some systems (eg. FreeBSD 5), we would find a definition of the +# functions ctermid_r, setgroups in the library, but no prototype +# (e.g. because we use _XOPEN_SOURCE). See whether we can take their +# address to avoid compiler warnings and potential miscompilations +# because of the missing prototypes. + +AC_MSG_CHECKING(for ctermid_r) +AC_TRY_COMPILE([ +#include "confdefs.h" +#include <stdio.h> +], void* p = ctermid_r, + AC_DEFINE(HAVE_CTERMID_R, 1, Define if you have the 'ctermid_r' function.) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) + +AC_MSG_CHECKING(for setgroups) +AC_TRY_COMPILE([ +#include "confdefs.h" +#include <unistd.h.h> +], +void* p = setgroups, + AC_DEFINE(HAVE_SETGROUPS, 1, Define if you have the 'setgroups' function.) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) + # check for openpty and forkpty AC_CHECK_FUNCS(openpty,, AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"])) |