summaryrefslogtreecommitdiff
path: root/configure.in
blob: cdd638237dfae9aed2d8a28d9ecbcdc7bbe9862c (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
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
AC_INIT(daemon/gdm.h)

dnl
dnl Due to the sed scripts being split on 90 line
dnl blocks, this macro needs to be right at the beggining.
dnl
AM_PROG_XML_I18N_TOOLS

AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(gdm,2.2.5.4)
AM_MAINTAINER_MODE
AM_ACLOCAL_INCLUDE(macros)

GDK_PIXBUF_REQUIRED=0.7.0

# vicious-extensions stuff
AC_CHECK_FUNCS([setenv unsetenv clearenv])

# find the actual value for $prefix that we'll end up with
REAL_PREFIX=
if test "x$prefix" = "xNONE"; then
  REAL_PREFIX=$ac_default_prefix
else
  REAL_PREFIX=$prefix
fi
old_prefix=$prefix
prefix=$REAL_PREFIX

REAL_EXEC_PREFIX=
if test "x$exec_prefix" = "xNONE"; then
  REAL_EXEC_PREFIX=$prefix
else
  REAL_EXEC_PREFIX=$exec_prefix
fi
old_exec_prefix=$exec_prefix
exec_prefix=$REAL_EXEC_PREFIX


dnl
dnl Configure arguments
dnl
AC_ARG_ENABLE(console-helper,
  [  --enable-console-helper=[auto/no/yes]  Enable PAM console helper [default=auto]],,
  enable_console_helper=auto)
    
AC_ARG_ENABLE(authentication-scheme,
  [  --enable-authentication-scheme=[auto/pam/crypt/shadow]  Choose a specific
                          authentication scheme [default=auto]],,
  enable_authentication_scheme=auto)

AC_ARG_WITH(xinerama,
  [  --with-xinerama=[auto/yes/no]  Add Xinerama support [default=auto]],,
  with_xinerama=auto)

AC_ARG_WITH(xdmcp,
  [  --with-xdmcp=[auto/yes/no]  Add XDMCP (remote login) support [default=auto]],,
  with_xdmcp=auto)

AC_ARG_WITH(tcp-wrappers,
  [  --with-tcp-wrappers=[auto/yes/no]  Use TCP Wrappers [default=auto]],,
  with_tcp_wrappers=auto)

dnl
dnl PAM prefix
dnl
withval=""
AC_ARG_WITH(pam-prefix,
[      --with-pam-prefix=<prefix>   specify where pam files go],[
if test x$withval != x; then
   AC_MSG_RESULT("PAM files will be installed in prefix ${withval}.")
fi])
if test x$withval != x; then
	PAM_PREFIX_UNEXPANDED="$withval"
else
	PAM_PREFIX_UNEXPANDED="$sysconfdir"
fi
PAM_PREFIX=`eval echo $PAM_PREFIX_UNEXPANDED`
AC_SUBST(PAM_PREFIX)

    
AC_PATH_PROG(CONSOLE_HELPER,consolehelper,no)
if test "x$CONSOLE_HELPER" = "xno" ; then
  if test "x$enable_console_helper" = "xyes" ; then
    AC_MSG_ERROR(Console helper requested but consolehelper binary not found)
  fi
  # if it was no, nothing happens, if it was auto, well then we're out of luck
  enable_console_helper=no
else
  if test ! "x$enable_console_helper" = "xno" ; then
    enable_console_helper=yes
  fi
fi

dnl
dnl Standard stuff
dnl
GNOME_INIT

AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
dnl AC_ARG_PROGRAM
AM_PROG_LIBTOOL

GNOME_X_CHECKS

AM_PATH_LIBGLADE(,,gnome)
if test "x$LIBGLADE_CFLAGS" = "x"; then
  AC_MSG_ERROR(Libglade is required for gdm)
fi

dnl Allow users to run gdmconfig using the console helper PAM stuff.
if test "x$enable_console_helper" = "xyes"; then
  AM_CONDITIONAL(CONSOLE_HELPER, true)
else
  AM_CONDITIONAL(CONSOLE_HELPER, false)
fi

AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)

dnl ## internationalization support
ALL_LINGUAS="az ca cs da de el es et fi fr ga gl hu it ja ko lt lv ms nl nn no pl pt_BR pt ro ru sk sl sv ta tr uk zh_CN.GB2312 zh_TW"
dnl AM_GNOME_GETTEXT
AM_GNU_GETTEXT

# TCP Wrappers for XDMCP access control
if test x$with_tcp_wrappers = xno ; then
	echo "TCP wrappers disabled"
