From fe2f7a3e5adfb6c6f7d235d21c98e15f4408e58a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 22 Aug 2018 16:08:07 +0200 Subject: [PATCH] configure.ac: add automake conditional "LINUX" --- Makefile.am | 10 +++++++--- configure.ac | 1 + src/system/EpollFD.cxx | 3 --- src/system/EventFD.cxx | 3 --- src/system/SignalFD.cxx | 3 --- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Makefile.am b/Makefile.am index ad9aa5f31..ebc306e77 100644 --- a/Makefile.am +++ b/Makefile.am @@ -617,12 +617,16 @@ libsystem_a_SOURCES = \ src/system/UniqueFileDescriptor.hxx \ src/system/Open.cxx src/system/Open.hxx \ src/system/EventPipe.cxx src/system/EventPipe.hxx \ - src/system/EventFD.cxx src/system/EventFD.hxx \ - src/system/SignalFD.cxx src/system/SignalFD.hxx \ - src/system/EpollFD.cxx src/system/EpollFD.hxx \ src/system/PeriodClock.hxx \ src/system/Clock.cxx src/system/Clock.hxx +if LINUX +libsystem_a_SOURCES += \ + src/system/EventFD.cxx src/system/EventFD.hxx \ + src/system/SignalFD.cxx src/system/SignalFD.hxx \ + src/system/EpollFD.cxx src/system/EpollFD.hxx +endif + # Event loop library libevent_a_SOURCES = \ diff --git a/configure.ac b/configure.ac index fb2a8fcab..1a94b9739 100644 --- a/configure.ac +++ b/configure.ac @@ -138,6 +138,7 @@ haiku*) ;; esac +AM_CONDITIONAL([LINUX], [test x$host_is_linux = xyes]) AM_CONDITIONAL([ANDROID], [test x$host_is_android = xyes]) AM_CONDITIONAL([HAVE_WINDOWS], [test x$host_is_windows = xyes]) diff --git a/src/system/EpollFD.cxx b/src/system/EpollFD.cxx index ce0d545ab..c06699527 100644 --- a/src/system/EpollFD.cxx +++ b/src/system/EpollFD.cxx @@ -28,7 +28,6 @@ */ #include "config.h" -#ifdef USE_EPOLL #include "EpollFD.hxx" #include "Error.hxx" @@ -38,5 +37,3 @@ EpollFD::EpollFD() if (!fd.IsDefined()) throw MakeErrno("epoll_create1() failed"); } - -#endif /* USE_EPOLL */ diff --git a/src/system/EventFD.cxx b/src/system/EventFD.cxx index 1c2e65d9d..8aeb0421c 100644 --- a/src/system/EventFD.cxx +++ b/src/system/EventFD.cxx @@ -28,7 +28,6 @@ */ #include "config.h" -#ifdef __linux__ #include "EventFD.hxx" #include "system/Error.hxx" #include "util/Compiler.h" @@ -60,5 +59,3 @@ EventFD::Write() noexcept gcc_unused ssize_t nbytes = fd.Write(&value, sizeof(value)); } - -#endif /* USE_EVENTFD */ diff --git a/src/system/SignalFD.cxx b/src/system/SignalFD.cxx index feea666fc..62af45549 100644 --- a/src/system/SignalFD.cxx +++ b/src/system/SignalFD.cxx @@ -28,7 +28,6 @@ */ #include "config.h" -#ifdef __linux__ #include "SignalFD.hxx" #include "Error.hxx" @@ -52,5 +51,3 @@ SignalFD::Read() noexcept ? info.ssi_signo : -1; } - -#endif /* __linux__ */