summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-howto-write-a-block/config/gr_fortran.m41
-rw-r--r--gr-howto-write-a-block/config/gr_pwin32.m43
-rw-r--r--gr-howto-write-a-block/config/gr_python.m444
-rw-r--r--gr-howto-write-a-block/config/gr_set_md_cpu.m481
-rw-r--r--gr-howto-write-a-block/config/lf_warnings.m447
-rw-r--r--gr-howto-write-a-block/config/usrp_fusb_tech.m415
6 files changed, 158 insertions, 33 deletions
diff --git a/gr-howto-write-a-block/config/gr_fortran.m4 b/gr-howto-write-a-block/config/gr_fortran.m4
index b5b0470f4..033ef0307 100644
--- a/gr-howto-write-a-block/config/gr_fortran.m4
+++ b/gr-howto-write-a-block/config/gr_fortran.m4
@@ -29,4 +29,5 @@ AC_DEFUN([GR_FORTRAN],[
AC_PROG_F77
AC_F77_LIBRARY_LDFLAGS
fi
+ AC_PROG_CC dnl bug fix to restore $ac_ext
])
diff --git a/gr-howto-write-a-block/config/gr_pwin32.m4 b/gr-howto-write-a-block/config/gr_pwin32.m4
index 7b99cba6b..495e9dd4d 100644
--- a/gr-howto-write-a-block/config/gr_pwin32.m4
+++ b/gr-howto-write-a-block/config/gr_pwin32.m4
@@ -99,6 +99,9 @@ struct timespec {
long tv_nsec;
};
#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
static inline int nanosleep(const struct timespec *req, struct timespec *rem) { return usleep(req->tv_sec*1000000+req->tv_nsec/1000); }
#endif
diff --git a/gr-howto-write-a-block/config/gr_python.m4 b/gr-howto-write-a-block/config/gr_python.m4
index 6c862bba3..43ccfc015 100644
--- a/gr-howto-write-a-block/config/gr_python.m4
+++ b/gr-howto-write-a-block/config/gr_python.m4
@@ -123,6 +123,50 @@ print path
;;
esac
+ case $host_os in
+ *mingw* )
+ # Python 2.5 requires ".pyd" instead of ".dll" for extensions
+ PYTHON_LDFLAGS="-shrext .pyd ${PYTHON_LDFLAGS}"
+ esac
+
AC_SUBST(PYTHON_LDFLAGS)
fi
])
+
+# PYTHON_CHECK_MODULE
+#
+# Determines if a particular Python module can be imported
+#
+# $1 - module name
+# $2 - module description
+# $3 - action if found
+# $4 - action if not found
+# $5 - test command
+
+AC_DEFUN([PYTHON_CHECK_MODULE],[
+ AC_MSG_CHECKING([for $2])
+ dnl ########################################
+ dnl # import and test checking
+ dnl ########################################
+ if test "$5"; then
+ python_cmd='
+try:
+ import $1
+ assert $5
+except: exit(1)'
+ dnl ########################################
+ dnl # import checking only
+ dnl ########################################
+ else
+ python_cmd='
+try: import $1
+except: exit(1)'
+ fi
+ if ! $PYTHON -c "$python_cmd" 2> /dev/null; then
+ AC_MSG_RESULT([no])
+ $4
+ else
+ AC_MSG_RESULT([yes])
+ $3
+ fi
+])
diff --git a/gr-howto-write-a-block/config/gr_set_md_cpu.m4 b/gr-howto-write-a-block/config/gr_set_md_cpu.m4
index b9c570ede..7ebf88a66 100644
--- a/gr-howto-write-a-block/config/gr_set_md_cpu.m4
+++ b/gr-howto-write-a-block/config/gr_set_md_cpu.m4
@@ -1,5 +1,5 @@
dnl
-dnl Copyright 2003,2008 Free Software Foundation, Inc.
+dnl Copyright 2003,2008,2009 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Radio
dnl
@@ -19,20 +19,89 @@ dnl the Free Software Foundation, Inc., 51 Franklin Street,
dnl Boston, MA 02110-1301, USA.
dnl
+AC_DEFUN([_TRY_ADD_ALTIVEC],
+[
+ LF_CHECK_CC_FLAG([-mabi=altivec -maltivec])
+ LF_CHECK_CXX_FLAG([-mabi=altivec -maltivec])
+])
+
+AC_DEFUN([_FIND_ARM_ISA],
+[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[#ifndef __ARM_ARCH_5__
+ #error "Not armv5"
+ #endif
+ ]])],
+ [is_armv5=yes],
+ [is_armv5=no])
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[#ifndef __ARM_ARCH_7A__
+ #error "Not armv7-a"
+ #endif
+ ]])],
+ [is_armv7_a=yes],
+ [is_armv7_a=no])
+
+])
+
AC_DEFUN([GR_SET_MD_CPU],[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_ARG_WITH(md-cpu,
- [ --with-md-cpu=ARCH set machine dependent speedups (auto)],
+ AC_HELP_STRING([--with-md-cpu=ARCH],[set machine dependent speedups (auto)]),
[cf_with_md_cpu="$withval"],
- [cf_with_md_cpu="$host_cpu"])
-
- AC_MSG_CHECKING([for machine dependent speedups])
+ [
+ dnl see if the user has specified --host or --build, via 'cross_compiling'
+ if test "$cross_compiling" != no; then
+ dnl when cross-compiling, because the user specified it either via
+ dnl --target or --build, just keep the user's specs & hope for the best.
+ cf_with_md_cpu="$host_cpu"
+ else
+ dnl when the user didn't specify --target or --build, on Darwin 10
+ dnl (OSX 10.6.0 and .1) and GNU libtoool 2.2.6, 'configure' doesn't
+ dnl figure out the CPU type correctly, so do it by hand here using
+ dnl the sizeof (void*): if 4 then use i386, and otherwise use x86_64.
+ case "$host_os" in
+ *darwin*10*)
+ AC_CHECK_SIZEOF(void*)
+ if test "$ac_cv_sizeof_voidp" = 4; then
+ cf_with_md_cpu="i386"
+ else
+ cf_with_md_cpu="x86_64"
+ fi
+ ;;
+ *)
+ cf_with_md_cpu="$host_cpu"
+ ;;
+ esac
+ fi
+ ])
case "$cf_with_md_cpu" in
x86 | i[[3-7]]86) MD_CPU=x86 MD_SUBCPU=x86 ;;
x86_64) MD_CPU=x86 MD_SUBCPU=x86_64 ;;
powerpc*) MD_CPU=powerpc ;;
+ arm)
+ _FIND_ARM_ISA
+ if test $is_armv5 = yes; then MD_CPU=armv5;
+ elif test $is_armv7_a = yes; then MD_CPU=armv7_a;
+ else MD_CPU=generic; fi
+ ;;
*) MD_CPU=generic ;;
esac
+
+ AC_ARG_ENABLE(altivec,
+ AC_HELP_STRING([--enable-altivec],[enable altivec on PowerPC (yes)]),
+ [ if test $MD_CPU = powerpc; then
+ case "$enableval" in
+ (no) MD_CPU=generic ;;
+ (yes) _TRY_ADD_ALTIVEC ;;
+ (*) AC_MSG_ERROR([Invalid argument ($enableval) to --enable-altivec]) ;;
+ esac
+ fi],
+ [ if test $MD_CPU = powerpc; then _TRY_ADD_ALTIVEC fi])
+
+
+ AC_MSG_CHECKING([for machine dependent speedups])
AC_MSG_RESULT($MD_CPU)
AC_SUBST(MD_CPU)
AC_SUBST(MD_SUBCPU)
@@ -40,5 +109,7 @@ AC_DEFUN([GR_SET_MD_CPU],[
AM_CONDITIONAL(MD_CPU_x86, test "$MD_CPU" = "x86")
AM_CONDITIONAL(MD_SUBCPU_x86_64, test "$MD_SUBCPU" = "x86_64")
AM_CONDITIONAL(MD_CPU_powerpc, test "$MD_CPU" = "powerpc")
+ AM_CONDITIONAL(MD_CPU_armv5, test "$MD_CPU" = "armv5")
+ AM_CONDITIONAL(MD_CPU_armv7_a, test "$MD_CPU" = "armv7_a")
AM_CONDITIONAL(MD_CPU_generic, test "$MD_CPU" = "generic")
])
diff --git a/gr-howto-write-a-block/config/lf_warnings.m4 b/gr-howto-write-a-block/config/lf_warnings.m4
index 4e2ca9111..d40c77f14 100644
--- a/gr-howto-write-a-block/config/lf_warnings.m4
+++ b/gr-howto-write-a-block/config/lf_warnings.m4
@@ -1,4 +1,5 @@
dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl Copyright (C) 2009 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
@@ -21,7 +22,7 @@ dnl distribution terms that you use for the rest of that program.
# --------------------------------------------------------------------------
# Check whether the C++ compiler accepts a certain flag
-# If it does it adds the flag to CXXFLAGS
+# If it does it adds the flag to lf_CXXFLAGS
# If it does not then it returns an error to lf_ok
# Usage:
# LF_CHECK_CXX_FLAG(-flag1 -flag2 -flag3 ...)
@@ -34,18 +35,19 @@ AC_DEFUN([LF_CHECK_CXX_FLAG],[
AC_MSG_CHECKING([whether $CXX accepts $i])
if test -z "`${CXX} $i -c conftest.cc 2>&1`"
then
- CXXFLAGS="${CXXFLAGS} $i"
+ lf_CXXFLAGS="${lf_CXXFLAGS} $i"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
done
rm -f conftest.cc conftest.o
+ AC_SUBST(lf_CXXFLAGS)
])
# --------------------------------------------------------------------------
# Check whether the C compiler accepts a certain flag
-# If it does it adds the flag to CFLAGS
+# If it does it adds the flag to lf_CFLAGS
# If it does not then it returns an error to lf_ok
# Usage:
# LF_CHECK_CC_FLAG(-flag1 -flag2 -flag3 ...)
@@ -58,18 +60,19 @@ AC_DEFUN([LF_CHECK_CC_FLAG],[
AC_MSG_CHECKING([whether $CC accepts $i])
if test -z "`${CC} $i -c conftest.c 2>&1`"
then
- CFLAGS="${CFLAGS} $i"
+ lf_CFLAGS="${lf_CFLAGS} $i"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
done
rm -f conftest.c conftest.o
+ AC_SUBST(lf_CFLAGS)
])
# --------------------------------------------------------------------------
# Check whether the Fortran compiler accepts a certain flag
-# If it does it adds the flag to FFLAGS
+# If it does it adds the flag to lf_FFLAGS
# If it does not then it returns an error to lf_ok
# Usage:
# LF_CHECK_F77_FLAG(-flag1 -flag2 -flag3 ...)
@@ -87,42 +90,32 @@ EOF
AC_MSG_CHECKING([whether $F77 accepts $i])
if test -z "`${F77} $i -c conftest.f 2>&1`"
then
- FFLAGS="${FFLAGS} $i"
+ lf_FFLAGS="${lf_FFLAGS} $i"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
done
rm -f conftest.f conftest.o
+ AC_SUBST(lf_FFLAGS)
])
# ----------------------------------------------------------------------
-# Provide the configure script with an --with-warnings option that
-# turns on warnings. Call this command AFTER you have configured ALL your
-# compilers.
+# Enable compiler warnings.
+# Call this command AFTER you have configured ALL your compilers.
# ----------------------------------------------------------------------
AC_DEFUN([LF_SET_WARNINGS],[
- dnl Check for --with-warnings
- AC_MSG_CHECKING([whether user wants warnings])
- AC_ARG_WITH(warnings,
- [ --with-warnings Turn on warnings],
- [ lf_warnings=yes ], [ lf_warnings=no ])
- lf_warnings=yes # hard code for now -eb
- AC_MSG_RESULT($lf_warnings)
-
dnl Warnings for the two main compilers
- cc_warning_flags="-Wall"
+ dnl add -Wextra when you're got time to fix a bunch of them ;-)
+ cc_warning_flags="-Wall -Werror-implicit-function-declaration"
cxx_warning_flags="-Wall -Woverloaded-virtual"
- if test $lf_warnings = yes
+ if test -n "${CC}"
then
- if test -n "${CC}"
- then
- LF_CHECK_CC_FLAG($cc_warning_flags)
- fi
- if test -n "${CXX}"
- then
- LF_CHECK_CXX_FLAG($cxx_warning_flags)
- fi
+ LF_CHECK_CC_FLAG($cc_warning_flags)
+ fi
+ if test -n "${CXX}"
+ then
+ LF_CHECK_CXX_FLAG($cxx_warning_flags)
fi
])
diff --git a/gr-howto-write-a-block/config/usrp_fusb_tech.m4 b/gr-howto-write-a-block/config/usrp_fusb_tech.m4
index db857249b..b99cf2432 100644
--- a/gr-howto-write-a-block/config/usrp_fusb_tech.m4
+++ b/gr-howto-write-a-block/config/usrp_fusb_tech.m4
@@ -1,5 +1,5 @@
dnl
-dnl Copyright 2003,2008 Free Software Foundation, Inc.
+dnl Copyright 2003,2008,2009 Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Radio
dnl
@@ -25,6 +25,8 @@ dnl
# "" : do these tests
AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[
+ req_libusb1=no
+ USE_LIBUSB1=0
AC_ARG_WITH([fusb-tech],
AC_HELP_STRING([--with-fusb-tech=OS],
[Set fast USB technique (default=auto)]),
@@ -32,6 +34,11 @@ AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[
[cf_with_fusb_tech="$host_os"])
if test [x]$1 != xno; then
case "$cf_with_fusb_tech" in
+ libusb1*)
+ FUSB_TECH=libusb1
+ req_libusb1=yes
+ USE_LIBUSB1=1
+ ;;
linux*)
AC_CHECK_HEADER([linux/usbdevice_fs.h],
[x_have_usbdevice_fs_h=yes],
@@ -70,5 +77,11 @@ AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[
AM_CONDITIONAL(FUSB_TECH_win32, test x$FUSB_TECH = xwin32)
AM_CONDITIONAL(FUSB_TECH_generic, test x$FUSB_TECH = xgeneric)
AM_CONDITIONAL(FUSB_TECH_linux, test x$FUSB_TECH = xlinux)
+ AM_CONDITIONAL(FUSB_TECH_libusb1, test x$FUSB_TECH = xlibusb1)
AM_CONDITIONAL(FUSB_TECH_ra_wb, test x$FUSB_TECH = xra_wb)
+
+ AC_SUBST(USE_LIBUSB1)
+ AC_CONFIG_FILES([\
+ usrp/host/include/usrp/libusb_types.h \
+ ])
])