Not sure if this was an appropriate solution but when I peeked inside of /usr/local/lib/R/include/R_ext/eventloop.h
I saw the following in the include statements:
#ifndef R_EXT_EVENTLOOP_H
#define R_EXT_EVENTLOOP_H
#ifndef NO_C_HEADERS
#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h> /* for fd_set according to recent POSIX */
#endif
/* NOTE: Needed at least on FreeBSD so that fd_set is defined. */
# include <sys/types.h>
#endif
As you can see sys/select.h is only included conditional on some variable HAVE_SYS_SELECT_H. I took out this condition statement:
#ifndef R_EXT_EVENTLOOP_H
#define R_EXT_EVENTLOOP_H
#ifndef NO_C_HEADERS
# include <sys/select.h> /* for fd_set according to recent POSIX */
/* NOTE: Needed at least on FreeBSD so that fd_set is defined. */
# include <sys/types.h>
#endif
And the package compiled (and installed) successfully. If anyone has any insight into why this particular variable HAVE_SYS_SELECT_H
was not properly defined please let me know.