configure.ac 40.8 KB
Newer Older
1

William Jon McCann's avatar
William Jon McCann committed
2 3 4 5 6 7 8
AC_PREREQ(2.59c)
AC_INIT([gdm],
        [2.99.0],
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gdm2],
        [gdm])

AC_CONFIG_SRCDIR([daemon/gdm-manager.c])
9

William Jon McCann's avatar
William Jon McCann committed
10 11
AM_INIT_AUTOMAKE

12 13
AM_MAINTAINER_MODE

William Jon McCann's avatar
William Jon McCann committed
14 15 16 17 18 19 20 21
AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AC_PROG_LIBTOOL

AC_HEADER_STDC

AC_SUBST(VERSION)
22 23 24 25

AM_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])

26
IT_PROG_INTLTOOL([0.35.0])
27 28 29

GNOME_DOC_INIT

30 31 32 33 34 35 36 37 38 39
GETTEXT_PACKAGE=gdm
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")

AM_GLIB_GNU_GETTEXT

dnl ---------------------------------------------------------------------------
dnl - Dependencies
dnl ---------------------------------------------------------------------------

40 41 42 43 44 45 46 47
X11_REQUIRED_VERSION=1.0.0
DBUS_GLIB_REQUIRED_VERSION=0.74
GLIB_REQUIRED_VERSION=2.13.0
GTK_REQUIRED_VERSION=2.10.0
GNOME_VFS_REQUIRED_VERSION=2.18.0
PANGO_REQUIRED_VERSION=1.3.0
LIBGLADE_REQUIRED_VERSION=1.99.2
SCROLLKEEPER_REQUIRED_VERSION=0.1.4
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
EXTRA_COMPILE_WARNINGS(yes)

PKG_CHECK_MODULES(COMMON,
        dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
        gobject-2.0 >= $GLIB_REQUIRED_VERSION
)
AC_SUBST(COMMON_CFLAGS)
AC_SUBST(COMMON_LIBS)

PKG_CHECK_MODULES(DAEMON,
        dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
        gobject-2.0 >= $GLIB_REQUIRED_VERSION
        x11 >= $X11_REQUIRED_VERSION
)
AC_SUBST(DAEMON_CFLAGS)
AC_SUBST(DAEMON_LIBS)

PKG_CHECK_MODULES(GREETER,
        dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
        gtk+-2.0 >= $GTK_REQUIRED_VERSION
)
AC_SUBST(GREETER_CFLAGS)
AC_SUBST(GREETER_LIBS)

PKG_CHECK_MODULES(SIMPLE_GREETER,
        dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
        gtk+-2.0 >= $GTK_REQUIRED_VERSION
        libglade-2.0 >= $LIBGLADE_REQUIRED_VERSION
        gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED_VERSION
)
AC_SUBST(SIMPLE_GREETER_CFLAGS)
AC_SUBST(SIMPLE_GREETER_LIBS)

PKG_CHECK_MODULES(CHOOSER,
        dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
        gtk+-2.0 >= $GTK_REQUIRED_VERSION
)
AC_SUBST(CHOOSER_CFLAGS)
AC_SUBST(CHOOSER_LIBS)

PKG_CHECK_MODULES(SIMPLE_CHOOSER,
        dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
        gtk+-2.0 >= $GTK_REQUIRED_VERSION
        libglade-2.0 >= $LIBGLADE_REQUIRED_VERSION
        gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED_VERSION
)
AC_SUBST(SIMPLE_CHOOSER_CFLAGS)
AC_SUBST(SIMPLE_CHOOSER_LIBS)

AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_XTRA

dnl ---------------------------------------------------------------------------
dnl - Configuration file stuff
dnl ---------------------------------------------------------------------------
104 105 106 107 108

AC_ARG_WITH(sysconfsubdir, AC_HELP_STRING([--with-sysconfsubdir],
            [directory name used under sysconfdir, default=gdm]),
            sysconfsubdir=${withval}, sysconfsubdir=gdm)
AC_SUBST(sysconfsubdir)
109 110

if test x"${sysconfsubdir}" != xno -a x"${sysconfsubdir}" != x; then
111 112 113 114 115 116 117 118 119 120
    gdmconfdir='${sysconfdir}/${sysconfsubdir}'
else
    gdmconfdir='${sysconfdir}'
fi
AC_SUBST(gdmconfdir)

AC_ARG_WITH(dmconfdir, AC_HELP_STRING([--with-dmconfdir],
            [directory where Sessions are stored, default=SYSCONFDIR/dm]),
            dmconfdir=${withval}, dmconfdir=${sysconfdir}/dm)
AC_SUBST(dmconfdir)
121

122 123 124 125
dnl ---------------------------------------------------------------------------
dnl - Configure arguments
dnl ---------------------------------------------------------------------------

126 127 128
AC_ARG_ENABLE(console-helper,
  [  --enable-console-helper=[auto/no/yes]  Enable PAM console helper [default=auto]],,
  enable_console_helper=auto)
129

130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
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)

AC_ARG_WITH(selinux, [  --with-selinux  Add SELinux support])

149 150 151 152
AC_ARG_WITH(console-kit,
  [  --with-console-kit=[auto/yes/no]  Add ConsoleKit support [default=auto]],,
  with_console_kit=auto)

153 154 155 156 157 158 159 160 161 162 163 164 165 166
# On Solaris, Xnest is only shipped in /usr/openwin/, but your
# should use "--with-post-path=/usr/openwin/bin" for full
# Xserver support (such as access to Xnest and other X executables
# that are only in /usr/openwin/bin and not yet in /usr/X11/bin).
# Someday the Xserver team at Sun may fix this, then you don't
# have to do this anymore.
#
# For other platforms it may be useful to add stuff you want to the
# end of the default path, if your distribution provider has
# specific directories for branded applications or whatever or
# clever directories like /usr/sfw/bin or whatever that OpenView
# binary directory is for those OpenView users forced to use GDM.
# OpenView users like to recompile code anyway.
#
167 168 169 170 171 172 173 174 175 176
withval=""
AC_ARG_WITH(post-path,
[  --with-post-path=<PATH>   add PATH to end of user's PATH when logging in],[
if test x$withval != x; then
   AC_MSG_RESULT("PATH ${withval} with be added to end of user's PATH when logging in.")
fi])
if test x$withval != x; then
	USER_POST_PATH="$withval"
fi

177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
dnl
dnl file that sets LANG
dnl
withval=""
AC_ARG_WITH(lang-file,
    [  --with-lang-file=<filename>   file containing default language setting],[
if test x$withval != x; then
AC_MSG_RESULT("System locale will be looked for in file ${withval}.")
fi])
if test x$withval != x; then
	LANG_CONFIG_FILE="$withval"
