summaryrefslogtreecommitdiffstats
path: root/tdm/configure.in.in
blob: 5422e5a99c85b512396d55ebfed15afe7e234137 (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
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
KDE_FIND_PATH(xmkmf, XMKMF, [], [AC_MSG_ERROR([xmkmf/imake not found. Please make sure it's in PATH!])])

dnl ask imake about various X settings
AC_MSG_CHECKING([X paths])
imkv=8
test "$kde_cv_defines_imake_version" = $imkv || unset kde_cv_defines_imake
AC_CACHE_VAL(kde_cv_defines_imake, [
  rm -fr conftestdir
  if mkdir conftestdir; then
    cd conftestdir
    cat > Imakefile <<'EOF'[

acimake:
	@echo "XBINDIR=\"/usr/bin\" XLIBDIR=\"$(LIBDIR)\""

]EOF
    if imake -I/usr/lib/X11/config -DTOPDIR=/etc/X11 -DCURDIR=. /etc/X11 >&5 2>&1 && test -f Makefile; then
	kde_cv_defines_imake=`${MAKE-make} acimake 2> /dev/null | grep -v "^make"`
	kde_cv_defines_imake_version=$imkv
    else
        AC_MSG_RESULT([failed])
	AC_MSG_ERROR([$XMKMF (imake) failed.
Make sure you have all necessary X development packages installed.
On some systems a missing /lib/cpp symlink is at fault.])
    fi
    cd ..
    rm -fr conftestdir
  else
    AC_MSG_RESULT([failed])
    AC_MSG_ERROR([cannot create temporary directory])
  fi
])
AC_MSG_RESULT([done])
eval "$kde_cv_defines_imake"
AC_DEFINE_UNQUOTED(XBINDIR, "$XBINDIR", [X binaries directory])
AC_DEFINE_UNQUOTED(XLIBDIR, "$XLIBDIR", [X libraries directory])

if test -f /etc/ttys; then
  AC_DEFINE(BSD_INIT, 1, [Define if the system uses a BSD-style init])
fi

AC_CHECK_FUNCS([getttyent])
case $host_os in
	linux*) ac_cv_func_getutxent=no;;
	darwin*) ac_cv_func_getutxent=no;;
	kfreebsd*-gnu) ac_cv_func_getutxent=no;;
	*) AC_CHECK_FUNC([getutxent]);;
esac
if test $ac_cv_func_getutxent = yes; then
	AC_DEFINE(HAVE_UTMPX, 1, [Define if the system uses extended utmp])
else
	AC_CHECK_FUNC([getutent], ,
		[AC_DEFINE(BSD_UTMP, 1, [Define if the system has no getutent])])
fi

AC_CHECK_MEMBERS([struct utmp.ut_user], , , [#include <utmp.h>])
AC_CHECK_MEMBERS([struct passwd.pw_expire], , , [#include <pwd.h>])
AC_CHECK_MEMBERS([struct sockaddr_in.sin_len], , , [
#include <sys/socket.h>
#include <netinet/in.h>
])

ac_save_libs=$LIBS
LIBS="$LIBS $LIBUTIL"
AC_CHECK_FUNCS([setlogin setusercontext getusershell login_getclass auth_timeok])
LIBS=$ac_save_libs

dnl is getifaddrs always available without additional libs?
AC_CHECK_FUNCS([mkstemp setproctitle sysinfo strnlen getifaddrs])

AC_CHECK_FUNCS([arc4random], ,
	[
dnl assume that /dev/random is non-blocking if /dev/urandom does not exist
for i in urandom random; do
  if test -c /dev/$i; then
    AC_DEFINE_UNQUOTED(DEV_RANDOM, "/dev/$i", [Define the system's entropy device])
    break
  fi
done
	])

AC_CHECK_FUNC(vsyslog, [
  AC_DEFINE(USE_SYSLOG, 1, [Define if tdm should be built with syslog support])])

tdm_no_Xau=false
tdm_no_Xdmcp=false

AC_CHECK_LIB(Xau, main, [:], 
	[
	  tdm_no_Xau=true
	  DO_NOT_COMPILE="$DO_NOT_COMPILE tdm"
	], 
	  $X_LDFLAGS -lX11 $LIBSOCKET)

AC_ARG_WITH(xdmcp,
        AC_HELP_STRING([--without-xdmcp],[build tdm without xdmcp support [default=with xdmcp]]), ,
	[with_xdmcp=yes])
if test "x$with_xdmcp" = xyes; then
  AC_CHECK_LIB(Xdmcp, main, [LIBXDMCP="-lXdmcp"], , $X_LDFLAGS -lX11 $LIBSOCKET)
  if test -n "$LIBXDMCP"; then
    cppflags_safe=$CPPFLAGS
    CPPFLAGS="$CPPFLAGS $X_INCLUDES"
    AC_CHECK_HEADER(X11/Xdmcp.h, [HAVE_X11_XDMCP_H=1], , [#include <X11/Xmd.h>])
    CPPFLAGS=$cppflags_safe
  fi
  if test -z "$HAVE_X11_XDMCP_H"; then
    tdm_no_Xdmcp=true
    DO_NOT_COMPILE="$DO_NOT_COMPILE tdm"
  fi
  AC_DEFINE(XDMCP, 1, [Define if tdm should be built with XDMCP support])
  ac_save_libs=$LIBS
  LIBS="$LIBS $LIBXDMCP"
  AC_CHECK_FUNC(XdmcpWrap, [
    AC_DEFINE(HASXDMAUTH, 1, [Define if tdm should be built with XDMAUTH support])
  ])
  LIBS=$ac_save_libs
fi
AC_SUBST(LIBXDMCP)

KRB4_INCS=
KRB4_LIBS=
KRB4_RPATH=

AC_MSG_CHECKING(whether to use Kerberos v4)
AC_ARG_WITH(krb4,
AC_HELP_STRING([--with-krb4=PATH],[Compile in Kerberos v4 support]),
[ test "x$with_krb4" = xyes && with_krb4=/usr/kerberos ],
[ with_krb4=no ]
)
case "$with_krb4" in
no)
  AC_MSG_RESULT(no)
  ;;
*)
  AC_MSG_RESULT(yes)
  AC_DEFINE_UNQUOTED(KRB4, 1, [define if you have Kerberos IV])
  KRB4_INCS="-I$with_krb4/include"
  KRB4_LIBS="-L$with_krb4/lib -lkrb -ldes"
  if test "$USE_RPATH" = "yes" ; then
    KRB4_RPATH="-R $with_krb4/lib"
  fi
  AC_CHECK_LIB(resolv, dn_expand, KRB4_LIBS="$KRB4_LIBS -lresolv")
  ;;
esac

AC_MSG_CHECKING(whether to use AFS)
AC_ARG_WITH(afs,
  AC_HELP_STRING([--with-afs],[Compile in AFS support (requires KTH krb4)]), , 
  [ with_afs=no ])
if test "$with_afs" = no; then
  AC_MSG_RESULT(no)
else
  if test "$with_krb4" = no; then
    AC_MSG_RESULT(no)
    AC_MSG_WARN("AFS requires Kerberos v4 support.")
    with_afs=no
  else
    AC_MSG_RESULT(yes)
    AC_DEFINE_UNQUOTED(AFS, 1, [define if you have KTH Kerberos IV and AFS])
    KRB4_LIBS="$KRB4_LIBS -lkafs"
    if test -n "$os_aix"; then
      KRB4_LIBS="$KRB4_LIBS -lld"
    fi
  fi
fi

AC_SUBST(KRB4_INCS)
AC_SUBST(KRB4_LIBS)
AC_SUBST(KRB4_RPATH)

AC_CHECK_LIB(s, main, [LIB_LIBS="-ls"]) dnl for AIX
AC_SUBST(LIB_LIBS)

AC_CHECK_LIB(posix4, sched_yield, [LIBPOSIX4=-lposix4])
AC_SUBST(LIBPOSIX4)

KRB5_INCS=
KRB5_LIBS=
KRB5_RPATH=

AC_MSG_CHECKING([whether to use Kerberos5 for Xauth cookies in tdm])
AC_ARG_WITH(krb5auth,
  AC_HELP_STRING([--with-krb5auth=PATH],[Use Kerberos5 for Xauth cookies in tdm]), ,
  [ with_krb5auth=no ])
if test "x$with_krb5auth" = xno; then
  AC_MSG_RESULT(no)
else
  AC_MSG_RESULT(yes)
  if test "x$with_krb5auth" != xyes; then
    KRB5_INCS="-I$with_krb5auth/include"
    KRB5_LIBS="-L$with_krb5auth/lib"
    if test "$USE_RPATH" = "yes" ; then
      KRB5_RPATH="-R $with_krb5auth/lib"
    fi
  fi
  KRB5_LIBS="$KRB5_LIBS -lkrb5" dnl -lk5crypto -lcom_err -lresolv
  keepcflags=$CFLAGS
  CFLAGS="$KRB5_INCS $CFLAGS"
  AC_CHECK_HEADER(krb5/krb5.h, 
    [ AC_DEFINE(K5AUTH, 1, [Define if tdm should use Kerberos 5 for Xauth cookies.]) ],
    [ AC_MSG_ERROR([--with-krb5auth requires Kerberos5 header files.
Due to a problem with X includes you probably have to run "ln -s . krb5"
in the directory where the krb5.h include resides to make things actually work.])])
  CFLAGS="$keepcflags"
fi

AC_SUBST(KRB5_INCS)
AC_SUBST(KRB5_LIBS)
AC_SUBST(KRB5_RPATH)

AC_MSG_CHECKING([whether to use Sun's secure RPC for Xauth cookies in tdm])
AC_ARG_WITH(rpcauth,
  AC_HELP_STRING([--with-rpcauth],[Use Sun's secure RPC for Xauth cookies in tdm.]), , 
  [ with_rpcauth=no ])
if test "x$with_rpcauth" = xno; then
  AC_MSG_RESULT(no)
else
  AC_MSG_RESULT(yes)
  AC_CHECK_HEADER(rpc/rpc.h, 
    [ AC_DEFINE(SECURE_RPC, 1, [Define if tdm should use Sun's secure RPC for Xauth cookies.]) ],
    [ AC_MSG_ERROR([--with-rpcauth requires Sun RPC header files.])])
fi

if test "x$use_pam" = xyes; then
    AC_DEFINE(USE_PAM, 1, [Define if tdm should use PAM])
elif test "x$use_shadow" = xyes; then
    AC_DEFINE(USESHADOW, 1, [Define if tdm should use shadow passwords])
fi
if test "x$with_krb4" != xno; then
    AC_DEFINE(KERBEROS, 1, [Define if tdm should use Kerberos IV])
    if test "x$with_afs" = xno; then
        AC_DEFINE(NO_AFS, 1, [Define if tdm should not use AFS])
    fi
fi

AC_ARG_WITH(tdm-xconsole,
	AC_HELP_STRING([--with-tdm-xconsole],[build tdm with built-in xconsole [default=no]]), ,
	[with_tdm_xconsole=no])
if test "x$with_tdm_xconsole" = xyes; then
    AC_DEFINE(WITH_TDM_XCONSOLE, 1, [Build tdm with built-in xconsole])
fi

########### Check for DBus

  AC_MSG_CHECKING(for DBus)

  dbus_inc=NOTFOUND
  dbus_lib=NOTFOUND
  dbus=NOTFOUND

  search_incs="$kde_includes $kde_extra_includes /usr/include /usr/include/dbus-1.0 /usr/local/include /usr/local/include/dbus-1.0"
  AC_FIND_FILE(dbus/dbus.h, $search_incs, dbus_incdir)

  search_incs_arch_deps="$kde_includes $kde_extra_includes /usr/lib$tdelibsuff/dbus-1.0/include /usr/local/lib$tdelibsuff/dbus-1.0/include"
  AC_FIND_FILE(dbus/dbus-arch-deps.h, $search_incs_arch_deps, dbus_incdir_arch_deps)

  if test -r $dbus_incdir/dbus/dbus.h && test -r $dbus_incdir_arch_deps/dbus/dbus-arch-deps.h ; then
    DBUS_INCS="-I$dbus_incdir -I$dbus_incdir_arch_deps"
    dbus_inc=FOUND
  fi

  search_libs="$kde_libraries $kde_extra_libs /usr/lib$tdelibsuff /usr/local/lib$tdelibsuff"
  AC_FIND_FILE(libdbus-1.so, $search_libs, dbus_libdir)

  if test -r $dbus_libdir/libdbus-1.so ; then
    DBUS_LIBS="-L$dbus_libdir -ldbus-1"
    dbus_lib=FOUND
  fi

  if test $dbus_inc != FOUND || test $dbus_lib != FOUND ; then 
    KDE_PKG_CHECK_MODULES( DBUS, "dbus-1", [ DBUS_INCS=$DBUS_CFLAGS; dbus_inc=FOUND; dbus_lib=FOUND; ] , AC_MSG_RESULT( Nothing found on PKG_CONFIG_PATH ) )
  fi

  dbus_bus_var=`pkg-config --variable=system_bus_default_address dbus-1 2>/dev/null`
  if test -z "$dbus_bus_var"; then
        dbus_bus_var="unix:path=/var/run/dbus/system_bus_socket"
  fi
  AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS, "$dbus_bus_var", [Define the unix domain path for dbus system bus])

  if test $dbus_inc = FOUND && test $dbus_lib = FOUND ; then
    AC_MSG_RESULT(headers $DBUS_INCS libraries $DBUS_LIBS)
    dbus=FOUND
  else
    AC_MSG_RESULT(searched but not found)
  fi

  AC_SUBST(DBUS_INCS)
  AC_SUBST(DBUS_LIBS)

########### Check for DBus

  AC_MSG_CHECKING(for DBus)

  dbus_inc=NOTFOUND
  dbus_lib=NOTFOUND
  dbus=NOTFOUND

  search_incs="$kde_includes $kde_extra_includes /usr/include /usr/include/dbus-1.0 /usr/local/include /usr/local/include/dbus-1.0"
  AC_FIND_FILE(dbus/dbus.h, $search_incs, dbus_incdir)

  search_incs_arch_deps="$kde_includes $kde_extra_includes /usr/lib$tdelibsuff/dbus-1.0/include /usr/local/lib$tdelibsuff/dbus-1.0/include"
  AC_FIND_FILE(dbus/dbus-arch-deps.h, $search_incs_arch_deps, dbus_incdir_arch_deps)

  if test -r $dbus_incdir/dbus/dbus.h && test -r $dbus_incdir_arch_deps/dbus/dbus-arch-deps.h ; then
    DBUS_INCS="-I$dbus_incdir -I$dbus_incdir_arch_deps"
    dbus_inc=FOUND
  fi

  search_libs="$kde_libraries $kde_extra_libs /usr/lib$tdelibsuff /usr/local/lib$tdelibsuff"
  AC_FIND_FILE(libdbus-1.so, $search_libs, dbus_libdir)

  if test -r $dbus_libdir/libdbus-1.so ; then
    DBUS_LIBS="-L$dbus_libdir -ldbus-1"
    dbus_lib=FOUND
  fi

  if test $dbus_inc != FOUND || test $dbus_lib != FOUND ; then 
    KDE_PKG_CHECK_MODULES( DBUS, "dbus-1", [ DBUS_INCS=$DBUS_CFLAGS; dbus_inc=FOUND; dbus_lib=FOUND; ] , AC_MSG_RESULT( Nothing found on PKG_CONFIG_PATH ) )
  fi

  dbus_bus_var=`pkg-config --variable=system_bus_default_address dbus-1 2>/dev/null`
  if test -z "$dbus_bus_var"; then
        dbus_bus_var="unix:path=/var/run/dbus/system_bus_socket"
  fi
  AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS, "$dbus_bus_var", [Define the unix domain path for dbus system bus])

  if test $dbus_inc = FOUND && test $dbus_lib = FOUND ; then
    AC_MSG_RESULT(headers $DBUS_INCS libraries $DBUS_LIBS)
    dbus=FOUND
  else
    AC_MSG_RESULT(searched but not found)
  fi

  AC_SUBST(DBUS_INCS)
  AC_SUBST(DBUS_LIBS)

dnl AC_OUTPUT(tdm/kfrontend/sessions/kde.desktop)


AC_ARG_WITH(libaudit,
  [  --with-libaudit=[auto/yes/no]  Add Linux audit support [default=auto]],,
  with_libaudit=auto)

# Check for Linux auditing API
#
# libaudit detection
if test x$with_libaudit = xno ; then
    have_libaudit=no;
else
    # See if we have audit daemon library
    AC_CHECK_LIB(audit, audit_log_user_message,
                 have_libaudit=yes, have_libaudit=no)
fi

AM_CONDITIONAL(HAVE_LIBAUDIT, test x$have_libaudit = xyes)

if test x$have_libaudit = xyes ; then
    EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -laudit"
    AC_DEFINE(HAVE_LIBAUDIT,1,[linux audit support])
fi