blob: 43b540385b047aa2094c975e0edf55d718d28fee [file] [log] [blame]
Alexander Chemeris040b3052013-06-16 14:29:54 +04001dnl
2dnl Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
3dnl
4dnl This software is distributed under the terms of the GNU Public License.
5dnl See the COPYING file in the main directory for details.
6dnl
7dnl This program is free software: you can redistribute it and/or modify
8dnl it under the terms of the GNU General Public License as published by
9dnl the Free Software Foundation, either version 3 of the License, or
10dnl (at your option) any later version.
11dnl
12dnl This program is distributed in the hope that it will be useful,
13dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15dnl GNU General Public License for more details.
16dnl
17dnl You should have received a copy of the GNU General Public License
18dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
19dnl
20
21AC_INIT(openbts,P2.8TRUNK)
22AC_PREREQ(2.57)
23AC_CONFIG_SRCDIR([Transceiver52M/Makefile.am])
24AC_CONFIG_AUX_DIR([.])
Thomas Tsou3eaae802013-08-20 19:31:14 -040025AC_CONFIG_MACRO_DIR([config])
Alexander Chemeris040b3052013-06-16 14:29:54 +040026AM_CONFIG_HEADER(config.h)
27
28AC_CANONICAL_BUILD
29AC_CANONICAL_HOST
30AC_CANONICAL_TARGET
31
Tom Tsou2cc2ddd2015-04-06 18:02:56 -070032AM_INIT_AUTOMAKE([subdir-objects])
Alexander Chemeris040b3052013-06-16 14:29:54 +040033
34dnl Linux kernel KBuild style compile messages
35m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
36
Max099a44a2017-08-28 12:10:55 +020037dnl include release helper
38RELMAKE='-include osmo-release.mk'
39AC_SUBST([RELMAKE])
40
Alexander Chemeris040b3052013-06-16 14:29:54 +040041AM_PROG_AS
42AC_PROG_CXX
Tom Tsou8ca237b2017-06-09 11:15:58 -070043AX_CXX_COMPILE_STDCXX_11
Alexander Chemeris040b3052013-06-16 14:29:54 +040044AC_PROG_LN_S
45AC_PROG_MAKE_SET
46AC_PROG_INSTALL
47AC_PATH_PROG([RM_PROG], [rm])
48
49AC_LIBTOOL_WIN32_DLL
50AC_ENABLE_SHARED dnl do build shared libraries
51AC_DISABLE_STATIC dnl don't build static libraries
52AC_PROG_LIBTOOL
53
54dnl Checks for header files.
55AC_HEADER_STDC
56dnl This is required for GnuRadio includes to understand endianess correctly:
57AC_CHECK_HEADERS([byteswap.h])
58
59dnl Checks for typedefs, structures, and compiler characteristics.
60AC_C_CONST
61AC_C_INLINE
62AC_TYPE_SIZE_T
63AC_HEADER_TIME
64AC_C_BIGENDIAN
65
66AC_ARG_WITH(usrp1, [
67 AS_HELP_STRING([--with-usrp1],
68 [enable USRP1 gnuradio based transceiver])
69])
70
Alexander Chemeris040b3052013-06-16 14:29:54 +040071AC_ARG_WITH(singledb, [
72 AS_HELP_STRING([--with-singledb],
73 [enable single daughterboard use on USRP1])
74])
75
Thomas Tsou7e4e5362013-10-30 21:18:55 -040076AC_ARG_WITH(neon, [
77 AS_HELP_STRING([--with-neon],
78 [enable ARM NEON support])
79])
80
81AC_ARG_WITH(neon-vfpv4, [
82 AS_HELP_STRING([--with-neon-vfpv4],
83 [enable ARM NEON FMA support])
84])
85
Tom Tsou66133312015-05-18 16:26:33 -070086AC_ARG_WITH(sse, [
87 AS_HELP_STRING([--with-sse],
88 [enable x86 SSE support (default)])
89])
90
Thomas Tsou7e4e5362013-10-30 21:18:55 -040091AS_IF([test "x$with_neon" = "xyes"], [
92 AC_DEFINE(HAVE_NEON, 1, Support ARM NEON)
93])
94
95AS_IF([test "x$with_neon_vfpv4" = "xyes"], [
96 AC_DEFINE(HAVE_NEON, 1, Support ARM NEON)
97 AC_DEFINE(HAVE_NEON_FMA, 1, Support ARM NEON with FMA)
98])
99
Alexander Chemeris040b3052013-06-16 14:29:54 +0400100AS_IF([test "x$with_usrp1" = "xyes"], [
Thomas Tsouc0641242013-10-11 14:55:31 -0400101 PKG_CHECK_MODULES(USRP, usrp >= 3.3)
Alexander Chemeris040b3052013-06-16 14:29:54 +0400102])
103
Thomas Tsoufffd9872013-11-04 10:20:21 -0800104AS_IF([test "x$with_usrp1" != "xyes"],[
Tom Tsou72bf7622017-03-07 14:16:46 -0800105 PKG_CHECK_MODULES(UHD, uhd >= 003.011,
106 [AC_DEFINE(USE_UHD_3_11, 1, UHD version 3.11.0 or higher)],
107 [PKG_CHECK_MODULES(UHD, uhd >= 003.009,
108 [AC_DEFINE(USE_UHD_3_9, 1, UHD version 3.9.0 or higher)],
109 [PKG_CHECK_MODULES(UHD, uhd >= 003.005)]
110 )]
Tom Tsou80cb0802017-01-19 13:44:02 -0800111 )
112 AC_DEFINE(USE_UHD, 1, All UHD versions)
Tom Tsou35222292016-06-22 16:16:30 -0700113 PKG_CHECK_MODULES(FFTWF, fftw3f)
Alexander Chemeris040b3052013-06-16 14:29:54 +0400114])
115
Alexander Chemeris040b3052013-06-16 14:29:54 +0400116AS_IF([test "x$with_singledb" = "xyes"], [
117 AC_DEFINE(SINGLEDB, 1, Define to 1 for single daughterboard)
118])
119
Thomas Tsoufffd9872013-11-04 10:20:21 -0800120# Find and define supported SIMD extensions
Tom Tsou66133312015-05-18 16:26:33 -0700121AS_IF([test "x$with_sse" != "xno"], [
Philipp Maiere8ae9fc2017-03-20 12:08:42 +0100122 AX_SSE
123], [
124 AM_CONDITIONAL(HAVE_SSE3, false)
125 AM_CONDITIONAL(HAVE_SSE4_1, false)
Tom Tsou66133312015-05-18 16:26:33 -0700126])
Thomas Tsoufffd9872013-11-04 10:20:21 -0800127
Vadim Yanitskiyee573572017-05-20 01:34:34 +0300128dnl Check if the compiler supports specified GCC's built-in function
129AC_DEFUN([CHECK_BUILTIN_SUPPORT], [
130 AC_CACHE_CHECK(
131 [whether ${CC} has $1 built-in],
132 [osmo_cv_cc_has_builtin], [
133 AC_LINK_IFELSE([
134 AC_LANG_PROGRAM([], [
135 __builtin_cpu_supports("sse");
136 ])
137 ],
138 [AS_VAR_SET([osmo_cv_cc_has_builtin], [yes])],
139 [AS_VAR_SET([osmo_cv_cc_has_builtin], [no])])
140 ]
141 )
142
143 AS_IF([test yes = AS_VAR_GET([osmo_cv_cc_has_builtin])], [
144 AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1,
145 [Define to 1 if compiler has the '$1' built-in function])
146 ], [
147 AC_MSG_WARN($2)
148 ])
149])
150
151dnl Check if the compiler supports runtime SIMD detection
152CHECK_BUILTIN_SUPPORT([__builtin_cpu_supports],
153 [Runtime SIMD detection will be disabled])
154
Alexander Chemeris040b3052013-06-16 14:29:54 +0400155AM_CONDITIONAL(USRP1, [test "x$with_usrp1" = "xyes"])
Thomas Tsou7e4e5362013-10-30 21:18:55 -0400156AM_CONDITIONAL(ARCH_ARM, [test "x$with_neon" = "xyes" || test "x$with_neon_vfpv4" = "xyes"])
157AM_CONDITIONAL(ARCH_ARM_A15, [test "x$with_neon_vfpv4" = "xyes"])
Alexander Chemeris040b3052013-06-16 14:29:54 +0400158
Max2dee3e92017-01-26 14:57:44 +0100159AC_CHECK_LIB(sqlite3, sqlite3_open, , AC_MSG_ERROR(sqlite3 is not available))
160
Alexander Chemeris040b3052013-06-16 14:29:54 +0400161PKG_CHECK_MODULES(LIBUSB, libusb-1.0)
Max2dee3e92017-01-26 14:57:44 +0100162PKG_CHECK_MODULES(SQLITE3, sqlite3)
Alexander Chemeris040b3052013-06-16 14:29:54 +0400163
Neels Hofmeyr24575a62016-07-05 13:00:18 +0200164AC_CHECK_HEADER([boost/config.hpp],[],
165 [AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])])
166
Alexander Chemeris040b3052013-06-16 14:29:54 +0400167dnl Output files
168AC_CONFIG_FILES([\
169 Makefile \
170 CommonLibs/Makefile \
171 GSM/Makefile \
172 Transceiver52M/Makefile \
Thomas Tsou7e4e5362013-10-30 21:18:55 -0400173 Transceiver52M/arm/Makefile \
Thomas Tsou17bbb9b2013-10-30 21:24:40 -0400174 Transceiver52M/x86/Makefile \
Thomas Tsou7e4e5362013-10-30 21:18:55 -0400175])
Alexander Chemeris040b3052013-06-16 14:29:54 +0400176
177AC_OUTPUT