else
	LANG_CONFIG_FILE='${sysconfdir}/sysconfig/i18n'
fi
AC_SUBST(LANG_CONFIG_FILE)
William Jon McCann's avatar
William Jon McCann committed
192

193 194 195 196 197 198 199 200 201 202
dnl socklen_t may be declared, but not in a "standard" C header location
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_TYPE(socklen_t,,
        AC_DEFINE(socklen_t,size_t,Compatibility type),
[AC_INCLUDES_DEFAULT]
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
)

203 204
AC_CHECK_FUNCS([setresuid setenv unsetenv clearenv])

205 206 207 208
dnl checks needed for Darwin compatibility to linux **environ.
AC_CHECK_HEADERS(crt_externs.h)
AC_CHECK_FUNCS(_NSGetEnviron)

209
EXTRA_DAEMON_LIBS=""
210
EXTRA_SLAVE_LIBS=""
211 212 213 214 215
EXTRA_CHOOSER_LIBS=""
EXTRA_XNEST_LIBS=""
EXTRA_FLEXI_LIBS=""
EXTRA_DYNAMIC_LIBS=""
EXTRA_SETUP_LIBS=""
216
EXTRA_GREETER_LIBS=""
217 218 219 220

AC_CHECK_FUNC(socket,,[
	      AC_CHECK_LIB(socket,socket, [
			   EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lsocket"
221
			   EXTRA_SLAVE_LIBS="$EXTRA_SLAVE_LIBS -lsocket"
222 223 224 225 226 227 228 229
			   EXTRA_CHOOSER_LIBS="$EXTRA_CHOOSER_LIBS -lsocket"
			   EXTRA_XNEST_LIBS="$EXTRA_XNEST_LIBS -lsocket"
			   EXTRA_FLEXI_LIBS="$EXTRA_FLEXI_LIBS -lsocket"
			   EXTRA_DYNAMIC_LIBS="$EXTRA_DYNAMIC_LIBS -lsocket"
			   EXTRA_SETUP_LIBS="$EXTRA_SETUP_LIBS -lsocket"])])
AC_CHECK_FUNC(gethostbyname,,[
	      AC_CHECK_LIB(nsl,gethostbyname, [
			   EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lnsl"
230
			   EXTRA_SLAVE_LIBS="$EXTRA_SLAVE_LIBS -lnsl"
231 232 233 234 235 236 237 238 239 240 241
			   EXTRA_CHOOSER_LIBS="$EXTRA_CHOOSER_LIBS -lnsl"])])
AC_CHECK_FUNC(sched_yield,[
	      AC_DEFINE(HAVE_SCHED_YIELD)],[
	      AC_CHECK_LIB(rt,sched_yield, [
			   AC_DEFINE(HAVE_SCHED_YIELD)
			   EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lrt"], [
			   echo "No sched_yield found"])])
AC_CHECK_FUNC(inet_aton,,[
	      AC_CHECK_LIB(resolv,inet_aton, [
			   EXTRA_CHOOSER_LIBS="$EXTRA_CHOOSER_LIBS -lresolv"])])

242 243 244 245 246

dnl ---------------------------------------------------------------------------
dnl - Check for IPv6
dnl ---------------------------------------------------------------------------

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
AC_MSG_CHECKING([whether to enable IPv6])
AC_ARG_ENABLE(ipv6, [  --enable-ipv6=[yes/no] Enables compilation of IPv6 code default=[no]],, enable_ipv6=no)
if test x$enable_ipv6 = xyes; then
  AC_TRY_COMPILE([
    #include <sys/types.h>
    #include <sys/socket.h>],[
    struct sockaddr_storage ss;
    socket(AF_INET6, SOCK_STREAM, 0)
    ],
    have_ipv6=yes,
    have_ipv6=no
    )
  if test x$have_ipv6 = xyes; then
    have_getaddrinfo=no
    have_inet_ntop=no
    AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
    if test x$have_getaddrinfo != xyes; then
      for lib in bsd socket inet; do
        AC_CHECK_LIB($lib,getaddrinfo,["LIBS=$LIBS -l$lib";have_getaddrinfo=yes;break])
      done
    fi

    AC_CHECK_FUNC(inet_ntop,have_inet_ntop=yes)
    if test x$have_inet_ntop != xyes; then
      for lib in bsd nsl inet; do
        AC_CHECK_LIB($lib,inet_ntop,["LIBS=$LIBS -l$lib";have_inet_ntop=yes;break])
      done
    fi

    if test x$have_getaddrinfo = xyes; then
      if test x$have_inet_ntop = xyes; then
        have_ipv6=yes
        AC_DEFINE(ENABLE_IPV6)
        AC_MSG_RESULT($have_ipv6)
      else
        have_ipv6=no
        AC_MSG_RESULT($have_ipv6)
      fi
    fi
  fi
else
  AC_MSG_RESULT(no)
fi

AC_ARG_WITH(afs,
[  --with-afs              support -fstype afs],
[  AC_DEFINE(AFS, [], [Define if you have the Andrew File System])
  CPPFLAGS="$CPPFLAGS -I/usr/afsws/include"
  LIBS="$LIBS -L/usr/afsws/lib -L/usr/afsws/lib/afs -lsys -lrx -llwp"])

297 298 299 300 301

dnl ---------------------------------------------------------------------------
dnl - Check for filesystem type support
dnl ---------------------------------------------------------------------------

302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317
AC_MSG_CHECKING(how to get filesystem type)
fstype=no
# The order of these tests is important.
AC_TRY_CPP([#include <sys/statvfs.h>
#include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS, [],
							[Define to use SVR4 statvfs to get filesystem type]) fstype=SVR4)
if test $fstype = no; then
AC_TRY_CPP([#include <sys/statfs.h>
#include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS, [],
							[Define to use SVR3.2 statfs to get filesystem type]) fstype=SVR3)
fi
if test $fstype = no; then
AC_TRY_CPP([#include <sys/statfs.h>
#include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS, [],
							 [Define to use AIX3 statfs to get filesystem type]) fstype=AIX)
fi
318
if test $fstype = no; then
319 320 321
AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT, [],
						    [Define to use 4.3BSD getmntent to get filesystem typ]) fstype=4.3BSD)
fi
322
if test $fstype = no; then
323 324 325
AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS, [],
							   [Define to use 4.4BSD and OSF1 statfs to get filesystem typ]) fstype=4.4BSD/OSF1)
fi
326
if test $fstype = no; then
327 328 329 330 331 332 333
AC_TRY_CPP([#include <sys/mount.h>
#include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT, [],
							   [Define to use Ultrix getmnt to get filesystem typ]) fstype=Ultrix)
