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 | |
| 21 | AC_INIT(openbts,P2.8TRUNK) |
| 22 | AC_PREREQ(2.57) |
| 23 | AC_CONFIG_SRCDIR([Transceiver52M/Makefile.am]) |
| 24 | AC_CONFIG_AUX_DIR([.]) |
| 25 | AM_CONFIG_HEADER(config.h) |
| 26 | |
| 27 | AC_CANONICAL_BUILD |
| 28 | AC_CANONICAL_HOST |
| 29 | AC_CANONICAL_TARGET |
| 30 | |
| 31 | AM_INIT_AUTOMAKE |
| 32 | |
| 33 | dnl Linux kernel KBuild style compile messages |
| 34 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 35 | |
| 36 | AM_PROG_AS |
| 37 | AC_PROG_CXX |
| 38 | AC_PROG_LN_S |
| 39 | AC_PROG_MAKE_SET |
| 40 | AC_PROG_INSTALL |
| 41 | AC_PATH_PROG([RM_PROG], [rm]) |
| 42 | |
| 43 | AC_LIBTOOL_WIN32_DLL |
| 44 | AC_ENABLE_SHARED dnl do build shared libraries |
| 45 | AC_DISABLE_STATIC dnl don't build static libraries |
| 46 | AC_PROG_LIBTOOL |
| 47 | |
| 48 | dnl Checks for header files. |
| 49 | AC_HEADER_STDC |
| 50 | dnl This is required for GnuRadio includes to understand endianess correctly: |
| 51 | AC_CHECK_HEADERS([byteswap.h]) |
| 52 | |
| 53 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 54 | AC_C_CONST |
| 55 | AC_C_INLINE |
| 56 | AC_TYPE_SIZE_T |
| 57 | AC_HEADER_TIME |
| 58 | AC_C_BIGENDIAN |
| 59 | |
| 60 | AC_ARG_WITH(usrp1, [ |
| 61 | AS_HELP_STRING([--with-usrp1], |
| 62 | [enable USRP1 gnuradio based transceiver]) |
| 63 | ]) |
| 64 | |
| 65 | AC_ARG_WITH(uhd, [ |
| 66 | AS_HELP_STRING([--with-uhd], |
| 67 | [enable UHD based transceiver]) |
| 68 | ]) |
| 69 | |
| 70 | AC_ARG_WITH(singledb, [ |
| 71 | AS_HELP_STRING([--with-singledb], |
| 72 | [enable single daughterboard use on USRP1]) |
| 73 | ]) |
| 74 | |
| 75 | AC_ARG_WITH(resamp, [ |
| 76 | AS_HELP_STRING([--with-resamp], |
| 77 | [enable resampling for non-52MHz devices]) |
| 78 | ]) |
| 79 | |
| 80 | AC_ARG_WITH(extref, [ |
| 81 | AS_HELP_STRING([--with-extref], |
| 82 | [enable external reference on UHD devices]) |
| 83 | ]) |
| 84 | |
| 85 | AS_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 | |
| 100 | AS_IF([test "x$with_uhd" = "xyes"],[ |
Thomas Tsou | b4cb4e2 | 2013-04-05 15:11:35 -0400 | [diff] [blame^] | 101 | PKG_CHECK_MODULES(UHD, uhd >= 003.004.000) |
Alexander Chemeris | 040b305 | 2013-06-16 14:29:54 +0400 | [diff] [blame] | 102 | AC_DEFINE(USE_UHD, 1, Define to 1 if using UHD) |
| 103 | ]) |
| 104 | |
| 105 | AS_IF([test "x$with_resamp" = "xyes"], [ |
| 106 | AC_DEFINE(RESAMPLE, 1, Define to 1 for resampling) |
| 107 | ]) |
| 108 | |
| 109 | AS_IF([test "x$with_extref" = "xyes"], [ |
| 110 | AC_DEFINE(EXTREF, 1, Define to 1 for external reference) |
| 111 | ]) |
| 112 | |
| 113 | AS_IF([test "x$with_singledb" = "xyes"], [ |
| 114 | AC_DEFINE(SINGLEDB, 1, Define to 1 for single daughterboard) |
| 115 | ]) |
| 116 | |
| 117 | AM_CONDITIONAL(RESAMPLE, [test "x$with_resamp" = "xyes"]) |
| 118 | AM_CONDITIONAL(UHD, [test "x$with_uhd" = "xyes"]) |
| 119 | AM_CONDITIONAL(USRP1, [test "x$with_usrp1" = "xyes"]) |
| 120 | |
| 121 | # Defines LIBUSB_TRANSFER_CANCELLED, LIBUSB_TRANSFER_COMPLETED, LIBUSB_SUCCESS, LIBUSB_ERROR_* |
| 122 | PKG_CHECK_MODULES(LIBUSB, libusb-1.0) |
| 123 | |
| 124 | dnl Output files |
| 125 | AC_CONFIG_FILES([\ |
| 126 | Makefile \ |
| 127 | CommonLibs/Makefile \ |
| 128 | GSM/Makefile \ |
| 129 | Transceiver52M/Makefile \ |
| 130 | sqlite3/Makefile \ |
| 131 | ]) |
| 132 | |
| 133 | AC_OUTPUT |