Use standard autotools means to detect X11
Use AC_PATH_XTRA to search for X11 in configure.ac. In Makefiles, add X_CFLAGS to AM_CFLAGS for the source compilation. Add X_LIBS to LDFLAGS. Add X_PRE_LIBS and X_EXTRA_LIBS to LDADD. With this patch, X Windows system is correctly detected on Mac OS X.
This commit is contained in:
parent
334eeb970a
commit
00e70a5c54
16
configure.ac
16
configure.ac
@ -199,16 +199,26 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# checking for Xlib, Xfixes
|
||||
AC_CHECK_HEADER([X11/Xlib.h], [],
|
||||
[AC_MSG_ERROR([please install libx11-dev or libX11-devel])])
|
||||
AC_PATH_XTRA
|
||||
if test "x$no_x" == "xyes"; then
|
||||
AC_MSG_ERROR([please install libx11-dev or libX11-devel])
|
||||
fi
|
||||
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $X_CFLAGS"
|
||||
|
||||
# checking for Xfixes
|
||||
AC_CHECK_HEADER([X11/extensions/Xfixes.h], [],
|
||||
[AC_MSG_ERROR([please install libx11-dev and libxfixes-dev or libXfixes-devel])],
|
||||
[#include <X11/Xlib.h>])
|
||||
|
||||
# checking for Xrandr
|
||||
AC_CHECK_HEADER([X11/extensions/Xrandr.h], [],
|
||||
[AC_MSG_ERROR([please install libxrandr-dev or libXrandr-devel])],
|
||||
[#include <X11/Xlib.h>])
|
||||
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
libdir="${libdir}/xrdp";
|
||||
if test "x${prefix}" = "xNONE" ; then
|
||||
sysconfdir="/etc";
|
||||
|
@ -1,9 +1,12 @@
|
||||
AM_CFLAGS = $(X_CFLAGS)
|
||||
|
||||
bin_PROGRAMS = \
|
||||
xrdp-genkeymap
|
||||
|
||||
xrdp_genkeymap_SOURCES = genkeymap.c evdev-map.c
|
||||
|
||||
xrdp_genkeymap_LDFLAGS = \
|
||||
$(X_LIBS)
|
||||
|
||||
xrdp_genkeymap_LDADD = \
|
||||
-L/usr/X11R6/lib \
|
||||
-lX11
|
||||
$(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS)
|
||||
|
@ -40,6 +40,8 @@ AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/common \
|
||||
$(EXTRA_INCLUDES)
|
||||
|
||||
AM_CFLAGS = $(X_CFLAGS)
|
||||
|
||||
sbin_PROGRAMS = \
|
||||
xrdp-chansrv
|
||||
|
||||
@ -60,10 +62,10 @@ xrdp_chansrv_SOURCES = \
|
||||
chansrv_common.c
|
||||
|
||||
xrdp_chansrv_LDFLAGS = \
|
||||
$(X_LIBS) \
|
||||
$(EXTRA_FLAGS)
|
||||
|
||||
xrdp_chansrv_LDADD = \
|
||||
-L/usr/X11R6/lib \
|
||||
$(top_builddir)/common/libcommon.la \
|
||||
-lX11 -lXfixes -lXrandr \
|
||||
$(X_PRE_LIBS) -lXfixes -lXrandr -lX11 $(X_EXTRA_LIBS) \
|
||||
$(EXTRA_LIBS)
|
||||
|
@ -9,6 +9,8 @@ AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/sesman/libscp \
|
||||
-I$(top_srcdir)/sesman
|
||||
|
||||
AM_CFLAGS = $(X_CFLAGS)
|
||||
|
||||
bin_PROGRAMS = \
|
||||
xrdp-sesrun \
|
||||
xrdp-sesadmin \
|
||||
@ -46,6 +48,8 @@ xrdp_sesadmin_LDADD = \
|
||||
$(top_builddir)/common/libcommon.la \
|
||||
$(top_builddir)/sesman/libscp/libscp.la
|
||||
|
||||
xrdp_xcon_LDFLAGS = \
|
||||
$(X_LIBS)
|
||||
|
||||
xrdp_xcon_LDADD = \
|
||||
-L/usr/X11R6/lib \
|
||||
-lX11
|
||||
$(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS)
|
||||
|
Loading…
Reference in New Issue
Block a user