fi
AC_MSG_RESULT($fstype)


334
dnl ---------------------------------------------------------------------------
335
dnl - Check for PAM stuff
336 337
dnl ---------------------------------------------------------------------------

338 339 340 341 342 343 344 345 346 347 348 349 350 351
dnl PAM prefix
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="$withval"
else
	PAM_PREFIX='${sysconfdir}'
fi
AC_SUBST(PAM_PREFIX)

352
have_pam=no
353
AC_CHECK_LIB(pam, pam_start, have_pam=yes)
354

355 356
if test "x$have_pam" = "xyes"; then
        PAM_LIBS="${PAM_LIBS} -lpam"
357
fi
358 359
AC_SUBST(HAVE_PAM)
AC_SUBST(PAM_LIBS)
360

361 362
AC_CHECK_HEADERS([security/pam_modutil.h security/pam_ext.h])
AC_CHECK_LIB(pam, pam_syslog, [AC_DEFINE(HAVE_PAM_SYSLOG, [], [Define to 1 if you have the pam_syslog function])])
363

364 365 366 367 368 369 370 371 372 373 374 375 376 377 378
dnl test whether struct pam_message is const (Linux) or not (Sun)
if test "x$have_pam" = "xyes"; then
   pam_appl_h="$ac_pam_includes/security/pam_appl.h"
   AC_MSG_CHECKING(for const pam_message)
   AC_EGREP_HEADER([struct pam_message],
      $pam_appl_h,
      [ AC_EGREP_HEADER([const struct pam_message],
                        $pam_appl_h,
                        [AC_MSG_RESULT(["const: Linux-type PAM"]) ],
                        [AC_MSG_RESULT(["nonconst: Sun-type PAM"])
                        AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
                        )],
       [AC_MSG_RESULT(["not found - assume const, Linux-type PAM"])]
       )
fi
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

dnl Check if we can use the setpenv function to add specialvariable
dnl to the environment (such as the /etc/environment file under AIX)
AC_LINK_IFELSE([
	AC_LANG_PROGRAM([[
		#ifdef HAVE_USERSEC_H
		#include <usersec.h>
		#endif
		]],[[
		return (setpenv(NULL, (PENV_INIT | PENV_NOEXEC), NULL, NULL));
		]])],
	can_use_setpenv=yes,
	can_use_setpenv=no)

if test x$can_use_setpenv = xyes ; then
	AC_DEFINE(CAN_USE_SETPENV,,[Define this variable if the code to use
		the setpenv function can be compiled and used])
fi

#
# Can we use BSD's setusercontext
#
AC_CHECK_HEADER(login_cap.h, [
		EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lutil"
		AC_DEFINE(HAVE_LOGINCAP)])

#
# Check for sys/sockio.h
#
AC_CHECK_HEADERS(sys/sockio.h, [
		 AC_DEFINE(HAVE_SYS_SOCKIO_H)])

411 412 413 414 415 416
#
# Check for libgen.h
#
AC_CHECK_HEADERS(libgen.h, [
		 AC_DEFINE(HAVE_LIBGEN_H)])

417

418 419 420 421
dnl ---------------------------------------------------------------------------
dnl - Check for POSIX version of getpwnam_r
dnl ---------------------------------------------------------------------------

422 423 424 425 426
# Checking for a posix version of getpwnam_r
# if we are cross compiling and can not run the test
# assume getpwnam_r is the posix version
# it is up to the person cross compiling to change
# this behavior if desired
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
AC_LANG_PUSH(C)
AC_CACHE_CHECK([for posix getpwnam_r],
		ac_cv_func_posix_getpwnam_r,
		[AC_RUN_IFELSE([AC_LANG_PROGRAM(
[[
#include <errno.h>
#include <pwd.h>
]],
[[
    char buffer[10000];
    struct passwd pwd, *pwptr = &pwd;
    int error;
    errno = 0;
    error = getpwnam_r ("", &pwd, buffer,
                        sizeof (buffer), &pwptr);
   return (error < 0 && errno == ENOSYS)
	   || error == ENOSYS;
]])],
	[ac_cv_func_posix_getpwnam_r=yes],
	[ac_cv_func_posix_getpwnam_r=no],
        [ac_cv_func_posix_getpwnam_r=yes]
)])
AC_LANG_POP(C)

if test "$ac_cv_func_posix_getpwnam_r" = yes; then
	AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
		[Have POSIX function getpwnam_r])
else
	AC_CACHE_CHECK([for nonposix getpwnam_r],
		ac_cv_func_nonposix_getpwnam_r,
		[AC_TRY_LINK([#include <pwd.h>],
                      	[char buffer[10000];
                       	struct passwd pwd;
                       	getpwnam_r ("", &pwd, buffer, 
                               		sizeof (buffer));],
			[ac_cv_func_nonposix_getpwnam_r=yes],
			[ac_cv_func_nonposix_getpwnam_r=no])])
		if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
		AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
			[Have non-POSIX function getpwnam_r])
	fi
fi

471 472 473 474 475

dnl ---------------------------------------------------------------------------
dnl - Check for utmp stuff
dnl ---------------------------------------------------------------------------

476 477 478 479 480
AC_CHECK_HEADERS(utmp.h utmpx.h libutil.h sys/param.h)
AC_CHECK_FUNC(getutmpx updwtmpx)
AC_CHECK_LIB(util,login)
AC_CHECK_LIB(util,logout)
GDM_CHECK_UTMP
481

482 483 484 485 486 487 488 489 490 491 492 493 494 495
AC_MSG_CHECKING(if utmpx structure has ut_syslen field)
AC_TRY_COMPILE([
  #include <utmpx.h>],[
  struct utmpx record;
  record.ut_syslen = sizeof (record.ut_host);
  ],
  have_ut_syslen=yes,
  have_ut_syslen=no
  )
if test x$have_ut_syslen = xyes; then
  AC_DEFINE(HAVE_UT_SYSLEN)
fi
AC_MSG_RESULT($have_ut_syslen)

496 497 498 499 500

dnl ---------------------------------------------------------------------------
dnl - Check for Xdmcp
dnl ---------------------------------------------------------------------------

