blob: 03028c2939577514146b4f3ec1ec503445ae5d0d [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([.])
25AM_CONFIG_HEADER(config.h)
26
27AC_CANONICAL_BUILD
28AC_CANONICAL_HOST
29AC_CANONICAL_TARGET
30
31AM_INIT_AUTOMAKE
32
33dnl Linux kernel KBuild style compile messages
34m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
35
36AM_PROG_AS
37AC_PROG_CXX
38AC_PROG_LN_S
39AC_PROG_MAKE_SET
40AC_PROG_INSTALL
41AC_PATH_PROG([RM_PROG], [rm])
42
43AC_LIBTOOL_WIN32_DLL
44AC_ENABLE_SHARED dnl do build shared libraries
45AC_DISABLE_STATIC dnl don't build static libraries
46AC_PROG_LIBTOOL
47
48dnl Checks for header files.
49AC_HEADER_STDC
50dnl This is required for GnuRadio includes to understand endianess correctly:
51AC_CHECK_HEADERS([byteswap.h])
52
53dnl Checks for typedefs, structures, and compiler characteristics.
54AC_C_CONST
55AC_C_INLINE
56AC_TYPE_SIZE_T
57AC_HEADER_TIME
58AC_C_BIGENDIAN
59
60AC_ARG_WITH(usrp1, [
61 AS_HELP_STRING([--with-usrp1],
62 [enable USRP1 gnuradio based transceiver])
63])
64
65AC_ARG_WITH(uhd, [
66 AS_HELP_STRING([--with-uhd],
67 [enable UHD based transceiver])
68])
69
70AC_ARG_WITH(singledb, [
71 AS_HELP_STRING([--with-singledb],
72 [enable single daughterboard use on USRP1])
73])
74
75AC_ARG_WITH(resamp, [
76 AS_HELP_STRING([--with-resamp],
77 [enable resampling for non-52MHz devices])
78])
79
80AC_ARG_WITH(extref, [
81 AS_HELP_STRING([--with-extref],
82 [enable external reference on UHD devices])
83])
84
85AS_IF([test "x$with_usrp1" = "xyes"], [
86 # Defines USRP_CFLAGS, USRP_INCLUDEDIR, and USRP_LIBS
87 PKG_CHECK_MODULES(USRP, usrp > 3.1)
88 # Check whether we have libusrp >= 3.2
89 PKG_CHECK_EXISTS(usrp >= 3.2, libusrp_3_2=yes, libusrp_3_2=no)
90 if test "x$libusrp_3_2" = "xyes";then
91 AC_DEFINE(HAVE_LIBUSRP_3_2, 1, Define to 1 if you have libusrp >= 3.2)
92 fi
93 # Check whether we have libusrp >= 3.3
94 PKG_CHECK_EXISTS(usrp >= 3.3, libusrp_3_3=yes, libusrp_3_3=no)
95 if test "x$libusrp_3_3" = "xyes";then
96 AC_DEFINE(HAVE_LIBUSRP_3_3, 1, Define to 1 if you have libusrp >= 3.3)
97 fi
98])
99
100AS_IF([test "x$with_uhd" = "xyes"],[
101 PKG_CHECK_MODULES(UHD, uhd >= 003.002.000)
102 AC_DEFINE(USE_UHD, 1, Define to 1 if using UHD)
103])
104
105AS_IF([test "x$with_resamp" = "xyes"], [
106 AC_DEFINE(RESAMPLE, 1, Define to 1 for resampling)
107])
108
109AS_IF([test "x$with_extref" = "xyes"], [
110 AC_DEFINE(EXTREF, 1, Define to 1 for external reference)
111])
112
113AS_IF([test "x$with_singledb" = "xyes"], [
114 AC_DEFINE(SINGLEDB, 1, Define to 1 for single daughterboard)
115])
116
117AM_CONDITIONAL(RESAMPLE, [test "x$with_resamp" = "xyes"])
118AM_CONDITIONAL(UHD, [test "x$with_uhd" = "xyes"])
119AM_CONDITIONAL(USRP1, [test "x$with_usrp1" = "xyes"])
120
121# Defines LIBUSB_TRANSFER_CANCELLED, LIBUSB_TRANSFER_COMPLETED, LIBUSB_SUCCESS, LIBUSB_ERROR_*
122PKG_CHECK_MODULES(LIBUSB, libusb-1.0)
123
124dnl Output files
125AC_CONFIG_FILES([\
126 Makefile \
127 CommonLibs/Makefile \
128 GSM/Makefile \
129 Transceiver52M/Makefile \
130 sqlite3/Makefile \
131])
132
133AC_OUTPUT