Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 1 | dnl |
| 2 | dnl Copyright 2008, 2009, 2010 Free Software Foundation, Inc. |
| 3 | dnl |
| 4 | dnl This software is distributed under the terms of the GNU Public License. |
| 5 | dnl See the COPYING file in the main directory for details. |
| 6 | dnl |
| 7 | dnl This program is free software: you can redistribute it and/or modify |
| 8 | dnl it under the terms of the GNU General Public License as published by |
| 9 | dnl the Free Software Foundation, either version 3 of the License, or |
| 10 | dnl (at your option) any later version. |
| 11 | dnl |
| 12 | dnl This program is distributed in the hope that it will be useful, |
| 13 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | dnl GNU General Public License for more details. |
| 16 | dnl |
| 17 | dnl You should have received a copy of the GNU General Public License |
| 18 | dnl along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | dnl |
| 20 | |
Harald Welte | db9c1b5 | 2017-10-28 17:49:36 +0200 | [diff] [blame] | 21 | AC_INIT([osmo-trx], |
Martin Hauke | 20259cb | 2018-04-08 19:53:37 +0200 | [diff] [blame] | 22 | m4_esyscmd([./git-version-gen .tarball-version]), |
Harald Welte | db9c1b5 | 2017-10-28 17:49:36 +0200 | [diff] [blame] | 23 | [openbsc@lists.osmocom.org]) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 24 | AC_PREREQ(2.57) |
| 25 | AC_CONFIG_SRCDIR([Transceiver52M/Makefile.am]) |
Pau Espin Pedrol | 82f83ce | 2018-01-09 15:09:31 +0100 | [diff] [blame] | 26 | AC_CONFIG_AUX_DIR([.]) |
Thomas Tsou | 3eaae80 | 2013-08-20 19:31:14 -0400 | [diff] [blame] | 27 | AC_CONFIG_MACRO_DIR([config]) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 28 | AM_CONFIG_HEADER(config.h) |
Pau Espin Pedrol | 2ac788b | 2018-01-09 17:44:49 +0100 | [diff] [blame] | 29 | AC_CONFIG_TESTDIR(tests) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 30 | |
| 31 | AC_CANONICAL_BUILD |
| 32 | AC_CANONICAL_HOST |
| 33 | AC_CANONICAL_TARGET |
| 34 | |
Pau Espin Pedrol | c27d9f8 | 2019-06-25 12:09:45 +0200 | [diff] [blame] | 35 | AM_INIT_AUTOMAKE([foreign subdir-objects]) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 36 | |
Oliver Smith | 0f4d579 | 2021-01-27 17:59:02 +0100 | [diff] [blame] | 37 | CFLAGS="$CFLAGS -std=gnu11" |
| 38 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 39 | dnl Linux kernel KBuild style compile messages |
| 40 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 41 | |
Max | 099a44a | 2017-08-28 12:10:55 +0200 | [diff] [blame] | 42 | dnl include release helper |
| 43 | RELMAKE='-include osmo-release.mk' |
| 44 | AC_SUBST([RELMAKE]) |
| 45 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 46 | AM_PROG_AS |
Pau Espin Pedrol | 5ea1817 | 2018-02-20 16:48:15 +0100 | [diff] [blame] | 47 | AC_PROG_CC |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 48 | AC_PROG_CXX |
Tom Tsou | 8ca237b | 2017-06-09 11:15:58 -0700 | [diff] [blame] | 49 | AX_CXX_COMPILE_STDCXX_11 |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 50 | AC_PROG_LN_S |
| 51 | AC_PROG_MAKE_SET |
| 52 | AC_PROG_INSTALL |
| 53 | AC_PATH_PROG([RM_PROG], [rm]) |
Pau Espin Pedrol | b148d05 | 2018-09-03 18:59:53 +0200 | [diff] [blame] | 54 | AC_LANG([C++]) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 55 | |
Eric | c5d5586 | 2020-04-11 01:20:19 +0200 | [diff] [blame] | 56 | dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang |
| 57 | AS_CASE(["$LD"],[*clang*], |
| 58 | [AS_CASE(["${host_os}"], |
| 59 | [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])]) |
| 60 | |
Pau Espin Pedrol | c92dad3 | 2018-02-20 13:22:58 +0100 | [diff] [blame] | 61 | dnl check for pkg-config (explained in detail in libosmocore/configure.ac) |
| 62 | AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no) |
| 63 | if test "x$PKG_CONFIG_INSTALLED" = "xno"; then |
| 64 | AC_MSG_WARN([You need to install pkg-config]) |
| 65 | fi |
| 66 | PKG_PROG_PKG_CONFIG([0.20]) |
| 67 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 68 | AC_LIBTOOL_WIN32_DLL |
| 69 | AC_ENABLE_SHARED dnl do build shared libraries |
| 70 | AC_DISABLE_STATIC dnl don't build static libraries |
| 71 | AC_PROG_LIBTOOL |
| 72 | |
| 73 | dnl Checks for header files. |
| 74 | AC_HEADER_STDC |
Martin Hauke | 066fd04 | 2019-10-13 19:08:00 +0200 | [diff] [blame] | 75 | dnl This is required for GnuRadio includes to understand endianness correctly: |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 76 | AC_CHECK_HEADERS([byteswap.h]) |
| 77 | |
| 78 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 79 | AC_C_CONST |
| 80 | AC_C_INLINE |
| 81 | AC_TYPE_SIZE_T |
| 82 | AC_HEADER_TIME |
| 83 | AC_C_BIGENDIAN |
| 84 | |
Pau Espin Pedrol | 2ada887 | 2023-09-12 15:56:57 +0200 | [diff] [blame] | 85 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.9.0) |
| 86 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.9.0) |
| 87 | PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.9.0) |
| 88 | PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 1.9.0) |
Pau Espin Pedrol | 8b843e5 | 2018-02-20 14:44:39 +0100 | [diff] [blame] | 89 | |
Pau Espin Pedrol | 53bdb7f | 2018-04-16 14:27:38 +0200 | [diff] [blame] | 90 | AC_ARG_ENABLE(sanitize, |
| 91 | [AS_HELP_STRING( |
| 92 | [--enable-sanitize], |
| 93 | [Compile with address sanitizer enabled], |
| 94 | )], |
| 95 | [sanitize=$enableval], [sanitize="no"]) |
| 96 | if test x"$sanitize" = x"yes" |
| 97 | then |
| 98 | CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" |
| 99 | LDFLAGS="$LDFLAGS -fsanitize=address -fsanitize=undefined" |
| 100 | fi |
| 101 | |
Pau Espin Pedrol | 288d8af | 2018-08-30 17:29:41 +0200 | [diff] [blame] | 102 | AC_ARG_ENABLE(werror, |
| 103 | [AS_HELP_STRING( |
| 104 | [--enable-werror], |
| 105 | [Turn all compiler warnings into errors, with exceptions: |
| 106 | a) deprecation (allow upstream to mark deprecation without breaking builds); |
| 107 | b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds) |
| 108 | ] |
| 109 | )], |
| 110 | [werror=$enableval], [werror="no"]) |
| 111 | if test x"$werror" = x"yes" |
| 112 | then |
| 113 | WERROR_FLAGS="-Werror" |
| 114 | WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations" |
| 115 | WERROR_FLAGS+=" -Wno-error=cpp" # "#warning" |
| 116 | CFLAGS="$CFLAGS $WERROR_FLAGS" |
| 117 | CPPFLAGS="$CPPFLAGS $WERROR_FLAGS" |
| 118 | fi |
| 119 | |
| 120 | |
Pau Espin Pedrol | f3d7f44 | 2018-04-24 18:49:03 +0200 | [diff] [blame] | 121 | AC_ARG_WITH(uhd, [ |
| 122 | AS_HELP_STRING([--with-uhd], |
| 123 | [enable UHD based transceiver]) |
| 124 | ]) |
| 125 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 126 | AC_ARG_WITH(usrp1, [ |
| 127 | AS_HELP_STRING([--with-usrp1], |
| 128 | [enable USRP1 gnuradio based transceiver]) |
| 129 | ]) |
| 130 | |
Pau Espin Pedrol | 1f50fed | 2018-04-25 11:12:06 +0200 | [diff] [blame] | 131 | AC_ARG_WITH(lms, [ |
| 132 | AS_HELP_STRING([--with-lms], |
Pau Espin Pedrol | 70d0344 | 2018-08-17 17:17:05 +0200 | [diff] [blame] | 133 | [enable LimeSuite based transceiver]) |
Pau Espin Pedrol | 1f50fed | 2018-04-25 11:12:06 +0200 | [diff] [blame] | 134 | ]) |
| 135 | |
Eric Wild | 1e17c4f | 2020-03-24 17:19:27 +0100 | [diff] [blame] | 136 | AC_ARG_WITH(ipc, [ |
| 137 | AS_HELP_STRING([--with-ipc], |
| 138 | [enable IPC]) |
| 139 | ]) |
| 140 | |
Eric | 7d897cb | 2022-11-28 19:20:32 +0100 | [diff] [blame] | 141 | AC_ARG_WITH(bladerf, [ |
| 142 | AS_HELP_STRING([--with-bladerf], |
| 143 | [enable bladeRF]) |
| 144 | ]) |
| 145 | |
Eric | b7253c6 | 2022-11-28 19:21:08 +0100 | [diff] [blame] | 146 | AC_ARG_WITH(mstrx, [ |
| 147 | AS_HELP_STRING([--with-mstrx], |
| 148 | [enable MS TRX]) |
| 149 | ]) |
| 150 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 151 | AC_ARG_WITH(singledb, [ |
| 152 | AS_HELP_STRING([--with-singledb], |
| 153 | [enable single daughterboard use on USRP1]) |
| 154 | ]) |
| 155 | |
Thomas Tsou | 7e4e536 | 2013-10-30 21:18:55 -0400 | [diff] [blame] | 156 | AC_ARG_WITH(neon, [ |
| 157 | AS_HELP_STRING([--with-neon], |
| 158 | [enable ARM NEON support]) |
| 159 | ]) |
| 160 | |
| 161 | AC_ARG_WITH(neon-vfpv4, [ |
| 162 | AS_HELP_STRING([--with-neon-vfpv4], |
| 163 | [enable ARM NEON FMA support]) |
| 164 | ]) |
| 165 | |
Tom Tsou | 6613331 | 2015-05-18 16:26:33 -0700 | [diff] [blame] | 166 | AC_ARG_WITH(sse, [ |
| 167 | AS_HELP_STRING([--with-sse], |
| 168 | [enable x86 SSE support (default)]) |
| 169 | ]) |
| 170 | |
Thomas Tsou | 7e4e536 | 2013-10-30 21:18:55 -0400 | [diff] [blame] | 171 | AS_IF([test "x$with_neon" = "xyes"], [ |
| 172 | AC_DEFINE(HAVE_NEON, 1, Support ARM NEON) |
| 173 | ]) |
| 174 | |
| 175 | AS_IF([test "x$with_neon_vfpv4" = "xyes"], [ |
| 176 | AC_DEFINE(HAVE_NEON, 1, Support ARM NEON) |
| 177 | AC_DEFINE(HAVE_NEON_FMA, 1, Support ARM NEON with FMA) |
| 178 | ]) |
| 179 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 180 | AS_IF([test "x$with_usrp1" = "xyes"], [ |
Pau Espin Pedrol | affd351 | 2018-12-03 19:15:01 +0100 | [diff] [blame] | 181 | AC_CHECK_HEADER([boost/config.hpp],[], |
| 182 | [AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])]) |
Thomas Tsou | c064124 | 2013-10-11 14:55:31 -0400 | [diff] [blame] | 183 | PKG_CHECK_MODULES(USRP, usrp >= 3.3) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 184 | ]) |
| 185 | |
Pau Espin Pedrol | 1f50fed | 2018-04-25 11:12:06 +0200 | [diff] [blame] | 186 | AS_IF([test "x$with_lms" = "xyes"], [ |
| 187 | PKG_CHECK_MODULES(LMS, LimeSuite) |
| 188 | ]) |
| 189 | |
Eric Wild | 1e17c4f | 2020-03-24 17:19:27 +0100 | [diff] [blame] | 190 | AS_IF([test "x$with_uhd" = "xyes"],[ |
Tom Tsou | 72bf762 | 2017-03-07 14:16:46 -0800 | [diff] [blame] | 191 | PKG_CHECK_MODULES(UHD, uhd >= 003.011, |
| 192 | [AC_DEFINE(USE_UHD_3_11, 1, UHD version 3.11.0 or higher)], |
| 193 | [PKG_CHECK_MODULES(UHD, uhd >= 003.009, |
| 194 | [AC_DEFINE(USE_UHD_3_9, 1, UHD version 3.9.0 or higher)], |
| 195 | [PKG_CHECK_MODULES(UHD, uhd >= 003.005)] |
| 196 | )] |
Tom Tsou | 80cb080 | 2017-01-19 13:44:02 -0800 | [diff] [blame] | 197 | ) |
Oliver Smith | 71c46e9 | 2022-07-08 13:24:35 +0200 | [diff] [blame] | 198 | # OS#5608: libuhd < 4.2.0 includes boost/thread/thread.hpp in its logging |
| 199 | # code and therefore requires linking against boost_thread. It's missing in |
| 200 | # uhd.pc, so work around it here. |
| 201 | # https://github.com/EttusResearch/uhd/commit/04a83b6e76beef970854da69ba882d717669b49c |
| 202 | PKG_CHECK_MODULES(UHD, uhd < 004.002, |
| 203 | [LIBS="$LIBS -lboost_thread"], |
| 204 | [] |
| 205 | ) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 206 | ]) |
| 207 | |
Eric | 7d897cb | 2022-11-28 19:20:32 +0100 | [diff] [blame] | 208 | AS_IF([test "x$with_bladerf" = "xyes"], [ |
| 209 | PKG_CHECK_MODULES(BLADE, libbladeRF >= 2.0) |
| 210 | ]) |
| 211 | |
Vadim Yanitskiy | 0ce6470 | 2022-12-28 05:05:17 +0700 | [diff] [blame] | 212 | AC_MSG_CHECKING([whether to enable building MS TRX]) |
Vadim Yanitskiy | d0b947a | 2022-12-28 04:58:39 +0700 | [diff] [blame] | 213 | AS_IF([test "x$with_mstrx" = "xyes"], [ |
Vadim Yanitskiy | d0b947a | 2022-12-28 04:58:39 +0700 | [diff] [blame] | 214 | AC_CONFIG_SUBDIRS([osmocom-bb/src/host/trxcon]) |
Vadim Yanitskiy | fe1b9ce | 2022-12-28 05:20:49 +0700 | [diff] [blame] | 215 | LIBTRXCON_DIR="osmocom-bb/src/host/trxcon" |
| 216 | if ! test -d "$srcdir/$LIBTRXCON_DIR"; then |
| 217 | AC_MSG_RESULT([no]) |
| 218 | AC_MSG_ERROR([$LIBTRXCON_DIR does not exist]) |
| 219 | fi |
| 220 | AC_SUBST(LIBTRXCON_DIR) |
Vadim Yanitskiy | 0ce6470 | 2022-12-28 05:05:17 +0700 | [diff] [blame] | 221 | AC_MSG_RESULT([yes]) |
Vadim Yanitskiy | d0b947a | 2022-12-28 04:58:39 +0700 | [diff] [blame] | 222 | ], [ |
| 223 | # Despite LIBTRXCON_DIR is added to SUBDIRS conditionally, |
| 224 | # autoconf/automake still requires the directory to be present |
| 225 | # and thus the submodule to be fetched (even if MS TRX is not needed). |
| 226 | # Work this around by pointing it to an empty dir. |
| 227 | AC_SUBST(LIBTRXCON_DIR, "osmocom-bb") |
Vadim Yanitskiy | 0ce6470 | 2022-12-28 05:05:17 +0700 | [diff] [blame] | 228 | AC_MSG_RESULT([no]) |
Vadim Yanitskiy | d0b947a | 2022-12-28 04:58:39 +0700 | [diff] [blame] | 229 | ]) |
Eric | b7253c6 | 2022-11-28 19:21:08 +0100 | [diff] [blame] | 230 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 231 | AS_IF([test "x$with_singledb" = "xyes"], [ |
| 232 | AC_DEFINE(SINGLEDB, 1, Define to 1 for single daughterboard) |
| 233 | ]) |
| 234 | |
Thomas Tsou | fffd987 | 2013-11-04 10:20:21 -0800 | [diff] [blame] | 235 | # Find and define supported SIMD extensions |
Tom Tsou | 6613331 | 2015-05-18 16:26:33 -0700 | [diff] [blame] | 236 | AS_IF([test "x$with_sse" != "xno"], [ |
Philipp Maier | e8ae9fc | 2017-03-20 12:08:42 +0100 | [diff] [blame] | 237 | AX_SSE |
| 238 | ], [ |
| 239 | AM_CONDITIONAL(HAVE_SSE3, false) |
| 240 | AM_CONDITIONAL(HAVE_SSE4_1, false) |
Tom Tsou | 6613331 | 2015-05-18 16:26:33 -0700 | [diff] [blame] | 241 | ]) |
Thomas Tsou | fffd987 | 2013-11-04 10:20:21 -0800 | [diff] [blame] | 242 | |
Vadim Yanitskiy | ee57357 | 2017-05-20 01:34:34 +0300 | [diff] [blame] | 243 | dnl Check if the compiler supports specified GCC's built-in function |
| 244 | AC_DEFUN([CHECK_BUILTIN_SUPPORT], [ |
| 245 | AC_CACHE_CHECK( |
| 246 | [whether ${CC} has $1 built-in], |
Pau Espin Pedrol | e503c98 | 2019-09-13 18:56:08 +0200 | [diff] [blame] | 247 | [osmo_cv_cc_has_$1], [ |
Vadim Yanitskiy | ee57357 | 2017-05-20 01:34:34 +0300 | [diff] [blame] | 248 | AC_LINK_IFELSE([ |
| 249 | AC_LANG_PROGRAM([], [ |
Pau Espin Pedrol | e503c98 | 2019-09-13 18:56:08 +0200 | [diff] [blame] | 250 | $2 |
Vadim Yanitskiy | ee57357 | 2017-05-20 01:34:34 +0300 | [diff] [blame] | 251 | ]) |
| 252 | ], |
Pau Espin Pedrol | e503c98 | 2019-09-13 18:56:08 +0200 | [diff] [blame] | 253 | [AS_VAR_SET([osmo_cv_cc_has_$1], [yes])], |
| 254 | [AS_VAR_SET([osmo_cv_cc_has_$1], [no])]) |
Vadim Yanitskiy | ee57357 | 2017-05-20 01:34:34 +0300 | [diff] [blame] | 255 | ] |
| 256 | ) |
| 257 | |
Pau Espin Pedrol | e503c98 | 2019-09-13 18:56:08 +0200 | [diff] [blame] | 258 | AS_IF([test yes = AS_VAR_GET([osmo_cv_cc_has_$1])], [ |
Vadim Yanitskiy | ee57357 | 2017-05-20 01:34:34 +0300 | [diff] [blame] | 259 | AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1, |
| 260 | [Define to 1 if compiler has the '$1' built-in function]) |
| 261 | ], [ |
Pau Espin Pedrol | e503c98 | 2019-09-13 18:56:08 +0200 | [diff] [blame] | 262 | AC_MSG_WARN($3) |
Vadim Yanitskiy | ee57357 | 2017-05-20 01:34:34 +0300 | [diff] [blame] | 263 | ]) |
| 264 | ]) |
| 265 | |
| 266 | dnl Check if the compiler supports runtime SIMD detection |
Pau Espin Pedrol | e503c98 | 2019-09-13 18:56:08 +0200 | [diff] [blame] | 267 | CHECK_BUILTIN_SUPPORT([__builtin_cpu_supports], [__builtin_cpu_supports("sse");], |
Vadim Yanitskiy | ee57357 | 2017-05-20 01:34:34 +0300 | [diff] [blame] | 268 | [Runtime SIMD detection will be disabled]) |
| 269 | |
Pau Espin Pedrol | e503c98 | 2019-09-13 18:56:08 +0200 | [diff] [blame] | 270 | dnl Check for __sync_fetch_and_add(). |
| 271 | CHECK_BUILTIN_SUPPORT([__sync_fetch_and_and], [int x;__sync_fetch_and_and(&x,1);], |
| 272 | [Atomic operation not available, will use mutex]) |
| 273 | dnl Check for __sync_or_and_fetch(). |
| 274 | CHECK_BUILTIN_SUPPORT([__sync_or_and_fetch], [int x;__sync_or_and_fetch(&x,1);], |
| 275 | [Atomic operation not available, will use mutex]) |
| 276 | AS_IF([test "x$osmo_cv_cc_has___sync_fetch_and_and" = "xyes" && test "x$osmo_cv_cc_has___sync_or_and_fetch" = "xyes"], [ |
| 277 | AC_DEFINE(HAVE_ATOMIC_OPS, 1, [Support all required atomic operations], [AC_MSG_WARN("At least one aotmic operation missing, will use mutex")]) |
| 278 | ]) |
| 279 | |
Eric Wild | 1e17c4f | 2020-03-24 17:19:27 +0100 | [diff] [blame] | 280 | AM_CONDITIONAL(DEVICE_UHD, [test "x$with_uhd" = "xyes"]) |
Pau Espin Pedrol | a4316ee | 2018-04-24 16:29:05 +0200 | [diff] [blame] | 281 | AM_CONDITIONAL(DEVICE_USRP1, [test "x$with_usrp1" = "xyes"]) |
Pau Espin Pedrol | 1f50fed | 2018-04-25 11:12:06 +0200 | [diff] [blame] | 282 | AM_CONDITIONAL(DEVICE_LMS, [test "x$with_lms" = "xyes"]) |
Eric Wild | 1e17c4f | 2020-03-24 17:19:27 +0100 | [diff] [blame] | 283 | AM_CONDITIONAL(DEVICE_IPC, [test "x$with_ipc" = "xyes"]) |
Eric | 7d897cb | 2022-11-28 19:20:32 +0100 | [diff] [blame] | 284 | AM_CONDITIONAL(DEVICE_BLADE, [test "x$with_bladerf" = "xyes"]) |
Thomas Tsou | 7e4e536 | 2013-10-30 21:18:55 -0400 | [diff] [blame] | 285 | AM_CONDITIONAL(ARCH_ARM, [test "x$with_neon" = "xyes" || test "x$with_neon_vfpv4" = "xyes"]) |
| 286 | AM_CONDITIONAL(ARCH_ARM_A15, [test "x$with_neon_vfpv4" = "xyes"]) |
Vadim Yanitskiy | d0b947a | 2022-12-28 04:58:39 +0700 | [diff] [blame] | 287 | AM_CONDITIONAL(ENABLE_MS_TRX, [test "x$with_mstrx" = "xyes"]) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 288 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 289 | PKG_CHECK_MODULES(LIBUSB, libusb-1.0) |
Alexander Huemer | 6fafd33 | 2018-01-12 15:04:02 +0100 | [diff] [blame] | 290 | PKG_CHECK_MODULES(FFTWF, fftw3f) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 291 | |
Oliver Smith | be8a83f | 2018-11-14 10:47:01 +0100 | [diff] [blame] | 292 | # Generate manuals |
| 293 | AC_ARG_ENABLE(manuals, |
| 294 | [AS_HELP_STRING( |
| 295 | [--enable-manuals], |
| 296 | [Generate manual PDFs [default=no]], |
| 297 | )], |
| 298 | [osmo_ac_build_manuals=$enableval], [osmo_ac_build_manuals="no"]) |
| 299 | AM_CONDITIONAL([BUILD_MANUALS], [test x"$osmo_ac_build_manuals" = x"yes"]) |
| 300 | AC_ARG_VAR(OSMO_GSM_MANUALS_DIR, [path to common osmo-gsm-manuals files, overriding pkg-config and "../osmo-gsm-manuals" |
| 301 | fallback]) |
| 302 | if test x"$osmo_ac_build_manuals" = x"yes" |
| 303 | then |
| 304 | # Find OSMO_GSM_MANUALS_DIR (env, pkg-conf, fallback) |
| 305 | if test -n "$OSMO_GSM_MANUALS_DIR"; then |
| 306 | echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (from env)" |
| 307 | else |
| 308 | OSMO_GSM_MANUALS_DIR="$($PKG_CONFIG osmo-gsm-manuals --variable=osmogsmmanualsdir 2>/dev/null)" |
| 309 | if test -n "$OSMO_GSM_MANUALS_DIR"; then |
| 310 | echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (from pkg-conf)" |
| 311 | else |
| 312 | OSMO_GSM_MANUALS_DIR="../osmo-gsm-manuals" |
| 313 | echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (fallback)" |
| 314 | fi |
| 315 | fi |
| 316 | if ! test -d "$OSMO_GSM_MANUALS_DIR"; then |
| 317 | AC_MSG_ERROR("OSMO_GSM_MANUALS_DIR does not exist! Install osmo-gsm-manuals or set OSMO_GSM_MANUALS_DIR.") |
| 318 | fi |
| 319 | |
| 320 | # Find and run check-depends |
| 321 | CHECK_DEPENDS="$OSMO_GSM_MANUALS_DIR/check-depends.sh" |
| 322 | if ! test -x "$CHECK_DEPENDS"; then |
| 323 | CHECK_DEPENDS="osmo-gsm-manuals-check-depends" |
| 324 | fi |
| 325 | if ! $CHECK_DEPENDS; then |
| 326 | AC_MSG_ERROR("missing dependencies for --enable-manuals") |
| 327 | fi |
| 328 | |
| 329 | # Put in Makefile with absolute path |
| 330 | OSMO_GSM_MANUALS_DIR="$(realpath "$OSMO_GSM_MANUALS_DIR")" |
| 331 | AC_SUBST([OSMO_GSM_MANUALS_DIR]) |
| 332 | fi |
| 333 | |
Pau Espin Pedrol | 5ac2cb3 | 2018-09-10 13:39:02 +0200 | [diff] [blame] | 334 | # https://www.freedesktop.org/software/systemd/man/daemon.html |
| 335 | AC_ARG_WITH([systemdsystemunitdir], |
| 336 | [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],, |
| 337 | [with_systemdsystemunitdir=auto]) |
| 338 | AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [ |
| 339 | def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) |
| 340 | |
| 341 | AS_IF([test "x$def_systemdsystemunitdir" = "x"], |
| 342 | [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], |
| 343 | [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]) |
| 344 | with_systemdsystemunitdir=no], |
| 345 | [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) |
| 346 | AS_IF([test "x$with_systemdsystemunitdir" != "xno"], |
| 347 | [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) |
| 348 | AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) |
| 349 | |
Pau Espin Pedrol | 53bdb7f | 2018-04-16 14:27:38 +0200 | [diff] [blame] | 350 | AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) |
| 351 | AC_MSG_RESULT([CFLAGS="$CFLAGS"]) |
| 352 | AC_MSG_RESULT([CXXFLAGS="$CXXFLAGS"]) |
| 353 | AC_MSG_RESULT([LDFLAGS="$LDFLAGS"]) |
| 354 | |
Eric | b7253c6 | 2022-11-28 19:21:08 +0100 | [diff] [blame] | 355 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 356 | dnl Output files |
| 357 | AC_CONFIG_FILES([\ |
| 358 | Makefile \ |
| 359 | CommonLibs/Makefile \ |
| 360 | GSM/Makefile \ |
| 361 | Transceiver52M/Makefile \ |
Pau Espin Pedrol | 43fedb6 | 2018-04-24 15:22:57 +0200 | [diff] [blame] | 362 | Transceiver52M/arch/Makefile \ |
| 363 | Transceiver52M/arch/common/Makefile \ |
| 364 | Transceiver52M/arch/arm/Makefile \ |
| 365 | Transceiver52M/arch/x86/Makefile \ |
Pau Espin Pedrol | 2128a30 | 2018-04-24 16:16:06 +0200 | [diff] [blame] | 366 | Transceiver52M/device/Makefile \ |
Pau Espin Pedrol | b5def41 | 2019-05-03 21:08:40 +0200 | [diff] [blame] | 367 | Transceiver52M/device/common/Makefile \ |
Pau Espin Pedrol | 2128a30 | 2018-04-24 16:16:06 +0200 | [diff] [blame] | 368 | Transceiver52M/device/uhd/Makefile \ |
| 369 | Transceiver52M/device/usrp1/Makefile \ |
Pau Espin Pedrol | 1f50fed | 2018-04-25 11:12:06 +0200 | [diff] [blame] | 370 | Transceiver52M/device/lms/Makefile \ |
Eric Wild | 1e17c4f | 2020-03-24 17:19:27 +0100 | [diff] [blame] | 371 | Transceiver52M/device/ipc/Makefile \ |
Eric | 7d897cb | 2022-11-28 19:20:32 +0100 | [diff] [blame] | 372 | Transceiver52M/device/bladerf/Makefile \ |
Pau Espin Pedrol | 2ac788b | 2018-01-09 17:44:49 +0100 | [diff] [blame] | 373 | tests/Makefile \ |
| 374 | tests/CommonLibs/Makefile \ |
Pau Espin Pedrol | c2ba427 | 2018-01-10 13:06:22 +0100 | [diff] [blame] | 375 | tests/Transceiver52M/Makefile \ |
Harald Welte | 6879bb0 | 2020-05-02 22:27:14 +0200 | [diff] [blame] | 376 | utils/Makefile \ |
Eric | 1f8eb7c | 2023-07-25 18:43:24 +0200 | [diff] [blame] | 377 | utils/va-test/Makefile \ |
Pau Espin Pedrol | c7756e7 | 2018-06-19 11:14:45 +0200 | [diff] [blame] | 378 | doc/Makefile \ |
| 379 | doc/examples/Makefile \ |
Pau Espin Pedrol | 5ac2cb3 | 2018-09-10 13:39:02 +0200 | [diff] [blame] | 380 | contrib/Makefile \ |
| 381 | contrib/systemd/Makefile \ |
Eric | b7253c6 | 2022-11-28 19:21:08 +0100 | [diff] [blame] | 382 | doc/manuals/Makefile \ |
| 383 | contrib/osmo-trx.spec \ |
Thomas Tsou | 7e4e536 | 2013-10-30 21:18:55 -0400 | [diff] [blame] | 384 | ]) |
Eric | b7253c6 | 2022-11-28 19:21:08 +0100 | [diff] [blame] | 385 | AC_OUTPUT |