501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532
XDMCP_LIBS=""
if test x$with_xdmcp != xno ; then
	xdmcp_save_CPPFLAGS="$CPPFLAGS"
	CPPFLAGS="$CPPFLAGS $X_CFLAGS"
	AC_CHECK_HEADER(X11/Xdmcp.h, [
		AC_CHECK_LIB(Xdmcp, XdmcpFlush, [
		     	AC_DEFINE(HAVE_LIBXDMCP)
		     	XDMCP_LIBS="-lXdmcp"
		     	XDMCP_SUPPORT=yes],,[$X_LIBS -lX11 $X_EXTRA_LIBS])
	],,[#include <X11/Xproto.h>])

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

if test x$XDMCP_SUPPORT = xyes ; then
	AM_CONDITIONAL(XDMCP_SUPPORT, true)
	GDMCHOOSER=gdmchooser
else
        # No need for TCP Wrappers in case XDMCP is disabled
        if test x$with_tcp_wrappers != xno ; then
	        echo "TCP wrappers not needed if XDMCP is not enabled"
        fi
	with_tcp_wrappers=no
	AM_CONDITIONAL(XDMCP_SUPPORT, false)
	GDMCHOOSER=
fi
AC_SUBST(GDMCHOOSER)

533 534 535 536 537

dnl ---------------------------------------------------------------------------
dnl - Check for TCP Wrappers for XDMCP access control
dnl ---------------------------------------------------------------------------

538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632
if test x$with_tcp_wrappers = xno ; then
	echo "TCP wrappers disabled"
else
  AC_MSG_CHECKING([whether to use TCP wrappers])
  LIBWRAP_PATH=""
  case "$host" in
    *-*-solaris*)
	if test -f /usr/sfw/lib/libwrap.so; then
		LIBWRAP_PATH=/usr/sfw/lib/libwrap.so
		echo "Found $LIBWRAP_PATH" 1>&5
	fi
	EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -L/usr/sfw/lib -R/usr/sfw/lib -lwrap"
	;;
    *)
        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
	;;
  esac

  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

  case "$host" in
    *-*-solaris*)
	# No need for extra libwrap checking.
	;;
    *)
	if test -n "$LIBWRAP_PATH"; then
	AC_CHECK_LIB(wrap, hosts_ctl, [
		EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lwrap"], [
		EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_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 also requires -lnsl)
		ORIG_LIBS="$LIBS"
		LIBS="$EXTRA_DAEMON_LIBS $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)
			EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS $LIB_NSL"
		else
			AC_MSG_RESULT(no)
		fi
	fi
	;;
   esac
fi

633 634 635 636

dnl ---------------------------------------------------------------------------
dnl - Check for Xinput
dnl ---------------------------------------------------------------------------
637 638 639 640 641 642 643 644

have_xinput=
AC_CHECK_LIB(Xi, XOpenDevice, XINPUT_LIBS=-lXi)
if test "x$XINPUT_LIBS" = x; then
  save_LIBS="$LIBS"
  for xinputpath in $x_libraries /usr/X11R6/lib /usr/openwin/lib; do
    LIBS="-L$xinputpath -lXi"
    case "$host" in
645
       *solaris*) XINPUT_RPATH_FLAGS="-R$xinputpath"
646 647 648
       ;;
    esac
    AC_MSG_CHECKING(for -lXi in $xinputpath)
