summaryrefslogtreecommitdiffstats
path: root/kdesu/configure.in.in
blob: 5f398b7201ce26018eab2bd426d9e79c79b094a2 (plain)
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
dnl Check for su
AC_PATH_PROG(path_su, "su", "no")
if test "$path_su" = "no"; then
    AC_MSG_WARN(su was not found)
else
    AC_DEFINE_UNQUOTED(__PATH_SU, "$path_su", [path to su])
fi

dnl Check for sudo
AC_PATH_PROG(path_sudo, "sudo", "no")
if test "$path_sudo" = "no"; then
    AC_MSG_WARN(sudo was not found)
else
    AC_DEFINE_UNQUOTED(__PATH_SUDO, "$path_sudo", [path to sudo])
fi

AC_ARG_WITH(sudo-tdesu-backend,
	    AC_HELP_STRING([--with-sudo-tdesu-backend],
			   [use sudo as backend for tdesu (default is su)]),
[
    if test x$withval = xyes; then
        use_tdesu_backend="sudo"
    else
        use_tdesu_backend="su"
    fi
],
    use_tdesu_backend="su"
)

if test x$use_tdesu_backend = xsudo -a x$path_sudo = xno; then
    AC_MSG_ERROR(sudo was chosen as tdesu backend, but was not found in path.)
fi

AC_DEFINE_UNQUOTED(DEFAULT_SUPER_USER_COMMAND, "$use_tdesu_backend", [Use su or sudo])

dnl Check for POSIX.1b scheduling
AC_MSG_CHECKING([POSIX.1b scheduling])
AC_TRY_LINK([
    #include <sched.h>
],
[
    sched_getscheduler(0);
],
have_rtsched="yes", have_rtsched="no")
if test "$have_rtsched" = "yes"; then
    AC_DEFINE(POSIX1B_SCHEDULING, 1, [Define if you have POSIX.1b scheduling])
    AC_MSG_RESULT(yes)
else
    AC_MSG_RESULT(no)
fi

dnl Check for initgroups()
AC_CHECK_FUNCS(initgroups)

dnl openpty stuff
AC_CHECK_HEADERS(libutil.h util.h pty.h)
AC_CHECK_LIB(util, openpty, [AC_DEFINE_UNQUOTED(HAVE_OPENPTY, 1, [Define if you have openpty in -lutil])])
AC_CHECK_FUNCS(openpty initgroups setgroups getgroups grantpt setpriority getpt unlockpt ptsname)

AH_VERBATIM(_OPENPTY,
[
/*
 * Steven Schultz <sms at to.gd-es.com> tells us :
 * BSD/OS 4.2 doesn't have a prototype for openpty in its system header files
 */
#ifdef __bsdi__
__BEGIN_DECLS
int openpty(int *, int *, char *, struct termios *, struct winsize *);
__END_DECLS
#endif
])

dnl irix pty stuff
AC_CHECK_FUNCS(_getpty)

AC_MSG_CHECKING([for struct ucred])
AC_CACHE_VAL(kde_cv_have_struct_ucred,
[
  AC_TRY_COMPILE(
  [
    #include <sys/socket.h>
  ],
  [
    struct ucred cred;
  ], kde_cv_have_struct_ucred=yes,
  kde_cv_have_struct_ucred=no)
])

AC_MSG_RESULT($kde_cv_have_struct_ucred)
if test "$kde_cv_have_struct_ucred" = yes; then
   AC_DEFINE(HAVE_STRUCT_UCRED,1, [Define if struct ucred is present from sys/socket.h])
fi
AC_CHECK_FUNCS(getpeereid)