Updated gr-howto-write-a-block; mostly the .m4 macros and configure.ac.
[debian/gnuradio] / gr-howto-write-a-block / configure.ac
1 dnl 
2 dnl  Copyright 2004,2005,2007,2008 Free Software Foundation, Inc.
3 dnl  
4 dnl  This file is part of GNU Radio
5 dnl  
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)
9 dnl  any later version.
10 dnl  
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.
15 dnl  
16 dnl  You should have received a copy of the GNU General Public License
17 dnl  along with GNU Radio; see the file COPYING.  If not, write to
18 dnl  the Free Software Foundation, Inc., 51 Franklin Street,
19 dnl  Boston, MA 02110-1301, USA.
20 dnl 
21
22 AC_INIT
23 AC_PREREQ(2.57)
24 AC_CONFIG_SRCDIR([src/lib/howto.i])
25 AM_CONFIG_HEADER(config.h)
26
27 AC_CANONICAL_BUILD
28 AC_CANONICAL_HOST
29 AC_CANONICAL_TARGET
30
31 AM_INIT_AUTOMAKE(gr-howto-write-a-block,3.1.svn)
32
33 LF_CONFIGURE_CC
34 LF_CONFIGURE_CXX
35 GR_LIB64                dnl check for lib64 suffix after choosing compilers
36
37
38 dnl add ${prefix}/lib${gr_libdir_suffix}/pkgconfig to the head of the PKG_CONFIG_PATH
39 if test x${PKG_CONFIG_PATH} = x; then
40     PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig
41 else
42     PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig:${PKG_CONFIG_PATH}
43 fi
44 export PKG_CONFIG_PATH
45
46 LF_SET_WARNINGS
47 GR_SET_GPROF
48 GR_SET_PROF
49 AM_PROG_AS
50 AC_PROG_LN_S
51 AC_PROG_MAKE_SET
52 AC_PROG_INSTALL
53 AC_PATH_PROG([RM_PROG], [rm])
54
55 AC_LIBTOOL_WIN32_DLL
56 AC_ENABLE_SHARED        dnl do build shared libraries
57 AC_DISABLE_STATIC       dnl don't build static libraries
58 m4_ifdef([LT_INIT],[LT_INIT],[AC_PROG_LIBTOOL])
59 dnl GR_FORTRAN
60
61 GR_NO_UNDEFINED         dnl do we need the -no-undefined linker flag
62 GR_SCRIPTING            dnl Locate python, SWIG, etc
63
64 AC_CHECK_PROG([XMLTO],[xmlto],[yes],[])
65 AM_CONDITIONAL([HAS_XMLTO], [test x$XMLTO = xyes])
66
67
68 dnl Checks for libraries.
69
70 dnl Set the c++ compiler that we use for the build system when cross compiling
71 if test "x$CXX_FOR_BUILD" = x
72 then
73   CXX_FOR_BUILD=${CXX}
74 fi
75 AC_SUBST(CXX_FOR_BUILD)
76
77 dnl Checks for header files.
78 AC_HEADER_STDC
79 AC_HEADER_SYS_WAIT
80 AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/ioctl.h sys/time.h unistd.h)
81 AC_CHECK_HEADERS(sys/mman.h)
82
83 dnl Checks for typedefs, structures, and compiler characteristics.
84 AC_C_CONST
85 AC_C_INLINE
86 AC_TYPE_SIZE_T
87 AC_HEADER_TIME
88 AC_C_BIGENDIAN
89
90
91 dnl Checks for library functions.
92 AC_CHECK_FUNCS([])
93
94 dnl Check for Mingw support
95 GR_PWIN32
96
97 PKG_CHECK_MODULES(GNURADIO_CORE, gnuradio-core >= 3)
98 LIBS="$LIBS $GNURADIO_CORE_LIBS"
99
100 dnl We pick up the boost cppflags, cxxflags and thread lib via GNURADIO_CORE
101 dnl
102 dnl If you need additional boost libraries, you'll need to
103 dnl uncomment AX_BOOST_BASE, plus some of the following:
104 dnl
105 dnl calls AC_SUBST(BOOST_CPPFLAGS), AC_SUBST(BOOST_LDFLAGS) and defines HAVE_BOOST
106 dnl AX_BOOST_BASE([1.35])
107 dnl
108 dnl All the rest of these call AC_SUBST(BOOST_<foo>_LIB) and define HAVE_BOOST_<foo>
109 dnl
110 dnl AX_BOOST_DATE_TIME
111 dnl AX_BOOST_FILESYSTEM
112 dnl AX_BOOST_IOSTREAMS
113 dnl AX_BOOST_PROGRAM_OPTIONS
114 dnl AX_BOOST_REGEX
115 dnl AX_BOOST_SERIALIZATION
116 dnl AX_BOOST_SIGNALS
117 dnl AX_BOOST_SYSTEM
118 dnl AX_BOOST_TEST_EXEC_MONITOR
119 dnl AX_BOOST_UNIT_TEST_FRAMEWORK
120 dnl AX_BOOST_WSERIALIZATION
121
122
123 STD_DEFINES_AND_INCLUDES="$GNURADIO_CORE_CFLAGS"
124 AC_SUBST(STD_DEFINES_AND_INCLUDES)
125  
126 AC_CONFIG_FILES([\
127           Makefile \
128           config/Makefile \
129           doc/Makefile \
130           src/Makefile \
131           src/lib/Makefile \
132           src/python/Makefile \
133           src/python/run_tests \
134         ])
135
136 dnl run_tests is created from run_tests.in.  Make it executable.
137 AC_CONFIG_COMMANDS([run_tests], [chmod +x src/python/run_tests])
138
139 AC_OUTPUT