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.
This commit is contained in:
Harald Welte 2010-02-20 20:14:01 +01:00
parent 75135413cb
commit 7756235562
4 changed files with 15 additions and 0 deletions

View File

@ -14,6 +14,7 @@ AC_PROG_LIBTOOL
dnl checks for header files dnl checks for header files
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS(execinfo.h sys/select.h)
# The following test is taken from WebKit's webkit.m4 # The following test is taken from WebKit's webkit.m4
saved_CFLAGS="$CFLAGS" saved_CFLAGS="$CFLAGS"

View File

@ -31,6 +31,8 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include "../config.h"
/* GSM 03.38 6.2.1 Charachter packing */ /* GSM 03.38 6.2.1 Charachter packing */
int gsm_7bit_decode(char *text, const uint8_t *user_data, uint8_t length) int gsm_7bit_decode(char *text, const uint8_t *user_data, uint8_t length)
{ {
@ -190,6 +192,7 @@ uint8_t dbm2rxlev(int dbm)
return rxlev; return rxlev;
} }
#ifdef HAVE_EXECINFO_H
#include <execinfo.h> #include <execinfo.h>
void generate_backtrace() void generate_backtrace()
{ {
@ -209,3 +212,4 @@ void generate_backtrace()
free(strings); free(strings);
} }
#endif

View File

@ -23,6 +23,8 @@
#include <osmocore/linuxlist.h> #include <osmocore/linuxlist.h>
#include <osmocore/timer.h> #include <osmocore/timer.h>
#ifdef HAVE_SYS_SELECT_H
static int maxfd = 0; static int maxfd = 0;
static LLIST_HEAD(bsc_fds); static LLIST_HEAD(bsc_fds);
static int unregistered_count; static int unregistered_count;
@ -122,3 +124,5 @@ restart:
} }
return work; return work;
} }
#endif /* _HAVE_SYS_SELECT_H */

View File

@ -23,6 +23,8 @@
#include <osmocore/timer.h> #include <osmocore/timer.h>
#include <osmocore/select.h> #include <osmocore/select.h>
#include "../config.h"
static void timer_fired(unsigned long data); static void timer_fired(unsigned long data);
static struct timer_list timer_one = { static struct timer_list timer_one = {
@ -64,7 +66,11 @@ int main(int argc, char** argv)
bsc_schedule_timer(&timer_two, 5, 0); bsc_schedule_timer(&timer_two, 5, 0);
bsc_schedule_timer(&timer_three, 4, 0); bsc_schedule_timer(&timer_three, 4, 0);
#ifdef HAVE_SYS_SELECT_H
while (1) { while (1) {
bsc_select_main(0); bsc_select_main(0);
} }
#else
printf("Select not supported on this platform!\n");
#endif
} }