else
  AC_MSG_CHECKING("whether to use TCP wrappers")
  LIBWRAP_PATH=""
  for I in $LDFLAGS $LIBS -L/usr/lib; do
	case "$I" in
	-L*)
	THEFILE="`echo $I | sed -e 's,^-L,,'`"
	echo "From $I, checking in dir $THEFILE for libwrap.a" 1>&5
	if test -f $THEFILE/libwrap.a; then
		LIBWRAP_PATH=$THEFILE/libwrap.a
		echo "Found $LIBWRAP_PATH" 1>&5
		break
	fi
	esac
  done

  if test -n "$LIBWRAP_PATH"; then
        AC_MSG_RESULT(yes)
  else
        AC_MSG_RESULT(no)
  fi

  if test -n "$LIBWRAP_PATH"; then
	nm $LIBWRAP_PATH | grep 'T setenv' && LIBWRAP_PATH=""
	if test -z "$LIBWRAP_PATH"; then
		echo "*********************************************************"
	        echo " You have a broken TCP wrappers library (setenv included)"
		echo " Please get the latest TCP wrappers package from your OS"
		echo " vendor, or recompile TCP wrappers to not include a"
		echo " setenv() implementation."
		echo
		echo "Not using TCP wrappers after all."
		echo "*********************************************************"
	else
                AC_DEFINE(HAVE_TCPWRAPPERS)
	fi
  fi
  if test -n "$LIBWRAP_PATH"; then
	AC_CHECK_LIB(wrap, hosts_ctl, [
		     LIBS="$LIBS -lwrap"], [
		     LIBS="$LIBS $LIBWRAP_PATH"])
  fi

  dnl find out if we need -lnsl or whatever
  LIB_NSL=
  if test -n "$LIBWRAP_PATH"; then
        AC_MSG_CHECKING(whether -lwrap requires -lnsl)
        ORIG_LIBS="$LIBS"
        LIBS="-lwrap $LIBS"
        AC_TRY_LINK([
#include <tcpd.h>
int allow_severity, deny_severity;
], [return hosts_access;], ,[
dnl try with -lnsl
OLD_LIBS="$LIBS"
LIBS="$LIBS -lnsl"
AC_TRY_LINK([
#include <tcpd.h>
int allow_severity, deny_severity;
], [return hosts_access;], LIB_NSL="-lnsl",
LIBWRAP_PATH="")
LIBS="$OLD_LIBS"
])
        LIBS="$ORIG_LIBS"
	if test -n "$LIB_NSL"; then
        	AC_MSG_RESULT(yes)
        	LIBS="$LIBS $LIB_NSL"
	else
        	AC_MSG_RESULT(no)
	fi
  fi
fi

AC_MSG_CHECKING("for corrupt government")
AC_MSG_RESULT(yes)

dnl ## gdmopen building
dnl There are perhaps others where this works
GDMOPEN=
AC_CHECK_HEADERS(linux/vt.h, [
		 GDMOPEN=gdmopen])
AC_SUBST(GDMOPEN)

dnl ## Autentication scheme
have_pam=no
VRFY="verify-crypt"
if test x$enable_authentication_scheme != xcrypt -a \
	x$enable_authentication_scheme != xshadow ; then
	AC_CHECK_HEADERS(security/pam_appl.h, [
		have_pam=yes
        	LIBS="$LIBS -lpam"
        	VRFY="verify-pam"
        	AC_DEFINE(HAVE_PAM)])
fi

GDMASKPASS=
if test x$have_pam = xyes ; then
	AC_CHECK_HEADERS(security/pam_misc.h, [
			 GDMASKPASS=gdmaskpass])
fi
AC_SUBST(GDMASKPASS)

if test x$enable_authentication_scheme = xpam -a x$have_pam = xno ; then
	AC_MSG_ERROR(PAM support requested but not available)
fi

if test x$have_pam = xno; then

  # Check if -lcrypt is necessary
  AC_CHECK_LIB(crypt, crypt, [
  	      LIBS="$LIBS -lcrypt"])

  # Check if crypt lives in a separate header file
  AC_CHECK_HEADERS(crypt.h, [
		AC_DEFINE(HAVE_CRYPT)])

  if test x$enable_authentication_scheme = xshadow ; then
  	VRFY="verify-shadow"
	AC_DEFINE(HAVE_SHADOW)
  elif test x$enable_authentication_scheme != xcrypt ; then
  	# Check for shadow passwords (hack)
  	AC_MSG_CHECKING("for /etc/shadow")

  	if test -f /etc/shadow; then
		VRFY="verify-shadow"
		AC_MSG_RESULT(yes)
		AC_DEFINE(HAVE_SHADOW)
  	else	
		AC_MSG_RESULT(no)
  	fi
  fi

