Statistics
| Branch: | Tag: | Revision:

root / firmware / fx2 / configure.ac @ 70eae1d2

History | View | Annotate | Download (9.9 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
AM_CONFIG_HEADER(config.h)
23

    
24
AC_CANONICAL_BUILD
25
AC_CANONICAL_HOST
26
AC_CANONICAL_TARGET
27

    
28
dnl ustar required to have pathnames > 99 chars
29
_AM_SET_OPTION([tar-ustar])
30
AM_INIT_AUTOMAKE(gnuradio,$RELEASE)
31

    
32
DEFINES=""
33
AC_SUBST(DEFINES)
34

    
35
dnl Remember if the user explicity set CFLAGS
36
if test -n "${CFLAGS}"; then
37
  user_set_cflags=yes
38
fi
39
dnl Remember if the user explicity set CXXFLAGS
40
if test -n "${CXXFLAGS}"; then
41
  user_set_cxxflags=yes
42
fi
43

    
44

    
45
LF_CONFIGURE_CC
46
LF_CONFIGURE_CXX
47
GR_LIB64		dnl check for lib64 suffix after choosing compilers
48

    
49

    
50
dnl The three macros above are known to override CFLAGS if the user
51
dnl didn't specify them.  Though I'm sure somebody thought this was
52
dnl a good idea, it makes it hard to use other than -g -O2 when compiling
53
dnl selected files.  Thus we "undo" the damage here...
54
dnl 
55
dnl If the user specified CFLAGS, we use them.
56
dnl See Makefile.common for the rest of the magic.
57
if test "$user_set_cflags" != yes; then
58
  autoconf_default_CFLAGS="$CFLAGS"
59
  CFLAGS=""
60
fi
61
AC_SUBST(autoconf_default_CFLAGS)
62

    
63

    
64
dnl The three macros above are known to override CXXFLAGS if the user
65
dnl didn't specify them.  Though I'm sure somebody thought this was
66
dnl a good idea, it makes it hard to use other than -g -O2 when compiling
67
dnl selected files.  Thus we "undo" the damage here...
68
dnl 
69
dnl If the user specified CXXFLAGS, we use them.  Otherwise when compiling
70
dnl the output of swig use use -O1 if we're using g++.
71
dnl See Makefile.common for the rest of the magic.
72
if test "$user_set_cxxflags" != yes; then
73
  autoconf_default_CXXFLAGS="$CXXFLAGS"
74
  CXXFLAGS=""
75
  if test "$GXX" = yes; then
76
    case "$host_cpu" in
77
    	powerpc*)
78
	   dnl "-O1" is broken on the PPC for some reason
79
	   dnl (at least as of g++ 4.1.1)
80
	   swig_CXXFLAGS="-g1 -O2 -Wno-strict-aliasing -Wno-parentheses"
81
	;;
82
    	*) 
83
	swig_CXXFLAGS="-g -O1 -Wno-strict-aliasing -Wno-parentheses"
84
	;;
85
    esac
86
  fi
87
fi
88
AC_SUBST(autoconf_default_CXXFLAGS)
89
AC_SUBST(swig_CXXFLAGS)
90

    
91
dnl add ${prefix}/lib${gr_libdir_suffix}/pkgconfig to the head of the PKG_CONFIG_PATH
92
if test x${PKG_CONFIG_PATH} = x; then
93
    PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig
94
else
95
    PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig:${PKG_CONFIG_PATH}
96
fi
97
export PKG_CONFIG_PATH
98

    
99
LF_SET_WARNINGS
100
AM_PROG_AS
101
AC_PROG_LN_S
102
AC_PROG_MAKE_SET
103
AC_PROG_INSTALL
104

    
105
# AC_PROG_MKDIR_P
106
# is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
107
# Remove this macro when we can assume autoconf >= 2.60.
108
m4_ifdef([AC_PROG_MKDIR_P], [], [
109
  AC_DEFUN([AC_PROG_MKDIR_P],
110
    [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
111
     MKDIR_P='$(mkdir_p)'
112
     AC_SUBST([MKDIR_P])])
113
])
114
AC_PROG_MKDIR_P
115

    
116
AC_PATH_PROG([RM_PROG], [rm])
117

    
118
AC_LIBTOOL_WIN32_DLL
119
dnl AC_DISABLE_SHARED	dnl don't build shared libraries
120
AC_ENABLE_SHARED	dnl do build shared libraries
121
AC_DISABLE_STATIC	dnl don't build static libraries
122
m4_ifdef([LT_INIT],[LT_INIT],[AC_PROG_LIBTOOL])
123
dnl GR_FORTRAN
124

    
125
GR_NO_UNDEFINED		dnl do we need the -no-undefined linker flag
126
GR_SCRIPTING
127

    
128

    
129
AM_CONDITIONAL([PYTHON], [test x$enable_python = xyes])
130

    
131
dnl Checks for libraries.
132
AC_CHECK_LIB(socket,socket)
133

    
134
dnl Set the c++ compiler that we use for the build system when cross compiling
135
if test x$CXX_FOR_BUILD = x
136
then
137
  if test x$cross_compiling = xno; then