649
    AC_TRY_LINK([], [XOpenDevice()], [
650 651 652 653 654 655 656
	AC_MSG_RESULT(yes)
	XINPUT_LIBS="$XINPUT_RPATH_FLAGS -L$xinputpath -lXi"
        LIBS="$save_LIBS"
	break],[AC_MSG_RESULT(no)])
  done
  if test "x$XINPUT_LIBS" = x; then
    AC_MSG_ERROR(Couldn't find the XInput library. Check config.log for details)
657
  fi
658 659 660 661 662 663 664
fi
AC_CHECK_HEADER(X11/extensions/XInput.h, have_xinput=yes)
if test "x$have_xinput" = xyes; then
   AC_DEFINE(HAVE_XINPUT)
   X_EXTRA_LIBS="$X_EXTRA_LIBS $XINPUT_LIBS"
fi

665 666 667 668 669

dnl ---------------------------------------------------------------------------
dnl - Check for Xinerama
dnl ---------------------------------------------------------------------------

670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733
# X11 Xinerama extension
# Check for Xinerama extension (Solaris impl or Xfree impl)
xinerama_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"

# Check for defopen
#
if test -f /etc/default/login; then
  AC_CHECK_LIB(cmd, defopen, use_defopen=yes, use_defopen=no)
  if test "x$use_defopen" = "xyes"; then
    EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lcmd"
    AC_DEFINE(HAVE_DEFOPEN)
  fi
fi

ALL_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"

if test ! x$with_xinerama = xno ; then
  case "$host" in
    *-*-solaris*)
	# Check for solaris
	use_solaris_xinerama=yes
	AC_CHECK_LIB(Xext, XineramaGetInfo,
                     use_solaris_xinerama=yes, use_solaris_xinerama=no,
                     $ALL_X_LIBS)
	if test "x$use_solaris_xinerama" = "xyes"; then
            AC_CHECK_HEADER(X11/extensions/xinerama.h,
                            if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
 				X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
                            fi
                            AC_DEFINE(HAVE_SOLARIS_XINERAMA)
                            AC_DEFINE(HAVE_XINERAMA)
		     	    XINERAMA_LIBS=""
		     	    XINERAMA_SUPPORT=yes,
                            use_solaris_xinerama=no,
                            [#include <X11/Xlib.h>])
	fi
        AC_MSG_CHECKING(for Xinerama support on Solaris)
	AC_MSG_RESULT($use_solaris_xinerama);
	;;
    *)
      	# Check for XFree
	use_xfree_xinerama=yes
	AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
            [AC_CHECK_HEADER(X11/extensions/Xinerama.h,
                             if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
  				 X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
                             fi
                             AC_DEFINE(HAVE_XFREE_XINERAMA)
                             AC_DEFINE(HAVE_XINERAMA)
		     	     XINERAMA_LIBS="-lXinerama"
		     	     XINERAMA_SUPPORT=yes,
                             use_xfree_xinerama=no,
                             [#include <X11/Xlib.h>])],
            use_xfree_xinerama=no, -lXext $ALL_X_LIBS)
	AC_MSG_CHECKING(for Xinerama support on XFree86)
	AC_MSG_RESULT($use_xfree_xinerama);
	;;
  esac
fi

AC_SUBST(XINERAMA_LIBS)
CPPFLAGS="$xinerama_save_cppflags"

734 735 736 737 738

dnl ---------------------------------------------------------------------------
dnl - Check for Solaris Trusted Extensions stuff
dnl ---------------------------------------------------------------------------

739 740 741 742 743 744 745 746 747 748 749 750 751 752 753
case "$host" in
*solaris*)
        AC_CHECK_HEADERS(sys/tsol/label_macro.h,
                AC_DEFINE(HAVE_TSOL, ,[Building with TSOL support]) found_tsol=yes,)
        ;;
*)
        ;;
esac

AM_CONDITIONAL(TSOL_DEFINED, test x$found_tsol = xyes)
if test "x$found_tsol" = "xyes" ; then
	EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lsecdb"
fi


754 755 756 757
dnl ---------------------------------------------------------------------------
dnl - Check for SELinux
dnl ---------------------------------------------------------------------------

758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778
if test "x$with_selinux" = "xyes" ; then
	echo "SELinux support requested (--with-selinux was given), checking prerequisites"
	if test -d /usr/local/selinux/include ; then
		echo "Found /usr/local/selinux/include, will look there for SELinux stuff as well"
		CFLAGS="$CFLAGS -I/usr/local/selinux/include"
		LDFLAGS="$LDFLAGS -L/usr/local/selinux/lib"
	fi
	AC_CHECK_HEADER(selinux/selinux.h)
	AC_CHECK_HEADER(selinux/get_context_list.h)
	AC_CHECK_LIB(attr,attr_get,/bin/true)
	# I'm anal and I don't know which versions have which symbols,
	# so I check for all the ones we use
	AC_CHECK_LIB(selinux,get_ordered_context_list,/bin/true)
	AC_CHECK_LIB(selinux,freecon,/bin/true)
	AC_CHECK_LIB(selinux,freeconary,/bin/true)
	AC_CHECK_LIB(selinux,setexeccon,/bin/true)
	AC_CHECK_LIB(selinux,is_selinux_enabled,/bin/true)
	AC_DEFINE(HAVE_SELINUX)
	EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lselinux -lattr"
fi

779
dnl ---------------------------------------------------------------------------
780
dnl - Check for ConsoleKit support
781 782
dnl ---------------------------------------------------------------------------

783 784 785 786 787 788 789
use_console_kit=no
if test "x$with_console_kit" != "xno" ; then
	use_console_kit=yes
	AC_DEFINE(WITH_CONSOLE_KIT, 1, [Define to enable ConsoleKit support])
fi
AM_CONDITIONAL(WITH_CONSOLE_KIT, test x$use_console_kit = xyes)
AC_SUBST(WITH_CONSOLE_KIT)
790 791

dnl ---------------------------------------------------------------------------
792
dnl - Check for D-Bus
793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808
dnl ---------------------------------------------------------------------------

dnl - Are we specifying a different dbus root ?
AC_ARG_WITH(dbus-sys,
        [AC_HELP_STRING([--with-dbus-sys=<dir>],
        [where D-BUS system.d directory is])])
AC_ARG_WITH(dbus-services,
        [AC_HELP_STRING([--with-dbus-services=<dir>],
        [where D-BUS services directory is])])
if ! test -z "$with_dbus_sys" ; then
        DBUS_SYS_DIR="$with_dbus_sys"
else
        DBUS_SYS_DIR="$sysconfdir/dbus-1/system.d"
fi
AC_SUBST(DBUS_SYS_DIR)

809
dnl ---------------------------------------------------------------------------
810
dnl - Check for ISO Codes
811 812 813 814 815 816 817 818 819 820
dnl ---------------------------------------------------------------------------

AC_MSG_CHECKING([whether iso-codes has iso-639 domain])
if $PKG_CONFIG --variable=domains iso-codes | grep 639 >/dev/null ; then
	AC_MSG_RESULT([yes])
else
	AC_MSG_RESULT([no])
fi
AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
ISO_CODES=iso-codes
821

822 823 824 825 826

dnl ---------------------------------------------------------------------------
dnl - Define some variables to represent the directories we use.
dnl ---------------------------------------------------------------------------

827 828 829
AC_SUBST(authdir, ${localstatedir}/gdm)
AC_SUBST(gdmlocaledir, ${gdmconfdir})
AC_SUBST(pixmapdir, ${datadir}/pixmaps)
830

831 832 833 834 835 836 837 838 839
AC_ARG_WITH(log-dir,    [  --with-log-dir=<file>     log dir])

if ! test -z "$with_log_dir"; then
   GDM_LOG_DIR=$with_log_dir
else
   GDM_LOG_DIR=/var/log/gdm
fi
AC_SUBST(logdir, $GDM_LOG_DIR)

840 841
withval=""
AC_ARG_WITH(at-bindir,
842
[  --with-at-bindir=<PATH>   PATH to Accessible Technology programs [default=BINDIR]],)
843 844 845 846

if test x$withval != x; then
	AT_BINDIR="$withval"
else
847
	AT_BINDIR='${bindir}'
848 849 850 851 852
fi

AC_SUBST(AT_BINDIR)

withval=""
853 854
AC_ARG_WITH(defaults_conf,
[  --with-defaults-conf=<FILENAME>   FILENAME to give to defaults file [default=DATADIR/gdm/defaults.conf]],)
855 856

if test x$withval != x; then
857
	GDM_DEFAULTS_CONF="$withval"
858
else
859
	GDM_DEFAULTS_CONF='${datadir}/gdm/defaults.conf'
860 861
fi

862 863 864 865
AC_SUBST(GDM_DEFAULTS_CONF)

withval=""
AC_ARG_WITH(custom_conf,
866
[  --with-custom-conf=<FILENAME>   FILENAME to give to custom configuration file [default=GDMCONFDIR/custom.conf]],)
867 868 869 870

if test x$withval != x; then
	GDM_CUSTOM_CONF="$withval"
else
871
	GDM_CUSTOM_CONF='${gdmconfdir}/custom.conf'
872 873 874
fi

AC_SUBST(GDM_CUSTOM_CONF)
875
AC_SUBST(GDM_OLD_CONF, '${gdmconfdir}/gdm.conf')
876

877 878 879
dnl ---------------------------------------------------------------------------
dnl - Check for XEvIE extension support
dnl ---------------------------------------------------------------------------
880

881 882 883 884 885 886 887 888 889 890 891 892 893
AC_ARG_WITH(xevie,
  [  --with-xevie=[yes/no]  Add XEvIE Xserver extension support [default=no]],,
  with_xevie=no)

if test x$with_xevie != xno ; then
	XEVIE_OPTION="+extension XEVIE"
else
	XEVIE_OPTION=""
fi

AC_SUBST(XEVIE_OPTION)
AC_DEFINE_UNQUOTED(XEVIE_OPTION,"$XEVIE_OPTION")

894 895 896 897 898

dnl ---------------------------------------------------------------------------
dnl - Check for Solaris fbconsole
dnl ---------------------------------------------------------------------------

899
AC_MSG_CHECKING(for Solaris fbconsole)
900 901 902 903 904 905 906
if test -x /usr/openwin/bin/fbconsole; then
   AC_DEFINE(HAVE_FBCONSOLE)
   AC_MSG_RESULT(yes)
else
   AC_MSG_RESULT(no)
fi

907 908 909 910
dnl ---------------------------------------------------------------------------
dnl - Check for audit framework
dnl ---------------------------------------------------------------------------

911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938
# Check for Solaris auditing API
# Note, Solaris auditing not supported for Solaris 9 or earlier and
# should not be used on these versions of Solaris if auditing is
# required.  Solaris auditing is only supported on systems that
# support the ADT_USER enumeration value.
#
AC_MSG_CHECKING(for Solaris auditing API)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <bsm/adt.h>
adt_user_context = ADT_USER;
]], [[]])], [ check_sun_audit=yes ], [ check_sun_audit=no ])

