root/gnuradio/tags/releases/3.1.2/configure.ac

Revision 8104 (checked in by jcorgan, 8 months ago)

Update revision to 3.1.2.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
Line 
1 dnl Copyright 2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
2 dnl
3 dnl This file is part of GNU Radio
4 dnl
5 dnl GNU Radio is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 3, or (at your option)
8 dnl any later version.
9 dnl
10 dnl GNU Radio is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 dnl GNU General Public License for more details.
14 dnl
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with GNU Radio; see the file COPYING.  If not, write to
17 dnl the Free Software Foundation, Inc., 51 Franklin Street,
18 dnl Boston, MA 02110-1301, USA.
19
20 AC_INIT
21 AC_PREREQ(2.57)
22 AM_CONFIG_HEADER(config.h)
23 AC_CANONICAL_HOST
24 AC_CANONICAL_TARGET([])
25 AM_INIT_AUTOMAKE(gnuradio,3.1.2)
26 AC_CONFIG_SRCDIR([gnuradio-core/src/lib/runtime/gr_vmcircbuf.cc])
27
28 if test x$cross_compiling != xno; then
29   AC_MSG_NOTICE([Configuring GNU Radio for cross compilation])
30 else
31   AC_MSG_NOTICE([Configuring GNU Radio for native compilation])
32 fi
33
34 dnl add ${prefix}/lib/pkgconfig to the head of the PKG_CONFIG_PATH
35 if test [x]${PKG_CONFIG_PATH} = x; then
36     PKG_CONFIG_PATH=${prefix}/lib/pkgconfig
37 else
38     PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:${PKG_CONFIG_PATH}
39 fi
40 export PKG_CONFIG_PATH
41
42 DEFINES=""
43 AC_SUBST(DEFINES)
44
45 dnl Remember if the user explicity set CXXFLAGS
46 if test -n "${CXXFLAGS}"; then
47   user_set_cxxflags=yes
48 fi
49
50 GR_X86_64               dnl check for lib64 suffix
51 LF_CONFIGURE_CC
52 LF_CONFIGURE_CXX
53
54 dnl The three macros above are known to override CXXFLAGS if the user
55 dnl didn't specify them.  Though I'm sure somebody thought this was
56 dnl a good idea, it makes it hard to use other than -g -O2 when compiling
57 dnl selected files.  Thus we "undo" the damage here...
58 dnl
59 dnl If the user specified CXXFLAGS, we use them.  Otherwise when compiling
60 dnl the output of swig use use -O1 if we're using g++.
61 dnl See Makefile.common for the rest of the magic.
62 if test "$user_set_cxxflags" != yes; then
63   autoconf_default_CXXFLAGS="$CXXFLAGS"
64   CXXFLAGS=""
65   if test "$GXX" = yes; then
66     case "$host_cpu" in
67         powerpc*)
68            dnl "-O1" is broken on the PPC for some reason
69            dnl (at least as of g++ 4.1.1)
70            swig_CXXFLAGS="-g1 -O2"
71         ;;
72         *)
73         swig_CXXFLAGS="-g1 -O1"
74         ;;
75     esac
76   fi
77 fi
78 AC_SUBST(autoconf_default_CXXFLAGS)
79 AC_SUBST(swig_CXXFLAGS)
80
81 LF_SET_WARNINGS
82 GR_SET_GPROF
83 GR_SET_PROF
84 AM_PROG_AS
85 AC_PROG_LN_S
86 AC_PROG_MAKE_SET
87 AC_PROG_INSTALL
88 AC_PATH_PROG([RM_PROG], [rm])
89
90 AC_LIBTOOL_WIN32_DLL
91 dnl AC_DISABLE_SHARED   dnl don't build shared libraries
92 AC_ENABLE_SHARED        dnl do build shared libraries
93 AC_DISABLE_STATIC       dnl don't build static libraries
94 AC_PROG_LIBTOOL
95 GR_FORTRAN
96
97 GR_NO_UNDEFINED         dnl do we need the -no-undefined linker flag
98 GR_SCRIPTING
99
100 AC_CHECK_PROG([XMLTO],[xmlto],[yes],[])
101 AM_CONDITIONAL([HAS_XMLTO], [test x$XMLTO = xyes])
102
103 dnl Checks for libraries.
104 AC_CHECK_LIB(socket,socket)
105
106 dnl check for threads (mandatory)
107 GR_OMNITHREAD
108 CFLAGS="${CFLAGS} $PTHREAD_CFLAGS"
109 CXXFLAGS="${CXXFLAGS} $PTHREAD_CFLAGS"
110
111 if test "x$CXX_FOR_BUILD" = x
112 then
113   CXX_FOR_BUILD=${CXX}
114 fi
115 AC_SUBST(CXX_FOR_BUILD)
116
117 dnl Check for SysV shm (mandatory)
118 dnl FIXME this is no longer mandatory.  Check the macro.
119 GR_SYSV_SHM
120
121 dnl Checks for header files.
122 AC_HEADER_STDC
123 AC_HEADER_SYS_WAIT
124 AC_CHECK_HEADERS(fcntl.h limits.h strings.h time.h sys/ioctl.h sys/time.h unistd.h)
125 AC_CHECK_HEADERS(linux/ppdev.h dev/ppbus/ppi.h sys/mman.h sys/select.h sys/types.h)
126 AC_CHECK_HEADERS(sys/resource.h stdint.h sched.h signal.h sys/syscall.h)
127 AC_CHECK_HEADERS(netinet/in.h)
128 AC_CHECK_HEADERS(windows.h)
129
130 dnl Checks for typedefs, structures, and compiler characteristics.
131 AC_C_CONST
132 AC_C_INLINE
133 AC_TYPE_SIZE_T
134 AC_HEADER_TIME
135 AC_C_BIGENDIAN
136 AC_STRUCT_TM
137
138 dnl Checks for library functions.
139 AC_FUNC_ALLOCA
140 AC_FUNC_SETVBUF_REVERSED
141 AC_FUNC_VPRINTF
142 AC_CHECK_FUNCS([mmap select socket strcspn strerror strspn getpagesize sysconf])
143 AC_CHECK_FUNCS([snprintf gettimeofday nanosleep sched_setscheduler])
144 AC_CHECK_FUNCS([modf sqrt sigaction sigprocmask pthread_sigmask])
145 AC_CHECK_FUNCS([sched_setaffinity])
146
147 AC_CHECK_LIB(m, sincos, [AC_DEFINE([HAVE_SINCOS],[1],[Define to 1 if your system has `sincos'.])])
148 AC_CHECK_LIB(m, sincosf,[AC_DEFINE([HAVE_SINCOSF],[1],[Define to 1 if your system has `sincosf'.])])
149 AC_CHECK_LIB(m, sinf, [AC_DEFINE([HAVE_SINF],[1],[Define to 1 if your system has `sinf'.])])
150 AC_CHECK_LIB(m, cosf, [AC_DEFINE([HAVE_COSF],[1],[Define to 1 if your system has `cosf'.])])
151 AC_CHECK_LIB(m, trunc, [AC_DEFINE([HAVE_TRUNC],[1],[Define to 1 if your system has `trunc'.])])
152 AC_CHECK_LIB(m, exp10, [AC_DEFINE([HAVE_EXP10],[1],[Define to 1 if your system has 'exp10'.])])
153 #AC_FUNC_MKTIME
154
155 AH_BOTTOM([
156 #ifndef HAVE_TRUNC
157 #include <math.h>
158 inline static double trunc(double x)
159 {
160   return x >= 0 ? floor(x) : ceil(x);
161 }
162 #endif
163
164 #ifndef HAVE_EXP10
165 #include <math.h>
166 inline static double exp10(double x)
167 {
168   return pow(10.0, x);
169 }
170 #endif
171
172 #ifdef HAVE_WINDOWS_H
173 #define NOMINMAX
174 #endif
175 ])
176
177 GR_CHECK_SHM_OPEN
178 GR_LIBGNURADIO_CORE_EXTRA_LDFLAGS
179 GR_CHECK_CREATEFILEMAPPING
180
181 dnl Check for Mingw support
182 GR_PWIN32
183
184 dnl Do we have "dot", part of the graphviz package from AT&T?
185 dnl Doxgen will use it to draw pretty diagrams ;-)
186 AC_CHECK_PROG(HAVE_DOT, [dot],[YES],[NO])
187
188 PKG_CHECK_MODULES(FFTW3F, fftw3f >= 3.0)
189 AC_SUBST(FFTW3F_LIBS)
190
191 dnl conditional build stuff
192 GR_CHECK_DOXYGEN
193 GR_SET_MD_CPU
194
195 dnl Define where to look for cppunit includes and libs
196 dnl sets CPPUNIT_CFLAGS and CPPUNIT_LIBS
197 AM_PATH_CPPUNIT([1.9.14],[],
198                 [AC_MSG_ERROR([GNU Radio requires cppunit.  Stop])])
199
200 dnl see if GUILE is installed
201 AC_PATH_PROG(GUILE,guile)
202
203 CPPUNIT_INCLUDES=$CPPUNIT_CFLAGS
204 AC_SUBST(CPPUNIT_INCLUDES)
205
206 dnl Define where to find boost includes
207 dnl defines BOOST_CFLAGS
208 GR_REQUIRE_BOOST_INCLUDES
209
210 dnl If this is being done from a subversion tree, create variables
211 GR_SUBVERSION
212
213 dnl Component specific configuration
214 dnl The order of the GR_ macros determines the order of compilation
215 dnl For -any- checks on $enable_all_components
216 dnl use the following guildlines:
217 dnl   yes : --enable-all-components was specified, so error out if any
218 dnl         components do not pass configuration checks.
219 dnl   no  : --disable-all-components was specified, so try to build the
220 dnl         --enable'd components, and error out if any do not pass
221 dnl         configuration checks.
222 dnl   ""  : this option was not specified on the command line; try to
223 dnl         build all components that are not --with'd, but don't
224 dnl         error out if any component does not pass configuration checks.
225 dnl
226 dnl For each --enable-foo component, if that flag is not specified on
227 dnl the command line, the related variable $enable_foo will be set to
228 dnl $enable_all_components .
229
230 AC_ARG_ENABLE(
231     [all-components],
232     [  --enable-all-components Build all configurable components (default), or stop on failed dependencies]
233 )
234
235 build_dirs="config"
236 GRC_OMNITHREAD                  dnl must come before gnuradio-core and mblock
237 GRC_GNURADIO_CORE
238 GRC_USRP
239 GRC_GR_USRP                     dnl this must come after GRC_USRP
240 GRC_GR_AUDIO_ALSA
241 GRC_GR_AUDIO_JACK
242 GRC_GR_AUDIO_OSS
243 GRC_GR_AUDIO_OSX
244 GRC_GR_AUDIO_PORTAUDIO
245 GRC_GR_AUDIO_WINDOWS
246 GRC_GR_ATSC
247 GRC_GR_COMEDI
248 GRC_GR_GPIO
249 GRC_GR_GSM_FR_VOCODER
250 GRC_GR_PAGER
251 GRC_GR_RADAR_MONO
252 GRC_GR_RADIO_ASTRONOMY
253 GRC_GR_TRELLIS
254 GRC_GR_VIDEO_SDL
255 GRC_GR_WXGUI
256 GRC_GR_SOUNDER                  dnl this must come after GRC_USRP
257 GRC_GR_UTILS                    dnl this must come after GRC_GR_WXGUI
258 GRC_GNURADIO_EXAMPLES           dnl must come last
259
260 # Each component is now either to be built, was skipped, will be
261 # included from pre-installed libraries and includes, or failed
262 # dependencies.
263 AC_SUBST([build_dirs], [$build_dirs])
264 AC_SUBST([skipped_dirs], [$skipped_dirs])
265 AC_SUBST([with_dirs], [$with_dirs])
266
267 # fix for older autotools that don't define "abs_top_YYY" by default
268 AC_SUBST(abs_top_srcdir)
269 AC_SUBST(abs_top_builddir)
270
271 # 'with' variables - the pre-installed libraries, includes, and paths
272 # - must always come last in the lists, so they require special
273 # treatment.
274 AC_SUBST(with_INCLUDES)
275 AC_SUBST(with_SWIG_INCLUDES)
276 AC_SUBST(with_PYDIRPATH)
277 AC_SUBST(with_SWIGDIRPATH)
278 AC_SUBST(with_LIBDIRPATH)
279
280 # Local files tweaked by AC
281 AC_CONFIG_FILES([\
282     Makefile \
283     run_tests.sh \
284     config/Makefile \
285 ])
286
287 dnl run_tests.sh is created from run_tests.sh.in .  Make it executable.
288 AC_CONFIG_COMMANDS([run_tests_build], [chmod +x run_tests.sh])
289
290 AC_OUTPUT
291
292 echo
293 echo "*********************************************************************"
294 echo The following GNU Radio components have been successfully configured:
295 echo
296 for dir in $build_dirs
297 do
298     echo $dir
299 done
300 echo
301 echo You my now run the 'make' command to build these components.
302 echo
303 if test "$skipped_dirs" != ""; then
304     echo "*********************************************************************"
305     echo The following components were skipped either because you asked not
306     echo to build them or they didn\'t pass configuration checks:
307     echo
308     for dir in $skipped_dirs
309     do
310         echo $dir
311     done
312     echo
313     echo These components will not be built.
314     echo
315 fi
316 if test "$with_dirs" != ""; then
317     echo "*********************************************************************"
318     echo The following components will be included from pre-installed
319     echo libraries and includes:
320     echo
321     for dir in $with_dirs
322     do
323         echo $dir
324     done
325     echo
326     echo These components will not be built.
327     echo
328 fi
Note: See TracBrowser for help on using the browser.