[vinagre] Only compile pty-open.c if getpt() is available



commit 3ddb7f54d2df3a80f54fb85082f2edeb33f948df
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Thu Jun 2 19:54:19 2011 +0200

    Only compile pty-open.c if getpt() is available
    
    Signed-off-by: David King <amigadave amigadave com>

 Makefile.am  |    9 +++++++--
 configure.ac |    2 ++
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 361a68c..077f051 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -55,7 +55,6 @@ noinst_vinagreh_headers = \
 	vinagre/view/drawer.h \
 	vinagre/view/ovBox.h \
 	vinagre/vinagre-window-private.h \
-	vinagre/pty_open.h \
 	vinagre/vinagre-bookmarks-entry.h \
 	vinagre/vinagre-bookmarks.h \
 	vinagre/vinagre-bookmarks-migration.h \
@@ -105,13 +104,19 @@ handwritten_sources = \
 	vinagre/vinagre-tab.c \
 	vinagre/vinagre-utils.vala \
 	vinagre/vinagre-window.c \
-	vinagre/pty_open.c \
 	vinagre/vinagre-ssh.c \
 	vinagre/vinagre-cache-prefs.c \
 	vinagre/vinagre-protocol.c \
 	vinagre/vinagre-plugins-engine.c \
 	$(ifaddrs_sources)
 
+if VINAGRE_PTY_OPEN
+noinst_vinagreh_headers += \
+	vinagre/pty_open.h
+handwritten_sources += \
+	vinagre/pty_open.c
+endif
+
 libvinagre_la_SOURCES = \
 	$(handwritten_sources)
 
diff --git a/configure.ac b/configure.ac
index b53a067..ffb3c3a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,6 +127,8 @@ AC_TYPE_UINT64_T
 # Checks for library functions. See vinagre/pty_open.c for usage.
 AC_CHECK_FUNCS([getpt posix_openpt grantpt unlockpt ptsname ptsname_r])
 
+AM_CONDITIONAL([VINAGRE_PTY_OPEN], [test "x$ac_cv_func_getpt" = xyes])
+
 AC_SEARCH_LIBS([strerror], [cposix])
 
 # Check for Avahi.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]