freebsd: Fixes for the compilation of libosmocore on FreeBSD

alloca.h is not available on FreeBSD, use the default autoconf
function to check for it, there is a complete list[1] of what to
do for using alloca but let us see how far we get with this test.

Include netinet/in.h for the IPv4 and IPv6 socket address. Check
for dlopen in libraries and use this instead of linking -dl.

[1] http://www.gnu.org/s/hello/manual/autoconf/Particular-Functions.html
This commit is contained in:
Holger Hans Peter Freyther 2011-11-09 11:26:15 +01:00
parent 07f1103782
commit 4772348b4f
4 changed files with 10 additions and 2 deletions

View File

@ -19,6 +19,10 @@ AC_CONFIG_MACRO_DIR([m4])
dnl checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h)
# for src/conv.c
AC_FUNC_ALLOCA
AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
AC_SUBST(LIBRARY_DL)
AC_PATH_PROG(DOXYGEN,doxygen,false)
AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)

View File

@ -19,7 +19,7 @@ libosmocore_la_SOURCES = timer.c select.c signal.c msgb.c bits.c \
if ENABLE_PLUGIN
libosmocore_la_SOURCES += plugin.c
libosmocore_la_LDFLAGS = -version-info $(LIBVERSION) -ldl
libosmocore_la_LDFLAGS = -version-info $(LIBVERSION) $(LIBRARY_DL)
else
libosmocore_la_LDFLAGS = -version-info $(LIBVERSION)
endif

View File

@ -29,8 +29,10 @@
/*! \file conv.c
* \file Osmocom convolutional encoder and decoder
*/
#include "config.h"
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

View File

@ -18,6 +18,8 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <stdio.h>
#include <unistd.h>
#include <stdint.h>