blob: 3706b6c40325c7ad101e27b03e5397869437b191 [file] [log] [blame]
Harald Welte57f6b022012-06-14 21:05:44 +08001dnl Process this file with autoconf to produce a configure script
2AC_INIT([osmo-pcu],
3 m4_esyscmd([./git-version-gen .tarball-version]),
Holger Hans Peter Freyther57522852015-05-22 10:43:34 +08004 [osmocom-net-gprs@lists.osmocom.org])
Harald Welte57f6b022012-06-14 21:05:44 +08005
Neels Hofmeyrda933e02016-10-01 00:35:06 +02006dnl *This* is the root dir, even if an install-sh exists in ../ or ../../
7AC_CONFIG_AUX_DIR([.])
8
Harald Welte57f6b022012-06-14 21:05:44 +08009AM_INIT_AUTOMAKE([dist-bzip2])
Holger Hans Peter Freythere13298d2013-07-28 16:45:54 +020010AC_CONFIG_TESTDIR(tests)
Harald Welte57f6b022012-06-14 21:05:44 +080011
12dnl kernel style compile messages
13m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
14
Maxd78adfb2017-08-24 13:53:25 +020015dnl include release helper
16RELMAKE='-include osmo-release.mk'
17AC_SUBST([RELMAKE])
18
Harald Welte57f6b022012-06-14 21:05:44 +080019dnl checks for programs
20AC_PROG_MAKE_SET
21AC_PROG_CC
22AC_PROG_CXX
23AC_PROG_INSTALL
24LT_INIT
25
Neels Hofmeyrda66f712016-10-01 00:52:10 +020026dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
27AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
28if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
29 AC_MSG_WARN([You need to install pkg-config])
30fi
31PKG_PROG_PKG_CONFIG([0.20])
32
Harald Welte57f6b022012-06-14 21:05:44 +080033dnl checks for header files
34AC_HEADER_STDC
35
36dnl Checks for typedefs, structures and compiler characteristics
37
Maxb2f0b622017-12-21 17:27:34 +010038AC_ARG_ENABLE(sanitize,
39 [AS_HELP_STRING([--enable-sanitize], [Compile with address sanitizer enabled], )],
40 [sanitize=$enableval], [sanitize="no"])
41if test x"$sanitize" = x"yes"
42then
43 CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
44 CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
Max21419622018-01-14 22:17:10 +010045 LDFLAGS="$LDFLAGS -fsanitize=address -fsanitize=undefined"
Maxb2f0b622017-12-21 17:27:34 +010046fi
47
Maxeffdec62017-12-28 14:18:02 +010048AC_ARG_ENABLE(profile,
49 [AS_HELP_STRING([--enable-profile], [Compile with profiling support enabled], )],
50 [profile=$enableval], [profile="no"])
51if test x"$profile" = x"yes"
52then
53 CFLAGS="$CFLAGS -pg"
54 CPPFLAGS="$CPPFLAGS -pg"
55fi
56
Harald Welte57f6b022012-06-14 21:05:44 +080057dnl checks for libraries
Harald Welte3e51d3e2017-10-29 10:57:27 +010058PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.1)
Harald Welte57f6b022012-06-14 21:05:44 +080059PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty)
60PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.3)
Ivan Kluchnikovef7f28c2012-07-12 14:49:15 +040061PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.5.1.4)
Harald Welte57f6b022012-06-14 21:05:44 +080062
Andreas Eversberga23c7ee2012-12-18 10:47:28 +010063AC_MSG_CHECKING([whether to enable direct DSP access for PDCH of sysmocom-bts])
64AC_ARG_ENABLE(sysmocom-dsp,
65 AC_HELP_STRING([--enable-sysmocom-dsp],
66 [enable code for sysmocom DSP [default=no]]),
Holger Hans Peter Freyther827ed552013-01-23 21:54:19 +010067 [enable_sysmocom_dsp="$enableval"],[enable_sysmocom_dsp="no"])
Max186206c2018-01-15 16:43:22 +010068AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])],
69 [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
70AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir)
Andreas Eversberga23c7ee2012-12-18 10:47:28 +010071AC_MSG_RESULT([$enable_sysmocom_dsp])
72AM_CONDITIONAL(ENABLE_SYSMODSP, test "x$enable_sysmocom_dsp" = "xyes")
Max186206c2018-01-15 16:43:22 +010073if test "$enable_sysmocom_bts" = "yes"; then
74 oldCPPFLAGS=$CPPFLAGS
75 CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS"
76 AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
77 [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])],
78 [#include <sysmocom/femtobts/superfemto.h>])
79 CPPFLAGS=$oldCPPFLAGS
80fi
Andreas Eversberga23c7ee2012-12-18 10:47:28 +010081
Yves Godin660709d2016-05-19 11:08:03 +020082AC_MSG_CHECKING([whether to enable direct PHY access for PDCH of NuRAN Wireless Litecell 1.5 BTS])
83AC_ARG_ENABLE(lc15bts-phy,
84 AC_HELP_STRING([--enable-lc15bts-phy],
85 [enable code for Litecell 1.5 PHY [default=no]]),
86 [enable_lc15bts_phy="$enableval"],[enable_lc15bts_phy="no"])
87AC_ARG_WITH([litecell15], [AS_HELP_STRING([--with-litecell15=INCLUDE_DIR], [Location of the litecell 1.5 API header files])],
Harald Weltec136be02017-06-11 11:36:33 +020088 [litecell15_cflags="-I$withval"],[litecell15_cflags=""])
89AC_SUBST([LITECELL15_CFLAGS], $litecell15_cflags)
Yves Godin660709d2016-05-19 11:08:03 +020090AC_MSG_RESULT([$enable_lc15bts_phy])
91AM_CONDITIONAL(ENABLE_LC15BTS_PHY, test "x$enable_lc15bts_phy" = "xyes")
92if test "$enable_litecell15" = "yes"; then
93 oldCPPFLAGS=$CPPFLAGS
Harald Weltec136be02017-06-11 11:36:33 +020094 CPPFLAGS="$CPPFLAGS $LITECELL15_CFLAGS -I$srcdir/include $LIBOSMOCORE_CFLAGS"
Yves Godin660709d2016-05-19 11:08:03 +020095 AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[],
Harald Weltec136be02017-06-11 11:36:33 +020096 [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found using $litecell15_cflags])],
Yves Godin660709d2016-05-19 11:08:03 +020097 [#include <nrw/litecell15/litecell15.h>])
98 CPPFLAGS=$oldCPPFLAGS
99fi
100
Kat7dac4862013-04-05 21:44:46 +0200101AC_ARG_ENABLE([vty_tests],
102 AC_HELP_STRING([--enable-vty-tests],
Ivan Kluchnikovb6bb55d2013-04-24 15:53:25 +0400103 [Include the VTY tests in make check [default=no]]),
104 [enable_vty_tests="$enableval"],[enable_vty_tests="no"])
Kat7dac4862013-04-05 21:44:46 +0200105if test "x$enable_vty_tests" = "xyes" ; then
106 AM_PATH_PYTHON
107 AC_CHECK_PROG(OSMOTESTVTY_CHECK,osmotestvty.py,yes)
108 if test "x$OSMOTESTVTY_CHECK" != "xyes" ; then
109 AC_MSG_ERROR([Please install osmocom-python to run the vty tests.])
110 fi
111fi
112AC_MSG_CHECKING([whether to enable VTY tests])
113AC_MSG_RESULT([$enable_vty_tests])
114AM_CONDITIONAL(ENABLE_VTY_TESTS, test "x$enable_vty_tests" = "xyes")
115
Neels Hofmeyr6348aea2016-09-30 16:25:16 +0200116STD_DEFINES_AND_INCLUDES="-Wall"
117AC_SUBST(STD_DEFINES_AND_INCLUDES)
118
Harald Welte57f6b022012-06-14 21:05:44 +0800119AC_OUTPUT(
Max727295f2017-03-08 11:58:57 +0100120 osmo-pcu.pc
Harald Welte68fc1272016-11-16 22:48:33 +0100121 include/Makefile
Harald Welte57f6b022012-06-14 21:05:44 +0800122 src/Makefile
Harald Weltee4050112013-01-11 17:49:22 +0100123 examples/Makefile
Holger Hans Peter Freytherbb007042013-07-28 16:15:41 +0200124 tests/Makefile
Harald Welte57f6b022012-06-14 21:05:44 +0800125 Makefile)