mirror of https://gerrit.osmocom.org/libosmocore
fix libosmocore build for NuttX target
this fixes some compilation issues with libosmocore under NuttX, particularly as some #defines are missing or some header files are slightly different.
This commit is contained in:
parent
20144f7bc5
commit
e15ac060e7
|
@ -31,7 +31,7 @@ AC_SUBST(LTLDFLAGS_OSMOGSM)
|
||||||
|
|
||||||
dnl checks for header files
|
dnl checks for header files
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h)
|
AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h netinet/tcp.h)
|
||||||
# for src/conv.c
|
# for src/conv.c
|
||||||
AC_FUNC_ALLOCA
|
AC_FUNC_ALLOCA
|
||||||
AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
|
AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
|
||||||
|
|
|
@ -81,10 +81,16 @@ static void sighup_hdlr(int signal)
|
||||||
void osmo_init_ignore_signals(void)
|
void osmo_init_ignore_signals(void)
|
||||||
{
|
{
|
||||||
/* Signals that by default would terminate */
|
/* Signals that by default would terminate */
|
||||||
|
#ifdef SIGPIPE
|
||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
#endif
|
||||||
signal(SIGALRM, SIG_IGN);
|
signal(SIGALRM, SIG_IGN);
|
||||||
|
#ifdef SIGHUP
|
||||||
signal(SIGHUP, &sighup_hdlr);
|
signal(SIGHUP, &sighup_hdlr);
|
||||||
|
#endif
|
||||||
|
#ifdef SIGIO
|
||||||
signal(SIGIO, SIG_IGN);
|
signal(SIGIO, SIG_IGN);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Initialize the osmocom logging framework
|
/*! \brief Initialize the osmocom logging framework
|
||||||
|
|
|
@ -31,10 +31,12 @@
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include <netinet/tcp.h>
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#ifdef HAVE_NETINET_TCP_H
|
||||||
|
#include <netinet/tcp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -378,6 +380,7 @@ static int listen_fd_cb(struct osmo_fd *listen_bfd, unsigned int what)
|
||||||
LOGP(DLCTRL, LOGL_INFO, "accept()ed new control connection from %s\n",
|
LOGP(DLCTRL, LOGL_INFO, "accept()ed new control connection from %s\n",
|
||||||
inet_ntoa(sa.sin_addr));
|
inet_ntoa(sa.sin_addr));
|
||||||
|
|
||||||
|
#ifdef TCP_NODELAY
|
||||||
on = 1;
|
on = 1;
|
||||||
ret = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
|
ret = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
@ -385,6 +388,7 @@ static int listen_fd_cb(struct osmo_fd *listen_bfd, unsigned int what)
|
||||||
close(fd);
|
close(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
ccon = ctrl_connection_alloc(listen_bfd->data);
|
ccon = ctrl_connection_alloc(listen_bfd->data);
|
||||||
if (!ccon) {
|
if (!ccon) {
|
||||||
LOGP(DLCTRL, LOGL_ERROR, "Failed to allocate.\n");
|
LOGP(DLCTRL, LOGL_ERROR, "Failed to allocate.\n");
|
||||||
|
|
|
@ -39,6 +39,11 @@
|
||||||
|
|
||||||
#include <osmocom/gsm/a5.h>
|
#include <osmocom/gsm/a5.h>
|
||||||
|
|
||||||
|
/* Somme OS (like Nuttx) don't have ENOTSUP */
|
||||||
|
#ifndef ENOTSUP
|
||||||
|
#define ENOTSUP EINVAL
|
||||||
|
#endif
|
||||||
|
|
||||||
/*! \brief Main method to generate a A5/x cipher stream
|
/*! \brief Main method to generate a A5/x cipher stream
|
||||||
* \param[in] n Which A5/x method to use
|
* \param[in] n Which A5/x method to use
|
||||||
* \param[in] key 8 byte array for the key (as received from the SIM)
|
* \param[in] key 8 byte array for the key (as received from the SIM)
|
||||||
|
|
|
@ -89,6 +89,7 @@ int osmo_get_macaddr(uint8_t *mac_out, const char *dev_name)
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
#include <netinet/ip.h>
|
#include <netinet/ip.h>
|
||||||
|
|
||||||
int osmo_get_macaddr(uint8_t *mac_out, const char *dev_name)
|
int osmo_get_macaddr(uint8_t *mac_out, const char *dev_name)
|
||||||
|
|
Loading…
Reference in New Issue