Imported Upstream version 3.2.2
[debian/gnuradio] / usrp2 / firmware / configure.ac
1 dnl
2 dnl Copyright 2007,2008 Free Software Foundation, Inc.
3 dnl
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 dnl
17
18 AC_INIT
19 AC_PREREQ(2.57)
20 AM_CONFIG_HEADER(config.h)
21 AC_CONFIG_AUX_DIR([.])
22 AC_CONFIG_SRCDIR([lib/u2_init.c])
23
24 AM_INIT_AUTOMAKE(usrp2-firmware,0.0svn)
25
26 dnl Component specific configuration
27 dnl The order of the GR_ macros determines the order of compilation
28 dnl For -any- checks on $enable_all_components
29 dnl use the following guidelines:
30 dnl   yes : --enable-all-components was specified, so error out if any
31 dnl         components do not pass configuration checks.
32 dnl   no  : --disable-all-components was specified, so try to build the
33 dnl         --enable'd components, and error out if any do not pass
34 dnl         configuration checks.
35 dnl   ""  : this option was not specified on the command line; try to
36 dnl         build all components that are not --with'd, but don't
37 dnl         error out if any component does not pass configuration checks.
38 dnl
39 dnl For each --enable-foo component, if that flag is not specified on
40 dnl the command line, the related variable $enable_foo will be set to
41 dnl $enable_all_components .
42
43 AC_ARG_ENABLE(
44     [all-components],
45     [  --enable-all-components Build all configurable components (default), or stop on failed dependencies]
46 )
47
48 #build_dirs="config"
49 build_dirs=
50 GRC_USRP2_STUB
51 GRC_USRP2_FIRMWARE
52
53
54 # Each component is now either to be built, was skipped, will be
55 # included from pre-installed libraries and includes, or failed
56 # dependencies.
57 AC_SUBST([build_dirs], [$build_dirs])
58 AC_SUBST([skipped_dirs], [$skipped_dirs])
59 AC_SUBST([with_dirs], [$with_dirs])
60
61 # fix for older autotools that don't define "abs_top_YYY" by default
62 AC_SUBST(abs_top_srcdir)
63 AC_SUBST(abs_top_builddir)
64
65 # 'with' variables - the pre-installed libraries, includes, and paths
66 # - must always come last in the lists, so they require special
67 # treatment.
68 AC_SUBST(with_INCLUDES)
69 AC_SUBST(with_SWIG_INCLUDES)
70 AC_SUBST(with_PYDIRPATH)
71 AC_SUBST(with_SWIGDIRPATH)
72 AC_SUBST(with_LIBDIRPATH)
73
74 AC_CONFIG_FILES([ \
75     Makefile \
76     config/Makefile \
77 ])
78
79 AC_OUTPUT
80
81 #
82 # trim usrp2 out of dirs; we only use it as a controlling dependency
83 #
84 t=
85 for d in $build_dirs
86 do
87     if test $d != usrp2; then
88         if test -z "$t"; then
89             t="$d"
90         else
91             t="$t $d"
92         fi
93     fi
94 done
95 build_dirs=$t
96
97 t=
98 for d in $skipped_dirs
99 do
100     if test $d != usrp2; then
101         if test -z "$t"; then
102             t="$d"
103         else
104             t="$t $d"
105         fi
106     fi
107 done
108 skipped_dirs=$t
109
110 t=
111 for d in $with_dirs
112 do
113     if test $d != usrp2; then
114         if test -z "$t"; then
115             t="$d"
116         else
117             t="$t $d"
118         fi
119     fi
120 done
121 with_dirs=$t
122
123 if test "$build_dirs" != ""; then
124     echo
125     echo "*********************************************************************"
126     echo The following GNU Radio components have been successfully configured:
127     echo 
128     for dir in $build_dirs
129     do
130         echo $dir
131     done
132     echo
133     echo You my now run the 'make' command to build these components.
134     echo
135 fi
136
137 if test "$skipped_dirs" != ""; then
138     echo "*********************************************************************"
139     echo The following components were skipped either because you asked not
140     echo to build them or they didn\'t pass configuration checks:
141     echo
142     for dir in $skipped_dirs
143     do
144         echo $dir
145     done
146     echo
147     echo These components will not be built.
148     echo
149 fi
150 if test "$with_dirs" != ""; then
151     echo "*********************************************************************"
152     echo The following components will be included from pre-installed
153     echo libraries and includes:
154     echo
155     for dir in $with_dirs
156     do
157         echo $dir
158     done
159     echo
160     echo These components will not be built.
161     echo
162 fi