2010-07-29 18:13:37 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script
|
|
|
|
AC_INIT([libosmo-sccp],
|
|
|
|
m4_esyscmd([./git-version-gen .tarball-version]),
|
2012-03-26 14:37:37 +00:00
|
|
|
[openbsc@lists.osmocom.org])
|
2010-07-29 18:13:37 +00:00
|
|
|
|
2016-09-30 22:34:08 +00:00
|
|
|
dnl *This* is the root dir, even if an install-sh exists in ../ or ../../
|
|
|
|
AC_CONFIG_AUX_DIR([.])
|
|
|
|
|
2010-07-29 18:13:37 +00:00
|
|
|
AM_INIT_AUTOMAKE([dist-bzip2])
|
2011-11-20 11:02:14 +00:00
|
|
|
AC_CONFIG_TESTDIR(tests)
|
2010-07-29 18:13:37 +00:00
|
|
|
|
2021-01-27 16:33:48 +00:00
|
|
|
CFLAGS="$CFLAGS -std=gnu11"
|
|
|
|
|
2010-07-29 18:13:37 +00:00
|
|
|
dnl kernel style compile messages
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
2017-08-28 09:48:31 +00:00
|
|
|
dnl include release helper
|
|
|
|
RELMAKE='-include osmo-release.mk'
|
|
|
|
AC_SUBST([RELMAKE])
|
|
|
|
|
2010-07-29 18:13:37 +00:00
|
|
|
dnl checks for programs
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_INSTALL
|
2015-12-22 21:22:23 +00:00
|
|
|
LT_INIT
|
2010-07-29 18:13:37 +00:00
|
|
|
|
2020-08-18 10:00:26 +00:00
|
|
|
dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang
|
2020-04-10 23:16:19 +00:00
|
|
|
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'])])
|
|
|
|
|
2016-09-30 22:49:54 +00:00
|
|
|
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])
|
|
|
|
|
2022-06-28 16:22:14 +00:00
|
|
|
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.7.0)
|
|
|
|
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.7.0)
|
|
|
|
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.7.0)
|
|
|
|
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.2.0)
|
2010-07-29 18:13:37 +00:00
|
|
|
|
2017-04-03 15:37:10 +00:00
|
|
|
old_LIBS=$LIBS
|
2020-01-09 13:01:22 +00:00
|
|
|
AC_SEARCH_LIBS([sctp_recvmsg], [sctp], [
|
2017-04-03 15:37:10 +00:00
|
|
|
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
|
|
|
|
], [
|
2020-01-09 13:01:22 +00:00
|
|
|
AC_MSG_ERROR([sctp_recvmsg not found in searched libs])])
|
2017-04-03 15:37:10 +00:00
|
|
|
LIBS=$old_LIBS
|
|
|
|
|
2017-11-17 00:43:36 +00:00
|
|
|
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
|
|
|
|
|
2018-03-05 19:39:36 +00:00
|
|
|
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
|
|
|
|
|
2010-07-29 18:13:37 +00:00
|
|
|
# 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])
|
2011-05-24 13:17:26 +00:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
|
2010-07-29 18:13:37 +00:00
|
|
|
[ AC_MSG_RESULT([yes])
|
|
|
|
SYMBOL_VISIBILITY="-fvisibility=hidden"],
|
|
|
|
AC_MSG_RESULT([no]))
|
|
|
|
CFLAGS="$saved_CFLAGS"
|
|
|
|
AC_SUBST(SYMBOL_VISIBILITY)
|
|
|
|
|
2017-07-05 17:56:34 +00:00
|
|
|
CFLAGS="$CFLAGS -Wall"
|
2017-07-05 18:00:57 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS -Wall"
|
2017-06-21 09:18:14 +00:00
|
|
|
|
2017-10-12 14:29:14 +00:00
|
|
|
AC_ARG_ENABLE(doxygen,
|
|
|
|
[AS_HELP_STRING(
|
|
|
|
[--disable-doxygen],
|
|
|
|
[Disable generation of documentation using doxygen],
|
|
|
|
)],
|
|
|
|
[doxygen=$enableval], [doxygen="yes"])
|
|
|
|
AC_PATH_PROG(DOXYGEN,doxygen,false)
|
|
|
|
AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes")
|
|
|
|
|
2018-11-14 09:47:01 +00:00
|
|
|
# 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
|
|
|
|
|
2018-09-10 08:40:22 +00:00
|
|
|
# https://www.freedesktop.org/software/systemd/man/daemon.html
|
|
|
|
AC_ARG_WITH([systemdsystemunitdir],
|
|
|
|
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
|
|
|
|
[with_systemdsystemunitdir=auto])
|
|
|
|
AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
|
|
|
|
def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
|
|
|
|
AS_IF([test "x$def_systemdsystemunitdir" = "x"],
|
|
|
|
[AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
|
|
|
|
[AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
|
|
|
|
with_systemdsystemunitdir=no],
|
|
|
|
[with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
|
|
|
|
AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
|
|
|
|
[AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
|
|
|
|
AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
|
|
|
|
|
2018-09-26 20:41:40 +00:00
|
|
|
AC_ARG_ENABLE([external_tests],
|
|
|
|
AC_HELP_STRING([--enable-external-tests],
|
|
|
|
[Include the VTY/CTRL tests in make check [default=no]]),
|
|
|
|
[enable_ext_tests="$enableval"],[enable_ext_tests="no"])
|
|
|
|
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
|
2022-06-17 21:18:02 +00:00
|
|
|
AC_MSG_ERROR([Please install https://gitea.osmocom.org/cellular-infrastructure/osmo-python-tests to run the VTY/CTRL tests.])
|
2018-09-26 20:41:40 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
|
|
|
|
AC_MSG_RESULT([$enable_ext_tests])
|
|
|
|
AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
|
|
|
|
|
2018-03-05 19:39:36 +00:00
|
|
|
AC_MSG_RESULT([CFLAGS="$CFLAGS"])
|
|
|
|
AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
|
|
|
|
|
2010-07-29 18:13:37 +00:00
|
|
|
AC_OUTPUT(
|
2015-12-22 21:25:34 +00:00
|
|
|
libosmo-sigtran.pc
|
2010-07-29 18:25:47 +00:00
|
|
|
libosmo-sccp.pc
|
2010-08-01 08:58:34 +00:00
|
|
|
libosmo-mtp.pc
|
2016-11-02 17:32:56 +00:00
|
|
|
libosmo-xua.pc
|
2015-12-22 21:22:23 +00:00
|
|
|
include/osmocom/Makefile
|
build: move include/{mtp,sccp} to include/osmocom/
Anywhere else in the Osmocom code base, we arrange headers in
include/osmocom/foo/ and pass -I ${root_srcdir}/include/.
This way including an osmocom header always has the format
#include <osmocom/foo/bar.h>
whether we are including from the local source tree or from $prefix.
For some reason not clear to me, the mtp and sccp folders, even though they are
being installed to $prefix/include/osmocom/, were kept *next* to the osmocom/
dir, instead of inside it. Fix that weird situation.
The motivation is that I wanted to use a definition from sccp_types.h in a
public-API header. That is impossible if it requires
#include <sccp/sccp_types.h>
in a local build, but
#include <osmocom/sccp/sccp_types.h>
for any other source tree using libosmo-sccp. After this patch, both are
identical and including works without quirks. (The other patch that needed this
has changed in the meantime on and no longer needs this, but this still makes
sense for future hacking.)
The installed result does not change, since both mtp/*.h and sccp/*.h have
always been installed to $prefix/include/osmocom/{mtp,sccp}/. This merely
changes their position in the source tree.
The most curious situation before this is that any patch #including
<osmocom/sccp/sccp_types.h> might not get a notice that the header didn't
exist, but might instead include an older system-installed file.
Change-Id: I1209a4ecf9f692a8030b5c93cd281fc9dd58d105
2018-09-26 18:49:48 +00:00
|
|
|
include/osmocom/sccp/Makefile
|
|
|
|
include/osmocom/mtp/Makefile
|
2015-12-22 21:22:23 +00:00
|
|
|
include/osmocom/sigtran/Makefile
|
2010-07-29 18:13:37 +00:00
|
|
|
include/Makefile
|
|
|
|
src/Makefile
|
|
|
|
tests/Makefile
|
|
|
|
tests/sccp/Makefile
|
2010-08-01 08:58:34 +00:00
|
|
|
tests/mtp/Makefile
|
2011-01-12 10:20:32 +00:00
|
|
|
tests/m2ua/Makefile
|
2017-04-03 16:06:50 +00:00
|
|
|
tests/xua/Makefile
|
2017-04-03 15:37:10 +00:00
|
|
|
tests/ss7/Makefile
|
2018-09-26 20:41:40 +00:00
|
|
|
tests/vty/Makefile
|
2017-04-03 20:00:45 +00:00
|
|
|
examples/Makefile
|
2017-04-05 09:14:24 +00:00
|
|
|
stp/Makefile
|
2018-07-02 14:44:39 +00:00
|
|
|
doc/Makefile
|
|
|
|
doc/examples/Makefile
|
2018-11-14 09:47:01 +00:00
|
|
|
doc/manuals/Makefile
|
2018-09-10 08:40:22 +00:00
|
|
|
contrib/Makefile
|
|
|
|
contrib/systemd/Makefile
|
2020-05-14 09:35:08 +00:00
|
|
|
contrib/libosmo-sccp.spec
|
2017-10-12 14:29:14 +00:00
|
|
|
Doxyfile
|
2010-07-29 18:13:37 +00:00
|
|
|
Makefile)
|