]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Default eloop to epoll on Solaris.
authorRoy Marples <roy@marples.name>
Thu, 13 Apr 2017 15:38:17 +0000 (16:38 +0100)
committerRoy Marples <roy@marples.name>
Thu, 13 Apr 2017 15:38:17 +0000 (16:38 +0100)
Fix eloop-bench to work on Solaris.

src/eloop.c
tests/eloop-bench/Makefile

index 4633c41f0593698c0cd9ce0e065461e9b8b7a44a..52b7e1b186bab4e7c60c6189bfaf8b88e6976009 100644 (file)
@@ -40,7 +40,7 @@
 #include <unistd.h>
 
 /* config.h should define HAVE_KQUEUE, HAVE_EPOLL, etc. */
-#ifdef HAVE_CONFIG_H
+#if defined(HAVE_CONFIG_H) && !defined(NO_CONFIG_H)
 #include "config.h"
 #endif
 
@@ -52,8 +52,8 @@
 /* Assume BSD has a working sys/queue.h and kqueue(2) interface. */
 #define HAVE_SYS_QUEUE_H
 #define HAVE_KQUEUE
-#elif defined(__linux__)
-/* Assume Linux has a working epoll(3) interface. */
+#elif defined(__linux__) || defined(__sun)
+/* Assume Linux and Solaris have a working epoll(3) interface. */
 #define HAVE_EPOLL
 #else
 /* pselect(2) is a POSIX standard. */
index 3e302a20b7e17c8a018d70085d562a96a033ecab..e3be36c8da4d94d6cf64920d5fd0d85462aadff5 100644 (file)
@@ -9,7 +9,8 @@ CFLAGS?=        -O2
 CSTD?=         c99
 CFLAGS+=       -std=${CSTD}
 
-CPPFLAGS=      -I${TOP} -I${TOP}/src -I${TOP}/compat
+CPPFLAGS+=     -DNO_CONFIG_H
+CPPFLAGS+=     -I${TOP} -I${TOP}/src -I${TOP}/compat
 
 # Default is to let eloop decide
 #CPPFLAGS+=    -DHAVE_KQUEUE
@@ -18,7 +19,7 @@ CPPFLAGS=     -I${TOP} -I${TOP}/src -I${TOP}/compat
 #CPPFLAGS+=    -DHAVE_EPOLL
 #CPPFLAGS+=    -DHAVE_PPOLL
 
-OBJS+=         ${SRCS:.c=.o}
+OBJS+=          ${SRCS:.c=.o}
 
 .c.o: Makefile
        ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@