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 | |
Tom Tsou | 2cc2ddd | 2015-04-06 18:02:56 -0700 | [diff] [blame] | 35 | AM_INIT_AUTOMAKE([subdir-objects]) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 36 | |
| 37 | dnl Linux kernel KBuild style compile messages |
| 38 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 39 | |
Max | 099a44a | 2017-08-28 12:10:55 +0200 | [diff] [blame] | 40 | dnl include release helper |
| 41 | RELMAKE='-include osmo-release.mk' |
| 42 | AC_SUBST([RELMAKE]) |
| 43 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 44 | AM_PROG_AS |
Pau Espin Pedrol | 5ea1817 | 2018-02-20 16:48:15 +0100 | [diff] [blame] | 45 | AC_PROG_CC |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 46 | AC_PROG_CXX |
Tom Tsou | 8ca237b | 2017-06-09 11:15:58 -0700 | [diff] [blame] | 47 | AX_CXX_COMPILE_STDCXX_11 |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 48 | AC_PROG_LN_S |
| 49 | AC_PROG_MAKE_SET |
| 50 | AC_PROG_INSTALL |
| 51 | AC_PATH_PROG([RM_PROG], [rm]) |
| 52 | |
Pau Espin Pedrol | c92dad3 | 2018-02-20 13:22:58 +0100 | [diff] [blame] | 53 | dnl check for pkg-config (explained in detail in libosmocore/configure.ac) |
| 54 | AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no) |
| 55 | if test "x$PKG_CONFIG_INSTALLED" = "xno"; then |
| 56 | AC_MSG_WARN([You need to install pkg-config]) |
| 57 | fi |
| 58 | PKG_PROG_PKG_CONFIG([0.20]) |
| 59 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 60 | AC_LIBTOOL_WIN32_DLL |
| 61 | AC_ENABLE_SHARED dnl do build shared libraries |
| 62 | AC_DISABLE_STATIC dnl don't build static libraries |
| 63 | AC_PROG_LIBTOOL |
| 64 | |
| 65 | dnl Checks for header files. |
| 66 | AC_HEADER_STDC |
| 67 | dnl This is required for GnuRadio includes to understand endianess correctly: |
| 68 | AC_CHECK_HEADERS([byteswap.h]) |
| 69 | |
| 70 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 71 | AC_C_CONST |
| 72 | AC_C_INLINE |
| 73 | AC_TYPE_SIZE_T |
| 74 | AC_HEADER_TIME |
| 75 | AC_C_BIGENDIAN |
| 76 | |
Pau Espin Pedrol | 8b843e5 | 2018-02-20 14:44:39 +0100 | [diff] [blame] | 77 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) |
Pau Espin Pedrol | 5ea1817 | 2018-02-20 16:48:15 +0100 | [diff] [blame] | 78 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) |
| 79 | PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0) |
Pau Espin Pedrol | 8b843e5 | 2018-02-20 14:44:39 +0100 | [diff] [blame] | 80 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 81 | AC_ARG_WITH(usrp1, [ |
| 82 | AS_HELP_STRING([--with-usrp1], |
| 83 | [enable USRP1 gnuradio based transceiver]) |
| 84 | ]) |
| 85 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 86 | AC_ARG_WITH(singledb, [ |
| 87 | AS_HELP_STRING([--with-singledb], |
| 88 | [enable single daughterboard use on USRP1]) |
| 89 | ]) |
| 90 | |
Thomas Tsou | 7e4e536 | 2013-10-30 21:18:55 -0400 | [diff] [blame] | 91 | AC_ARG_WITH(neon, [ |
| 92 | AS_HELP_STRING([--with-neon], |
| 93 | [enable ARM NEON support]) |
| 94 | ]) |
| 95 | |
| 96 | AC_ARG_WITH(neon-vfpv4, [ |
| 97 | AS_HELP_STRING([--with-neon-vfpv4], |
| 98 | [enable ARM NEON FMA support]) |
| 99 | ]) |
| 100 | |
Tom Tsou | 6613331 | 2015-05-18 16:26:33 -0700 | [diff] [blame] | 101 | AC_ARG_WITH(sse, [ |
| 102 | AS_HELP_STRING([--with-sse], |
| 103 | [enable x86 SSE support (default)]) |
| 104 | ]) |
| 105 | |
Thomas Tsou | 7e4e536 | 2013-10-30 21:18:55 -0400 | [diff] [blame] | 106 | AS_IF([test "x$with_neon" = "xyes"], [ |
| 107 | AC_DEFINE(HAVE_NEON, 1, Support ARM NEON) |
| 108 | ]) |
| 109 | |
| 110 | AS_IF([test "x$with_neon_vfpv4" = "xyes"], [ |
| 111 | AC_DEFINE(HAVE_NEON, 1, Support ARM NEON) |
| 112 | AC_DEFINE(HAVE_NEON_FMA, 1, Support ARM NEON with FMA) |
| 113 | ]) |
| 114 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 115 | AS_IF([test "x$with_usrp1" = "xyes"], [ |
Thomas Tsou | c064124 | 2013-10-11 14:55:31 -0400 | [diff] [blame] | 116 | PKG_CHECK_MODULES(USRP, usrp >= 3.3) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 117 | ]) |
| 118 | |
Thomas Tsou | fffd987 | 2013-11-04 10:20:21 -0800 | [diff] [blame] | 119 | AS_IF([test "x$with_usrp1" != "xyes"],[ |
Tom Tsou | 72bf762 | 2017-03-07 14:16:46 -0800 | [diff] [blame] | 120 | PKG_CHECK_MODULES(UHD, uhd >= 003.011, |
| 121 | [AC_DEFINE(USE_UHD_3_11, 1, UHD version 3.11.0 or higher)], |
| 122 | [PKG_CHECK_MODULES(UHD, uhd >= 003.009, |
| 123 | [AC_DEFINE(USE_UHD_3_9, 1, UHD version 3.9.0 or higher)], |
| 124 | [PKG_CHECK_MODULES(UHD, uhd >= 003.005)] |
| 125 | )] |
Tom Tsou | 80cb080 | 2017-01-19 13:44:02 -0800 | [diff] [blame] | 126 | ) |
| 127 | AC_DEFINE(USE_UHD, 1, All UHD versions) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 128 | ]) |
| 129 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 130 | AS_IF([test "x$with_singledb" = "xyes"], [ |
| 131 | AC_DEFINE(SINGLEDB, 1, Define to 1 for single daughterboard) |
| 132 | ]) |
| 133 | |
Thomas Tsou | fffd987 | 2013-11-04 10:20:21 -0800 | [diff] [blame] | 134 | # Find and define supported SIMD extensions |
Tom Tsou | 6613331 | 2015-05-18 16:26:33 -0700 | [diff] [blame] | 135 | AS_IF([test "x$with_sse" != "xno"], [ |
Philipp Maier | e8ae9fc | 2017-03-20 12:08:42 +0100 | [diff] [blame] | 136 | AX_SSE |
| 137 | ], [ |
| 138 | AM_CONDITIONAL(HAVE_SSE3, false) |
| 139 | AM_CONDITIONAL(HAVE_SSE4_1, false) |
Tom Tsou | 6613331 | 2015-05-18 16:26:33 -0700 | [diff] [blame] | 140 | ]) |
Thomas Tsou | fffd987 | 2013-11-04 10:20:21 -0800 | [diff] [blame] | 141 | |
Vadim Yanitskiy | ee57357 | 2017-05-20 01:34:34 +0300 | [diff] [blame] | 142 | dnl Check if the compiler supports specified GCC's built-in function |
| 143 | AC_DEFUN([CHECK_BUILTIN_SUPPORT], [ |
| 144 | AC_CACHE_CHECK( |
| 145 | [whether ${CC} has $1 built-in], |
| 146 | [osmo_cv_cc_has_builtin], [ |
| 147 | AC_LINK_IFELSE([ |
| 148 | AC_LANG_PROGRAM([], [ |
| 149 | __builtin_cpu_supports("sse"); |
| 150 | ]) |
| 151 | ], |
| 152 | [AS_VAR_SET([osmo_cv_cc_has_builtin], [yes])], |
| 153 | [AS_VAR_SET([osmo_cv_cc_has_builtin], [no])]) |
| 154 | ] |
| 155 | ) |
| 156 | |
| 157 | AS_IF([test yes = AS_VAR_GET([osmo_cv_cc_has_builtin])], [ |
| 158 | AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1, |
| 159 | [Define to 1 if compiler has the '$1' built-in function]) |
| 160 | ], [ |
| 161 | AC_MSG_WARN($2) |
| 162 | ]) |
| 163 | ]) |
| 164 | |
| 165 | dnl Check if the compiler supports runtime SIMD detection |
| 166 | CHECK_BUILTIN_SUPPORT([__builtin_cpu_supports], |
| 167 | [Runtime SIMD detection will be disabled]) |
| 168 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 169 | AM_CONDITIONAL(USRP1, [test "x$with_usrp1" = "xyes"]) |
Thomas Tsou | 7e4e536 | 2013-10-30 21:18:55 -0400 | [diff] [blame] | 170 | AM_CONDITIONAL(ARCH_ARM, [test "x$with_neon" = "xyes" || test "x$with_neon_vfpv4" = "xyes"]) |
| 171 | AM_CONDITIONAL(ARCH_ARM_A15, [test "x$with_neon_vfpv4" = "xyes"]) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 172 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 173 | PKG_CHECK_MODULES(LIBUSB, libusb-1.0) |
Alexander Huemer | 6fafd33 | 2018-01-12 15:04:02 +0100 | [diff] [blame] | 174 | PKG_CHECK_MODULES(FFTWF, fftw3f) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 175 | |
Neels Hofmeyr | 24575a6 | 2016-07-05 13:00:18 +0200 | [diff] [blame] | 176 | AC_CHECK_HEADER([boost/config.hpp],[], |
| 177 | [AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])]) |
| 178 | |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 179 | dnl Output files |
| 180 | AC_CONFIG_FILES([\ |
| 181 | Makefile \ |
| 182 | CommonLibs/Makefile \ |
| 183 | GSM/Makefile \ |
| 184 | Transceiver52M/Makefile \ |
Pau Espin Pedrol | 8fbbd65 | 2018-03-07 20:21:06 +0100 | [diff] [blame] | 185 | Transceiver52M/common/Makefile \ |
Thomas Tsou | 7e4e536 | 2013-10-30 21:18:55 -0400 | [diff] [blame] | 186 | Transceiver52M/arm/Makefile \ |
Thomas Tsou | 17bbb9b | 2013-10-30 21:24:40 -0400 | [diff] [blame] | 187 | Transceiver52M/x86/Makefile \ |
Pau Espin Pedrol | 2ac788b | 2018-01-09 17:44:49 +0100 | [diff] [blame] | 188 | tests/Makefile \ |
| 189 | tests/CommonLibs/Makefile \ |
Pau Espin Pedrol | c2ba427 | 2018-01-10 13:06:22 +0100 | [diff] [blame] | 190 | tests/Transceiver52M/Makefile \ |
Thomas Tsou | 7e4e536 | 2013-10-30 21:18:55 -0400 | [diff] [blame] | 191 | ]) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 192 | |
| 193 | AC_OUTPUT |