make sure libosmocom builds when cross-compiling for ARM without OS

This is required to build the library and be able to use it from
within OsmocomBB.
diff --git a/libosmocore/configure.in b/libosmocore/configure.in
index b5898bd..a5c5f6b 100644
--- a/libosmocore/configure.in
+++ b/libosmocore/configure.in
@@ -14,6 +14,7 @@
 
 dnl checks for header files
 AC_HEADER_STDC
+AC_CHECK_HEADERS(execinfo.h sys/select.h)
 
 # The following test is taken from WebKit's webkit.m4
 saved_CFLAGS="$CFLAGS"
diff --git a/libosmocore/src/gsm_utils.c b/libosmocore/src/gsm_utils.c
index 85f7839..b0a66a6 100644
--- a/libosmocore/src/gsm_utils.c
+++ b/libosmocore/src/gsm_utils.c
@@ -31,6 +31,8 @@
 #include <stdio.h>
 #include <errno.h>
 
+#include "../config.h"
+
 /* GSM 03.38 6.2.1 Charachter packing */
 int gsm_7bit_decode(char *text, const uint8_t *user_data, uint8_t length)
 {
@@ -190,6 +192,7 @@
 	return rxlev;
 }
 
+#ifdef HAVE_EXECINFO_H
 #include <execinfo.h>
 void generate_backtrace()
 {
@@ -209,3 +212,4 @@
 
 	free(strings);
 }
+#endif
diff --git a/libosmocore/src/select.c b/libosmocore/src/select.c
index 46a0b96..4f5d7ed 100644
--- a/libosmocore/src/select.c
+++ b/libosmocore/src/select.c
@@ -23,6 +23,8 @@
 #include <osmocore/linuxlist.h>
 #include <osmocore/timer.h>
 
+#ifdef HAVE_SYS_SELECT_H
+
 static int maxfd = 0;
 static LLIST_HEAD(bsc_fds);
 static int unregistered_count;
@@ -122,3 +124,5 @@
 	}
 	return work;
 }
+
+#endif /* _HAVE_SYS_SELECT_H */
diff --git a/libosmocore/tests/timer/timer_test.c b/libosmocore/tests/timer/timer_test.c
index ec29ef0..f1b4ad7 100644
--- a/libosmocore/tests/timer/timer_test.c
+++ b/libosmocore/tests/timer/timer_test.c
@@ -23,6 +23,8 @@
 #include <osmocore/timer.h>
 #include <osmocore/select.h>
 
+#include "../config.h"
+
 static void timer_fired(unsigned long data);
 
 static struct timer_list timer_one = {
@@ -64,7 +66,11 @@
     bsc_schedule_timer(&timer_two, 5, 0);
     bsc_schedule_timer(&timer_three, 4, 0);
 
+#ifdef HAVE_SYS_SELECT_H
     while (1) {
         bsc_select_main(0);
     }
+#else
+    printf("Select not supported on this platform!\n");
+#endif
 }