From c32a530143e92f8e0fc9b521a627ab73977ad7f3 Mon Sep 17 00:00:00 2001 From: Chris Pankow <chris.pankow@ligo.org> Date: Thu, 4 Sep 2014 13:49:51 -0400 Subject: [PATCH] Initial commit of gstlal-burst --- gstlal-burst/00init.sh | 15 + gstlal-burst/COPYING | 340 ++++++++++++++++++ gstlal-burst/Makefile.am | 9 + gstlal-burst/bin/Makefile.am | 3 + gstlal-burst/configure.ac | 261 ++++++++++++++ gstlal-burst/debian/Makefile.am | 9 + gstlal-burst/debian/changelog | 5 + gstlal-burst/debian/compat | 1 + gstlal-burst/debian/control.in | 39 ++ gstlal-burst/debian/copyright | 1 + gstlal-burst/debian/gstlal-burst.install | 2 + gstlal-burst/debian/rules | 17 + gstlal-burst/debian/source/format | 1 + gstlal-burst/gnuscripts/ax_cflags_warn_all.m4 | 151 ++++++++ .../gnuscripts/ax_check_compiler_flags.m4 | 76 ++++ gstlal-burst/gnuscripts/ax_compare_version.m4 | 177 +++++++++ gstlal-burst/gnuscripts/ax_compiler_vendor.m4 | 63 ++++ gstlal-burst/gnuscripts/ax_gcc_archflag.m4 | 215 +++++++++++ gstlal-burst/gnuscripts/ax_gcc_x86_cpuid.m4 | 79 ++++ .../gnuscripts/ax_gstlal_split_version.m4 | 20 ++ gstlal-burst/gnuscripts/ax_python_devel.m4 | 316 ++++++++++++++++ gstlal-burst/gnuscripts/ax_python_glue.m4 | 17 + gstlal-burst/gnuscripts/ax_python_module.m4 | 49 +++ gstlal-burst/gnuscripts/ax_python_pylal.m4 | 17 + gstlal-burst/gnuscripts/ax_split_version.m4 | 38 ++ gstlal-burst/gnuscripts/lalsuite_c99.m4 | 255 +++++++++++++ gstlal-burst/gstlal-burst.spec.in | 67 ++++ gstlal-burst/python/Makefile.am | 11 + 28 files changed, 2254 insertions(+) create mode 100755 gstlal-burst/00init.sh create mode 100644 gstlal-burst/COPYING create mode 100644 gstlal-burst/Makefile.am create mode 100644 gstlal-burst/bin/Makefile.am create mode 100644 gstlal-burst/configure.ac create mode 100644 gstlal-burst/debian/Makefile.am create mode 100644 gstlal-burst/debian/changelog create mode 100644 gstlal-burst/debian/compat create mode 100644 gstlal-burst/debian/control.in create mode 100644 gstlal-burst/debian/copyright create mode 100644 gstlal-burst/debian/gstlal-burst.install create mode 100755 gstlal-burst/debian/rules create mode 100644 gstlal-burst/debian/source/format create mode 100644 gstlal-burst/gnuscripts/ax_cflags_warn_all.m4 create mode 100644 gstlal-burst/gnuscripts/ax_check_compiler_flags.m4 create mode 100644 gstlal-burst/gnuscripts/ax_compare_version.m4 create mode 100644 gstlal-burst/gnuscripts/ax_compiler_vendor.m4 create mode 100644 gstlal-burst/gnuscripts/ax_gcc_archflag.m4 create mode 100644 gstlal-burst/gnuscripts/ax_gcc_x86_cpuid.m4 create mode 100644 gstlal-burst/gnuscripts/ax_gstlal_split_version.m4 create mode 100644 gstlal-burst/gnuscripts/ax_python_devel.m4 create mode 100644 gstlal-burst/gnuscripts/ax_python_glue.m4 create mode 100644 gstlal-burst/gnuscripts/ax_python_module.m4 create mode 100644 gstlal-burst/gnuscripts/ax_python_pylal.m4 create mode 100644 gstlal-burst/gnuscripts/ax_split_version.m4 create mode 100644 gstlal-burst/gnuscripts/lalsuite_c99.m4 create mode 100644 gstlal-burst/gstlal-burst.spec.in create mode 100644 gstlal-burst/python/Makefile.am diff --git a/gstlal-burst/00init.sh b/gstlal-burst/00init.sh new file mode 100755 index 0000000000..f0a3954ebf --- /dev/null +++ b/gstlal-burst/00init.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check with the user +echo "This script (re-)builds the source tree's configuration and build system." +read -p "Press CTRL-C to abort, or RETURN to continue... " INPUT + +# Get it done +{ + { echo "running aclocal (please ignore \"underquoted\" warnings)..." ; aclocal -I gnuscripts ; } && + { echo "running libtoolize..." ; libtoolize -i -c -f || glibtoolize $LIBTOOLIZE_FLAGS ; } && + #{ echo "running autoheader..." ; autoheader ; } && + { echo "running automake..." ; automake -a -c ; } && + { echo "running autoconf..." ; autoconf ; } && + echo "$0 complete." ; +} || { echo "$0 failed." ; false ; } diff --git a/gstlal-burst/COPYING b/gstlal-burst/COPYING new file mode 100644 index 0000000000..d60c31a97a --- /dev/null +++ b/gstlal-burst/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/gstlal-burst/Makefile.am b/gstlal-burst/Makefile.am new file mode 100644 index 0000000000..4ea090590f --- /dev/null +++ b/gstlal-burst/Makefile.am @@ -0,0 +1,9 @@ +ACLOCAL_AMFLAGS = -I gnuscripts +EXTRA_DIST = gstlal-burst.spec +SUBDIRS = debian python bin + +# check that the most recent changelog entry's version matches the package +# version + +check-local : + @CHANGELOG_VERSION=`"head" -n 1 $(top_srcdir)/debian/changelog | "sed" -e "s?.*(\([.0-9]*\).*?\1?"` ; [ "$${CHANGELOG_VERSION}" = "$(PACKAGE_VERSION)" ] || { "echo" "debian/changelog <--> package version mismatch ($${CHANGELOG_VERSION} != $(PACKAGE_VERSION))" ; "false" ; } diff --git a/gstlal-burst/bin/Makefile.am b/gstlal-burst/bin/Makefile.am new file mode 100644 index 0000000000..b880b81940 --- /dev/null +++ b/gstlal-burst/bin/Makefile.am @@ -0,0 +1,3 @@ +dist_bin_SCRIPTS = \ + gstlal_excesspower \ + gstlal_excesspower_trigvis diff --git a/gstlal-burst/configure.ac b/gstlal-burst/configure.ac new file mode 100644 index 0000000000..b56eddf9f6 --- /dev/null +++ b/gstlal-burst/configure.ac @@ -0,0 +1,261 @@ +# +# Preamble +# + + +AC_INIT([gstlal-burst],[0.0.1],[gstlal-discuss@ligo.org],[gstlal-burst]) +AC_COPYRIGHT([Copyright (C) 2011-2014 Chris Pankow]) +# a file whose existance can be used to use to check that we are in the +# top-level directory of the source tree +AC_CONFIG_SRCDIR([gnuscripts/ltmain.sh]) +AC_CONFIG_AUX_DIR([gnuscripts]) +AC_CONFIG_MACRO_DIR([gnuscripts]) +AM_INIT_AUTOMAKE([1.9 tar-ustar foreign]) +AUTOMAKE_OPTIONS="${AUTOMAKE_OPTIONS} --add-missing --copy" +AC_CONFIG_FILES([ \ + Makefile \ + gstlal-burst.spec \ + bin/Makefile \ + debian/control \ + debian/Makefile \ + python/Makefile \ +]) + + +# +# Split package version +# + + +AX_GSTLAL_SPLIT_VERSION([PACKAGE_VERSION]) +AC_SUBST([PACKAGE_VERSION_MAJOR]) +AC_SUBST([PACKAGE_VERSION_MINOR]) +AC_SUBST([PACKAGE_VERSION_POINT]) + + +# +# Move headers into a versioned sub-directory to allow more than one set of +# headers to be installed system-wide. (commented out until this is +# needed) +# + + +#AC_SUBST([includedir],["\${includedir}/\${PACKAGE}-\${PACKAGE_VERSION}"]) + + +# +# Extra directories +# + + +AC_SUBST([docdir], ["\${datadir}/doc"]) +AC_SUBST([pkgdocdir], ["\${docdir}/\${PACKAGE_NAME}-\${PACKAGE_VERSION}"]) +AC_SUBST([pkgconfigdir],["\${libdir}/pkgconfig"]) + + +# +# force /usr/share/ package files into same directory as gstlal +# + + +AC_SUBST([pkgdatadir],["\${datadir}/gstlal"]) + + +# +# Set the library API info +# +# 0.0.0 Original version + + +AC_SUBST([LIBAPI], [0]) +AC_SUBST([LIBREL], [0]) +AC_SUBST([LIBAGE], [0]) +AC_SUBST([LIBVERSION], [${LIBAPI}:${LIBREL}:${LIBAGE}]) + + +# +# Check for programs +# + +# check for c99 compiler +m4_pattern_allow([AC_PROG_CC_C99]) +m4_ifdef([AC_PROG_CC_C99],[AC_PROG_CC_C99],[LALSUITE_AC_PROG_CC_C99]) + +AC_PROG_INSTALL +# libtool incorrectly determines library path on SL6. FIXME: remove when +# no longer needed +case `cat /etc/redhat-release 2> /dev/null` in + "Scientific Linux"*|"CentOS"*) + AC_MSG_NOTICE([hacking round broken libtool multilib support on RedHat systems]) + lt_cv_sys_lib_dlsearch_path_spec="/lib64 /usr/lib64" + ;; +esac +LT_INIT +PKG_PROG_PKG_CONFIG() + + +# +# Check for Python +# + + +AM_PATH_PYTHON([2.6],,) +AX_PYTHON_DEVEL() +# hack to remove default lib dirs from PYTHON_LDFLAGS. only tested on +# Debian and SL6. FIXME: find a way to do this properly +PYTHON_LDFLAGS="`echo $PYTHON_LDFLAGS | sed -e 'sX-L/usr/lib\(64\)\?\(/\)\?[[:space:]]*XXg'`" +# hack to add missing options to PYTHON_LDFLAGS. sigh, what's the point of +# AX_PYTHON_DEVEL!? +PYTHON_LDFLAGS="-module -avoid-version $PYTHON_LDFLAGS" +# force python modules into same directory as gstlal +AC_SUBST([pkgpythondir], ["\${pythondir}/gstlal"]) +AC_SUBST([pkgpyexecdir], ["\${pyexecdir}/gstlal"]) + + +# +# CFLAGS +# + + +AX_CFLAGS_WARN_ALL([AM_CFLAGS]) +AM_CFLAGS="$AM_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter" # extra gcc-specific stuff +AC_SUBST([AM_CFLAGS]) + + +# +# LDFLAGS +# + + +# Turn on error messages for undefined symbols +AM_LDFLAGS="$AM_LDFLAGS -no-undefined" +AC_SUBST([AM_LDFLAGS]) + + +# +# Check for math library +# + + +AC_CHECK_LIB([m], [main], , [AC_MSG_ERROR([Not found!])]) + + +# +# Check for GStreamer +# + + +AC_SUBST([GSTREAMER_RELEASE], [0.10]) +AC_SUBST([MIN_GSTREAMER_VERSION], [0.10.32]) +PKG_CHECK_MODULES([gstreamer], [gstreamer-${GSTREAMER_RELEASE} >= ${MIN_GSTREAMER_VERSION} gstreamer-base-${GSTREAMER_RELEASE} >= ${MIN_GSTREAMER_VERSION}]) +AC_SUBST([gstreamer_CFLAGS]) +AC_SUBST([gstreamer_LIBS]) +AC_SUBST([plugindir], [${libdir}/gstreamer-${GSTREAMER_RELEASE}]) +AC_MSG_NOTICE([If you have chosen to install the software in a location not included in your default gstreamer plugin search path, you might need to add the directory + + $plugindir + +to your GST_PLUGIN_PATH environment variable.]) +AC_SUBST([GSTLAL_PLUGIN_LDFLAGS], ["-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\|gstlal_\|GstLAL_\|GSTLAL_\).*"]) + + +# +# Check for GStreamer Audio Library +# + + +AC_SUBST([GSTREAMER_AUDIO_RELEASE], [0.10]) +AC_SUBST([MIN_GSTREAMER_AUDIO_VERSION], [0.10.32]) +PKG_CHECK_MODULES([gstreamer_audio], [gstreamer-audio-${GSTREAMER_AUDIO_RELEASE} >= ${MIN_GSTREAMER_AUDIO_VERSION}]) +AC_SUBST([gstreamer_audio_CFLAGS]) +AC_SUBST([gstreamer_audio_LIBS]) + + +# +# Check for PyGObject +# + + +PKG_CHECK_MODULES([pygobject], [pygobject-2.0]) +AC_SUBST([pygobject_CFLAGS]) +AC_SUBST([pygobject_LIBS]) + + +# +# Check for NumPy +# + + +AX_PYTHON_MODULE(numpy, fatal) +NUMPY_CFLAGS=-I`$PYTHON -c "import numpy;print (numpy.get_include());"` +old_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS ${PYTHON_CPPFLAGS} ${NUMPY_CFLAGS}" +AC_CHECK_HEADER([numpy/arrayobject.h], + [PYTHON_CPPFLAGS="${PYTHON_CPPFLAGS} ${NUMPY_CFLAGS}"], + [AC_MSG_ERROR([Numpy extension header not found])], + [#include "Python.h"]) +CFLAGS="$old_CFLAGS" + + +# +# Check for LAL +# + + +AC_SUBST([MIN_LAL_VERSION], [6.12.0]) +AC_SUBST([MIN_LALMETAIO_VERSION], [1.2.0]) +AC_SUBST([MIN_LALBURST_VERSION], [1.2.2]) +PKG_CHECK_MODULES([LAL], [lal >= ${MIN_LAL_VERSION} lalburst >= ${MIN_LALBURST_VERSION} lalmetaio >= ${MIN_LALMETAIO_VERSION} lalsupport]) +AC_SUBST([LAL_CFLAGS]) +AC_SUBST([LAL_LIBS]) + + +# +# Check for glue and pylal +# + + +AC_SUBST([MIN_GLUE_VERSION], [1.46]) +AC_SUBST([MIN_PYLAL_VERSION], [0.5.0]) +AX_PYTHON_GLUE() +AX_PYTHON_PYLAL() + + +# +# Check for gstlal +# + + +AC_SUBST([MIN_GSTLAL_VERSION], [0.7.0]) +PKG_CHECK_MODULES([GSTLAL], [gstlal >= ${MIN_GSTLAL_VERSION}]) +AC_SUBST([GSTLAL_VERSION], [`$PKG_CONFIG --modversion gstlal`]) +AX_GSTLAL_SPLIT_VERSION([GSTLAL_VERSION]) +AC_SUBST([GSTLAL_VERSION_MAJOR]) +AC_SUBST([GSTLAL_VERSION_MINOR]) +AC_SUBST([GSTLAL_VERSION_POINT]) +AC_SUBST([GSTLAL_CFLAGS]) +AC_SUBST([GSTLAL_LIBS]) + +# +# Check for gstlal-ugly +# + + +AC_SUBST([MIN_GSTLAL_UGLY_VERSION], [0.6.0]) +PKG_CHECK_MODULES([GSTLAL_UGLY], [gstlal-ugly >= ${MIN_GSTLAL_UGLY_VERSION}]) +AC_SUBST([GSTLAL_UGLY_VERSION], [`$PKG_CONFIG --modversion gstlal-ugly`]) +AX_GSTLAL_SPLIT_VERSION([GSTLAL_UGLY_VERSION]) +AC_SUBST([GSTLAL_UGLY_VERSION_MAJOR]) +AC_SUBST([GSTLAL_UGLY_VERSION_MINOR]) +AC_SUBST([GSTLAL_UGLY_VERSION_POINT]) +AC_SUBST([GSTLAL_UGLY_CFLAGS]) +AC_SUBST([GSTLAL_UGLY_LIBS]) + + +# +# Output configure information +# + + +AC_PROG_MAKE_SET +AC_OUTPUT diff --git a/gstlal-burst/debian/Makefile.am b/gstlal-burst/debian/Makefile.am new file mode 100644 index 0000000000..36f7da340c --- /dev/null +++ b/gstlal-burst/debian/Makefile.am @@ -0,0 +1,9 @@ +EXTRA_DIST = \ + changelog \ + compat \ + control \ + control.in \ + copyright \ + gstlal-burst.install \ + rules \ + source/format diff --git a/gstlal-burst/debian/changelog b/gstlal-burst/debian/changelog new file mode 100644 index 0000000000..22756c8b6e --- /dev/null +++ b/gstlal-burst/debian/changelog @@ -0,0 +1,5 @@ +gstlal-burst (0.0.1-1) unstable; urgency=low + + * initial release + + -- Chris Pankow <chris.pankow@ligo.org> Wed, 27 Aug 2014 12:44:16 -0500 diff --git a/gstlal-burst/debian/compat b/gstlal-burst/debian/compat new file mode 100644 index 0000000000..45a4fb75db --- /dev/null +++ b/gstlal-burst/debian/compat @@ -0,0 +1 @@ +8 diff --git a/gstlal-burst/debian/control.in b/gstlal-burst/debian/control.in new file mode 100644 index 0000000000..307b074a30 --- /dev/null +++ b/gstlal-burst/debian/control.in @@ -0,0 +1,39 @@ +Source: gstlal-burst +Maintainer: Chris Pankow <chris.pankow@gravity.phys.uwm.edu> +Section: lscsoft +Priority: optional +Standards-Version: 3.9.2 +X-Python-Version: >= 2.6 +Build-Depends: + debhelper (>= 8), + python-all-dev (>= 2.6), + gstlal-dep (>= 2.2) | gstenvironment, + python-gobject-dev, + python-numpy, + lal-dev (>= @MIN_LAL_VERSION@), + lalmetaio-dev (>= @MIN_LALMETAIO_VERSION@), + python-glue (>= @MIN_GLUE_VERSION@), + fakeroot, + pkg-config, + gstlal-dev (>= @MIN_GSTLAL_VERSION@) + +Package: gstlal-burst +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, + python (>= 2.6), + python-glue (>= @MIN_GLUE_VERSION@), + python-glue-segments (>= @MIN_GLUE_VERSION@), + python-pylal (>= @MIN_PYLAL_VERSION@), + gstlal-dep (>= 2.2) | gstenvironment, + python-gobject, + python-numpy, + python-scipy, + lal (>= @MIN_LAL_VERSION@), + lalmetaio (>= @MIN_LALMETAIO_VERSION@), + lalburst (>= @MIN_LALBURST_VERSION@), + gstlal (>= @MIN_GSTLAL_VERSION@), + gstlal-ugly (>= @MIN_GSTLAL_UGLY_VERSION@) +Conflicts: + gstlal-ugly (<< 0.6.0) +Description: GStreamer for generic transient data analysis + This package contains the plugins and shared libraries required to run the gstlal burst (generic transient) pipeline. diff --git a/gstlal-burst/debian/copyright b/gstlal-burst/debian/copyright new file mode 100644 index 0000000000..5852795b4d --- /dev/null +++ b/gstlal-burst/debian/copyright @@ -0,0 +1 @@ +License: GPL diff --git a/gstlal-burst/debian/gstlal-burst.install b/gstlal-burst/debian/gstlal-burst.install new file mode 100644 index 0000000000..17c701b401 --- /dev/null +++ b/gstlal-burst/debian/gstlal-burst.install @@ -0,0 +1,2 @@ +usr/bin/* +usr/lib/python*/*/gstlal diff --git a/gstlal-burst/debian/rules b/gstlal-burst/debian/rules new file mode 100755 index 0000000000..7906db3c91 --- /dev/null +++ b/gstlal-burst/debian/rules @@ -0,0 +1,17 @@ +#!/usr/bin/make -f +%: + . /opt/lscsoft/gst/etc/gstenvironment.sh; \ + dh $@ --with=python2 + +override_dh_auto_install: + $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + ls -lR $(CURDIR)/debian/tmp + +override_dh_auto_test: + . /opt/lscsoft/gst/etc/gstenvironment.sh; \ + export PYTHONPATH=$$(pwd)/python; \ + dh $@ + +override_dh_shlibdeps: + . /opt/lscsoft/gst/etc/gstenvironment.sh; \ + dh "$@" -Xlibgstaudio-0.10.so.0 diff --git a/gstlal-burst/debian/source/format b/gstlal-burst/debian/source/format new file mode 100644 index 0000000000..163aaf8d82 --- /dev/null +++ b/gstlal-burst/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/gstlal-burst/gnuscripts/ax_cflags_warn_all.m4 b/gstlal-burst/gnuscripts/ax_cflags_warn_all.m4 new file mode 100644 index 0000000000..64fb29769e --- /dev/null +++ b/gstlal-burst/gnuscripts/ax_cflags_warn_all.m4 @@ -0,0 +1,151 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] +# +# DESCRIPTION +# +# Try to find a compiler option that enables most reasonable warnings. +# +# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The +# result is added to the shellvar being CFLAGS by default. +# +# Currently this macro knows about GCC, Solaris C compiler, Digital Unix C +# compiler, C for AIX Compiler, HP-UX C compiler, IRIX C compiler, NEC +# SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos 10.0.0.8) C +# compiler. +# +# - $1 shell-variable-to-add-to : CFLAGS +# - $2 add-value-if-not-found : nothing +# - $3 action-if-found : add value to shellvariable +# - $4 action-if-not-found : nothing +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 8 + +AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl +AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl +AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl +AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], +VAR,[VAR="no, unknown" + AC_LANG_SAVE + AC_LANG_C + ac_save_[]FLAGS="$[]FLAGS" +for ac_arg dnl +in "-pedantic % -Wall" dnl GCC + "-xstrconst % -v" dnl Solaris C + "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix + "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX + "-ansi -ansiE % -fullwarn" dnl IRIX + "+ESlit % +w1" dnl HP-UX C + "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10) + "-h conform % -h msglevel 2" dnl Cray C (Unicos) + # +do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` + AC_TRY_COMPILE([],[return 0;], + [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) +done + FLAGS="$ac_save_[]FLAGS" + AC_LANG_RESTORE +]) +case ".$VAR" in + .ok|.ok,*) m4_ifvaln($3,$3) ;; + .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[ + AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"]) + m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;; + *) m4_ifvaln($3,$3,[ + if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null + then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) + else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) + m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" + fi ]) ;; +esac +AS_VAR_POPDEF([VAR])dnl +AS_VAR_POPDEF([FLAGS])dnl +]) + +dnl the only difference - the LANG selection... and the default FLAGS + +AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl +AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl +AS_VAR_PUSHDEF([VAR],[ax_cv_cxxflags_warn_all])dnl +AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], +VAR,[VAR="no, unknown" + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_[]FLAGS="$[]FLAGS" +for ac_arg dnl +in "-pedantic % -Wall" dnl GCC + "-xstrconst % -v" dnl Solaris C + "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix + "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX + "-ansi -ansiE % -fullwarn" dnl IRIX + "+ESlit % +w1" dnl HP-UX C + "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10) + "-h conform % -h msglevel 2" dnl Cray C (Unicos) + # +do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` + AC_TRY_COMPILE([],[return 0;], + [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) +done + FLAGS="$ac_save_[]FLAGS" + AC_LANG_RESTORE +]) +case ".$VAR" in + .ok|.ok,*) m4_ifvaln($3,$3) ;; + .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[ + AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"]) + m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;; + *) m4_ifvaln($3,$3,[ + if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null + then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) + else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) + m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" + fi ]) ;; +esac +AS_VAR_POPDEF([VAR])dnl +AS_VAR_POPDEF([FLAGS])dnl +]) + +dnl implementation tactics: +dnl the for-argument contains a list of options. The first part of +dnl these does only exist to detect the compiler - usually it is +dnl a global option to enable -ansi or -extrawarnings. All other +dnl compilers will fail about it. That was needed since a lot of +dnl compilers will give false positives for some option-syntax +dnl like -Woption or -Xoption as they think of it is a pass-through +dnl to later compile stages or something. The "%" is used as a +dnl delimimiter. A non-option comment can be given after "%%" marks +dnl which will be shown but not added to the respective C/CXXFLAGS. diff --git a/gstlal-burst/gnuscripts/ax_check_compiler_flags.m4 b/gstlal-burst/gnuscripts/ax_check_compiler_flags.m4 new file mode 100644 index 0000000000..35bfd2a5a2 --- /dev/null +++ b/gstlal-burst/gnuscripts/ax_check_compiler_flags.m4 @@ -0,0 +1,76 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_compiler_flags.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_COMPILER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE]) +# +# DESCRIPTION +# +# Check whether the given compiler FLAGS work with the current language's +# compiler, or whether they give an error. (Warnings, however, are +# ignored.) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# LICENSE +# +# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2009 Matteo Frigo +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 9 + +AC_DEFUN([AX_CHECK_COMPILER_FLAGS], +[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX +AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1]) +dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: +AS_LITERAL_IF([$1], + [AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]), [ + ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes, + AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no) + _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])], + [ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes, + eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no) + _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS]) +eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]) +AC_MSG_RESULT($ax_check_compiler_flags) +if test "x$ax_check_compiler_flags" = xyes; then + m4_default([$2], :) +else + m4_default([$3], :) +fi +])dnl AX_CHECK_COMPILER_FLAGS diff --git a/gstlal-burst/gnuscripts/ax_compare_version.m4 b/gstlal-burst/gnuscripts/ax_compare_version.m4 new file mode 100644 index 0000000000..74dc0fdd9a --- /dev/null +++ b/gstlal-burst/gnuscripts/ax_compare_version.m4 @@ -0,0 +1,177 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_compare_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# This macro compares two version strings. Due to the various number of +# minor-version numbers that can exist, and the fact that string +# comparisons are not compatible with numeric comparisons, this is not +# necessarily trivial to do in a autoconf script. This macro makes doing +# these comparisons easy. +# +# The six basic comparisons are available, as well as checking equality +# limited to a certain number of minor-version levels. +# +# The operator OP determines what type of comparison to do, and can be one +# of: +# +# eq - equal (test A == B) +# ne - not equal (test A != B) +# le - less than or equal (test A <= B) +# ge - greater than or equal (test A >= B) +# lt - less than (test A < B) +# gt - greater than (test A > B) +# +# Additionally, the eq and ne operator can have a number after it to limit +# the test to that number of minor versions. +# +# eq0 - equal up to the length of the shorter version +# ne0 - not equal up to the length of the shorter version +# eqN - equal up to N sub-version levels +# neN - not equal up to N sub-version levels +# +# When the condition is true, shell commands ACTION-IF-TRUE are run, +# otherwise shell commands ACTION-IF-FALSE are run. The environment +# variable 'ax_compare_version' is always set to either 'true' or 'false' +# as well. +# +# Examples: +# +# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) +# +# would both be true. +# +# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) +# +# would both be false. +# +# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) +# +# would be true because it is only comparing two minor versions. +# +# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) +# +# would be true because it is only comparing the lesser number of minor +# versions of the two values. +# +# Note: The characters that separate the version numbers do not matter. An +# empty string is the same as version 0. OP is evaluated by autoconf, not +# configure, so must be a string, not a variable. +# +# The author would like to acknowledge Guido Draheim whose advice about +# the m4_case and m4_ifvaln functions make this macro only include the +# portions necessary to perform the specific comparison specified by the +# OP argument in the final configure script. +# +# LICENSE +# +# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 11 + +dnl ######################################################################### +AC_DEFUN([AX_COMPARE_VERSION], [ + AC_REQUIRE([AC_PROG_AWK]) + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + AS_VAR_PUSHDEF([A],[ax_compare_version_A]) + A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + AS_VAR_PUSHDEF([B],[ax_compare_version_B]) + B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary + dnl # then the first line is used to determine if the condition is true. + dnl # The sed right after the echo is to remove any indented white space. + m4_case(m4_tolower($2), + [lt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [gt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [le],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ], + [ge],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ],[ + dnl Split the operator from the subversion count if present. + m4_bmatch(m4_substr($2,2), + [0],[ + # A count of zero means use the length of the shorter version. + # Determine the number of characters in A and B. + ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` + ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` + + # Set A to no more than B's length and B to no more than A's length. + A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` + B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` + ], + [[0-9]+],[ + # A count greater than zero means use only that many subversions + A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + ], + [.+],[ + AC_WARNING( + [illegal OP numeric parameter: $2]) + ],[]) + + # Pad zeros at end of numbers to make same length. + ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" + B="$B`echo $A | sed 's/./0/g'`" + A="$ax_compare_version_tmp_A" + + # Check for equality or inequality as necessary. + m4_case(m4_tolower(m4_substr($2,0,2)), + [eq],[ + test "x$A" = "x$B" && ax_compare_version=true + ], + [ne],[ + test "x$A" != "x$B" && ax_compare_version=true + ],[ + AC_WARNING([illegal OP parameter: $2]) + ]) + ]) + + AS_VAR_POPDEF([A])dnl + AS_VAR_POPDEF([B])dnl + + dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. + if test "$ax_compare_version" = "true" ; then + m4_ifvaln([$4],[$4],[:])dnl + m4_ifvaln([$5],[else $5])dnl + fi +]) dnl AX_COMPARE_VERSION diff --git a/gstlal-burst/gnuscripts/ax_compiler_vendor.m4 b/gstlal-burst/gnuscripts/ax_compiler_vendor.m4 new file mode 100644 index 0000000000..7692ed3508 --- /dev/null +++ b/gstlal-burst/gnuscripts/ax_compiler_vendor.m4 @@ -0,0 +1,63 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPILER_VENDOR +# +# DESCRIPTION +# +# Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun, +# hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft, +# watcom, etc. The vendor is returned in the cache variable +# $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2008 Matteo Frigo +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 8 + +AC_DEFUN([AX_COMPILER_VENDOR], +[ +AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, + [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown + # note: don't check for gcc first since some other compilers define __GNUC__ + for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do + vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ +#if !($vencpp) + thisisanerror; +#endif +])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break]) + done + ]) +]) diff --git a/gstlal-burst/gnuscripts/ax_gcc_archflag.m4 b/gstlal-burst/gnuscripts/ax_gcc_archflag.m4 new file mode 100644 index 0000000000..d37a9134c2 --- /dev/null +++ b/gstlal-burst/gnuscripts/ax_gcc_archflag.m4 @@ -0,0 +1,215 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_gcc_archflag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE]) +# +# DESCRIPTION +# +# This macro tries to guess the "native" arch corresponding to the target +# architecture for use with gcc's -march=arch or -mtune=arch flags. If +# found, the cache variable $ax_cv_gcc_archflag is set to this flag and +# ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is is set to +# "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is +# to add $ax_cv_gcc_archflag to the end of $CFLAGS. +# +# PORTABLE? should be either [yes] (default) or [no]. In the former case, +# the flag is set to -mtune (or equivalent) so that the architecture is +# only used for tuning, but the instruction set used is still portable. In +# the latter case, the flag is set to -march (or equivalent) so that +# architecture-specific instructions are enabled. +# +# The user can specify --with-gcc-arch=<arch> in order to override the +# macro's choice of architecture, or --without-gcc-arch to disable this. +# +# When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is +# called unless the user specified --with-gcc-arch manually. +# +# Requires macros: AX_CHECK_COMPILER_FLAGS, AX_GCC_X86_CPUID +# +# (The main emphasis here is on recent CPUs, on the principle that doing +# high-performance computing on old hardware is uncommon.) +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2008 Matteo Frigo +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 8 + +AC_DEFUN([AX_GCC_ARCHFLAG], +[AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_CANONICAL_HOST]) + +AC_ARG_WITH(gcc-arch, [AS_HELP_STRING([--with-gcc-arch=<arch>], [use architecture <arch> for gcc -march/-mtune, instead of guessing])], + ax_gcc_arch=$withval, ax_gcc_arch=yes) + +AC_MSG_CHECKING([for gcc architecture flag]) +AC_MSG_RESULT([]) +AC_CACHE_VAL(ax_cv_gcc_archflag, +[ +ax_cv_gcc_archflag="unknown" + +if test "$GCC" = yes; then + +if test "x$ax_gcc_arch" = xyes; then +ax_gcc_arch="" +if test "$cross_compiling" = no; then +case $host_cpu in + i[[3456]]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones + AX_GCC_X86_CPUID(0) + AX_GCC_X86_CPUID(1) + case $ax_cv_gcc_x86_cpuid_0 in + *:756e6547:*:*) # Intel + case $ax_cv_gcc_x86_cpuid_1 in + *5[[48]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; + *5??:*:*:*) ax_gcc_arch=pentium ;; + *6[[3456]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; + *6a?:*[[01]]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; + *6a?:*[[234]]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; + *6[[9d]]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; + *6[[78b]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; + *6??:*:*:*) ax_gcc_arch=pentiumpro ;; + *f3[[347]]:*:*:*|*f4[1347]:*:*:*) + case $host_cpu in + x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;; + *) ax_gcc_arch="prescott pentium4 pentiumpro" ;; + esac ;; + *f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";; + esac ;; + *:68747541:*:*) # AMD + case $ax_cv_gcc_x86_cpuid_1 in + *5[[67]]?:*:*:*) ax_gcc_arch=k6 ;; + *5[[8d]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; + *5[[9]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; + *60?:*:*:*) ax_gcc_arch=k7 ;; + *6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;; + *6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; + *67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;; + *6[[68a]]?:*:*:*) + AX_GCC_X86_CPUID(0x80000006) # L2 cache size + case $ax_cv_gcc_x86_cpuid_0x80000006 in + *:*:*[[1-9a-f]]??????:*) # (L2 = ecx >> 16) >= 256 + ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; + *) ax_gcc_arch="athlon-4 athlon k7" ;; + esac ;; + *f[[4cef8b]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; + *f5?:*:*:*) ax_gcc_arch="opteron k8" ;; + *f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;; + *f??:*:*:*) ax_gcc_arch="k8" ;; + esac ;; + *:746e6543:*:*) # IDT + case $ax_cv_gcc_x86_cpuid_1 in + *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; + *58?:*:*:*) ax_gcc_arch=winchip2 ;; + *6[[78]]?:*:*:*) ax_gcc_arch=c3 ;; + *69?:*:*:*) ax_gcc_arch="c3-2 c3" ;; + esac ;; + esac + if test x"$ax_gcc_arch" = x; then # fallback + case $host_cpu in + i586*) ax_gcc_arch=pentium ;; + i686*) ax_gcc_arch=pentiumpro ;; + esac + fi + ;; + + sparc*) + AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/]) + cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` + cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters` + case $cputype in + *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; + *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; + *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; + *supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;; + *hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;; + *cypress*) ax_gcc_arch=cypress ;; + esac ;; + + alphaev5) ax_gcc_arch=ev5 ;; + alphaev56) ax_gcc_arch=ev56 ;; + alphapca56) ax_gcc_arch="pca56 ev56" ;; + alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; + alphaev6) ax_gcc_arch=ev6 ;; + alphaev67) ax_gcc_arch=ev67 ;; + alphaev68) ax_gcc_arch="ev68 ev67" ;; + alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; + alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; + alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; + + powerpc*) + cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` + cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'` + case $cputype in + *750*) ax_gcc_arch="750 G3" ;; + *740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;; + *74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;; + *74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;; + *970*) ax_gcc_arch="970 G5 power4";; + *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; + *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; + 603ev|8240) ax_gcc_arch="$cputype 603e 603";; + *) ax_gcc_arch=$cputype ;; + esac + ax_gcc_arch="$ax_gcc_arch powerpc" + ;; +esac +fi # not cross-compiling +fi # guess arch + +if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then +for arch in $ax_gcc_arch; do + if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code + flags="-mtune=$arch" + # -mcpu=$arch and m$arch generate nonportable code on every arch except + # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. + case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac + else + flags="-march=$arch -mcpu=$arch -m$arch" + fi + for flag in $flags; do + AX_CHECK_COMPILER_FLAGS($flag, [ax_cv_gcc_archflag=$flag; break]) + done + test "x$ax_cv_gcc_archflag" = xunknown || break +done +fi + +fi # $GCC=yes +]) +AC_MSG_CHECKING([for gcc architecture flag]) +AC_MSG_RESULT($ax_cv_gcc_archflag) +if test "x$ax_cv_gcc_archflag" = xunknown; then + m4_default([$3],:) +else + m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"]) +fi +]) diff --git a/gstlal-burst/gnuscripts/ax_gcc_x86_cpuid.m4 b/gstlal-burst/gnuscripts/ax_gcc_x86_cpuid.m4 new file mode 100644 index 0000000000..7d46fee021 --- /dev/null +++ b/gstlal-burst/gnuscripts/ax_gcc_x86_cpuid.m4 @@ -0,0 +1,79 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_GCC_X86_CPUID(OP) +# +# DESCRIPTION +# +# On Pentium and later x86 processors, with gcc or a compiler that has a +# compatible syntax for inline assembly instructions, run a small program +# that executes the cpuid instruction with input OP. This can be used to +# detect the CPU type. +# +# On output, the values of the eax, ebx, ecx, and edx registers are stored +# as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable +# ax_cv_gcc_x86_cpuid_OP. +# +# If the cpuid instruction fails (because you are running a +# cross-compiler, or because you are not using gcc, or because you are on +# a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP +# is set to the string "unknown". +# +# This macro mainly exists to be used in AX_GCC_ARCHFLAG. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2008 Matteo Frigo +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 7 + +AC_DEFUN([AX_GCC_X86_CPUID], +[AC_REQUIRE([AC_PROG_CC]) +AC_LANG_PUSH([C]) +AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1, + [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [ + int op = $1, eax, ebx, ecx, edx; + FILE *f; + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op)); + f = fopen("conftest_cpuid", "w"); if (!f) return 1; + fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); + fclose(f); + return 0; +])], + [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid], + [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid], + [ax_cv_gcc_x86_cpuid_$1=unknown])]) +AC_LANG_POP([C]) +]) diff --git a/gstlal-burst/gnuscripts/ax_gstlal_split_version.m4 b/gstlal-burst/gnuscripts/ax_gstlal_split_version.m4 new file mode 100644 index 0000000000..04dc1f31dc --- /dev/null +++ b/gstlal-burst/gnuscripts/ax_gstlal_split_version.m4 @@ -0,0 +1,20 @@ +AC_DEFUN([AX_GSTLAL_SPLIT_VERSION], [ +dnl save VERSION and AX_*_VERSION variables +_orig_VERSION=$VERSION +for part in MAJOR MINOR POINT ; do + eval _orig_AX_${part}_VERSION=\$AX_${part}_VERSION +done +dnl split the argument +eval VERSION=\$$1 +AX_SPLIT_VERSION +for part in MAJOR MINOR POINT ; do + eval $1_${part}=\$AX_${part}_VERSION +done +dnl restore VERSION and AX_*_VERSION to orignal values +VERSION=$_orig_VERSION +unset _orig_VERSION +for part in MAJOR MINOR POINT ; do + eval AX_${part}_VERSION=\$_orig_AX_${part}_VERSION + unset _orig_AX_${part}_VERSION +done +]) diff --git a/gstlal-burst/gnuscripts/ax_python_devel.m4 b/gstlal-burst/gnuscripts/ax_python_devel.m4 new file mode 100644 index 0000000000..469b36b494 --- /dev/null +++ b/gstlal-burst/gnuscripts/ax_python_devel.m4 @@ -0,0 +1,316 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_python_devel.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PYTHON_DEVEL([version]) +# +# DESCRIPTION +# +# Note: Defines as a precious variable "PYTHON_VERSION". Don't override it +# in your configure.ac. +# +# This macro checks for Python and tries to get the include path to +# 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) +# output variables. It also exports $(PYTHON_EXTRA_LIBS) and +# $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code. +# +# You can search for some particular version of Python by passing a +# parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please +# note that you *have* to pass also an operator along with the version to +# match, and pay special attention to the single quotes surrounding the +# version number. Don't use "PYTHON_VERSION" for this: that environment +# variable is declared as precious and thus reserved for the end-user. +# +# This macro should work for all versions of Python >= 2.1.0. As an end +# user, you can disable the check for the python version by setting the +# PYTHON_NOVERSIONCHECK environment variable to something else than the +# empty string. +# +# If you need to use this macro for an older Python version, please +# contact the authors. We're always open for feedback. +# +# LICENSE +# +# Copyright (c) 2009 Sebastian Huber <sebastian-huber@web.de> +# Copyright (c) 2009 Alan W. Irwin +# Copyright (c) 2009 Rafael Laboissiere <rafael@laboissiere.net> +# Copyright (c) 2009 Andrew Collier +# Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org> +# Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org> +# Copyright (c) 2013 Daniel Mullner <muellner@math.stanford.edu> +# +# MODIFIED 2013-09-11 by Leo Singer <leo.singer@ligo.org>: don't use +# LINKFORSHARED; according to <http://trac.macports.org/ticket/39223>, +# LINKFORSHARED is not needed for building Python extension modules. +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 16 + +AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL]) +AC_DEFUN([AX_PYTHON_DEVEL],[ + # + # Allow the use of a (user set) custom python version + # + AC_ARG_VAR([PYTHON_VERSION],[The installed Python + version to use, for example '2.3'. This string + will be appended to the Python interpreter + canonical name.]) + + AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) + if test -z "$PYTHON"; then + AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path]) + PYTHON_VERSION="" + fi + + # + # Check for a version of Python >= 2.1.0 + # + AC_MSG_CHECKING([for a version of Python >= '2.1.0']) + ac_supports_python_ver=`$PYTHON -c "import sys; \ + ver = sys.version.split ()[[0]]; \ + print (ver >= '2.1.0')"` + if test "$ac_supports_python_ver" != "True"; then + if test -z "$PYTHON_NOVERSIONCHECK"; then + AC_MSG_RESULT([no]) + AC_MSG_FAILURE([ +This version of the AC@&t@_PYTHON_DEVEL macro +doesn't work properly with versions of Python before +2.1.0. You may need to re-run configure, setting the +variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, +PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. +Moreover, to disable this check, set PYTHON_NOVERSIONCHECK +to something else than an empty string. +]) + else + AC_MSG_RESULT([skip at user request]) + fi + else + AC_MSG_RESULT([yes]) + fi + + # + # if the macro parameter ``version'' is set, honour it + # + if test -n "$1"; then + AC_MSG_CHECKING([for a version of Python $1]) + ac_supports_python_ver=`$PYTHON -c "import sys; \ + ver = sys.version.split ()[[0]]; \ + print (ver $1)"` + if test "$ac_supports_python_ver" = "True"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([this package requires Python $1. +If you have it installed, but it isn't the default Python +interpreter in your system path, please pass the PYTHON_VERSION +variable to configure. See ``configure --help'' for reference. +]) + PYTHON_VERSION="" + fi + fi + + # + # Check if you have distutils, else fail + # + AC_MSG_CHECKING([for the distutils Python package]) + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` + if test -z "$ac_distutils_result"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([cannot import Python module "distutils". +Please check your Python installation. The error was: +$ac_distutils_result]) + PYTHON_VERSION="" + fi + + # + # Check for Python include path + # + AC_MSG_CHECKING([for Python include path]) + if test -z "$PYTHON_CPPFLAGS"; then + python_path=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_inc ());"` + plat_python_path=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_inc (plat_specific=1));"` + if test -n "${python_path}"; then + if test "${plat_python_path}" != "${python_path}"; then + python_path="-I$python_path -I$plat_python_path" + else + python_path="-I$python_path" + fi + fi + PYTHON_CPPFLAGS=$python_path + fi + AC_MSG_RESULT([$PYTHON_CPPFLAGS]) + AC_SUBST([PYTHON_CPPFLAGS]) + + # + # Check for Python library path + # + AC_MSG_CHECKING([for Python library path]) + if test -z "$PYTHON_LDFLAGS"; then + # (makes two attempts to ensure we've got a version number + # from the interpreter) + ac_python_version=`cat<<EOD | $PYTHON - + +# join all versioning strings, on some systems +# major/minor numbers could be in different list elements +from distutils.sysconfig import * +e = get_config_var('VERSION') +if e is not None: + print(e) +EOD` + + if test -z "$ac_python_version"; then + if test -n "$PYTHON_VERSION"; then + ac_python_version=$PYTHON_VERSION + else + ac_python_version=`$PYTHON -c "import sys; \ + print (sys.version[[:3]])"` + fi + fi + + # Make the versioning information available to the compiler + AC_DEFINE_UNQUOTED([HAVE_PYTHON], ["$ac_python_version"], + [If available, contains the Python version number currently in use.]) + + # First, the library directory: + ac_python_libdir=`cat<<EOD | $PYTHON - + +# There should be only one +import distutils.sysconfig +e = distutils.sysconfig.get_config_var('LIBDIR') +if e is not None: + print (e) +EOD` + + # Now, for the library: + ac_python_library=`cat<<EOD | $PYTHON - + +import distutils.sysconfig +c = distutils.sysconfig.get_config_vars() +if 'LDVERSION' in c: + print ('python'+c[['LDVERSION']]) +else: + print ('python'+c[['VERSION']]) +EOD` + + # This small piece shamelessly adapted from PostgreSQL python macro; + # credits goes to momjian, I think. I'd like to put the right name + # in the credits, if someone can point me in the right direction... ? + # + if test -n "$ac_python_libdir" -a -n "$ac_python_library" + then + # use the official shared library + ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"` + PYTHON_LDFLAGS="-L$ac_python_libdir -l$ac_python_library" + else + # old way: use libpython from python_configdir + ac_python_libdir=`$PYTHON -c \ + "from distutils.sysconfig import get_python_lib as f; \ + import os; \ + print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"` + PYTHON_LDFLAGS="-L$ac_python_libdir -lpython$ac_python_version" + fi + + if test -z "PYTHON_LDFLAGS"; then + AC_MSG_ERROR([ + Cannot determine location of your Python DSO. Please check it was installed with + dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand. + ]) + fi + fi + AC_MSG_RESULT([$PYTHON_LDFLAGS]) + AC_SUBST([PYTHON_LDFLAGS]) + + # + # Check for site packages + # + AC_MSG_CHECKING([for Python site-packages path]) + if test -z "$PYTHON_SITE_PKG"; then + PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_lib(0,0));"` + fi + AC_MSG_RESULT([$PYTHON_SITE_PKG]) + AC_SUBST([PYTHON_SITE_PKG]) + + # + # libraries which must be linked in when embedding + # + AC_MSG_CHECKING(python extra libraries) + if test -z "$PYTHON_EXTRA_LIBS"; then + PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ + conf = distutils.sysconfig.get_config_var; \ + print (conf('LIBS'))"` + fi + AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) + AC_SUBST(PYTHON_EXTRA_LIBS) + + # + # final check to see if everything compiles alright + # + AC_MSG_CHECKING([consistency of all components of python development environment]) + # save current global flags + ac_save_LIBS="$LIBS" + ac_save_CPPFLAGS="$CPPFLAGS" + LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LDFLAGS $PYTHON_EXTRA_LIBS" + CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS" + AC_LANG_PUSH([C]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[#include <Python.h>]], + [[Py_Initialize();]]) + ],[pythonexists=yes],[pythonexists=no]) + AC_LANG_POP([C]) + # turn back to default flags + CPPFLAGS="$ac_save_CPPFLAGS" + LIBS="$ac_save_LIBS" + + AC_MSG_RESULT([$pythonexists]) + + if test ! "x$pythonexists" = "xyes"; then + AC_MSG_FAILURE([ + Could not link test program to Python. Maybe the main Python library has been + installed in some non-standard library path. If so, pass it to configure, + via the LDFLAGS environment variable. + Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" + ============================================================================ + ERROR! + You probably have to install the development version of the Python package + for your distribution. The exact name of this package varies among them. + ============================================================================ + ]) + PYTHON_VERSION="" + fi + + # + # all done! + # +]) diff --git a/gstlal-burst/gnuscripts/ax_python_glue.m4 b/gstlal-burst/gnuscripts/ax_python_glue.m4 new file mode 100644 index 0000000000..1ac53bcc28 --- /dev/null +++ b/gstlal-burst/gnuscripts/ax_python_glue.m4 @@ -0,0 +1,17 @@ +AC_DEFUN([AX_PYTHON_GLUE],[ + if test -z $PYTHON ; then + PYTHON="python" + fi + PYTHON_NAME=`basename $PYTHON` + AX_PYTHON_MODULE([glue]) + if test "x$HAVE_PYMOD_GLUE" == "xyes" ; then + AC_MSG_CHECKING(glue version) + GLUE_VERSION=`$PYTHON -c "from glue import git_version ; print '%s.%s' % tuple((git_version.tag or '0-0').replace('glue-release-', '').split('-')[[:2]])"` + if test "x${GLUE_VERSION}" == "x0.0" ; then + GLUE_VERSION= + AC_MSG_RESULT([unknown]) + else + AC_MSG_RESULT($GLUE_VERSION) + fi + fi +]) diff --git a/gstlal-burst/gnuscripts/ax_python_module.m4 b/gstlal-burst/gnuscripts/ax_python_module.m4 new file mode 100644 index 0000000000..bd70a06b4f --- /dev/null +++ b/gstlal-burst/gnuscripts/ax_python_module.m4 @@ -0,0 +1,49 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_python_module.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PYTHON_MODULE(modname[, fatal]) +# +# DESCRIPTION +# +# Checks for Python module. +# +# If fatal is non-empty then absence of a module will trigger an error. +# +# LICENSE +# +# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 5 + +AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE]) +AC_DEFUN([AX_PYTHON_MODULE],[ + if test -z $PYTHON; + then + PYTHON="python" + fi + PYTHON_NAME=`basename $PYTHON` + AC_MSG_CHECKING($PYTHON_NAME module: $1) + $PYTHON -c "import $1" 2>/dev/null + if test $? -eq 0; + then + AC_MSG_RESULT(yes) + eval AS_TR_CPP(HAVE_PYMOD_$1)=yes + else + AC_MSG_RESULT(no) + eval AS_TR_CPP(HAVE_PYMOD_$1)=no + # + if test -n "$2" + then + AC_MSG_ERROR(failed to find required module $1) + exit 1 + fi + fi +]) diff --git a/gstlal-burst/gnuscripts/ax_python_pylal.m4 b/gstlal-burst/gnuscripts/ax_python_pylal.m4 new file mode 100644 index 0000000000..2265e5cece --- /dev/null +++ b/gstlal-burst/gnuscripts/ax_python_pylal.m4 @@ -0,0 +1,17 @@ +AC_DEFUN([AX_PYTHON_PYLAL],[ + if test -z $PYTHON ; then + PYTHON="python" + fi + PYTHON_NAME=`basename $PYTHON` + AX_PYTHON_MODULE([pylal]) + if test "x$HAVE_PYMOD_PYLAL" == "xyes" ; then + AC_MSG_CHECKING(pylal version) + PYLAL_VERSION=`$PYTHON -c "from pylal import git_version ; print '%s.%s' % tuple((git_version.tag or '0-0').replace('pylal-', '').split('-')[[:2]])"` + if test "x${PYLAL_VERSION}" == "x0.0" ; then + PYLAL_VERSION= + AC_MSG_RESULT([unknown]) + else + AC_MSG_RESULT($PYLAL_VERSION) + fi + fi +]) diff --git a/gstlal-burst/gnuscripts/ax_split_version.m4 b/gstlal-burst/gnuscripts/ax_split_version.m4 new file mode 100644 index 0000000000..02737c3920 --- /dev/null +++ b/gstlal-burst/gnuscripts/ax_split_version.m4 @@ -0,0 +1,38 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_split_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_SPLIT_VERSION +# +# DESCRIPTION +# +# Splits a version number in the format MAJOR.MINOR.POINT into its +# separate components. +# +# Sets the variables. +# +# LICENSE +# +# Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 9 + +AC_DEFUN([AX_SPLIT_VERSION],[ + AC_REQUIRE([AC_PROG_SED]) + AX_MAJOR_VERSION=`echo "$VERSION" | $SED 's/\([[^.]][[^.]]*\).*/\1/'` + AX_MINOR_VERSION=`echo "$VERSION" | $SED 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'` + AX_POINT_VERSION=`echo "$VERSION" | $SED 's/[[^.]][[^.]]*.[[^.]][[^.]]*.\(.*\)/\1/'` + AC_MSG_CHECKING([Major version]) + AC_MSG_RESULT([$AX_MAJOR_VERSION]) + AC_MSG_CHECKING([Minor version]) + AC_MSG_RESULT([$AX_MINOR_VERSION]) + AC_MSG_CHECKING([Point version]) + AC_MSG_RESULT([$AX_POINT_VERSION]) +]) diff --git a/gstlal-burst/gnuscripts/lalsuite_c99.m4 b/gstlal-burst/gnuscripts/lalsuite_c99.m4 new file mode 100644 index 0000000000..397573c2e3 --- /dev/null +++ b/gstlal-burst/gnuscripts/lalsuite_c99.m4 @@ -0,0 +1,255 @@ +# lalsuite_c99.m4 - c99 detection macro taken from autoconf-2.63 +# +# serial 1 + +# This file is part of Autoconf. -*- Autoconf -*- +# Programming languages support. +# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free +# Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception, the Free Software Foundation gives unlimited +# permission to copy, distribute and modify the configure scripts that +# are the output of Autoconf. You need not follow the terms of the GNU +# General Public License when using or distributing such scripts, even +# though portions of the text of Autoconf appear in them. The GNU +# General Public License (GPL) does govern all other use of the material +# that constitutes the Autoconf program. +# +# Certain portions of the Autoconf source text are designed to be copied +# (in certain cases, depending on the input) into the output of +# Autoconf. We call these the "data" portions. The rest of the Autoconf +# source text consists of comments plus executable code that decides which +# of the data portions to output in any given case. We call these +# comments and executable code the "non-data" portions. Autoconf never +# copies any of the non-data portions into its output. +# +# This special exception to the GPL applies to versions of Autoconf +# released by the Free Software Foundation. When you make and +# distribute a modified version of Autoconf, you may extend this special +# exception to the GPL to apply to your modified version as well, *unless* +# your modified version has the potential to copy into its output some +# of the text that was the non-data portion of the version that you started +# with. (In other words, unless your change moves or copies text from +# the non-data portions to the data portions.) If your modification has +# such potential, you must delete any notice of this special exception +# to the GPL from your modified version. +# +# Written by David MacKenzie, with help from +# Akim Demaille, Paul Eggert, +# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, +# Roland McGrath, Noah Friedman, david d zuhn, and many others. + + +# _LALSUITE_AC_C_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST, +# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) +# -------------------------------------------------------------- +# Check whether the C compiler accepts features of STANDARD (e.g `c89', `c99') +# by trying to compile a program of TEST-PROLOGUE and TEST-BODY. If this fails, +# try again with each compiler option in the space-separated OPTION-LIST; if one +# helps, append it to CC. If eventually successful, run ACTION-IF-AVAILABLE, +# else ACTION-IF-UNAVAILABLE. +AC_DEFUN([_LALSUITE_AC_C_STD_TRY], +[AC_MSG_CHECKING([for $CC option to accept ISO ]m4_translit($1, [c], [C])) +AC_CACHE_VAL(ac_cv_prog_cc_$1, +[ac_cv_prog_cc_$1=no +ac_save_CC=$CC +AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])]) +for ac_arg in '' $4 +do + CC="$ac_save_CC $ac_arg" + _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_$1=$ac_arg]) + test "x$ac_cv_prog_cc_$1" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +])# AC_CACHE_VAL +case "x$ac_cv_prog_cc_$1" in + x) + AC_MSG_RESULT([none needed]) ;; + xno) + AC_MSG_RESULT([unsupported]) ;; + *) + CC="$CC $ac_cv_prog_cc_$1" + AC_MSG_RESULT([$ac_cv_prog_cc_$1]) ;; +esac +AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$5], [$6]) +])# _LALSUITE_AC_C_STD_TRY + + +# _LALSUITE_AC_PROG_CC_C99 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) +# ---------------------------------------------------------------- +# If the C compiler is not in ISO C99 mode by default, try to add an +# option to output variable CC to make it so. This macro tries +# various options that select ISO C99 on some system or another. It +# considers the compiler to be in ISO C99 mode if it handles _Bool, +# // comments, flexible array members, inline, long long int, mixed +# code and declarations, named initialization of structs, restrict, +# va_copy, varargs macros, variable declarations in for loops and +# variable length arrays. +AC_DEFUN([_LALSUITE_AC_PROG_CC_C99], +[_LALSUITE_AC_C_STD_TRY([c99], +[[#include <stdarg.h> +#include <stdbool.h> +#include <stdlib.h> +#include <wchar.h> +#include <stdio.h> + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} +]], +[[ + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); +]], +dnl Try +dnl GCC -std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999) +dnl AIX -qlanglvl=extc99 (unused restrictive mode: -qlanglvl=stdc99) +dnl HP cc -AC99 +dnl Intel ICC -std=c99, -c99 (deprecated) +dnl IRIX -c99 +dnl Solaris -xc99=all (Forte Developer 7 C mishandles -xc99 on Solaris 9, +dnl as it incorrectly assumes C99 semantics for library functions) +dnl Tru64 -c99 +dnl with extended modes being tried first. +[[-std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99]], [$1], [$2])[]dnl +])# _LALSUITE_AC_PROG_CC_C99 + + +# LALSUITE_AC_PROG_CC_C99 +# -------------- +AC_DEFUN([LALSUITE_AC_PROG_CC_C99], +[ AC_REQUIRE([AC_PROG_CC])dnl + _LALSUITE_AC_PROG_CC_C99 +]) diff --git a/gstlal-burst/gstlal-burst.spec.in b/gstlal-burst/gstlal-burst.spec.in new file mode 100644 index 0000000000..0608bb2469 --- /dev/null +++ b/gstlal-burst/gstlal-burst.spec.in @@ -0,0 +1,67 @@ +%define gstreamername gstreamer_lscsoft + +Name: @PACKAGE_NAME@ +Version: @PACKAGE_VERSION@ +Release: 1.lscsoft +Summary: GSTLAL Burst +License: GPL +Group: LSC Software/Data Analysis +Requires: gstlal-ugly >= @MIN_GSTLAL_UGLY_VERSION@ gstlal >= @MIN_GSTLAL_VERSION@ python >= 2.6 glue >= @MIN_GLUE_VERSION@ glue-segments >= @MIN_GLUE_VERSION@ python-pylal >= @MIN_PYLAL_VERSION@ %{gstreamername} >= @MIN_GSTREAMER_VERSION@ %{gstreamername}-plugins-base >= @MIN_GSTREAMER_VERSION@ %{gstreamername}-plugins-good >= 0.10.27 gstreamer_lscsoft-python >= 0.10.21 pygobject2 numpy scipy lal >= @MIN_LAL_VERSION@ lalmetaio >= @MIN_LALMETAIO_VERSION@ lalburst >= @MIN_LALBURST_VERSION@ +BuildRequires: gstlal-devel >= @MIN_GSTLAL_VERSION@ python-devel >= 2.6 fftw-devel >= 3 %{gstreamername}-devel >= @MIN_GSTREAMER_VERSION@ %{gstreamername}-plugins-base-devel >= @MIN_GSTREAMER_VERSION@ pygobject2-devel lal-devel >= @MIN_LAL_VERSION@ lalmetaio-devel >= @MIN_LALMETAIO_VERSION@ +Conflicts: gstlal-ugly < 0.6.0 +Source: @PACKAGE_NAME@-%{version}.tar.gz +URL: https://www.lsc-group.phys.uwm.edu/daswg/projects/gstlal.html +Packager: Chris Pankow <chris.pankow@gravity.phys.uwm.edu> +BuildRoot: %{_tmppath}/%{name}-%{version}-root +%description +This package contains the plugins and shared libraries required to run the gstlal burst (generic transient) pipeline. + + +%prep +%setup -q -n %{name}-%{version} + + +%build +. /opt/lscsoft/gst/gstenvironment.sh +%configure +%{__make} + + +%install +# FIXME: why doesn't % makeinstall macro work? +DESTDIR=${RPM_BUILD_ROOT} %{__make} install +# remove .so symlinks from libdir. these are not included in the .rpm, +# they will be installed by ldconfig in the post-install script, except for +# the .so symlink which isn't created by ldconfig and gets shipped in the +# devel package +[ ${RPM_BUILD_ROOT} != "/" ] && find ${RPM_BUILD_ROOT}/%{_libdir} -name "*.so.*" -type l -delete +# don't distribute *.la files +[ ${RPM_BUILD_ROOT} != "/" ] && find ${RPM_BUILD_ROOT} -name "*.la" -type f -delete + + +%post +if test -d /usr/lib64 ; then + ldconfig /usr/lib64 +else + ldconfig +fi + + +%postun +if test -d /usr/lib64 ; then + ldconfig /usr/lib64 +else + ldconfig +fi + + +%clean +[ ${RPM_BUILD_ROOT} != "/" ] && rm -Rf ${RPM_BUILD_ROOT} +rm -Rf ${RPM_BUILD_DIR}/%{name}-%{version} + + +%files +%defattr(-,root,root) +%{_bindir}/* +%{_prefix}/%{_lib}/python*/site-packages/gstlal +#%{_libdir}/gstreamer-0.10/python/* diff --git a/gstlal-burst/python/Makefile.am b/gstlal-burst/python/Makefile.am new file mode 100644 index 0000000000..f3e0ef8795 --- /dev/null +++ b/gstlal-burst/python/Makefile.am @@ -0,0 +1,11 @@ +# This is a trick taken from the gst-python automake setup. +# All of the Python scripts will be installed under the exec dir, +# which prevents the module from getting spread across lib and lib64 +# on e.g. CentOS. +pkgpythondir = $(pkgpyexecdir) + +pkgpython_PYTHON = \ + epparts.py \ + excesspower.py + +pkgpyexec_LTLIBRARIES = -- GitLab