Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ 1186ab98

History | View | Annotate | Download (13.1 kB)

1
dnl Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 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
23
dnl Set the prefix to the default when --prefix is not specified.
24
dnl This is critical for variable substitutions in the configure.
25
if test "${prefix}" = "NONE"; then
26
    prefix=${ac_default_prefix}
27
fi
28
29
AM_CONFIG_HEADER(config.h)
30
AC_CONFIG_SRCDIR([gnuradio-core/src/lib/runtime/gr_vmcircbuf.cc])
31
32
AC_CANONICAL_BUILD
33
AC_CANONICAL_HOST
34
AC_CANONICAL_TARGET
35
36
GR_VERSION
37
dnl ustar required to have pathnames > 99 chars
38
_AM_SET_OPTION([tar-ustar])
39
AM_INIT_AUTOMAKE(gnuradio,$RELEASE)
40
41
DEFINES=""
42
AC_SUBST(DEFINES)
43
44
dnl Remember if the user explicity set CFLAGS
45
if test -n "${CFLAGS}"; then
46
  user_set_cflags=yes
47
fi
48
dnl Remember if the user explicity set CXXFLAGS
49
if test -n "${CXXFLAGS}"; then
50
  user_set_cxxflags=yes
51
fi
52
53
54
LF_CONFIGURE_CC
55
LF_CONFIGURE_CXX
56
GR_LIB64		dnl check for lib64 suffix after choosing compilers
57
58
59
dnl The three macros above are known to override CFLAGS if the user
60
dnl didn't specify them.  Though I'm sure somebody thought this was
61
dnl a good idea, it makes it hard to use other than -g -O2 when compiling
62
dnl selected files.  Thus we "undo" the damage here...
63
dnl 
64
dnl If the user specified CFLAGS, we use them.
65
dnl See Makefile.common for the rest of the magic.
66
if test "$user_set_cflags" != yes; then
67
  autoconf_default_CFLAGS="$CFLAGS"
68
  CFLAGS=""
69
fi
70
AC_SUBST(autoconf_default_CFLAGS)
71
72
73
dnl The three macros above are known to override CXXFLAGS if the user
74
dnl didn't specify them.  Though I'm sure somebody thought this was
75
dnl a good idea, it makes it hard to use other than -g -O2 when compiling
76
dnl selected files.  Thus we "undo" the damage here...
77
dnl 
78
dnl If the user specified CXXFLAGS, we use them.  Otherwise when compiling
79
dnl the output of swig use use -O1 if we're using g++.
80
dnl See Makefile.common for the rest of the magic.
81
if test "$user_set_cxxflags" != yes; then
82
  autoconf_default_CXXFLAGS="$CXXFLAGS"
83
  CXXFLAGS=""
84
  if test "$GXX" = yes; then
85
    case "$host_cpu" in
86
    	powerpc*)
87
	   dnl "-O1" is broken on the PPC for some reason
88
	   dnl (at least as of g++ 4.1.1)
89
	   swig_CXXFLAGS="-g1 -O2 -Wno-strict-aliasing -Wno-parentheses"
90
	;;
91
    	*) 
92
	swig_CXXFLAGS="-g -O1 -Wno-strict-aliasing -Wno-parentheses"
93
	;;
94
    esac
95
  fi
96
fi
97
AC_SUBST(autoconf_default_CXXFLAGS)
98
AC_SUBST(swig_CXXFLAGS)
99
100
dnl add ${prefix}/lib${gr_libdir_suffix}/pkgconfig to the head of the PKG_CONFIG_PATH
101
if test x${PKG_CONFIG_PATH} = x; then
102
    PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig
103
else
104
    PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig:${PKG_CONFIG_PATH}
