Commit 800f55f8 authored by Alan Coopersmith's avatar Alan Coopersmith

Replace hardcoded _XOPEN_SOURCE=500 with AC_USE_SYSTEM_EXTENSIONS

-D_XOPEN_SOURCE was originally added for Linux in commit e7510863
and then updated to -D_XOPEN_SOURCE=500 in commit e1a00221 to
expose strdup() in glibc headers.

As noted in bug 47792 though, the posix_openpt() function is not
visible unless that's raised to 600.

Instead of continually chasing the standards ourselves, switch to letting
autoconf handle that for us.
Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau's avatarJulien Cristau <jcristau@debian.org>
Reviewed-by: default avatarMatthieu Herrb <matthieu.herrb@laas.fr>
parent 445863f8
......@@ -25,7 +25,6 @@ bin_PROGRAMS = luit
AM_CFLAGS = \
$(CWARNFLAGS) \
$(LUIT_CFLAGS) \
$(OS_CFLAGS) \
-DLOCALE_ALIAS_FILE=\"$(LOCALEALIASFILE)\"
luit_LDADD = $(LUIT_LIBS)
......
......@@ -26,6 +26,7 @@ AC_INIT([luit], [1.1.1],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [luit])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_USE_SYSTEM_EXTENSIONS
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
......@@ -37,9 +38,6 @@ m4_ifndef([XORG_MACROS_VERSION],
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
AC_CANONICAL_HOST
AC_CHECK_HEADERS([pty.h stropts.h sys/param.h sys/select.h])
AC_CHECK_FUNCS([select grantpt posix_openpt])
......@@ -57,23 +55,16 @@ PKG_CHECK_MODULES(LUIT, fontenc)
PKG_CHECK_EXISTS(x11, [],
[AC_MSG_WARN([libX11 not found. luit may not be able to find locale aliases without it.])])
AC_CANONICAL_HOST
case $host_os in
# darwin has poll() but can't be used to poll character devices (atleast through SnowLeopard)
darwin*)
OS_CFLAGS=
;;
linux*)
AC_CHECK_HEADERS([poll.h])
AC_CHECK_FUNCS([poll])
OS_CFLAGS="-D_XOPEN_SOURCE=500"
;;
*)
AC_CHECK_HEADERS([poll.h])
AC_CHECK_FUNCS([poll])
OS_CFLAGS=
;;
esac
AC_SUBST(OS_CFLAGS)
AC_CHECK_HEADERS([pty.h stropts.h sys/ioctl.h sys/param.h sys/poll.h sys/select.h sys/time.h termios.h])
AC_CHECK_FUNCS([grantpt putenv select strdup])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment