1a8fdb4bcSmrgdnl  Copyright 2005 Red Hat, Inc.
2a8fdb4bcSmrgdnl 
3a8fdb4bcSmrgdnl  Permission to use, copy, modify, distribute, and sell this software and its
4a8fdb4bcSmrgdnl  documentation for any purpose is hereby granted without fee, provided that
5a8fdb4bcSmrgdnl  the above copyright notice appear in all copies and that both that
6a8fdb4bcSmrgdnl  copyright notice and this permission notice appear in supporting
7a8fdb4bcSmrgdnl  documentation, and that the name of Red Hat not be used in
8a8fdb4bcSmrgdnl  advertising or publicity pertaining to distribution of the software without
9a8fdb4bcSmrgdnl  specific, written prior permission.  Red Hat makes no
10a8fdb4bcSmrgdnl  representations about the suitability of this software for any purpose.  It
11a8fdb4bcSmrgdnl  is provided "as is" without express or implied warranty.
12a8fdb4bcSmrgdnl 
13a8fdb4bcSmrgdnl  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
14a8fdb4bcSmrgdnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
15a8fdb4bcSmrgdnl  EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
16a8fdb4bcSmrgdnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
17a8fdb4bcSmrgdnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18a8fdb4bcSmrgdnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19a8fdb4bcSmrgdnl  PERFORMANCE OF THIS SOFTWARE.
20a8fdb4bcSmrgdnl
21a8fdb4bcSmrgdnl Process this file with autoconf to create configure.
22a8fdb4bcSmrg
2377683534SmrgAC_PREREQ([2.60])
244ed31819SmrgAC_INIT([luit], [1.1.1],
2577683534Smrg	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [luit])
26dbe7da2eSmrgAM_INIT_AUTOMAKE([foreign dist-bzip2])
27a8fdb4bcSmrgAM_MAINTAINER_MODE
28a8fdb4bcSmrg
2977683534Smrg# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
30dbe7da2eSmrgm4_ifndef([XORG_MACROS_VERSION],
3177683534Smrg          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
3277683534SmrgXORG_MACROS_VERSION(1.8)
33dbe7da2eSmrgXORG_DEFAULT_OPTIONS
34dbe7da2eSmrg
354ed31819SmrgAC_CONFIG_HEADERS([config.h])
36a8fdb4bcSmrg
37a8fdb4bcSmrgAC_CANONICAL_HOST
38a8fdb4bcSmrg
39dbe7da2eSmrg
40dbe7da2eSmrgAC_CHECK_HEADERS([pty.h stropts.h sys/param.h sys/select.h])
414ed31819SmrgAC_CHECK_FUNCS([select grantpt posix_openpt])
42a8fdb4bcSmrg
43a8fdb4bcSmrgAC_ARG_WITH(localealiasfile,
444ed31819Smrg        AS_HELP_STRING([--with-localealiasfile=<path>],
45a8fdb4bcSmrg                       [The locale alias file (default: ${datadir}/X11/locale/locale.alias)]),
46a8fdb4bcSmrg        [LOCALEALIASFILE="$withval"],
47a8fdb4bcSmrg        [LOCALEALIASFILE=${datadir}/X11/locale/locale.alias])
48a8fdb4bcSmrgAC_SUBST([LOCALEALIASFILE])
49a8fdb4bcSmrg
50a8fdb4bcSmrg# Checks for pkg-config packages
5177683534SmrgPKG_CHECK_MODULES(LUIT, fontenc)
5277683534Smrg
5377683534Smrg# We don't link against libX11, just use its locale.alias data file
5477683534SmrgPKG_CHECK_EXISTS(x11, [],
5577683534Smrg	[AC_MSG_WARN([libX11 not found.  luit may not be able to find locale aliases without it.])])
56a8fdb4bcSmrg
57a8fdb4bcSmrgcase $host_os in
58dbe7da2eSmrg    # darwin has poll() but can't be used to poll character devices (atleast through SnowLeopard)
59dbe7da2eSmrg    darwin*)
60dbe7da2eSmrg        OS_CFLAGS=
61dbe7da2eSmrg        ;;
62a8fdb4bcSmrg    linux*)
63dbe7da2eSmrg        AC_CHECK_HEADERS([poll.h])
64dbe7da2eSmrg        AC_CHECK_FUNCS([poll])
65a8fdb4bcSmrg        OS_CFLAGS="-D_XOPEN_SOURCE=500"
66a8fdb4bcSmrg        ;;
67a8fdb4bcSmrg    *)
68dbe7da2eSmrg        AC_CHECK_HEADERS([poll.h])
69dbe7da2eSmrg        AC_CHECK_FUNCS([poll])
70a8fdb4bcSmrg        OS_CFLAGS=
71a8fdb4bcSmrg        ;;
72a8fdb4bcSmrgesac
7377683534SmrgAC_SUBST(OS_CFLAGS)
7477683534Smrg
7577683534SmrgAC_CHECK_HEADERS([pty.h stropts.h sys/ioctl.h sys/param.h sys/poll.h sys/select.h sys/time.h termios.h]) 
7677683534SmrgAC_CHECK_FUNCS([grantpt putenv select strdup])
7777683534Smrg
7877683534Smrgif test "x$ac_cv_func_grantpt" != "xyes" ; then
7977683534Smrg        AC_CHECK_LIB(util, openpty, [cf_have_openpty=yes],[cf_have_openpty=no])
8077683534Smrg        if test "$cf_have_openpty" = yes ; then
8177683534Smrg                LIBS="-lutil $LIBS"
8277683534Smrg                AC_DEFINE(HAVE_OPENPTY, 1, [Have openpty in libutil])
8377683534Smrg                AC_CHECK_HEADERS( \
8477683534Smrg                        util.h \
8577683534Smrg                        libutil.h \
8677683534Smrg                        pty.h \
8777683534Smrg                )
8877683534Smrg        fi
8977683534Smrgfi
9077683534Smrg
9177683534SmrgCF_FUNC_POLL
9277683534SmrgCF_SIGWINCH
93a8fdb4bcSmrg
9477683534SmrgAC_CONFIG_FILES([Makefile
9577683534Smrg                 man/Makefile])
96a8fdb4bcSmrg
9777683534SmrgAC_OUTPUT
98