aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac148
1 files changed, 130 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac
index f5af0d02..6c7126f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,18 +53,23 @@ case $host in
*)
LTLDFLAGS_OSMOGB='-Wl,--version-script=$(srcdir)/libosmogb.map'
LTLDFLAGS_OSMOGSM='-Wl,--version-script=$(srcdir)/libosmogsm.map'
+ LTLDFLAGS_OSMOISDN='-Wl,--version-script=$(srcdir)/libosmoisdn.map'
LTLDFLAGS_OSMOCODING='-Wl,--version-script=$(srcdir)/libosmocoding.map'
+ LTLDFLAGS_OSMOCORE='-Wl,--version-script=$(srcdir)/libosmocore.map'
LTLDFLAGS_OSMOCTRL='-Wl,--version-script=$(srcdir)/libosmoctrl.map'
;;
esac
AC_SUBST(LTLDFLAGS_OSMOGB)
AC_SUBST(LTLDFLAGS_OSMOGSM)
+AC_SUBST(LTLDFLAGS_OSMOISDN)
AC_SUBST(LTLDFLAGS_OSMOCODING)
+AC_SUBST(LTLDFLAGS_OSMOCORE)
AC_SUBST(LTLDFLAGS_OSMOCTRL)
dnl checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS(execinfo.h poll.h sys/select.h sys/socket.h sys/signalfd.h sys/eventfd.h sys/timerfd.h syslog.h ctype.h netinet/tcp.h netinet/in.h)
+AC_CHECK_DECL(HAVE_SYS_SOCKET_H, AC_SUBST(HAVE_SYS_SOCKET_H, 1), AC_SUBST(HAVE_SYS_SOCKET_H, 0))
# for src/conv.c
AC_FUNC_ALLOCA
AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DLOPEN="$LIBS";LIBS=""])
@@ -78,6 +83,24 @@ AC_SUBST(BACKTRACE_LIB)
# check for pthread (PTHREAD_CFLAGS, PTHREAD_LIBS)
AX_PTHREAD
+AC_MSG_CHECKING(for pthread_getname_np(pthread_t, char*, size_t))
+saved_CFLAGS="$CFLAGS"
+saved_LIBS="$LIBS"
+CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+LIBS="$LIBS $PTHREAD_LIBS"
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [#define _GNU_SOURCE
+ #include <pthread.h>],
+ [pthread_getname_np(pthread_self(),"example",0)])],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_PTHREAD_GETNAME_NP,1,
+ [Have function pthread_setname_np(const char*)])],
+ [AC_MSG_RESULT(no)])
+CFLAGS="$saved_CFLAGS"
+LIBS="$saved_LIBS"
+
+
# check for old glibc < 2.17 to get clock_gettime
AC_SEARCH_LIBS([clock_gettime], [rt posix4],
[AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if clock_gettime is available])
@@ -150,7 +173,21 @@ ARG_ENABLE_DETECT_TLS_GCC_ARM_BUG
dnl Generate the output
AC_CONFIG_HEADER(config.h)
-PKG_CHECK_MODULES(TALLOC, [talloc >= 2.0.1])
+PKG_CHECK_MODULES(TALLOC, [talloc >= 2.1.0])
+
+AC_ARG_ENABLE([uring], [AS_HELP_STRING([--disable-uring], [Build without io_uring support])],
+ [
+ ENABLE_URING=$enableval
+ ],
+ [
+ ENABLE_URING="yes"
+ ])
+AS_IF([test "x$ENABLE_URING" = "xyes"], [
+ PKG_CHECK_MODULES(URING, [liburing >= 0.7])
+ AC_DEFINE([HAVE_URING],[1],[Build with io_uring support])
+])
+AM_CONDITIONAL(ENABLE_URING, test "x$ENABLE_URING" = "xyes")
+AC_SUBST(ENABLE_URING)
AC_ARG_ENABLE([pcsc], [AS_HELP_STRING([--disable-pcsc], [Build without PC/SC support])],
[
@@ -213,7 +250,7 @@ AC_ARG_ENABLE([libmnl],
)],
[mnl=$enableval], [mnl="yes"])
AS_IF([test "x$mnl" = "xyes"], [
- PKG_CHECK_MODULES(LIBMNL, libmnl)
+ PKG_CHECK_MODULES(LIBMNL, libmnl, [AC_SUBST(LIBMNL_PC, [libmnl])])
AC_DEFINE([ENABLE_LIBMNL], [1], [Enable netlink socket support via libmnl])
])
AM_CONDITIONAL(ENABLE_LIBMNL, test "x$mnl" = "xyes")
@@ -223,22 +260,33 @@ AC_ARG_ENABLE([libsctp], [AS_HELP_STRING([--disable-libsctp], [Do not enable soc
[ENABLE_LIBSCTP=$enableval], [ENABLE_LIBSCTP="yes"])
AM_CONDITIONAL(ENABLE_LIBSCTP, test x"$ENABLE_LIBSCTP" = x"yes")
AS_IF([test "x$ENABLE_LIBSCTP" = "xyes"], [
- old_LIBS=$LIBS
- AC_SEARCH_LIBS([sctp_bindx], [sctp], [
- AC_DEFINE(HAVE_LIBSCTP, 1, [Define 1 to enable SCTP support])
- AC_SUBST(HAVE_LIBSCTP, [1])
- if test -n "$ac_lib"; then
- AC_SUBST(LIBSCTP_LIBS, [-l$ac_lib])
- fi
- ], [
- AC_MSG_ERROR([sctp_bindx not found in searched libs])])
- LIBS=$old_LIBS
+ AC_DEFINE(HAVE_LIBSCTP, 1, [Define 1 to enable SCTP support])
+ # Attempt finding .pc, otherwise set manually (<1.0.17 have no .pc file)
+ PKG_CHECK_MODULES(LIBSCTP, libsctp,
+ [AC_SUBST(LIBSCTP_PC, [libsctp])],
+ [
+ AC_MSG_NOTICE([libsctp.pc not found (building against <1.0.17 ?), attempting manual lib lookup])
+ old_LIBS=$LIBS
+ AC_SEARCH_LIBS([sctp_bindx], [sctp], [
+ AC_SUBST(HAVE_LIBSCTP, [1])
+ if test -n "$ac_lib"; then
+ AC_SUBST(LIBSCTP_LIBS, [-l$ac_lib])
+ fi
+ ], [
+ AC_MSG_ERROR([sctp_bindx not found in searched libs])])
+ LIBS=$old_LIBS
+ ])
])
AC_ARG_ENABLE([sctp-tests], [AS_HELP_STRING([--disable-sctp-tests], [Do not run socket tests requiring system SCTP support])],
[ENABLE_SCTP_TESTS=$enableval], [ENABLE_SCTP_TESTS="yes"])
AM_CONDITIONAL(ENABLE_SCTP_TESTS, test x"$ENABLE_SCTP_TESTS" = x"yes")
+AC_ARG_ENABLE([uring-tests], [AS_HELP_STRING([--disable-uring-tests], [Do not run io_uring tests])],
+ [ENABLE_URING_TESTS=$enableval], [ENABLE_URING_TESTS="yes"])
+AM_CONDITIONAL(ENABLE_URING_TESTS, test x"$ENABLE_URING_TESTS" = x"yes")
+AC_SUBST(ENABLE_URING_TESTS)
+
AC_ARG_ENABLE(plugin,
[AS_HELP_STRING(
[--disable-plugin],
@@ -268,13 +316,13 @@ fi
AC_ARG_ENABLE(bsc_fd_check,
[AS_HELP_STRING(
- [--enable-bsc-fd-check],
+ [--enable-ofd-check],
[Instrument osmo_fd_register to check that the fd is registered]
)],
[fd_check=$enableval], [fd_check="no"])
-if test x"$fd_check" = x"no"
+if test x"$fd_check" = x"yes"
then
- AC_DEFINE([OSMO_FD_CHECK],[1],[Instrument the osmo_fd_register])
+ AC_DEFINE([OSMO_FD_CHECK], [1], [Instrument the osmo_fd_register])
fi
AC_ARG_ENABLE([force_io_select],
@@ -284,7 +332,7 @@ AC_ARG_ENABLE([force_io_select],
)],
[force_io_select=$enableval], [force_io_select="no"])
AS_IF([test "x$force_io_select" = "xyes"], [
- AC_DEFINE([FORCE_IO_SELECT], [1], [Force the use of select() instaed of poll()])
+ AC_DEFINE([FORCE_IO_SELECT], [1], [Force the use of select() instead of poll()])
])
AC_ARG_ENABLE(msgfile,
@@ -356,9 +404,11 @@ then
AM_CONDITIONAL(ENABLE_CTRL, false)
AM_CONDITIONAL(ENABLE_UTILITIES, false)
AM_CONDITIONAL(ENABLE_GB, false)
- AM_CONDITIONAL(ENABLE_GNUTLS, false)
+ AM_CONDITIONAL(ENABLE_LIBMNL, false)
AM_CONDITIONAL(ENABLE_LIBSCTP, false)
+ AM_CONDITIONAL(ENABLE_LIBUSB, false)
AM_CONDITIONAL(ENABLE_PCSC, false)
+ AM_CONDITIONAL(ENABLE_URING, false)
AM_CONDITIONAL(ENABLE_PSEUDOTALLOC, true)
AM_CONDITIONAL(ENABLE_SERCOM_STUB, true)
AM_CONDITIONAL(EMBEDDED, true)
@@ -366,6 +416,17 @@ then
AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
fi
+AC_ARG_ENABLE(log_macros,
+ [AS_HELP_STRING(
+ [--disable-log-macros],
+ [Disable logging macros that are also used internally to print information]
+ )],
+ [log_macros="yes"], [log_macros="no"])
+if test x"$log_macros" == x"yes"
+then
+ AC_DEFINE([LIBOSMOCORE_NO_LOGGING],[1],[Disable logging macros])
+fi
+
AC_ARG_ENABLE(sanitize,
[AS_HELP_STRING(
[--enable-sanitize],
@@ -390,6 +451,7 @@ AC_ARG_ENABLE(werror,
if test x"$werror" = x"yes"
then
WERROR_FLAGS="-Werror"
+ WERROR_FLAGS+=" -Werror=implicit-int -Werror=int-conversion -Werror=old-style-definition"
WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations"
WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
CFLAGS="$CFLAGS $WERROR_FLAGS"
@@ -404,7 +466,7 @@ if test "x$enable_ext_tests" = "xyes" ; then
AM_PATH_PYTHON
AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmo_verify_transcript_vty.py,yes)
if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
- AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.])
+ AC_MSG_ERROR([Please install https://gitea.osmocom.org/cellular-infrastructure/osmo-python-tests to run the VTY/CTRL tests.])
fi
fi
AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
@@ -505,6 +567,35 @@ dnl Check if the compiler supports runtime SIMD detection
CHECK_BUILTIN_SUPPORT([__builtin_cpu_supports],
[Runtime SIMD detection will be disabled])
+dnl There are some members in struct tcp_info that might not exist on all linux versions
+AC_CHECK_MEMBER([struct tcp_info.tcpi_notsent_bytes],
+ AC_DEFINE([HAVE_TCP_INFO_TCPI_NOTSENT_BYTES],
+ [1],
+ [Define to 1 if your <linux/tcp.h> header file have the tcpi_notsent_bytes member in struct tcp_info]),
+ [],
+ [#include <linux/tcp.h>])
+
+AC_CHECK_MEMBER([struct tcp_info.tcpi_rwnd_limited],
+ AC_DEFINE([HAVE_TCP_INFO_TCPI_RWND_LIMITED],
+ [1],
+ [Define to 1 if your <linux/tcp.h> header file have the tcpi_rwnd_limited member in struct tcp_info]),
+ [],
+ [#include <linux/tcp.h>])
+
+AC_CHECK_MEMBER([struct tcp_info.tcpi_sndbuf_limited],
+ AC_DEFINE([HAVE_TCP_INFO_TCPI_SNDBUF_LIMITED],
+ [1],
+ [Define to 1 if your <linux/tcp.h> header file have the tcpi_sndbuf_limited member in struct tcp_info]),
+ [],
+ [#include <linux/tcp.h>])
+
+AC_CHECK_MEMBER([struct tcp_info.tcpi_reord_seen],
+ AC_DEFINE([HAVE_TCP_INFO_TCPI_REORD_SEEN],
+ [1],
+ [Define to 1 if your <linux/tcp.h> header file have the tcpi_reord_seen member in struct tcp_info]),
+ [],
+ [#include <linux/tcp.h>])
+
AC_MSG_RESULT([CFLAGS="$CFLAGS"])
AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
@@ -514,18 +605,35 @@ AC_OUTPUT(
libosmocoding.pc
libosmovty.pc
libosmogsm.pc
+ libosmoisdn.pc
libosmogb.pc
libosmoctrl.pc
libosmosim.pc
libosmousb.pc
include/Makefile
+ include/osmocom/Makefile
+ include/osmocom/codec/Makefile
+ include/osmocom/coding/Makefile
+ include/osmocom/core/Makefile
+ include/osmocom/crypt/Makefile
+ include/osmocom/ctrl/Makefile
+ include/osmocom/gprs/Makefile
+ include/osmocom/gprs/protocol/Makefile
+ include/osmocom/gsm/Makefile
+ include/osmocom/gsm/protocol/Makefile
+ include/osmocom/isdn/Makefile
+ include/osmocom/sim/Makefile
+ include/osmocom/usb/Makefile
+ include/osmocom/vty/Makefile
src/Makefile
+ src/core/Makefile
src/vty/Makefile
src/codec/Makefile
src/coding/Makefile
src/sim/Makefile
src/usb/Makefile
src/gsm/Makefile
+ src/isdn/Makefile
src/gb/Makefile
src/ctrl/Makefile
src/pseudotalloc/Makefile
@@ -533,12 +641,16 @@ AC_OUTPUT(
tests/Makefile
tests/atlocal
utils/Makefile
+ utils/osmo-stat-dummy/Makefile
Doxyfile.core
Doxyfile.gsm
+ Doxyfile.isdn
Doxyfile.vty
Doxyfile.codec
Doxyfile.coding
Doxyfile.gb
Doxyfile.ctrl
+ Doxyfile.sim
+ Doxyfile.usb
Makefile
contrib/libosmocore.spec)