diff options
| author | Pavel Roskin <plroskin@gmail.com> | 2016-01-30 11:42:39 -0800 |
|---|---|---|
| committer | Pavel Roskin <plroskin@gmail.com> | 2016-01-30 17:18:52 -0800 |
| commit | 00e70a5c5450579145ef077340d8148a1ba3338c (patch) | |
| tree | 39f1a9cb809c04b92cba45c2035b355342a185ed | |
| parent | 334eeb970aeea2f4ca706eebd0326e9854e5d229 (diff) | |
| download | xrdp-proprietary-00e70a5c5450579145ef077340d8148a1ba3338c.tar.gz xrdp-proprietary-00e70a5c5450579145ef077340d8148a1ba3338c.zip | |
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.
| -rw-r--r-- | configure.ac | 16 | ||||
| -rw-r--r-- | genkeymap/Makefile.am | 7 | ||||
| -rw-r--r-- | sesman/chansrv/Makefile.am | 6 | ||||
| -rw-r--r-- | sesman/tools/Makefile.am | 8 |
4 files changed, 28 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 79e38d0d..cd873a68 100644 --- a/configure.ac +++ b/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"; diff --git a/genkeymap/Makefile.am b/genkeymap/Makefile.am index aed72512..25767395 100644 --- a/genkeymap/Makefile.am +++ b/genkeymap/Makefile.am @@ -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) diff --git a/sesman/chansrv/Makefile.am b/sesman/chansrv/Makefile.am index 1a0be24c..45397b73 100644 --- a/sesman/chansrv/Makefile.am +++ b/sesman/chansrv/Makefile.am @@ -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) diff --git a/sesman/tools/Makefile.am b/sesman/tools/Makefile.am index fa4568ef..066039b0 100644 --- a/sesman/tools/Makefile.am +++ b/sesman/tools/Makefile.am @@ -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) |
