dnl
-dnl Copyright 2007 Free Software Foundation, Inc.
+dnl Copyright 2007,2008 Free Software Foundation, Inc.
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_SRCDIR([lib/u2_init.c])
-AM_INIT_AUTOMAKE(u2f,0.0svn)
+AM_INIT_AUTOMAKE(usrp2-firmware,0.0svn)
-cross_compiling=yes
+dnl Component specific configuration
+dnl The order of the GR_ macros determines the order of compilation
+dnl For -any- checks on $enable_all_components
+dnl use the following guidelines:
+dnl yes : --enable-all-components was specified, so error out if any
+dnl components do not pass configuration checks.
+dnl no : --disable-all-components was specified, so try to build the
+dnl --enable'd components, and error out if any do not pass
+dnl configuration checks.
+dnl "" : this option was not specified on the command line; try to
+dnl build all components that are not --with'd, but don't
+dnl error out if any component does not pass configuration checks.
+dnl
+dnl For each --enable-foo component, if that flag is not specified on
+dnl the command line, the related variable $enable_foo will be set to
+dnl $enable_all_components .
+
+AC_ARG_ENABLE(
+ [all-components],
+ [ --enable-all-components Build all configurable components (default), or stop on failed dependencies]
+)
-AC_PROG_CC([mb-gcc])
-dnl AC_PROG_LD([mb-ld])
+#build_dirs="config"
+build_dirs=
+GRC_USRP2_STUB
+GRC_USRP2_FIRMWARE
-RANLIB=mb-ranlib
-AC_SUBST(RANLIB)
-dnl AC_PROG_RANLIB([mb-ranlib])
+# Each component is now either to be built, was skipped, will be
+# included from pre-installed libraries and includes, or failed
+# dependencies.
+AC_SUBST([build_dirs], [$build_dirs])
+AC_SUBST([skipped_dirs], [$skipped_dirs])
+AC_SUBST([with_dirs], [$with_dirs])
-AC_CHECK_HEADERS(arpa/inet.h netinet/in.h byteswap.h)
-AC_C_BIGENDIAN
+# fix for older autotools that don't define "abs_top_YYY" by default
+AC_SUBST(abs_top_srcdir)
+AC_SUBST(abs_top_builddir)
-AC_CONFIG_FILES([\
+# 'with' variables - the pre-installed libraries, includes, and paths
+# - must always come last in the lists, so they require special
+# treatment.
+AC_SUBST(with_INCLUDES)
+AC_SUBST(with_SWIG_INCLUDES)
+AC_SUBST(with_PYDIRPATH)
+AC_SUBST(with_SWIGDIRPATH)
+AC_SUBST(with_LIBDIRPATH)
+
+AC_CONFIG_FILES([ \
Makefile \
- apps/Makefile \
- include/Makefile \
- lib/Makefile \
+ config/Makefile \
])
AC_OUTPUT
+
+#
+# trim usrp2 out of dirs; we only use it as a controlling dependency
+#
+t=
+for d in $build_dirs
+do
+ if test $d != usrp2; then
+ if test -z "$t"; then
+ t="$d"
+ else
+ t="$t $d"
+ fi
+ fi
+done
+build_dirs=$t
+
+t=
+for d in $skipped_dirs
+do
+ if test $d != usrp2; then
+ if test -z "$t"; then
+ t="$d"
+ else
+ t="$t $d"
+ fi
+ fi
+done
+skipped_dirs=$t
+
+t=
+for d in $with_dirs
+do
+ if test $d != usrp2; then
+ if test -z "$t"; then
+ t="$d"
+ else
+ t="$t $d"
+ fi
+ fi
+done
+with_dirs=$t
+
+if test "$build_dirs" != ""; then
+ echo
+ echo "*********************************************************************"
+ echo The following GNU Radio components have been successfully configured:
+ echo
+ for dir in $build_dirs
+ do
+ echo $dir
+ done
+ echo
+ echo You my now run the 'make' command to build these components.
+ echo
+fi
+
+if test "$skipped_dirs" != ""; then
+ echo "*********************************************************************"
+ echo The following components were skipped either because you asked not
+ echo to build them or they didn\'t pass configuration checks:
+ echo
+ for dir in $skipped_dirs
+ do
+ echo $dir
+ done
+ echo
+ echo These components will not be built.
+ echo
+fi
+if test "$with_dirs" != ""; then
+ echo "*********************************************************************"
+ echo The following components will be included from pre-installed
+ echo libraries and includes:
+ echo
+ for dir in $with_dirs
+ do
+ echo $dir
+ done
+ echo
+ echo These components will not be built.
+ echo
+fi