aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: bcc95e60e41bec055dcf61d33017db2183015d00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
AC_INIT([libusrp],
	m4_esyscmd([./git-version-gen .tarball-version]),
	[openbsc@lists.osmocom.org])

AM_INIT_AUTOMAKE([foreign subdir-objects silent-rules])
AM_SILENT_RULES([yes])

AC_CONFIG_MACRO_DIRS([m4])

CFLAGS="$CFLAGS -std=gnu11"

dnl include release helper
RELMAKE='-include osmo-release.mk'
AC_SUBST([RELMAKE])

AC_PROG_CXX

LT_INIT([pic-only disable-static])

PKG_CHECK_MODULES([USB], [libusb-1.0])

AX_BOOST_BASE([1.37], [true], [AC_MSG_ERROR([boost is required, bailing out])])

AX_BOOST_THREAD
CXXFLAGS="$CXXFLAGS $BOOST_CXXFLAGS"       dnl often picks up a -pthread or something similar
CFLAGS="$CFLAGS $BOOST_CXXFLAGS"           dnl often picks up a -pthread or something similar

dnl
dnl all the rest of these call AC_SUBST(BOOST_<foo>_LIB) and define HAVE_BOOST_<foo>
dnl
AX_BOOST_DATE_TIME
AX_BOOST_FILESYSTEM
dnl AX_BOOST_IOSTREAMS
AX_BOOST_PROGRAM_OPTIONS
dnl AX_BOOST_REGEX
dnl AX_BOOST_SERIALIZATION
dnl AX_BOOST_SIGNALS
AX_BOOST_SYSTEM
dnl AX_BOOST_TEST_EXEC_MONITOR
dnl AX_BOOST_UNIT_TEST_FRAMEWORK
dnl AX_BOOST_WSERIALIZATION

# Allow user to choose whether to generate SWIG/Python
# Default is enabled
AC_ARG_ENABLE([python],
  [AS_HELP_STRING([--enable-python],
    [generate SWIG/Python components (default is yes)])],
  [case "${enableval}" in
     yes) enable_python=yes ;;
     no) enable_python=no ;;
     *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;;
   esac],
  [enable_python=no]
)

# Allow user to choose whether to generate SWIG/Guile
# Default is disabled
AC_ARG_ENABLE([guile],
  [AS_HELP_STRING([--enable-guile],
    [generate SWIG/Guile components (default is no)])],
  [case "${enableval}" in
     yes) enable_guile=yes ;;
     no) enable_guile=no ;;
     *) AC_MSG_ERROR([bad value ${enableval} for --enable-guile]) ;;
   esac],
  [enable_guile=no]
)

AM_PATH_PYTHON

AM_CONDITIONAL([PYTHON], [test x$enable_python = xyes])
AM_CONDITIONAL([GUILE], [test x$enable_guile = xyes])

AC_ARG_ENABLE(doxygen,
	[AS_HELP_STRING(
		[--disable-doxygen],
		[Disable generation of documentation using doxygen],
	)],
	[doxygen=$enableval], [doxygen="yes"])
AC_PATH_PROG(DOXYGEN,doxygen,false)
AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes")

AC_CHECK_PROG([XMLTO],[xmlto],[yes],[])
AM_CONDITIONAL([HAS_XMLTO], [test x$XMLTO = xyes])

USRP_SDCC([3.2.0],[],[passed=no;AC_MSG_RESULT([Unable to find firmware compiler SDCC 3.x.])])

AC_CONFIG_FILES([
  Makefile
  usrp.pc
  usrp.iss
  doc/Doxyfile
  doc/Makefile
  doc/other/Makefile
  host/Makefile
  host/include/Makefile
  host/include/usrp/Makefile
  host/include/usrp/libusb_types.h
  host/misc/Makefile
  host/lib/Makefile
  host/lib/std_paths.h
  host/swig/Makefile
  host/apps/Makefile
  firmware/Makefile
  firmware/include/Makefile
  firmware/lib/Makefile
  firmware/src/Makefile
  firmware/src/common/Makefile
  firmware/src/usrp2/Makefile
  fpga/Makefile
  fpga/rbf/Makefile
  fpga/rbf/rev2/Makefile
  fpga/rbf/rev4/Makefile
])
AC_OUTPUT([contrib/libusrp.spec])