2 dnl Copyright 2008,2009 Free Software Foundation, Inc.
4 dnl This file is part of GNU Radio
6 dnl GNU Radio is free software; you can redistribute it and/or modify
7 dnl it under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 3, or (at your option)
11 dnl GNU Radio is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 dnl GNU General Public License for more details.
16 dnl You should have received a copy of the GNU General Public License along
17 dnl with this program; if not, write to the Free Software Foundation, Inc.,
18 dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 dnl GR_STANDALONE([package],[version])
24 dnl Handles the bulk of the configure.ac work for an out-of-tree build
26 dnl N.B., this is an m4_define because if it were an AC_DEFUN it would
27 dnl get called too late to be useful.
29 m4_define([GR_STANDALONE],
31 AC_CONFIG_SRCDIR([config/gr_standalone.m4])
32 AM_CONFIG_HEADER(config.h)
34 dnl Remember if the user explicity set CXXFLAGS
35 if test -n "${CXXFLAGS}"; then
41 GR_LIB64 dnl check for lib64 suffix after choosing compilers
43 dnl The three macros above are known to override CXXFLAGS if the user
44 dnl didn't specify them. Though I'm sure somebody thought this was
45 dnl a good idea, it makes it hard to use other than -g -O2 when compiling
46 dnl selected files. Thus we "undo" the damage here...
48 dnl If the user specified CXXFLAGS, we use them. Otherwise when compiling
49 dnl the output of swig use use -O1 if we're using g++.
50 dnl See Makefile.common for the rest of the magic.
51 if test "$user_set_cxxflags" != yes; then
52 autoconf_default_CXXFLAGS="$CXXFLAGS"
53 if test "$GXX" = yes; then
56 dnl "-O1" is broken on the PPC for some reason
57 dnl (at least as of g++ 4.1.1)
58 swig_CXXFLAGS="-g1 -O2 -Wno-strict-aliasing -Wno-parentheses"
61 swig_CXXFLAGS="-g -O1 -Wno-strict-aliasing -Wno-parentheses"
66 AC_SUBST(autoconf_default_CXXFLAGS)
67 AC_SUBST(swig_CXXFLAGS)
69 dnl add ${prefix}/lib${gr_libdir_suffix}/pkgconfig to the head of the PKG_CONFIG_PATH
70 if test x${PKG_CONFIG_PATH} = x; then
71 PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig
73 PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig:${PKG_CONFIG_PATH}
75 export PKG_CONFIG_PATH
84 AC_PATH_PROG([RM_PROG], [rm])
87 AC_ENABLE_SHARED dnl do build shared libraries
88 AC_DISABLE_STATIC dnl don't build static libraries
89 m4_ifdef([LT_INIT],[LT_INIT],[AC_PROG_LIBTOOL])
92 GR_NO_UNDEFINED dnl do we need the -no-undefined linker flag
93 GR_SCRIPTING dnl Locate python, SWIG, etc
95 dnl Checks for header files.
98 dnl Checks for typedefs, structures, and compiler characteristics.
105 dnl Check for Mingw support
108 AC_CHECK_PROG([XMLTO],[xmlto],[yes],[])
109 AM_CONDITIONAL([HAS_XMLTO], [test x$XMLTO = xyes])
111 PKG_CHECK_MODULES(GNURADIO_CORE, gnuradio-core >= 3)
112 LIBS="$LIBS $GNURADIO_CORE_LIBS"
114 dnl Allow user to choose whether to generate SWIG/Python
115 dnl Default is enabled
116 AC_ARG_ENABLE([python],
117 [AS_HELP_STRING([--enable-python],
118 [generate SWIG/Python components (default is yes)])],
119 [case "${enableval}" in
120 yes) enable_python=yes ;;
121 no) enable_python=no ;;
122 *) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;;
126 AM_CONDITIONAL([PYTHON], [test x$enable_python = xyes])
128 dnl Define where to look for cppunit includes and libs
129 dnl sets CPPUNIT_CFLAGS and CPPUNIT_LIBS
130 dnl Try using pkg-config first, then fall back to cppunit-config.
131 PKG_CHECK_EXISTS(cppunit,
132 [PKG_CHECK_MODULES(CPPUNIT, cppunit >= 1.9.14)],
133 [AM_PATH_CPPUNIT([1.9.14],[],
134 [AC_MSG_ERROR([GNU Radio requires cppunit. Stop])])])