Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the use of a third-party poll implementation #87

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions configure.ac
Expand Up @@ -117,6 +117,12 @@ AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Def

AC_CHECK_LIB([ncurses], [setupterm])

AC_ARG_VAR([poll_CFLAGS], [C compiler flags for poll])
AC_ARG_VAR([poll_LIBS], [linker flags for poll])
if test -z "$poll_LIBS"; then
AC_CHECK_LIB([poll], [poll], [poll_LIBS="-lpoll"])
fi

AC_CHECK_DECLS([__builtin_bswap64, __builtin_ctz])

AC_CHECK_DECL([mach_absolute_time],
Expand Down
16 changes: 8 additions & 8 deletions src/examples/Makefile.am
Expand Up @@ -14,12 +14,12 @@ decrypt_CPPFLAGS = -I$(srcdir)/../crypto
decrypt_LDADD = ../crypto/libmoshcrypto.a

parse_SOURCES = parse.cc
parse_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util
parse_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a -lutil $(BOOST_LDFLAGS)
parse_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util $(poll_CFLAGS)
parse_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a -lutil $(BOOST_LDFLAGS) $(poll_LIBS)

termemu_SOURCES = termemu.cc
termemu_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util -I$(srcdir)/../statesync -I../protobufs
termemu_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a ../statesync/libmoshstatesync.a ../protobufs/libmoshprotos.a -lutil $(BOOST_LDFLAGS) $(protobuf_LIBS)
termemu_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util -I$(srcdir)/../statesync -I../protobufs $(poll_CFLAGS)
termemu_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a ../statesync/libmoshstatesync.a ../protobufs/libmoshprotos.a -lutil $(BOOST_LDFLAGS) $(protobuf_LIBS) $(poll_LIBS)
if COND_THIRD_LIBSTDDJB
termemu_CPPFLAGS += -I$(top_srcdir)/third/libstddjb
termemu_LDADD += $(top_builddir)/third/libstddjb/libstddjb.a
Expand All @@ -29,12 +29,12 @@ else
endif

ntester_SOURCES = ntester.cc
ntester_CPPFLAGS = -I$(srcdir)/../util -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I$(srcdir)/../network -I$(srcdir)/../crypto -I../protobufs $(BOOST_CPPFLAGS)
ntester_LDADD = ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../network/libmoshnetwork.a ../crypto/libmoshcrypto.a ../protobufs/libmoshprotos.a -lutil -lm $(BOOST_LDFLAGS) $(protobuf_LIBS)
ntester_CPPFLAGS = -I$(srcdir)/../util -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I$(srcdir)/../network -I$(srcdir)/../crypto -I../protobufs $(BOOST_CPPFLAGS) $(poll_CFLAGS)
ntester_LDADD = ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../network/libmoshnetwork.a ../crypto/libmoshcrypto.a ../protobufs/libmoshprotos.a $(poll_LIBS) -lutil -lm $(BOOST_LDFLAGS) $(protobuf_LIBS)

benchmark_SOURCES = benchmark.cc
benchmark_CPPFLAGS = -I$(srcdir)/../util -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I../protobufs -I$(srcdir)/../frontend -I$(srcdir)/../crypto $(BOOST_CPPFLAGS) -I$(srcdir)/../network
benchmark_LDADD = ../frontend/terminaloverlay.o ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../protobufs/libmoshprotos.a ../network/libmoshnetwork.a ../crypto/libmoshcrypto.a ../util/libmoshutil.a -lutil -lm $(BOOST_LDFLAGS) $(protobuf_LIBS)
benchmark_CPPFLAGS = -I$(srcdir)/../util -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I../protobufs -I$(srcdir)/../frontend -I$(srcdir)/../crypto $(BOOST_CPPFLAGS) -I$(srcdir)/../network $(poll_CFLAGS)
benchmark_LDADD = ../frontend/terminaloverlay.o ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../protobufs/libmoshprotos.a ../network/libmoshnetwork.a ../crypto/libmoshcrypto.a ../util/libmoshutil.a $(poll_LIBS) -lutil -lm $(BOOST_LDFLAGS) $(protobuf_LIBS)
if COND_THIRD_LIBSTDDJB
benchmark_CPPFLAGS += -I$(top_srcdir)/third/libstddjb
benchmark_LDADD += $(top_builddir)/third/libstddjb/libstddjb.a
Expand Down
2 changes: 1 addition & 1 deletion src/examples/benchmark.cc
Expand Up @@ -24,7 +24,7 @@
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <poll.h>
#include <sys/poll.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <pwd.h>
Expand Down
2 changes: 1 addition & 1 deletion src/examples/ntester.cc
Expand Up @@ -18,7 +18,7 @@

#include <termios.h>
#include <unistd.h>
#include <poll.h>
#include <sys/poll.h>

#include "user.h"
#include "fatal_assert.h"
Expand Down
2 changes: 1 addition & 1 deletion src/examples/parse.cc
Expand Up @@ -23,7 +23,7 @@
#include <stdlib.h>
#include <signal.h>
#include <errno.h>
#include <poll.h>
#include <sys/poll.h>
#include <string.h>
#include <locale.h>
#include <wchar.h>
Expand Down
2 changes: 1 addition & 1 deletion src/examples/termemu.cc
Expand Up @@ -23,7 +23,7 @@
#include <stdlib.h>
#include <signal.h>
#include <errno.h>
#include <poll.h>
#include <sys/poll.h>
#include <string.h>
#include <locale.h>
#include <wchar.h>
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/Makefile.am
@@ -1,6 +1,6 @@
AM_CPPFLAGS = -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I$(srcdir)/../network -I$(srcdir)/../crypto -I../protobufs -I$(srcdir)/../util $(BOOST_CPPFLAGS) $(protobuf_CFLAGS)
AM_CPPFLAGS = -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I$(srcdir)/../network -I$(srcdir)/../crypto -I../protobufs -I$(srcdir)/../util $(BOOST_CPPFLAGS) $(protobuf_CFLAGS) $(poll_CFLAGS)
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) -fno-default-inline -pipe
LDADD = ../crypto/libmoshcrypto.a ../network/libmoshnetwork.a ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../util/libmoshutil.a ../protobufs/libmoshprotos.a -lm $(protobuf_LIBS)
LDADD = ../crypto/libmoshcrypto.a ../network/libmoshnetwork.a ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../util/libmoshutil.a ../protobufs/libmoshprotos.a $(poll_LIBS) -lm $(protobuf_LIBS)
if COND_THIRD_LIBSTDDJB
AM_CPPFLAGS += -I$(top_srcdir)/third/libstddjb
LDADD += $(top_builddir)/third/libstddjb/libstddjb.a
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mosh-server.cc
Expand Up @@ -25,7 +25,7 @@
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <poll.h>
#include <sys/poll.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <pwd.h>
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/stmclient.cc
Expand Up @@ -24,7 +24,7 @@
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <poll.h>
#include <sys/poll.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <pwd.h>
Expand Down