if test ${check_sun_audit} = yes
then
   AC_DEFINE(HAVE_ADT)
   EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lbsm"
   AC_MSG_RESULT(yes)
else
   AC_MSG_RESULT(no)
fi

# Check for Solaris logindevperm support
#
AC_MSG_CHECKING(for Solaris di_devperm_login)
AC_CHECK_LIB(devinfo, di_devperm_login, [
		     	AC_DEFINE(HAVE_LOGINDEVPERM)
			    EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -ldevinfo" ])

939 940 941 942 943 944 945 946
# Check for RBAC support (chkauthattr
#
AC_MSG_CHECKING(for RBAC support - chkauthattr)
AC_CHECK_LIB(secdb, chkauthattr, [
		     	AC_DEFINE(HAVE_CHKAUTHATTR)
			    EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lsecdb"
			    EXTRA_GREETER_LIBS="$EXTRA_GREETER_LIBS -lsecdb"])

947 948 949 950 951

dnl ---------------------------------------------------------------------------
dnl - Check for Halt, and Reboot commands
dnl ---------------------------------------------------------------------------

952 953 954 955
# Define different Halt, and Reboot commands differently for Solaris.
#
# On Solaris/bin is a symlink to /usr/bin, so don't include it in
# GDM_USER_PATH.
956
GDM_USER_PATH=""
957
GDM_RBAC_SYSCMD_KEYS=""
958

959 960
case "$host" in
*solaris*)
961
        AC_CHECK_LIB(resolv, daemon, [EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lresolv"])
962 963 964 965 966 967
        GDM_USER_PATH="/usr/bin"
        HALT_COMMAND="/sbin/init 5"
        REBOOT_COMMAND="/sbin/init 6"
        SUSPEND_COMMAND="/usr/openwin/bin/sys-suspend -n"
        XSESSION_SHELL=/bin/ksh
        SOUND_PROGRAM=/usr/bin/audioplay
968
        GDM_RBAC_SYSCMD_KEYS="HALT:solaris.system.shutdown;REBOOT:solaris.system.shutdown"
969
        ;;
970 971 972 973 974 975 976 977
*freebsd*)
	GDM_USER_PATH="/bin:/usr/bin"
	HALT_COMMAND="/sbin/shutdown -p now;/usr/sbin/shutdown -p now"
	REBOOT_COMMAND="/sbin/shutdown -r now;/usr/sbin/shutdown -r now"
	SUSPEND_COMMAND="/usr/sbin/zzz"
	XSESSION_SHELL=/bin/sh
	SOUND_PROGRAM=
	;;
978 979 980 981 982 983 984 985 986 987
*)
        GDM_USER_PATH="/bin:/usr/bin"
        HALT_COMMAND="/usr/bin/poweroff;/sbin/poweroff;/sbin/shutdown -h now;/usr/sbin/shutdown -h now"
        REBOOT_COMMAND="/usr/bin/reboot;/sbin/reboot;/sbin/shutdown -r now;/usr/sbin/shutdown -r now"
        SUSPEND_COMMAND=""
        XSESSION_SHELL=/bin/sh
        SOUND_PROGRAM=/usr/bin/play
        ;;
esac

988 989 990 991 992 993 994 995 996 997 998 999
#
# Subst the extra libs
#
AC_SUBST(EXTRA_DAEMON_LIBS)
AC_SUBST(EXTRA_SLAVE_LIBS)
AC_SUBST(EXTRA_CHOOSER_LIBS)
AC_SUBST(EXTRA_XNEST_LIBS)
AC_SUBST(EXTRA_FLEXI_LIBS)
AC_SUBST(EXTRA_DYNAMIC_LIBS)
AC_SUBST(EXTRA_SETUP_LIBS)
AC_SUBST(EXTRA_GREETER_LIBS)

1000 1001 1002 1003
dnl ---------------------------------------------------------------------------
dnl - Check for X Server location
dnl ---------------------------------------------------------------------------

1004 1005 1006 1007
# First check with "! -h" for /usr/X11R6 and /usr/X11 since they often
# symlink to each other, and configure should use the more stable
# location (the real directory) if possible.
#
1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021
# On Solaris, the /usr/bin/Xserver script is used to decide whether to
# use Xsun or Xorg, so this is used on Solaris.
#
# When testing for /usr/X11R6, first check with "! -h" for /usr/X11R6
# and /usr/X11 since they often symlink to each other, and configure
# should use the more stable location (the real directory) if possible.
#
if test -x /usr/X11/bin/Xserver; then
   X_PATH="/usr/X11/bin"
   X_SERVER_PATH="/usr/X11/bin"
   X_SERVER="/usr/X11/bin/Xserver"
   GDM_USER_PATH="$GDM_USER_PATH:/usr/X11/bin"
   X_CONFIG_OPTIONS="-audit 0"
elif test ! -h /usr/X11R6 -a -x /usr/X11R6/bin/X; then
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038
   X_PATH="/usr/X11R6/bin"
   X_SERVER_PATH="/usr/X11R6/bin"
   X_SERVER="/usr/X11R6/bin/X"
   GDM_USER_PATH="$GDM_USER_PATH:/usr/X11R6/bin"
   X_CONFIG_OPTIONS="-audit 0"
elif test ! -h /usr/X11 -a -x /usr/X11/bin/X; then
   X_PATH="/usr/X11/bin"
   X_SERVER_PATH="/usr/X11/bin"
   X_SERVER="/usr/X11/bin/X"
   GDM_USER_PATH="$GDM_USER_PATH:/usr/X11/bin"
   X_CONFIG_OPTIONS="-audit 0"
elif test -x /usr/X11R6/bin/X; then
   X_PATH="/usr/X11R6/bin"
   X_SERVER_PATH="/usr/X11R6/bin"
   X_SERVER="/usr/X11R6/bin/X"
   GDM_USER_PATH="$GDM_USER_PATH:/usr/X11R6/bin"
   X_CONFIG_OPTIONS="-audit 0"
1039 1040 1041 1042 1043
elif test -x /usr/bin/Xorg; then
   X_PATH="/usr/bin"
   X_SERVER_PATH="/usr/bin"
   X_SERVER="/usr/bin/Xorg"
   X_CONFIG_OPTIONS="-audit 0"
1044 1045 1046 1047 1048 1049 1050
elif test -x /usr/X11/bin/X; then
   X_PATH="/usr/X11/bin"
   X_SERVER_PATH="/usr/X11/bin"
   X_SERVER="/usr/X11/bin/X"
   GDM_USER_PATH="$GDM_USER_PATH:/usr/X11/bin"
   X_CONFIG_OPTIONS="-audit 0"
elif test -x /usr/openwin/bin/Xsun; then
1051
   # Do not add /usr/openwin/bin here because on Solaris you need
1052 1053
   # /usr/openwin/bin in your PATH even if you are using the Xorg
   # Xserver.  We add this to the path below.
1054 1055 1056 1057 1058 1059 1060 1061 1062
   X_PATH="/usr/openwin/bin"
   X_SERVER_PATH="/usr/openwin/bin"
   X_SERVER="/usr/openwin/bin/Xsun"
   X_CONFIG_OPTIONS="-audit 0 -nobanner"
elif test -x /opt/X11R6/bin/X; then
   X_PATH="/opt/X11R6/bin"
   X_SERVER_PATH="/opt/X11R6/bin"
   X_SERVER="/opt/X11R6/bin/X"
   GDM_USER_PATH="$GDM_USER_PATH:/opt/X11R6/bin"
1063
   X_CONFIG_OPTIONS="-audit 0"
1064
elif test -x /usr/bin/X; then
1065 1066 1067 1068
   X_PATH="/usr/bin"
   X_SERVER_PATH="/usr/bin"
   X_SERVER="/usr/bin/X"
   X_CONFIG_OPTIONS="-audit 0"
1069 1070 1071 1072 1073 1074
else
   # what to do, what to do, this is wrong, but this just sets the
   # defaults, perhaps this user is cross compiling or some such
   X_PATH="/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin"
   X_SERVER_PATH="/usr/X11R6/bin"
   X_SERVER="/usr/X11R6/bin/X"
1075
   GDM_USER_PATH="$GDM_USER_PATH:/usr/bin/X11:/usr/X11R6/bin:/usr/local/bin:/opt/X11R6/bin"
1076 1077 1078
   X_CONFIG_OPTIONS="-audit 0"
fi

1079
# Don't add bindir to GDM_USER_PATH if it is already in the PATH.
1080
# If it is /bin or /usr/bin, for example.
1081
if test "x$real_gdm_prefix" != "x/" -a "x$real_gdm_prefix" != "x/usr"; then
1082
    GDM_USER_PATH="$GDM_USER_PATH:${bindir}"
1083 1084
fi

1085 1086 1087
dnl ---------------------------------------------------------------------------
dnl - Check for Xnest / Xephyr support
dnl ---------------------------------------------------------------------------
1088

1089 1090
# Use Xephyr if it is available.  It works better than Xnest since Xephyr
# supports the Xserver extensions, even if on a remote machine.
1091
#
1092
X_XNEST_UNSCALED_FONTPATH="true"
1093 1094 1095 1096 1097 1098 1099 1100 1101
if test -x $X_SERVER_PATH/Xephyr; then
    X_XNEST_CMD="$X_SERVER_PATH/Xephyr"
    X_XNEST_CONFIG_OPTIONS="-audit 0"
else
    if test -x /usr/openwin/bin/Xnest; then
        # If on Solaris, Xnest is only shipped with the Xsun Xserver, so
        # use this version.
        #
        X_XNEST_CMD="/usr/openwin/bin/Xnest"
1102
        X_XNEST_CONFIG_OPTIONS="-audit 0 -name Xnest -pn"
1103 1104 1105 1106 1107 1108 1109 1110
        X_XNEST_UNSCALED_FONTPATH="false"
    else
        if test -x $X_SERVER_PATH/Xnest; then
            X_XNEST_CMD="$X_SERVER_PATH/Xnest"
            X_XNEST_CONFIG_OPTIONS="-audit 0 -name Xnest"
        fi
    fi
fi
1111

1112 1113 1114 1115
# Set POST_PATH after doing system specific case above just in case
# any platforms want to update the PATH for a specific OS or distro.
# None currently, but might be useful.
#
1116 1117 1118 1119
if test "x$USER_POST_PATH" != "x"; then
   GDM_USER_PATH="$GDM_USER_PATH:$USER_POST_PATH"
fi

1120
dnl ---------------------------------------------------------------------------
1121
dnl - Expand vars
1122 1123 1124 1125 1126 1127 1128 1129 1130 1131
dnl ---------------------------------------------------------------------------

AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
AS_AC_EXPAND(DATADIR, $datadir)
AS_AC_EXPAND(BINDIR, $bindir)
AS_AC_EXPAND(SBINDIR, $sbindir)
AS_AC_EXPAND(LIBDIR, $libdir)
AS_AC_EXPAND(LIBEXECDIR, $libexecdir)

1132 1133 1134
dnl ---------------------------------------------------------------------------
dnl - PID file
dnl ---------------------------------------------------------------------------
1135

1136 1137 1138 1139 1140
AC_ARG_WITH(pid-file,    [  --with-pid-file=<file>     pid file])

if ! test -z "$with_pid_file"; then
   GDM_PID_FILE=$with_pid_file
else
1141
   GDM_PID_FILE=/var/run/gdm.pid
1142 1143 1144 1145 1146 1147
fi

AC_SUBST(GDM_PID_FILE)
AC_DEFINE_UNQUOTED(GDM_PID_FILE, "$GDM_PID_FILE", [pid file])

dnl ---------------------------------------------------------------------------
1148
dnl - Allow configure to specify RBAC keys.
1149
dnl ---------------------------------------------------------------------------
1150

1151 1152 1153 1154
AC_ARG_WITH(rbac-system-command-keys,    [  --with-rbac-system-command-keys=<keys>     RBAC system command keys])

if ! test -z "$with_system_command_keys"; then
   GDM_RBAC_SYSCMD_KEYS=$with_system_command_keys
1155
fi
1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173

dnl ---------------------------------------------------------------------------
dnl - Finish
dnl ---------------------------------------------------------------------------


# Turn on the additional warnings last, so -Werror doesn't affect other tests.

AC_ARG_ENABLE(more-warnings,
	[AC_HELP_STRING([--enable-more-warnings],
	[Maximum compiler warnings])],
	set_more_warnings="$enableval",[
        	if test -d $srcdir/.svn; then
        		set_more_warnings=yes
              	else
                  	set_more_warnings=no
              	fi
        ])
1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202
AC_MSG_CHECKING(for more warnings)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
        AC_MSG_RESULT(yes)
        CFLAGS="\
        -Wall \
        -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
        -Wnested-externs -Wpointer-arith \
        -Wcast-align -Wsign-compare \
        $CFLAGS"

        for option in -Wno-strict-aliasing -Wno-sign-compare; do
                SAVE_CFLAGS="$CFLAGS"
                CFLAGS="$CFLAGS $option"
                AC_MSG_CHECKING([whether gcc understands $option])
                AC_TRY_COMPILE([], [],
                        has_option=yes,
                        has_option=no,)
                if test $has_option = no; then
                        CFLAGS="$SAVE_CFLAGS"
                fi
                AC_MSG_RESULT($has_option)
                unset has_option
                unset SAVE_CFLAGS
        done
        unset option
else
        AC_MSG_RESULT(no)
fi

1203
#
1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217
# Enable Debug
#
AC_ARG_ENABLE(debug,
	[AC_HELP_STRING([--enable-debug],
	[turn on debugging])],
	, enable_debug=yes)
if test "$enable_debug" = "yes"; then
	DEBUG_CFLAGS="-DG_ENABLE_DEBUG"
else
	if test "x$enable_debug" = "xno"; then
		DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
  	else
    		DEBUG_CFLAGS=""
  	fi
1218
fi
1219
AC_SUBST(DEBUG_CFLAGS)
1220

1221 1222
# Set configuration choices.
#
1223 1224 1225 1226 1227 1228 1229 1230 1231
AC_SUBST(HALT_COMMAND)
AC_DEFINE_UNQUOTED(HALT_COMMAND,"$HALT_COMMAND")
AC_SUBST(REBOOT_COMMAND)
AC_DEFINE_UNQUOTED(REBOOT_COMMAND,"$REBOOT_COMMAND")
AC_SUBST(SUSPEND_COMMAND)
AC_DEFINE_UNQUOTED(SUSPEND_COMMAND,"$SUSPEND_COMMAND")
AC_SUBST(XSESSION_SHELL)
AC_DEFINE_UNQUOTED(XSESSION_SHELL,"$XSESSION_SHELL")
AC_SUBST(GDM_USER_PATH)
1232
AC_DEFINE_UNQUOTED(GDM_USER_PATH,"$GDM_USER_PATH")
1233 1234
AC_SUBST(SOUND_PROGRAM)
AC_DEFINE_UNQUOTED(SOUND_PROGRAM,"$SOUND_PROGRAM")
1235 1236
AC_SUBST(GDM_RBAC_SYSCMD_KEYS)
AC_DEFINE_UNQUOTED(GDM_RBAC_SYSCMD_KEYS,"$GDM_RBAC_SYSCMD_KEYS")
1237 1238 1239 1240 1241 1242 1243 1244 1245

AC_SUBST(X_PATH)
AC_SUBST(X_SERVER)
AC_SUBST(X_SERVER_PATH)
AC_SUBST(X_CONFIG_OPTIONS)
AC_DEFINE_UNQUOTED(X_SERVER,"$X_SERVER")
AC_DEFINE_UNQUOTED(X_SERVER_PATH,"$X_SERVER_PATH")
AC_DEFINE_UNQUOTED(X_CONFIG_OPTIONS,"$X_CONFIG_OPTIONS", Options used when launching xserver)

1246 1247 1248 1249 1250 1251 1252
AC_SUBST(X_XNEST_CMD)
AC_SUBST(X_XNEST_CONFIG_OPTIONS)
AC_SUBST(X_XNEST_UNSCALED_FONTPATH)
AC_DEFINE_UNQUOTED(X_XNEST_CMD,"$X_XNEST_CMD")
AC_DEFINE_UNQUOTED(X_XNEST_CONFIG_OPTIONS,"$X_XNEST_CONFIG_OPTIONS")
AC_DEFINE_UNQUOTED(X_XNEST_UNSCALED_FONTPATH,"$X_XNEST_UNSCALED_FONTPATH")

1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267
## 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)

AC_OUTPUT([
Makefile
daemon/Makefile
William Jon McCann's avatar
William Jon McCann committed
1268
libgreeter/Makefile
1269
gui/Makefile
1270
gui/simple-greeter/Makefile
William Jon McCann's avatar
William Jon McCann committed
1271
gui/simple-greeter/libnotificationarea/Makefile
1272
gui/simple-chooser/Makefile
1273
utils/Makefile
1274
data/Makefile
William Jon McCann's avatar
William Jon McCann committed
1275 1276 1277 1278 1279
data/faces/Makefile
data/pixmaps/Makefile
data/pixmaps/16x16/Makefile
data/pixmaps/32x32/Makefile
data/pixmaps/48x48/Makefile
1280
config/Makefile
1281
common/Makefile
1282
po/Makefile.in
1283 1284 1285 1286 1287
config/Init
config/PreSession
config/PostSession
])

1288 1289 1290
dnl ---------------------------------------------------------------------------
dnl - Show summary
dnl ---------------------------------------------------------------------------
1291

1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320
echo "
                    GDM $VERSION
                    ============

	prefix:                   ${prefix}
	exec_prefix:              ${exec_prefix}
        libdir:                   ${libdir}
        bindir:                   ${bindir}
        sbindir:                  ${sbindir}
        sysconfdir:               ${sysconfdir}
        sysconfsubdir:            ${sysconfsubdir}
        gdmconfdir:               ${gdmconfdir}
        dmconfdir:                ${dmconfdir}
        localstatedir:            ${localstatedir}
        datadir:                  ${datadir}
	source code location:	  ${srcdir}
	compiler:		  ${CC}
	cflags:		          ${CFLAGS}
        Maintainer mode:          ${USE_MAINTAINER_MODE}

        dbus-1 system.d dir:      ${DBUS_SYS_DIR}
        PAM prefix:               ${PAM_PREFIX}
        X server:                 ${X_SERVER}
"

dnl TCP Wrappers support?
if test x"$LIBWRAP_PATH" = x ; then
	echo \
"        TCP Wrappers support:     no"
1321
else
1322
"        TCP Wrappers support:     yes"
1323 1324
fi

1325 1326 1327 1328 1329 1330 1331
echo \
"        Xinerama support:         ${XINERAMA_SUPPORT}
        XDMCP support:            ${XDMCP_SUPPORT}
        SELinux support:          ${with_selinux}
        Solaris TSOL support:     ${found_tsol}
        ConsoleKit support:       ${use_console_kit}
"