fi

AC_SUBST(VRFY)


#
# Xdmcp checking
#
XDMCP_LIBS=""
if test x$with_xdmcp != xno ; then
	AC_CHECK_HEADER(X11/Xdmcp.h, [
		AC_CHECK_LIB(Xdmcp, XdmcpFlush, [
		     	AC_DEFINE(HAVE_LIBXDMCP)
		     	XDMCP_LIBS="-lXdmcp"
		     	XDMCP_SUPPORT=yes],, $GTK_LIBS)
	])

	if test x$with_xdmcp = xyes -a x$XDMCP_SUPPORT = x ; then
		AC_MSG_ERROR(XDMCP support requested but XDMCP libraries not found)
	fi
fi
AC_SUBST(XDMCP_LIBS)

if test x$XDMCP_SUPPORT = xyes ; then
	AM_CONDITIONAL(XDMCP_SUPPORT, true)
	GDMCHOOSER=gdmchooser
	GDMXNESTCHOOSER=gdmXnestchooser
else
	AM_CONDITIONAL(XDMCP_SUPPORT, false)
	GDMCHOOSER=
	GDMXNESTCHOOSER=
fi
AC_SUBST(GDMCHOOSER)
AC_SUBST(GDMXNESTCHOOSER)

#
# X11 Xinerama extension
#
if test x$with_xinerama != xno ; then
	AC_CHECK_HEADER(X11/extensions/Xinerama.h, [
		AC_CHECK_LIB(Xinerama, XineramaQueryScreens, [
		     	AC_DEFINE(HAVE_LIBXINERAMA)
		     	LIBS="$LIBS -lXinerama"
		     	XINERAMA_SUPPORT=yes],, $GTK_LIBS)
	])

	if test x$with_xinerama = xyes -a x$XINERAMA_SUPPORT = x ; then
		AC_MSG_ERROR(Xinerama support requested but Xinerama libraries not found)
	fi
fi

