From 3845f5fda7d638015cf7dc3eaae3a3e1f3d2d1e9 Mon Sep 17 00:00:00 2001 From: eb Date: Mon, 25 Aug 2008 23:31:35 +0000 Subject: [PATCH 1/1] Radically simplified standalone configure.ac (for out of tree builds). git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9413 221aa14e-8319-0410-a670-987f0aec2ac5 --- config/Makefile.am | 1 + config/gr_standalone.m4 | 98 +++++++++++++++++++ gr-howto-write-a-block/Makefile.am | 4 +- gr-howto-write-a-block/config/Makefile.am | 76 ++++++++------ gr-howto-write-a-block/config/gr_doxygen.m4 | 12 +-- .../config/gr_standalone.m4 | 98 +++++++++++++++++++ gr-howto-write-a-block/configure.ac | 81 ++------------- 7 files changed, 258 insertions(+), 112 deletions(-) create mode 100644 config/gr_standalone.m4 create mode 100644 gr-howto-write-a-block/config/gr_standalone.m4 diff --git a/config/Makefile.am b/config/Makefile.am index b0296901..abc34e34 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -87,6 +87,7 @@ m4macros = \ gr_require_mc4020.m4 \ gr_scripting.m4 \ gr_set_md_cpu.m4 \ + gr_standalone.m4 \ gr_subversion.m4 \ gr_swig.m4 \ gr_sysv_shm.m4 \ diff --git a/config/gr_standalone.m4 b/config/gr_standalone.m4 new file mode 100644 index 00000000..09744542 --- /dev/null +++ b/config/gr_standalone.m4 @@ -0,0 +1,98 @@ +dnl +dnl Copyright 2008 Free Software Foundation, Inc. +dnl +dnl This file is part of GNU Radio +dnl +dnl GNU Radio is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3, or (at your option) +dnl any later version. +dnl +dnl GNU Radio is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License along +dnl with this program; if not, write to the Free Software Foundation, Inc., +dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +dnl + +dnl +dnl GR_STANDALONE([package],[version]) +dnl +dnl Handles the bulk of the configure.ac work for an out-of-tree build +dnl +dnl N.B., this is an m4_define because if it were an AC_DEFUN it would +dnl get called too late to be useful. + +m4_define([GR_STANDALONE], +[ + AC_INIT([$1],[$2]) + AC_PREREQ(2.57) + AC_CONFIG_SRCDIR([config/gr_standalone.m4]) + AC_CONFIG_AUX_DIR([.]) + AM_CONFIG_HEADER(config.h) + + AC_CANONICAL_BUILD + AC_CANONICAL_HOST + AC_CANONICAL_TARGET + + AM_INIT_AUTOMAKE + + LF_CONFIGURE_CC + LF_CONFIGURE_CXX + GR_LIB64 dnl check for lib64 suffix after choosing compilers + + dnl add ${prefix}/lib${gr_libdir_suffix}/pkgconfig to the head of the PKG_CONFIG_PATH + if test x${PKG_CONFIG_PATH} = x; then + PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig + else + PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig:${PKG_CONFIG_PATH} + fi + export PKG_CONFIG_PATH + + LF_SET_WARNINGS + GR_SET_GPROF + GR_SET_PROF + AM_PROG_AS + AC_PROG_LN_S + AC_PROG_MAKE_SET + AC_PROG_INSTALL + AC_PATH_PROG([RM_PROG], [rm]) + + AC_LIBTOOL_WIN32_DLL + AC_ENABLE_SHARED dnl do build shared libraries + AC_DISABLE_STATIC dnl don't build static libraries + m4_ifdef([LT_INIT],[LT_INIT],[AC_PROG_LIBTOOL]) + dnl GR_FORTRAN + + GR_NO_UNDEFINED dnl do we need the -no-undefined linker flag + GR_SCRIPTING dnl Locate python, SWIG, etc + + dnl Set the c++ compiler that we use for the build system when cross compiling + if test "x$CXX_FOR_BUILD" = x + then + CXX_FOR_BUILD=${CXX} + fi + AC_SUBST(CXX_FOR_BUILD) + + dnl Checks for header files. + AC_HEADER_STDC + + dnl Checks for typedefs, structures, and compiler characteristics. + AC_C_CONST + AC_C_INLINE + AC_TYPE_SIZE_T + AC_HEADER_TIME + AC_C_BIGENDIAN + + dnl Check for Mingw support + GR_PWIN32 + + AC_CHECK_PROG([XMLTO],[xmlto],[yes],[]) + AM_CONDITIONAL([HAS_XMLTO], [test x$XMLTO = xyes]) + + PKG_CHECK_MODULES(GNURADIO_CORE, gnuradio-core >= 3) + LIBS="$LIBS $GNURADIO_CORE_LIBS" +]) diff --git a/gr-howto-write-a-block/Makefile.am b/gr-howto-write-a-block/Makefile.am index 638e4114..a230be80 100644 --- a/gr-howto-write-a-block/Makefile.am +++ b/gr-howto-write-a-block/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004 Free Software Foundation, Inc. +# Copyright 2004,2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -19,6 +19,8 @@ # Boston, MA 02110-1301, USA. # +ACLOCAL_AMFLAGS = -I config + include $(top_srcdir)/Makefile.common EXTRA_DIST = bootstrap configure config.h.in diff --git a/gr-howto-write-a-block/config/Makefile.am b/gr-howto-write-a-block/config/Makefile.am index 5af3e38e..5858d221 100644 --- a/gr-howto-write-a-block/config/Makefile.am +++ b/gr-howto-write-a-block/config/Makefile.am @@ -25,38 +25,54 @@ include $(top_srcdir)/Makefile.common m4datadir = $(datadir)/aclocal # List your m4 macros here -m4macros = \ - acx_pthread.m4 \ - bnv_have_qt.m4 \ - cppunit.m4 \ - gr_boost.m4 \ +m4macros = \ + acx_pthread.m4 \ + ax_boost_base.m4 \ + ax_boost_date_time.m4 \ + ax_boost_filesystem.m4 \ + ax_boost_iostreams.m4 \ + ax_boost_program_options.m4 \ + ax_boost_python.m4 \ + ax_boost_regex.m4 \ + ax_boost_serialization.m4 \ + ax_boost_signals.m4 \ + ax_boost_system.m4 \ + ax_boost_test_exec_monitor.m4 \ + ax_boost_thread.m4 \ + ax_boost_unit_test_framework.m4 \ + ax_boost_wserialization.m4 \ + bnv_have_qt.m4 \ + cppunit.m4 \ gr_check_createfilemapping.m4 \ - gr_check_usrp.m4 \ - gr_check_mc4020.m4 \ - gr_check_shm_open.m4 \ - gr_doxygen.m4 \ - gr_gprof.m4 \ + gr_check_mc4020.m4 \ + gr_check_shm_open.m4 \ + gr_check_usrp.m4 \ + gr_doxygen.m4 \ + gr_fortran.m4 \ + gr_gprof.m4 \ + gr_lib64.m4 \ gr_libgnuradio_core_extra_ldflags.m4 \ - gr_no_undefined.m4 \ - gr_omnithread.m4 \ - gr_pwin32.m4 \ - gr_python.m4 \ - gr_require_mc4020.m4 \ - gr_scripting.m4 \ - gr_set_md_cpu.m4 \ - gr_swig.m4 \ - gr_sysv_shm.m4 \ - gr_x86_64.m4 \ - lf_cc.m4 \ - lf_cxx.m4 \ - lf_warnings.m4 \ - lf_x11.m4 \ - mkstemp.m4 \ - onceonly.m4 \ - pkg.m4 \ - usrp_fusb_tech.m4 \ - usrp_libusb.m4 \ - usrp_sdcc.m4 + gr_no_undefined.m4 \ + gr_omnithread.m4 \ + gr_pwin32.m4 \ + gr_python.m4 \ + gr_require_mc4020.m4 \ + gr_scripting.m4 \ + gr_set_md_cpu.m4 \ + gr_standalone.m4 \ + gr_subversion.m4 \ + gr_swig.m4 \ + gr_sysv_shm.m4 \ + lf_cc.m4 \ + lf_cxx.m4 \ + lf_warnings.m4 \ + lf_x11.m4 \ + mkstemp.m4 \ + onceonly.m4 \ + pkg.m4 \ + usrp_fusb_tech.m4 \ + usrp_libusb.m4 \ + usrp_sdcc.m4 # Don't install m4 macros anymore diff --git a/gr-howto-write-a-block/config/gr_doxygen.m4 b/gr-howto-write-a-block/config/gr_doxygen.m4 index 43433098..15ece8b1 100644 --- a/gr-howto-write-a-block/config/gr_doxygen.m4 +++ b/gr-howto-write-a-block/config/gr_doxygen.m4 @@ -24,13 +24,6 @@ AC_DEFUN([GR_CHECK_DOXYGEN],[ AC_HELP_STRING([--enable-doxygen], [enable documentation generation with doxygen (no)])) AC_ARG_ENABLE(dot, AC_HELP_STRING([--enable-dot],[use 'dot' to generate graphs in doxygen (auto)])) - AC_ARG_ENABLE(html-docs, - AC_HELP_STRING([--enable-html-docs],[enable HTML generation with doxygen (yes)]), - [], [ enable_html_docs=yes]) - AC_ARG_ENABLE(latex-docs, - AC_HELP_STRING([--enable-latex-docs], - [enable LaTeX doc generation with doxygen (no)]), - [], [ enable_latex_docs=no]) if test "x$enable_doxygen" = xyes; then AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) @@ -60,7 +53,8 @@ AC_DEFUN([GR_CHECK_DOXYGEN],[ enable_dot=yes fi AC_SUBST(enable_dot) - AC_SUBST(enable_html_docs) - AC_SUBST(enable_latex_docs) + AC_SUBST(enable_xml_docs, YES) + AC_SUBST(enable_html_docs, YES) + AC_SUBST(enable_latex_docs, NO) AC_SUBST(generate_docs) ]) diff --git a/gr-howto-write-a-block/config/gr_standalone.m4 b/gr-howto-write-a-block/config/gr_standalone.m4 new file mode 100644 index 00000000..09744542 --- /dev/null +++ b/gr-howto-write-a-block/config/gr_standalone.m4 @@ -0,0 +1,98 @@ +dnl +dnl Copyright 2008 Free Software Foundation, Inc. +dnl +dnl This file is part of GNU Radio +dnl +dnl GNU Radio is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3, or (at your option) +dnl any later version. +dnl +dnl GNU Radio is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License along +dnl with this program; if not, write to the Free Software Foundation, Inc., +dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +dnl + +dnl +dnl GR_STANDALONE([package],[version]) +dnl +dnl Handles the bulk of the configure.ac work for an out-of-tree build +dnl +dnl N.B., this is an m4_define because if it were an AC_DEFUN it would +dnl get called too late to be useful. + +m4_define([GR_STANDALONE], +[ + AC_INIT([$1],[$2]) + AC_PREREQ(2.57) + AC_CONFIG_SRCDIR([config/gr_standalone.m4]) + AC_CONFIG_AUX_DIR([.]) + AM_CONFIG_HEADER(config.h) + + AC_CANONICAL_BUILD + AC_CANONICAL_HOST + AC_CANONICAL_TARGET + + AM_INIT_AUTOMAKE + + LF_CONFIGURE_CC + LF_CONFIGURE_CXX + GR_LIB64 dnl check for lib64 suffix after choosing compilers + + dnl add ${prefix}/lib${gr_libdir_suffix}/pkgconfig to the head of the PKG_CONFIG_PATH + if test x${PKG_CONFIG_PATH} = x; then + PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig + else + PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig:${PKG_CONFIG_PATH} + fi + export PKG_CONFIG_PATH + + LF_SET_WARNINGS + GR_SET_GPROF + GR_SET_PROF + AM_PROG_AS + AC_PROG_LN_S + AC_PROG_MAKE_SET + AC_PROG_INSTALL + AC_PATH_PROG([RM_PROG], [rm]) + + AC_LIBTOOL_WIN32_DLL + AC_ENABLE_SHARED dnl do build shared libraries + AC_DISABLE_STATIC dnl don't build static libraries + m4_ifdef([LT_INIT],[LT_INIT],[AC_PROG_LIBTOOL]) + dnl GR_FORTRAN + + GR_NO_UNDEFINED dnl do we need the -no-undefined linker flag + GR_SCRIPTING dnl Locate python, SWIG, etc + + dnl Set the c++ compiler that we use for the build system when cross compiling + if test "x$CXX_FOR_BUILD" = x + then + CXX_FOR_BUILD=${CXX} + fi + AC_SUBST(CXX_FOR_BUILD) + + dnl Checks for header files. + AC_HEADER_STDC + + dnl Checks for typedefs, structures, and compiler characteristics. + AC_C_CONST + AC_C_INLINE + AC_TYPE_SIZE_T + AC_HEADER_TIME + AC_C_BIGENDIAN + + dnl Check for Mingw support + GR_PWIN32 + + AC_CHECK_PROG([XMLTO],[xmlto],[yes],[]) + AM_CONDITIONAL([HAS_XMLTO], [test x$XMLTO = xyes]) + + PKG_CHECK_MODULES(GNURADIO_CORE, gnuradio-core >= 3) + LIBS="$LIBS $GNURADIO_CORE_LIBS" +]) diff --git a/gr-howto-write-a-block/configure.ac b/gr-howto-write-a-block/configure.ac index 66482637..fa7e02c1 100644 --- a/gr-howto-write-a-block/configure.ac +++ b/gr-howto-write-a-block/configure.ac @@ -19,83 +19,20 @@ dnl the Free Software Foundation, Inc., 51 Franklin Street, dnl Boston, MA 02110-1301, USA. dnl -AC_INIT -AC_PREREQ(2.57) -AC_CONFIG_SRCDIR([src/lib/howto.i]) -AM_CONFIG_HEADER(config.h) +dnl This is kind of non-standard, but it sure shortens up this file :-) +m4_include([config/gr_standalone.m4]) -AC_CANONICAL_BUILD -AC_CANONICAL_HOST -AC_CANONICAL_TARGET +GR_STANDALONE(gr-howto-write-a-block,3.1.svn) -AM_INIT_AUTOMAKE(gr-howto-write-a-block,3.1.svn) - -LF_CONFIGURE_CC -LF_CONFIGURE_CXX -GR_LIB64 dnl check for lib64 suffix after choosing compilers - - -dnl add ${prefix}/lib${gr_libdir_suffix}/pkgconfig to the head of the PKG_CONFIG_PATH -if test x${PKG_CONFIG_PATH} = x; then - PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig -else - PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig:${PKG_CONFIG_PATH} -fi -export PKG_CONFIG_PATH - -LF_SET_WARNINGS -GR_SET_GPROF -GR_SET_PROF -AM_PROG_AS -AC_PROG_LN_S -AC_PROG_MAKE_SET -AC_PROG_INSTALL -AC_PATH_PROG([RM_PROG], [rm]) - -AC_LIBTOOL_WIN32_DLL -AC_ENABLE_SHARED dnl do build shared libraries -AC_DISABLE_STATIC dnl don't build static libraries -m4_ifdef([LT_INIT],[LT_INIT],[AC_PROG_LIBTOOL]) -dnl GR_FORTRAN - -GR_NO_UNDEFINED dnl do we need the -no-undefined linker flag -GR_SCRIPTING dnl Locate python, SWIG, etc - -AC_CHECK_PROG([XMLTO],[xmlto],[yes],[]) -AM_CONDITIONAL([HAS_XMLTO], [test x$XMLTO = xyes]) - - -dnl Checks for libraries. - -dnl Set the c++ compiler that we use for the build system when cross compiling -if test "x$CXX_FOR_BUILD" = x -then - CXX_FOR_BUILD=${CXX} -fi -AC_SUBST(CXX_FOR_BUILD) - -dnl Checks for header files. -AC_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/ioctl.h sys/time.h unistd.h) -AC_CHECK_HEADERS(sys/mman.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_C_INLINE -AC_TYPE_SIZE_T -AC_HEADER_TIME -AC_C_BIGENDIAN +dnl Check for any libraries you need +dnl AC_CHECK_LIBRARY +dnl Check for header files you need +dnl AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/ioctl.h sys/time.h unistd.h) +dnl AC_CHECK_HEADERS(sys/mman.h) dnl Checks for library functions. -AC_CHECK_FUNCS([]) - -dnl Check for Mingw support -GR_PWIN32 - -PKG_CHECK_MODULES(GNURADIO_CORE, gnuradio-core >= 3) -LIBS="$LIBS $GNURADIO_CORE_LIBS" +dnl AC_CHECK_FUNCS([]) dnl We pick up the boost cppflags, cxxflags and thread lib via GNURADIO_CORE dnl -- 2.30.2