138
    CXX_FOR_BUILD=${CXX}
139
  else
140
    CXX_FOR_BUILD=g++
141
  fi
142
fi
143
AC_SUBST(CXX_FOR_BUILD)
144

    
145
dnl Checks for header files.
146
AC_HEADER_STDC
147
AC_HEADER_SYS_WAIT
148
AC_CHECK_HEADERS(fcntl.h limits.h strings.h time.h sys/ioctl.h sys/time.h unistd.h)
149
AC_CHECK_HEADERS(linux/ppdev.h dev/ppbus/ppi.h sys/mman.h sys/select.h sys/types.h)
150
AC_CHECK_HEADERS(sys/resource.h stdint.h sched.h signal.h sys/syscall.h malloc.h)
151
AC_CHECK_HEADERS(windows.h)
152
AC_CHECK_HEADERS(vec_types.h)
153
AC_CHECK_HEADERS(netdb.h netinet/in.h arpa/inet.h sys/types.h sys/socket.h)
154

    
155
dnl Checks for typedefs, structures, and compiler characteristics.
156
AC_C_CONST
157
AC_C_INLINE
158
AC_TYPE_SIZE_T
159
AC_HEADER_TIME
160
AC_C_BIGENDIAN([GR_ARCH_BIGENDIAN=1],[GR_ARCH_BIGENDIAN=0])
161
AC_SUBST(GR_ARCH_BIGENDIAN)
162
AC_STRUCT_TM
163

    
164
dnl Checks for library functions.
165
AC_FUNC_ALLOCA
166
AC_FUNC_SETVBUF_REVERSED
167
AC_FUNC_VPRINTF
168
AC_CHECK_FUNCS([mmap select socket strcspn strerror strspn getpagesize sysconf])
169
AC_CHECK_FUNCS([snprintf gettimeofday nanosleep sched_setscheduler])
170
AC_CHECK_FUNCS([modf sqrt sigaction sigprocmask pthread_sigmask])
171
AC_CHECK_FUNCS([sched_setaffinity])
172

    
173
AC_CHECK_LIB(m, sincos, [AC_DEFINE([HAVE_SINCOS],[1],[Define to 1 if your system has `sincos'.])])
174
AC_CHECK_LIB(m, sincosf,[AC_DEFINE([HAVE_SINCOSF],[1],[Define to 1 if your system has `sincosf'.])])
175
AC_CHECK_LIB(m, sinf, [AC_DEFINE([HAVE_SINF],[1],[Define to 1 if your system has `sinf'.])])
176
AC_CHECK_LIB(m, cosf, [AC_DEFINE([HAVE_COSF],[1],[Define to 1 if your system has `cosf'.])])
177
AC_CHECK_LIB(m, trunc, [AC_DEFINE([HAVE_TRUNC],[1],[Define to 1 if your system has `trunc'.])])
178
AC_CHECK_LIB(m, exp10, [AC_DEFINE([HAVE_EXP10],[1],[Define to 1 if your system has 'exp10'.])])
179
AC_CHECK_LIB(m, log2, [AC_DEFINE([HAVE_LOG2],[1],[Define to 1 if your system has 'log2'.])])
180
#AC_FUNC_MKTIME
181

    
182
AH_BOTTOM([
183
#ifndef HAVE_TRUNC
184
#include <math.h>
185
inline static double trunc(double x)
186
{
187
  return x >= 0 ? floor(x) : ceil(x);
188
}
189
#endif
190

    
191
#ifndef HAVE_EXP10
192
#include <math.h>
193
inline static double exp10(double x)
194
{
195
  return pow(10.0, x);
196
}
197
#endif
198

    
199
#ifdef HAVE_WINDOWS_H
200
#define NOMINMAX
201
#endif
202
])
203

    
204
dnl Do we have "dot", part of the graphviz package from AT&T?
205
dnl Doxgen will use it to draw pretty diagrams ;-)
206
AC_CHECK_PROG(HAVE_DOT, [dot],[YES],[NO])
207

    
208
PKG_CHECK_MODULES(FFTW3F, fftw3f >= 3.0)
209
AC_SUBST(FFTW3F_LIBS)
210

    
211
dnl Define where to look for cppunit includes and libs
212
dnl sets CPPUNIT_CFLAGS and CPPUNIT_LIBS
213
dnl Try using pkg-config first, then fall back to cppunit-config.
214
PKG_CHECK_EXISTS(cppunit,
215
  [PKG_CHECK_MODULES(CPPUNIT, cppunit >= 1.9.14)],
216
  [AM_PATH_CPPUNIT([1.9.14],[],
217
		[AC_MSG_ERROR([GNU Radio requires cppunit.  Stop])])])
218

    
219
CPPUNIT_INCLUDES=$CPPUNIT_CFLAGS
220
AC_SUBST(CPPUNIT_INCLUDES)
221

    
222
dnl see if GUILE is installed
223
AC_PATH_PROG(GUILE,guile)
224

    
225

    
226
BUILD_DATE=`date -R -u`
227
AC_SUBST(BUILD_DATE)
228

    
229
dnl SYSCONFDIR substitution
230
if test "${sysconfdir}" == "\${prefix}/etc" ; then
231
   if test "${prefix}" == "NONE" ; then
232
      SYSCONFDIR=["$ac_default_prefix/etc"]
233
   else
234
      SYSCONFDIR=["${prefix}/etc"]
235
   fi
236
else
237
   SYSCONFDIR=[${sysconfdir}]
238
fi
239
AC_SUBST(SYSCONFDIR)
240

    
241
dnl System configuration files
242
GR_PREFSDIR=[$SYSCONFDIR/${PACKAGE}/conf.d]
243
AC_SUBST(GR_PREFSDIR)
244

    
245
dnl Component specific configuration
246
dnl The order of the GR_ macros determines the order of compilation
247
dnl For -any- checks on $enable_all_components
248
dnl use the following guidelines:
249
dnl   yes : --enable-all-components was specified, so error out if any
250
dnl         components do not pass configuration checks.
251
dnl   no  : --disable-all-components was specified, so try to build the
252
dnl         --enable'd components, and error out if any do not pass
253
dnl         configuration checks.
254
dnl   ""  : this option was not specified on the command line; try to
255
dnl         build all components that are not --with'd, but don't
256
dnl         error out if any component does not pass configuration checks.
257
dnl
258
dnl For each --enable-foo component, if that flag is not specified on
259
dnl the command line, the related variable $enable_foo will be set to
260
dnl $enable_all_components .
261

    
262
AC_ARG_ENABLE(
263
    [all-components],
264
    [  --enable-all-components Build all configurable components (default), or stop on failed dependencies]
265
)
266

    
267
build_dirs="config"
268
GRC_FX2
269

    
270
# Each component is now either to be built, was skipped, will be
271
# included from pre-installed libraries and includes, or failed
272
# dependencies.
273
AC_SUBST([build_dirs], [$build_dirs])
274
AC_SUBST([skipped_dirs], [$skipped_dirs])
275
AC_SUBST([with_dirs], [$with_dirs])
276

    
277
# fix for older autotools that don't define these by default
278
AC_SUBST(abs_top_srcdir)
279
AC_SUBST(abs_top_builddir)
280
AC_SUBST(MKDIR_P)
281

    
282
# 'with' variables - the pre-installed libraries, includes, and paths
283
# - must always come last in the lists, so they require special
284
# treatment.
285
AC_SUBST(with_INCLUDES)
286
AC_SUBST(with_PYDIRPATH)
287
AC_SUBST(with_LIBDIRPATH)
288

    
289
# Local files tweaked by AC
290
AC_CONFIG_FILES([\
291
    Makefile \
292
    config/Makefile \
293
])
294

    
295
AC_OUTPUT
296

    
297
echo
298
echo "*********************************************************************"
299
echo The following GNU Radio components have been successfully configured:
300
echo 
301
for dir in $build_dirs
302
do
303
    echo $dir
304
done
305
echo
306
echo You my now run the 'make' command to build these components.
307
echo
308
if test "$skipped_dirs" != ""; then
309
    echo "*********************************************************************"
310
    echo The following components were skipped either because you asked not
311
    echo to build them or they didn\'t pass configuration checks:
312
    echo
313
    for dir in $skipped_dirs
314
    do
315
        echo $dir
316
    done
317
    echo
318
    echo These components will not be built.
319
    echo
320
fi
321
if test "$with_dirs" != ""; then
322
    echo "*********************************************************************"
323
    echo The following components will be included from pre-installed
324
    echo libraries and includes:
325
    echo
326
    for dir in $with_dirs
327
    do
328
        echo $dir
329
    done
330
    echo
331
    echo These components will not be built.
332
    echo
333
fi
334

    
335
echo Configured GNU Radio release $RELEASE for build.