configure.ac 3.21 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
dnl  Copyright 2005 Red Hat, Inc.
dnl 
dnl  Permission to use, copy, modify, distribute, and sell this software and its
dnl  documentation for any purpose is hereby granted without fee, provided that
dnl  the above copyright notice appear in all copies and that both that
dnl  copyright notice and this permission notice appear in supporting
dnl  documentation, and that the name of Red Hat not be used in
dnl  advertising or publicity pertaining to distribution of the software without
dnl  specific, written prior permission.  Red Hat makes no
dnl  representations about the suitability of this software for any purpose.  It
dnl  is provided "as is" without express or implied warranty.
dnl 
dnl  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
dnl  EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
dnl  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
dnl  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
dnl  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dnl  PERFORMANCE OF THIS SOFTWARE.
dnl
dnl Process this file with autoconf to create configure.

23
# Initialize Autoconf
24
AC_PREREQ([2.60])
Alan Coopersmith's avatar
Alan Coopersmith committed
25
AC_INIT([luit], [1.1.1],
Alan Coopersmith's avatar
Alan Coopersmith committed
26
	[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [luit])
27 28
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
29
AC_USE_SYSTEM_EXTENSIONS
30 31

# Initialize Automake
32
AM_INIT_AUTOMAKE([foreign dist-bzip2])
33

34
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
35
m4_ifndef([XORG_MACROS_VERSION],
36 37
          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.8)
38
XORG_DEFAULT_OPTIONS
39

40
AC_ARG_WITH(localealiasfile,
41
        AS_HELP_STRING([--with-localealiasfile=<path>],
42
                       [The locale alias file (default: ${datadir}/X11/locale/locale.alias)]),
43
        [LOCALEALIASFILE="$withval"],
44
        [LOCALEALIASFILE=${datadir}/X11/locale/locale.alias])
45 46
AC_SUBST([LOCALEALIASFILE])

47
# Checks for pkg-config packages
48 49 50 51 52
PKG_CHECK_MODULES(LUIT, fontenc)

# We don't link against libX11, just use its locale.alias data file
PKG_CHECK_EXISTS(x11, [],
	[AC_MSG_WARN([libX11 not found.  luit may not be able to find locale aliases without it.])])
53

54
AC_CANONICAL_HOST
55
case $host_os in
56
    # darwin has poll() but can't be used to poll character devices (atleast through SnowLeopard)
57
    darwin*)
58 59
        ;;
    *)
60 61
        AC_CHECK_HEADERS([poll.h])
        AC_CHECK_FUNCS([poll])
62 63 64
        ;;
esac

65
AC_CHECK_HEADERS([pty.h stropts.h sys/ioctl.h sys/param.h sys/poll.h sys/select.h sys/time.h termios.h]) 
66
AC_CHECK_FUNCS([grantpt posix_openpt putenv select strdup])
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83

if test "x$ac_cv_func_grantpt" != "xyes" ; then
        AC_CHECK_LIB(util, openpty, [cf_have_openpty=yes],[cf_have_openpty=no])
        if test "$cf_have_openpty" = yes ; then
                LIBS="-lutil $LIBS"
                AC_DEFINE(HAVE_OPENPTY, 1, [Have openpty in libutil])
                AC_CHECK_HEADERS( \
                        util.h \
                        libutil.h \
                        pty.h \
                )
        fi
fi

CF_FUNC_POLL
CF_SIGWINCH

84 85 86 87
AC_CONFIG_FILES([Makefile
                 man/Makefile])

AC_OUTPUT