[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r9320 - gnuradio/branches/developers/eb/ac-wip/config
From: |
eb |
Subject: |
[Commit-gnuradio] r9320 - gnuradio/branches/developers/eb/ac-wip/config |
Date: |
Mon, 18 Aug 2008 19:08:31 -0600 (MDT) |
Author: eb
Date: 2008-08-18 19:08:30 -0600 (Mon, 18 Aug 2008)
New Revision: 9320
Modified:
gnuradio/branches/developers/eb/ac-wip/config/ax_boost_base.m4
gnuradio/branches/developers/eb/ac-wip/config/ax_boost_date_time.m4
gnuradio/branches/developers/eb/ac-wip/config/ax_boost_thread.m4
Log:
more work-in-progress on boost m4 macros
Modified: gnuradio/branches/developers/eb/ac-wip/config/ax_boost_base.m4
===================================================================
--- gnuradio/branches/developers/eb/ac-wip/config/ax_boost_base.m4
2008-08-18 23:32:23 UTC (rev 9319)
+++ gnuradio/branches/developers/eb/ac-wip/config/ax_boost_base.m4
2008-08-19 01:08:30 UTC (rev 9320)
@@ -218,7 +218,81 @@
else
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)
- AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
+ AC_DEFINE(HAVE_BOOST,1,[Define if the Boost headers are available])
fi
fi
])
+
+dnl
+dnl Macros used by the boost items that need libraries.
+dnl
+
+dnl $1 is unit name. E.g., boost_thread
+AC_DEFUN([_AX_BOOST_CHECK_LIB],[
+ _AX_BOOST_CHECK_LIB_($1,HAVE_[]m4_toupper($1),m4_toupper($1)_LIB)
+])
+
+dnl $1 is unit name. E.g., boost_thread
+dnl $2 is AC_DEFINE name. E.g., HAVE_BOOST_THREAD
+dnl $3 is lib var name. E.g., BOOST_THREAD_LIB
+AC_DEFUN([_AX_BOOST_CHECK_LIB_],[
+ AC_LANG_PUSH([C++])
+ AC_DEFINE($2,1,[Define if the $1 library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+
+ dnl See if we can find a usable library
+ link_ok="no"
+ if test "$ax_boost_user_lib" != ""; then
+ dnl use what the user supplied
+ for ax_lib in $ax_boost_user_lib $1-${ax_boost_user_lib}; do
+ AC_CHECK_LIB($ax_lib, exit,
+ [$3="-l$ax_lib"; AC_SUBST($3) link_ok="yes"; break])
+ done
+ else
+ dnl Look in BOOSTLIBDIR for possible candidates
+ head=$BOOSTLIBDIR/lib[]$1
+ for f in ${head}*.so* ${head}*.a* ${head}*.dll*; do
+ echo 1: $f
+ f=`echo $f | sed -e 's,.*/,,' -e 's,^lib,,'`
+ echo 2: $f
+ f=`echo $f | sed -e 's,\($1.*\)\.so.*$,\1,' -e
's,\($1.*\)\.a.*$,\1,' -e 's,\($1.*\)\.dll.*$,\1,'`
+ echo 3: $f
+
+ ax_lib=$f
+ AC_CHECK_LIB($ax_lib, exit,
+ [$3="-l$ax_lib"; AC_SUBST($3) link_ok="yes"; break])
+ done
+ fi
+
+ if test "$link_ok" != "yes"; then
+ AC_MSG_ERROR([Could not link against lib${unit_name}!])
+ fi
+ AC_LANG_POP([C++])
+])
+
+
+dnl $1 is unit name. E.g., boost_thread
+AC_DEFUN([_AX_BOOST_WITH],[
+ _AX_BOOST_WITH_($1,m4_bpatsubst($1,_,-))
+])
+
+dnl $1 is unit name. E.g., boost_thread
+dnl $2 is hyphenated unit name. E.g., boost-thread
+AC_DEFUN([_AX_BOOST_WITH_],[
+ AC_ARG_WITH([$2],
+ AC_HELP_STRING([--with-$2@<:@=special-lib@:>@],
+ [Use the m4_substr($1,6) library from boost. It
is possible to specify a certain
+ library to the linker. E.g.,
--with-$2=$1-gcc41-mt-1_35]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"])
+])
Modified: gnuradio/branches/developers/eb/ac-wip/config/ax_boost_date_time.m4
===================================================================
--- gnuradio/branches/developers/eb/ac-wip/config/ax_boost_date_time.m4
2008-08-18 23:32:23 UTC (rev 9319)
+++ gnuradio/branches/developers/eb/ac-wip/config/ax_boost_date_time.m4
2008-08-19 01:08:30 UTC (rev 9320)
@@ -1,5 +1,6 @@
# ===========================================================================
-# http://autoconf-archive.cryp.to/ax_boost_date_time.html
+# Started with http://autoconf-archive.cryp.to/ax_boost_date_time.html
+# but difference is now huge...
# ===========================================================================
#
# SYNOPSIS
@@ -8,9 +9,7 @@
#
# DESCRIPTION
#
-# Test for Date_Time library from the Boost C++ libraries. The macro
-# requires a preceding call to AX_BOOST_BASE. Further documentation is
-# available at <http://randspringer.de/boost/index.html>.
+# Test for date_time library from the Boost C++ libraries.
#
# This macro calls:
#
@@ -20,14 +19,11 @@
#
# HAVE_BOOST_DATE_TIME
#
-# LAST MODIFICATION
-#
-# 2008-04-12
-#
# COPYLEFT
#
# Copyright (c) 2008 Thomas Porschberg <address@hidden>
# Copyright (c) 2008 Michael Tindal
+# Copyright (c) 2008 Free Software Foundation, Inc.
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
@@ -35,35 +31,19 @@
AC_DEFUN([AX_BOOST_DATE_TIME],
[
- AC_ARG_WITH([boost-date-time],
- AS_HELP_STRING([--with-boost-date-time@<:@=special-lib@:>@],
- [use the Date_Time library from boost - it is possible to
specify a certain library for the linker
- e.g.
--with-boost-date-time=boost_date_time-gcc-mt-d-1_33_1 ]),
- [
- if test "$withval" = "no"; then
- want_boost="no"
- elif test "$withval" = "yes"; then
- want_boost="yes"
- ax_boost_user_date_time_lib=""
- else
- want_boost="yes"
- ax_boost_user_date_time_lib="$withval"
- fi
- ],
- [want_boost="yes"]
- )
+ AC_REQUIRE([AX_BOOST_BASE])
+ _AX_BOOST_WITH([boost_date_time])
- if test "x$want_boost" = "xyes"; then
+ if test "$want_boost" = "yes"; then
AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_PROG_CXX])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
- AC_CACHE_CHECK(whether the Boost::Date_Time library is available,
+ AC_CACHE_CHECK(whether the boost::date_time library is available,
ax_cv_boost_date_time,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM(address@hidden:@include
<boost/date_time/gregorian/gregorian_types.hpp>]],
@@ -73,38 +53,8 @@
ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no)
AC_LANG_POP([C++])
])
- if test "x$ax_cv_boost_date_time" = "xyes"; then
- AC_LANG_PUSH([C++])
- AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time
library is available])
- BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
- if test "x$ax_boost_user_date_time_lib" = "x"; then
- for libextension in `ls
$BOOSTLIBDIR/libboost_date_time*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e
's;^lib\(boost_date_time.*\)\.so.*$;\1;' -e
's;^lib\(boost_date_time.*\)\.a*$;\1;'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_DATE_TIME_LIB="-l$ax_lib";
AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
- [link_date_time="no"])
- done
- if test "x$link_date_time" != "xyes"; then
- for libextension in `ls $BOOSTLIBDIR/boost_date_time*.{dll,a}*
2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_date_time.*\)\.dll.*$;\1;' -e
's;^\(boost_date_time.*\)\.a*$;\1;'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_DATE_TIME_LIB="-l$ax_lib";
AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
- [link_date_time="no"])
- done
- fi
-
- else
- for ax_lib in $ax_boost_user_date_time_lib
boost_date_time-$ax_boost_user_date_time_lib; do
- AC_CHECK_LIB($ax_lib, main,
- [BOOST_DATE_TIME_LIB="-l$ax_lib";
AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
- [link_date_time="no"])
- done
-
- fi
- if test "x$link_date_time" != "xyes"; then
- AC_MSG_ERROR(Could not link against $ax_lib !)
- fi
- AC_LANG_POP([C++])
+ if test "$ax_cv_boost_date_time" = "yes"; then
+ _AX_BOOST_CHECK_LIB([boost_date_time])
fi
CPPFLAGS="$CPPFLAGS_SAVED"
Modified: gnuradio/branches/developers/eb/ac-wip/config/ax_boost_thread.m4
===================================================================
--- gnuradio/branches/developers/eb/ac-wip/config/ax_boost_thread.m4
2008-08-18 23:32:23 UTC (rev 9319)
+++ gnuradio/branches/developers/eb/ac-wip/config/ax_boost_thread.m4
2008-08-19 01:08:30 UTC (rev 9320)
@@ -9,8 +9,7 @@
#
# DESCRIPTION
#
-# Test for Thread library from the Boost C++ libraries. The macro requires
-# a preceding call to AX_BOOST_BASE.
+# Test for Thread library from the Boost C++ libraries.
#
# This macro calls:
#
@@ -31,31 +30,16 @@
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
+
AC_DEFUN([AX_BOOST_THREAD],
[
+ AC_REQUIRE([AX_BOOST_BASE])
AC_REQUIRE([ACX_PTHREAD])
- AC_ARG_WITH([boost-thread],
- AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@],
- [use the Thread library from boost - it is possible to
specify a certain library for the linker
- e.g. --with-boost-thread=boost_thread-gcc-mt ]),
- [
- if test "$withval" = "no"; then
- want_boost="no"
- elif test "$withval" = "yes"; then
- want_boost="yes"
- ax_boost_user_thread_lib=""
- else
- want_boost="yes"
- ax_boost_user_thread_lib="$withval"
- fi
- ],
- [want_boost="yes"]
- )
+ _AX_BOOST_WITH([boost_thread])
- unit_name="boost_thread"
-
- if test "x$want_boost" = "xyes"; then
+ if test "$want_boost" = "yes"; then
AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([AC_CANONICAL_HOST])
CPPFLAGS_SAVED="$CPPFLAGS"
@@ -66,7 +50,7 @@
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS $PTHREAD_LIBS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
- AC_CACHE_CHECK(whether the Boost::Thread library is available,
+ AC_CACHE_CHECK(whether the boost::thread library is available,
ax_cv_boost_thread,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM(address@hidden:@include
<boost/thread/thread.hpp>]],
@@ -75,54 +59,14 @@
ax_cv_boost_thread=yes, ax_cv_boost_thread=no)
AC_LANG_POP([C++])
])
- if test "x$ax_cv_boost_thread" = "xyes"; then
- AC_LANG_PUSH([C++])
+
+ if test "$ax_cv_boost_thread" = "yes"; then
BOOST_CXXFLAGS="$PTHREAD_CFLAGS"
AC_SUBST(BOOST_CXXFLAGS)
-
- AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library
is available])
- BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
-
- dnl See if we can find a usable library
-
- link_thread="no"
-
- if test "$ax_boost_user_thread_lib" != ""; then
-
- dnl use what the user supplied
-
- for ax_lib in $ax_boost_user_thread_lib
${unit_name}-${ax_boost_user_thread_lib}; do
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_THREAD_LIB="-l$ax_lib";
AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
- [link_thread="no"])
- done
-
- else
-
- dnl Look in BOOSTLIBDIR for possible candiates
-
- head=$BOOSTLIBDIR/lib${unit_name}
-
- for f in ${head}*.so* ${head}*.a* ${head}*.dll*; do
- echo 1: $f
- f=`echo $f | sed -e 's,.*/,,' -e 's,^lib,,'`
- echo 2: $f
- f=`echo $f | sed -e 's,\(boost_thread.*\)\.so.*$,\1,' -e
's,\(boost_thread.*\)\.a.*$,\1,' -e 's,\(boost_thread.*\)\.dll.*$,\1,'`
- echo 3: $f
-
- ax_lib=$f
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_THREAD_LIB="-l$ax_lib";
AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
- [link_thread="no"])
- done
- fi
-
- if test "x$link_thread" = "xno"; then
- AC_MSG_ERROR([Could not link against lib${unit_name}!])
- else
- BOOST_THREAD_LIB="$BOOST_THREAD_LIB $PTHREAD_LIBS"
- fi
- AC_LANG_POP([C++])
+ _AX_BOOST_CHECK_LIB([boost_thread])
+ if test "$link_ok" = "yes" && test -n "$PTHREAD_LIBS"; then
+ BOOST_THREAD_LIB="$BOOST_THREAD_LIB $PTHREAD_LIBS"
+ fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r9320 - gnuradio/branches/developers/eb/ac-wip/config,
eb <=