105
fi
106
export PKG_CONFIG_PATH
107
108
LF_SET_WARNINGS
109
GR_SET_GPROF
110
GR_SET_PROF
111
AM_PROG_AS
112
AC_PROG_LN_S
113
AC_PROG_MAKE_SET
114
AC_PROG_INSTALL
115
116
# AC_PROG_MKDIR_P
117
# is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
118
# Remove this macro when we can assume autoconf >= 2.60.
119
m4_ifdef([AC_PROG_MKDIR_P], [], [
120
  AC_DEFUN([AC_PROG_MKDIR_P],
121
    [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
122
     MKDIR_P='$(mkdir_p)'
123
     AC_SUBST([MKDIR_P])])
124
])
125
AC_PROG_MKDIR_P
126
127
AC_PATH_PROG([RM_PROG], [rm])
128
129
AC_LIBTOOL_WIN32_DLL
130
dnl AC_DISABLE_SHARED	dnl don't build shared libraries
131
AC_ENABLE_SHARED	dnl do build shared libraries
132
AC_DISABLE_STATIC	dnl don't build static libraries
133
m4_ifdef([LT_INIT],[LT_INIT],[AC_PROG_LIBTOOL])
134
dnl GR_FORTRAN
135
136
GR_NO_UNDEFINED		dnl do we need the -no-undefined linker flag
137
GR_SCRIPTING
138
139
# Allow user to choose whether to generate SWIG/Python 
140
# Default is enabled
141
AC_ARG_ENABLE([python],
142
  [AS_HELP_STRING([--enable-python],
143
    [generate SWIG/Python components (default is yes)])],
144
  [case "${enableval}" in
145
     yes) enable_python=yes ;;
146
     no) enable_python=no ;;
147
     *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;;
148
   esac],
149
  [enable_python=yes]
150
)
151
AM_CONDITIONAL([PYTHON], [test x$enable_python = xyes])
152
153
AC_CHECK_PROG([XMLTO],[xmlto],[yes],[])
154
AM_CONDITIONAL([HAS_XMLTO], [test x$XMLTO = xyes])
155
156
dnl Checks for libraries.
157
AC_CHECK_LIB(socket,socket)
158
159
dnl Set the c++ compiler that we use for the build system when cross compiling
160
if test x$CXX_FOR_BUILD = x
161
then
162
  if test x$cross_compiling = xno; then
163
    CXX_FOR_BUILD=${CXX}
164
  else
165
    CXX_FOR_BUILD=g++
166
  fi
