AC_INIT([upf-benchmark], m4_esyscmd([./git-version-gen .tarball-version]), [osmocom-net-gprs@lists.osmocom.org]) dnl *This* is the root dir, even if an install-sh exists in ../ or ../../ AC_CONFIG_AUX_DIR([.]) AM_INIT_AUTOMAKE([dist-bzip2]) AC_CONFIG_TESTDIR(tests) CFLAGS="$CFLAGS -std=gnu11" dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) dnl include release helper RELMAKE='-include osmo-release.mk' AC_SUBST([RELMAKE]) dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC AC_PROG_INSTALL LT_INIT dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang AS_CASE(["$LD"],[*clang*], [AS_CASE(["${host_os}"], [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])]) dnl check for pkg-config (explained in detail in libosmocore/configure.ac) AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no) if test "x$PKG_CONFIG_INSTALLED" = "xno"; then AC_MSG_WARN([You need to install pkg-config]) fi PKG_PROG_PKG_CONFIG([0.20]) dnl checks for libraries PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.6.0) PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.6.0) PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.6.0) PKG_CHECK_MODULES(LIBOSMOPFCP, libosmo-pfcp >= 0.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(LIBURING, [liburing >= 0.7]) AC_DEFINE([HAVE_URING],[1],[Build with io_uring support for GTP flood commands]) ]) AM_CONDITIONAL(ENABLE_URING, test "x$ENABLE_URING" = "xyes") AC_SUBST(ENABLE_URING) dnl checks for header files AC_HEADER_STDC dnl Checks for typedefs, structures and compiler characteristics AC_ARG_ENABLE(sanitize, [AS_HELP_STRING( [--enable-sanitize], [Compile with address sanitizer enabled], )], [sanitize=$enableval], [sanitize="no"]) if test x"$sanitize" = x"yes" then CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" fi AC_ARG_ENABLE(werror, [AS_HELP_STRING( [--enable-werror], [Turn all compiler warnings into errors, with exceptions: a) deprecation (allow upstream to mark deprecation without breaking builds); b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds) ] )], [werror=$enableval], [werror="no"]) if test x"$werror" = x"yes" then WERROR_FLAGS="-Werror" WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations" WERROR_FLAGS+=" -Wno-error=cpp" # "#warning" CFLAGS="$CFLAGS $WERROR_FLAGS" CPPFLAGS="$CPPFLAGS $WERROR_FLAGS" fi # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], [ AC_MSG_RESULT([yes]) SYMBOL_VISIBILITY="-fvisibility=hidden"], AC_MSG_RESULT([no])) CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) AC_ARG_ENABLE(profile, [AS_HELP_STRING([--enable-profile], [Compile with profiling support enabled], )], [profile=$enableval], [profile="no"]) if test x"$profile" = x"yes" then CFLAGS="$CFLAGS -pg" CPPFLAGS="$CPPFLAGS -pg" fi # Generate manuals AC_ARG_ENABLE(manuals, [AS_HELP_STRING( [--enable-manuals], [Generate manual PDFs [default=no]], )], [osmo_ac_build_manuals=$enableval], [osmo_ac_build_manuals="no"]) AM_CONDITIONAL([BUILD_MANUALS], [test x"$osmo_ac_build_manuals" = x"yes"]) AC_ARG_VAR(OSMO_GSM_MANUALS_DIR, [path to common osmo-gsm-manuals files, overriding pkg-config and "../osmo-gsm-manuals" fallback]) if test x"$osmo_ac_build_manuals" = x"yes" then # Find OSMO_GSM_MANUALS_DIR (env, pkg-conf, fallback) if test -n "$OSMO_GSM_MANUALS_DIR"; then echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (from env)" else OSMO_GSM_MANUALS_DIR="$($PKG_CONFIG osmo-gsm-manuals --variable=osmogsmmanualsdir 2>/dev/null)" if test -n "$OSMO_GSM_MANUALS_DIR"; then echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (from pkg-conf)" else OSMO_GSM_MANUALS_DIR="../osmo-gsm-manuals" echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (fallback)" fi fi if ! test -d "$OSMO_GSM_MANUALS_DIR"; then AC_MSG_ERROR("OSMO_GSM_MANUALS_DIR does not exist! Install osmo-gsm-manuals or set OSMO_GSM_MANUALS_DIR.") fi # Find and run check-depends CHECK_DEPENDS="$OSMO_GSM_MANUALS_DIR/check-depends.sh" if ! test -x "$CHECK_DEPENDS"; then CHECK_DEPENDS="osmo-gsm-manuals-check-depends" fi if ! $CHECK_DEPENDS; then AC_MSG_ERROR("missing dependencies for --enable-manuals") fi # Put in Makefile with absolute path OSMO_GSM_MANUALS_DIR="$(realpath "$OSMO_GSM_MANUALS_DIR")" AC_SUBST([OSMO_GSM_MANUALS_DIR]) fi AC_MSG_RESULT([CFLAGS="$CFLAGS"]) AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) dnl Generate the output AM_CONFIG_HEADER(config.h) AC_OUTPUT( include/Makefile include/osmocom/Makefile include/osmocom/upfloadgen/Makefile src/Makefile src/osmo-upf-load-gen/Makefile src/osmo-udp-responder/Makefile src/osmo-udp-simpleflood/Makefile doc/Makefile doc/manuals/Makefile Makefile)