Codebase list snp-sites / 9ae7b83
Imported Upstream version 2.1.1 Sascha Steinbiss 8 years ago
6 changed file(s) with 157 addition(s) and 26 deletion(s). Raw diff Collapse all Expand all
33 - clang
44 before_install:
55 - sudo apt-get update -qq
6 - sudo apt-get install -qq check libsubunit-dev
6 - sudo apt-get install -qq check
77 script: autoreconf -i && ./configure && make && make check
0 2.1.0
0 2.1.1
0 AC_INIT([snp-sites], [1])
0 AC_INIT([snp-sites], m4_esyscmd([tr -d '\n' < VERSION]))
11 AM_INIT_AUTOMAKE([foreign subdir-objects])
22 AC_CONFIG_SRCDIR([configure.ac])
3 AC_CONFIG_HEADERS([config.h])
3 AC_CONFIG_HEADERS([config.h])
44 AC_CONFIG_MACRO_DIR([m4])
55
66 AC_CANONICAL_HOST
77
8 case $host_os in
9 *linux*)
10 HOST_OS=linux
11 ;;
12 *) ;;
13 esac
14
15 AM_CONDITIONAL([HOST_LINUX],[test x$HOST_OS = xlinux])
8 PKG_CHECK_MODULES([CHECK],[check >= 0.8.2],[have_check="yes"],
9 AC_MSG_WARN(["'Check' unit testing framework not found. It would be impossible to run unit tests!"])
10 [have_check="no"])
1611
1712 AC_CHECK_HEADERS([zlib.h math.h])
13 AC_CHECK_LIB(m, floor)
14 AX_CHECK_ZLIB
1815
1916 AC_PROG_LIBTOOL
20 AC_PROG_CC
17 AC_PROG_CC
2118 AC_PROG_CXX
2219
2320 AC_CONFIG_FILES([Makefile src/Makefile])
0 # ===========================================================================
1 # http://www.gnu.org/software/autoconf-archive/ax_check_zlib.html
2 # ===========================================================================
3 #
4 # SYNOPSIS
5 #
6 # AX_CHECK_ZLIB([action-if-found], [action-if-not-found])
7 #
8 # DESCRIPTION
9 #
10 # This macro searches for an installed zlib library. If nothing was
11 # specified when calling configure, it searches first in /usr/local and
12 # then in /usr, /opt/local and /sw. If the --with-zlib=DIR is specified,
13 # it will try to find it in DIR/include/zlib.h and DIR/lib/libz.a. If
14 # --without-zlib is specified, the library is not searched at all.
15 #
16 # If either the header file (zlib.h) or the library (libz) is not found,
17 # shell commands 'action-if-not-found' is run. If 'action-if-not-found' is
18 # not specified, the configuration exits on error, asking for a valid zlib
19 # installation directory or --without-zlib.
20 #
21 # If both header file and library are found, shell commands
22 # 'action-if-found' is run. If 'action-if-found' is not specified, the
23 # default action appends '-I${ZLIB_HOME}/include' to CPFLAGS, appends
24 # '-L$ZLIB_HOME}/lib' to LDFLAGS, prepends '-lz' to LIBS, and calls
25 # AC_DEFINE(HAVE_LIBZ). You should use autoheader to include a definition
26 # for this symbol in a config.h file. Sample usage in a C/C++ source is as
27 # follows:
28 #
29 # #ifdef HAVE_LIBZ
30 # #include <zlib.h>
31 # #endif /* HAVE_LIBZ */
32 #
33 # LICENSE
34 #
35 # Copyright (c) 2008 Loic Dachary <loic@senga.org>
36 # Copyright (c) 2010 Bastien Chevreux <bach@chevreux.org>
37 #
38 # This program is free software; you can redistribute it and/or modify it
39 # under the terms of the GNU General Public License as published by the
40 # Free Software Foundation; either version 2 of the License, or (at your
41 # option) any later version.
42 #
43 # This program is distributed in the hope that it will be useful, but
44 # WITHOUT ANY WARRANTY; without even the implied warranty of
45 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
46 # Public License for more details.
47 #
48 # You should have received a copy of the GNU General Public License along
49 # with this program. If not, see <http://www.gnu.org/licenses/>.
50 #
51 # As a special exception, the respective Autoconf Macro's copyright owner
52 # gives unlimited permission to copy, distribute and modify the configure
53 # scripts that are the output of Autoconf when processing the Macro. You
54 # need not follow the terms of the GNU General Public License when using
55 # or distributing such scripts, even though portions of the text of the
56 # Macro appear in them. The GNU General Public License (GPL) does govern
57 # all other use of the material that constitutes the Autoconf Macro.
58 #
59 # This special exception to the GPL applies to versions of the Autoconf
60 # Macro released by the Autoconf Archive. When you make and distribute a
61 # modified version of the Autoconf Macro, you may extend this special
62 # exception to the GPL to apply to your modified version as well.
63
64 #serial 14
65
66 AU_ALIAS([CHECK_ZLIB], [AX_CHECK_ZLIB])
67 AC_DEFUN([AX_CHECK_ZLIB],
68 #
69 # Handle user hints
70 #
71 [AC_MSG_CHECKING(if zlib is wanted)
72 zlib_places="/usr/local /usr /opt/local /sw"
73 AC_ARG_WITH([zlib],
74 [ --with-zlib=DIR root directory path of zlib installation @<:@defaults to
75 /usr/local or /usr if not found in /usr/local@:>@
76 --without-zlib to disable zlib usage completely],
77 [if test "$withval" != no ; then
78 AC_MSG_RESULT(yes)
79 if test -d "$withval"
80 then
81 zlib_places="$withval $zlib_places"
82 else
83 AC_MSG_WARN([Sorry, $withval does not exist, checking usual places])
84 fi
85 else
86 zlib_places=
87 AC_MSG_RESULT(no)
88 fi],
89 [AC_MSG_RESULT(yes)])
90
91 #
92 # Locate zlib, if wanted
93 #
94 if test -n "${zlib_places}"
95 then
96 # check the user supplied or any other more or less 'standard' place:
97 # Most UNIX systems : /usr/local and /usr
98 # MacPorts / Fink on OSX : /opt/local respectively /sw
99 for ZLIB_HOME in ${zlib_places} ; do
100 if test -f "${ZLIB_HOME}/include/zlib.h"; then break; fi
101 ZLIB_HOME=""
102 done
103
104 ZLIB_OLD_LDFLAGS=$LDFLAGS
105 ZLIB_OLD_CPPFLAGS=$CPPFLAGS
106 if test -n "${ZLIB_HOME}"; then
107 LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
108 CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
109 fi
110 AC_LANG_SAVE
111 AC_LANG_C
112 AC_CHECK_LIB([z], [inflateEnd], [zlib_cv_libz=yes], [zlib_cv_libz=no])
113 AC_CHECK_HEADER([zlib.h], [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
114 AC_LANG_RESTORE
115 if test "$zlib_cv_libz" = "yes" && test "$zlib_cv_zlib_h" = "yes"
116 then
117 #
118 # If both library and header were found, action-if-found
119 #
120 m4_ifblank([$1],[
121 CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
122 LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
123 LIBS="-lz $LIBS"
124 AC_DEFINE([HAVE_LIBZ], [1],
125 [Define to 1 if you have `z' library (-lz)])
126 ],[
127 # Restore variables
128 LDFLAGS="$ZLIB_OLD_LDFLAGS"
129 CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
130 $1
131 ])
132 else
133 #
134 # If either header or library was not found, action-if-not-found
135 #
136 m4_default([$2],[
137 AC_MSG_ERROR([either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib])
138 ])
139 fi
140 fi
141 ])
22
33 bin_PROGRAMS = snp-sites
44 snp_sites_SOURCES = main.c
5
6
7 snp_sites_LDADD =-lm libsnp-sites.la -lz -lpthread
8 if HOST_LINUX
9 snp_sites_LDADD += -lrt
10 endif
5 snp_sites_LDADD = libsnp-sites.la -lpthread
116
127 # libsnp_sites.so is our library
138 lib_LTLIBRARIES = libsnp-sites.la
2217 ../tests/check-vcf.c \
2318 ../tests/helper-methods.c \
2419 ../tests/run-all-tests.c
25 run_all_tests_CFLAGS = -I../tests
26
27 run_all_tests_LDADD = -lm -lcheck libsnp-sites.la -lz -lpthread
28 if HOST_LINUX
29 run_all_tests_LDADD += -lrt
30 endif
20 run_all_tests_CFLAGS = $(CHECK_CFLAGS) $(CFLAGS)
21 run_all_tests_LDADD = libsnp-sites.la -lpthread $(CHECK_LIBS)
2323 #include <ctype.h>
2424 #include <unistd.h>
2525 #include "snp-sites.h"
26 #include "config.h"
2627
2728 #define PROGRAM_NAME "snp-sites"
28 #define PROGRAM_VERSION "2.1.0"
29 #define PROGRAM_VERSION PACKAGE_VERSION
2930
3031 static void print_usage()
3132 {