167
fi
168
AC_SUBST(CXX_FOR_BUILD)
169
170
dnl Check for SysV shm (mandatory)
171
dnl FIXME this is no longer mandatory.  Check the macro.
172
GR_SYSV_SHM
173
174
dnl Checks for header files.
175
AC_HEADER_STDC
176
AC_HEADER_SYS_WAIT
177
AC_CHECK_HEADERS(fcntl.h limits.h strings.h time.h sys/ioctl.h sys/time.h unistd.h)
178
AC_CHECK_HEADERS(linux/ppdev.h dev/ppbus/ppi.h sys/mman.h sys/select.h sys/types.h)
179
AC_CHECK_HEADERS(sys/resource.h stdint.h sched.h signal.h sys/syscall.h malloc.h)
180
AC_CHECK_HEADERS(windows.h)
181
AC_CHECK_HEADERS(vec_types.h)
182
AC_CHECK_HEADERS(netdb.h netinet/in.h arpa/inet.h sys/types.h sys/socket.h)
183
184
dnl Checks for typedefs, structures, and compiler characteristics.
185
AC_C_CONST
186
AC_C_INLINE
187
AC_TYPE_SIZE_T
188
AC_HEADER_TIME
189
AC_C_BIGENDIAN([GR_ARCH_BIGENDIAN=1],[GR_ARCH_BIGENDIAN=0])
190
AC_SUBST(GR_ARCH_BIGENDIAN)
191
AC_STRUCT_TM
192
193
dnl Checks for library functions.
194
AC_FUNC_ALLOCA
195
GR_CHECK_MEMALIGN
196
AC_FUNC_SETVBUF_REVERSED
197
AC_FUNC_VPRINTF
198
AC_CHECK_FUNCS([mmap select socket strcspn strerror strspn getpagesize sysconf])
199
AC_CHECK_FUNCS([snprintf gettimeofday nanosleep sched_setscheduler])
200
AC_CHECK_FUNCS([modf sqrt sigaction sigprocmask pthread_sigmask])
201
AC_CHECK_FUNCS([sched_setaffinity])
202
203
AC_CHECK_LIB(m, sincos, [AC_DEFINE([HAVE_SINCOS],[1],[Define to 1 if your system has `sincos'.])])
204
AC_CHECK_LIB(m, sincosf,[AC_DEFINE([HAVE_SINCOSF],[1],[Define to 1 if your system has `sincosf'.])])
205
AC_CHECK_LIB(m, sinf, [AC_DEFINE([HAVE_SINF],[1],[Define to 1 if your system has `sinf'.])])
206
AC_CHECK_LIB(m, cosf, [AC_DEFINE([HAVE_COSF],[1],[Define to 1 if your system has `cosf'.])])
207
AC_CHECK_LIB(m, trunc, [AC_DEFINE([HAVE_TRUNC],[1],[Define to 1 if your system has `trunc'.])])
208
AC_CHECK_LIB(m, exp10, [AC_DEFINE([HAVE_EXP10],[1],[Define to 1 if your system has 'exp10'.])])
209
AC_CHECK_LIB(m, log2, [AC_DEFINE([HAVE_LOG2],[1],[Define to 1 if your system has 'log2'.])])
210
#AC_FUNC_MKTIME
211
212
AH_BOTTOM([
213
#ifndef HAVE_TRUNC
214
#include <math.h>
215
inline static double trunc(double x)
216
{
217
  return x >= 0 ? floor(x) : ceil(x);
218
}
219
#endif
220
221
#ifndef HAVE_EXP10
222
#include <math.h>
223
inline static double exp10(double x)
224
{
225
  return pow(10.0, x);
226
}
227
#endif
228
229
#ifdef HAVE_WINDOWS_H
230
#define NOMINMAX
231
#endif
232
])
233
234
GR_CHECK_SHM_OPEN
235
GR_LIBGNURADIO_CORE_EXTRA_LDFLAGS
236
GR_CHECK_CREATEFILEMAPPING
237
238
dnl Check for Mingw support
239
GR_PWIN32
240
241
dnl Do we have "dot", part of the graphviz package from AT&T?
242
dnl Doxgen will use it to draw pretty diagrams ;-)
243
AC_CHECK_PROG(HAVE_DOT, [dot],[YES],[NO])
244
245
PKG_CHECK_MODULES(FFTW3F, fftw3f >= 3.0)
246
AC_SUBST(FFTW3F_LIBS)
247
248
dnl conditional build stuff
249
GR_CHECK_DOXYGEN
250
GR_SET_MD_CPU
251
252
dnl Define where to look for cppunit includes and libs
253
dnl sets CPPUNIT_CFLAGS and CPPUNIT_LIBS
254
dnl Try using pkg-config first, then fall back to cppunit-config.
255
PKG_CHECK_EXISTS(cppunit,
256
  [PKG_CHECK_MODULES(CPPUNIT, cppunit >= 1.9.14)],
257
  [AM_PATH_CPPUNIT([1.9.14],[],
258
		[AC_MSG_ERROR([GNU Radio requires cppunit.  Stop])])])
259
260
CPPUNIT_INCLUDES=$CPPUNIT_CFLAGS
261
AC_SUBST(CPPUNIT_INCLUDES)
262
263
dnl see if GUILE is installed
264
AC_PATH_PROG(GUILE,guile)
265
266
dnl
267
dnl We require the boost headers, thread lib and date_time lib.
268
dnl AX_BOOST_BASE finds the headers and the lib dir (-L<foo>)
269
dnl
270
dnl calls AC_SUBST(BOOST_CPPFLAGS), AC_SUBST(BOOST_LDFLAGS) and defines HAVE_BOOST
271
dnl
272
dnl Current Boost version requirement is >=1.35 for all platforms except Darwin,
273
dnl which requires >=1.37 for code in usrp host library.
274
case "$host_os" in
275
     darwin*)
276
        AX_BOOST_BASE([1.37])
277
        ;;
278
      *)
279
        AX_BOOST_BASE([1.35])
280
        ;;
281
esac
282
283
dnl calls AC_SUBST(BOOST_THREAD_LIB), AC_SUBST(BOOST_CXXFLAGS) and defines HAVE_BOOST_THREAD
284
AX_BOOST_THREAD
285
CXXFLAGS="$CXXFLAGS $BOOST_CXXFLAGS"       dnl often picks up a -pthread or something similar
286
CFLAGS="$CFLAGS $BOOST_CXXFLAGS"           dnl often picks up a -pthread or something similar
287
288
dnl
289
dnl all the rest of these call AC_SUBST(BOOST_<foo>_LIB) and define HAVE_BOOST_<foo>
290
dnl
291
AX_BOOST_DATE_TIME
292
dnl AX_BOOST_FILESYSTEM
293
dnl AX_BOOST_IOSTREAMS
294
AX_BOOST_PROGRAM_OPTIONS
295
dnl AX_BOOST_REGEX
296
dnl AX_BOOST_SERIALIZATION
297
dnl AX_BOOST_SIGNALS
298
dnl AX_BOOST_SYSTEM
299
dnl AX_BOOST_TEST_EXEC_MONITOR
300
dnl AX_BOOST_UNIT_TEST_FRAMEWORK
301
dnl AX_BOOST_WSERIALIZATION
302
303
BUILD_DATE=`date -u +"%a, %d %b %Y %R:%S"`
304
AC_SUBST(BUILD_DATE)
305
306
dnl SYSCONFDIR substitution
307
if test "${sysconfdir}" == "\${prefix}/etc" ; then
308
   if test "${prefix}" == "NONE" ; then
309
      SYSCONFDIR=["$ac_default_prefix/etc"]
310
   else
311
      SYSCONFDIR=["${prefix}/etc"]
312
   fi
313
else
314
   SYSCONFDIR=[${sysconfdir}]
315
fi
316
AC_SUBST(SYSCONFDIR)
317
318
dnl System configuration files
319
GR_PREFSDIR=[$SYSCONFDIR/${PACKAGE}/conf.d]
320
AC_SUBST(GR_PREFSDIR)
321
322
dnl Component specific configuration
323
dnl The order of the GR_ macros determines the order of compilation
324
dnl For -any- checks on $enable_all_components
325
dnl use the following guidelines:
326
dnl   yes : --enable-all-components was specified, so error out if any
327
dnl         components do not pass configuration checks.
328
dnl   no  : --disable-all-components was specified, so try to build the
329
dnl         --enable'd components, and error out if any do not pass
330
dnl         configuration checks.
331
dnl   ""  : this option was not specified on the command line; try to
332
dnl         build all components that are not --with'd, but don't
333
dnl         error out if any component does not pass configuration checks.
334
dnl
335
dnl For each --enable-foo component, if that flag is not specified on
336
dnl the command line, the related variable $enable_foo will be set to
337
dnl $enable_all_components .
338
339
AC_ARG_ENABLE(
340
    [all-components],
341
    [  --enable-all-components Build all configurable components (default), or stop on failed dependencies]
342
)
343
344
build_dirs="config"
345
GRC_GRUEL                       dnl must come first
346
GRC_VOLK
347
GRC_GCELL
348
GRC_GNURADIO_CORE
349
GRC_USRP
350
GRC_USRP2
351
GRC_GR_USRP			dnl this must come after GRC_USRP
352
GRC_GR_USRP2
353
GRC_GR_GCELL			dnl this must come after GRC_GCELL and GRC_GNURADIO_CORE
354
GRC_GR_MSDD6000	
355
GRC_GR_AUDIO_ALSA
356
GRC_GR_AUDIO_JACK
357
GRC_GR_AUDIO_OSS
358
GRC_GR_AUDIO_OSX
359
GRC_GR_AUDIO_PORTAUDIO
360
GRC_GR_AUDIO_WINDOWS
361
GRC_GR_ATSC
362
GRC_GR_COMEDI
363
GRC_GR_CVSD_VOCODER
364
GRC_GR_GPIO
365
GRC_GR_GSM_FR_VOCODER
366
GRC_GR_NOAA
367
GRC_GR_PAGER
368
GRC_GR_RADAR_MONO
369
GRC_GR_RADIO_ASTRONOMY
370
GRC_GR_TRELLIS
371
GRC_GR_VIDEO_SDL
372
GRC_GR_WXGUI
373
GRC_GR_QTGUI
374
GRC_GR_SOUNDER			dnl this must come after GRC_USRP
375
GRC_GR_UTILS                   dnl this must come after GRC_GR_WXGUI
376
GRC_GNURADIO_EXAMPLES		dnl must come after all GRC_GR_*
377
GRC_GRC
378
GRC_GR_UHD
379
GRC_DOCS			dnl must be last
380
381
# Each component is now either to be built, was skipped, will be
382
# included from pre-installed libraries and includes, or failed
383
# dependencies.
384
AC_SUBST([build_dirs], [$build_dirs])
385
AC_SUBST([skipped_dirs], [$skipped_dirs])
386
AC_SUBST([with_dirs], [$with_dirs])
387
388
# fix for older autotools that don't define these by default
389
AC_SUBST(abs_top_srcdir)
390
AC_SUBST(abs_top_builddir)
391
AC_SUBST(MKDIR_P)
392
393
# 'with' variables - the pre-installed libraries, includes, and paths
394
# - must always come last in the lists, so they require special
395
# treatment.
396
AC_SUBST(with_INCLUDES)
397
AC_SUBST(with_SWIG_INCLUDES)
398
AC_SUBST(with_PYDIRPATH)
399
AC_SUBST(with_SWIGDIRPATH)
400
AC_SUBST(with_LIBDIRPATH)
401
402
# Local files tweaked by AC
403
AC_CONFIG_FILES([\
404
    Makefile \
405
    run_tests.sh \
406
    config/Makefile \
407
])
408
409
dnl run_tests.sh is created from run_tests.sh.in .  Make it executable.
410
AC_CONFIG_COMMANDS([run_tests_build], [chmod +x run_tests.sh])
411
412
AC_OUTPUT
413
414
echo
415
echo "*********************************************************************"
416
echo The following GNU Radio components have been successfully configured:
417
echo 
418
for dir in $build_dirs
419
do
420
    echo $dir
421
done
422
echo
423
echo You my now run the 'make' command to build these components.
424
echo
425
if test "$skipped_dirs" != ""; then
426
    echo "*********************************************************************"
427
    echo The following components were skipped either because you asked not
428
    echo to build them or they didn\'t pass configuration checks:
429
    echo
430
    for dir in $skipped_dirs
431
    do
432
        echo $dir
433
    done
434
    echo
435
    echo These components will not be built.
436
    echo
437
fi
438
if test "$with_dirs" != ""; then
439
    echo "*********************************************************************"
440
    echo The following components will be included from pre-installed
441
    echo libraries and includes:
442
    echo
443
    for dir in $with_dirs
444
    do
445
        echo $dir
446
    done
447
    echo
448
    echo These components will not be built.
449
    echo
450
fi
451
452
echo Configured GNU Radio release $RELEASE for build.