dnl
dnl GdkPixBuf
dnl
AC_MSG_CHECKING(for GdkPixbuf library >= $GDK_PIXBUF_REQUIRED)
PIXBUF_CFLAGS=`$GNOME_CONFIG --cflags gdk_pixbuf`
PIXBUF_LIBS=`$GNOME_CONFIG --libs gdk_pixbuf`
if test "x$PIXBUF_CFLAGS" != x ; then
    vers=`gdk-pixbuf-config --version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
    if test "$vers" -ge 0007000; then
        AC_MSG_RESULT(found)
    else
       AC_MSG_ERROR(You need at least GdkPixbuf version 0.7.0 for the panel)
    fi
else
    AC_MSG_ERROR(Did not find GdkPixbuf installed)
fi
AC_SUBST(PIXBUF_CFLAGS)
AC_SUBST(PIXBUF_LIBS)
AC_SUBST(GDK_PIXBUF_REQUIRED)

#
# Configuration file foo, we need to get expanded versions of a bunch of things
# if you actually know how to code shell then fix this :-) 
# Stolen mostly from GConf
#

DATADIR_TMP="$datadir"
EXPANDED_DATADIR=`eval echo $DATADIR_TMP`
AC_SUBST(EXPANDED_DATADIR)
AC_DEFINE_UNQUOTED(EXPANDED_DATADIR,"$EXPANDED_DATADIR")

PIXMAPDIR_TMP="$datadir/pixmaps"
EXPANDED_PIXMAPDIR=`eval echo $PIXMAPDIR_TMP`
AC_SUBST(EXPANDED_PIXMAPDIR)
AC_DEFINE_UNQUOTED(EXPANDED_PIXMAPDIR,"$EXPANDED_PIXMAPDIR")

BINDIR_TMP="$bindir"
EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
AC_SUBST(EXPANDED_BINDIR)
AC_DEFINE_UNQUOTED(EXPANDED_BINDIR,"$EXPANDED_BINDIR")

SBINDIR_TMP="$sbindir"
EXPANDED_SBINDIR=`eval echo $SBINDIR_TMP`
AC_SUBST(EXPANDED_SBINDIR)
AC_DEFINE_UNQUOTED(EXPANDED_SBINDIR,"$EXPANDED_SBINDIR")

dnl This is where the binary actually resides,
dnl not the console helper link
if test "x$enable_console_helper" = "xyes"; then
	GDMCONFIGDIR_TMP="$sbindir"
else
	GDMCONFIGDIR_TMP="$bindir"
fi
EXPANDED_GDMCONFIGDIR=`eval echo $GDMCONFIGDIR_TMP`
AC_SUBST(EXPANDED_GDMCONFIGDIR)
AC_DEFINE_UNQUOTED(EXPANDED_GDMCONFIGDIR,"$EXPANDED_GDMCONFIGDIR")

LOCALEDIR_TMP="$sysconfdir/gdm"
EXPANDED_LOCALEDIR=`eval echo $LOCALEDIR_TMP`
AC_SUBST(EXPANDED_LOCALEDIR)
AC_DEFINE_UNQUOTED(EXPANDED_LOCALEDIR,"$EXPANDED_LOCALEDIR")

AUTHDIR_TMP="$localstatedir/gdm"
EXPANDED_AUTHDIR=`eval echo $AUTHDIR_TMP`
AC_SUBST(EXPANDED_AUTHDIR)
AC_DEFINE_UNQUOTED(EXPANDED_AUTHDIR,"$EXPANDED_AUTHDIR")

SYSCONFDIR_TMP="$sysconfdir"
EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
AC_SUBST(EXPANDED_SYSCONFDIR)
AC_DEFINE_UNQUOTED(EXPANDED_SYSCONFDIR,"$EXPANDED_SYSCONFDIR")

SESSDIR_TMP="$sysconfdir/gdm/Sessions"
EXPANDED_SESSDIR=`eval echo $SESSDIR_TMP`
AC_SUBST(EXPANDED_SESSDIR)
AC_DEFINE_UNQUOTED(EXPANDED_SESSDIR,"$EXPANDED_SESSDIR")

## Stuff for debian/changelog.in
#if test -e "debian/changelog"; then
#  DEBIAN_DATESTAMP=`head -1 debian/changelog| sed -e 's/.*cvs.//' -e 's/).*//'`
#  DEBIAN_DATE=`grep '^ --' debian/changelog | head -1 | sed -e 's/.*  //'`
#else
#  DEBIAN_DATESTAMP=`date +%Y%m%d%H%M%s`
#  DEBIAN_DATE=`date -R`
#fi
#
#AC_SUBST(DEBIAN_DATESTAMP)
#AC_SUBST(DEBIAN_DATE)

prefix=$old_prefix
exec_prefix=$old_exec_prefix

AC_OUTPUT([
Makefile
daemon/Makefile
gui/Makefile
utils/Makefile
pixmaps/Makefile
macros/Makefile
config/Makefile
docs/Makefile
docs/C/Makefile
docs/gdmconfig/Makefile
docs/gdmconfig/C/Makefile
omf-install/Makefile
po/Makefile.in
intl/Makefile
vicious-extensions/Makefile
config/gdm.conf
config/Gnome
config/gnomerc
gdm-restart
gdm-safe-restart
gdmconfig-security
gdm.spec
])

dnl <= Configuration summary =>

echo ""
echo "GDM2 configuration summary:"
echo "==========================="
echo ""

dnl <= CFLAGS and LDFLAGS =>
echo "CFLAGS : $CFLAGS"
echo "LDFLAGS : $LDFLAGS"
echo ""

dnl <= Prefixes =>
echo "prefix : $prefix"
echo "sysconf dir : "`eval echo $sysconfdir`
echo "bin dir : $EXPANDED_BINDIR"
echo "sbin dir : $EXPANDED_SBINDIR"
echo "PAM prefix : $PAM_PREFIX"
echo "data dir : "`eval echo $datadir`
echo ""

dnl <= TCP Wrappers support? =>
if test x"$LIBWRAP_PATH" = x ; then
	echo "TCP Wrappers support              : NO"
else
	echo "TCP Wrappers support              : YES"
fi

dnl <= XINERAMA =>
if test x"$XINERAMA_SUPPORT" = xyes ; then
	echo "Xinerama support                  : YES"
else
	echo "Xinerama support                  : NO"
fi

dnl <= XDMCP =>
if test x"$XDMCP_SUPPORT" = xyes ; then
	echo "XDMCP (remote login) support      : YES"
else
	echo "XDMCP (remote login) support      : NO"
fi

dnl <= Console Helper =>
if test "x$enable_console_helper" = "xyes"; then
	echo "Console helper                    : YES"
else
	echo "Console helper                    : NO"
fi


dnl <= Authentication scheme =>
echo "Authentication scheme             : $VRFY"

dnl <= Utils built =>
echo "Utilities built                   : "`echo $GDMOPEN $GDMASKPASS`

echo ""
dnl <= End of configuration summary =>