~ubuntu-branches/ubuntu/saucy/clamav/saucy-backports

« back to all changes in this revision

Viewing changes to m4/reorganization/code_checks/unit_tests.m4

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2014-07-15 01:08:10 UTC
  • mfrom: (0.35.47 sid)
  • Revision ID: package-import@ubuntu.com-20140715010810-ru66ek4fun2iseba
Tags: 0.98.4+dfsg-2~ubuntu13.10.1
No-change backport to saucy (LP: #1341962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
enable_check_ut=auto
 
2
enable_ut_install=no
 
3
AC_ARG_ENABLE(check,
 
4
[  --enable-check           Enable 'check' unit tests (default=auto)], enable_check_ut=$enableval, enable_check_ut="auto" )
 
5
 
 
6
if test "$enable_check_ut" != "no" ; then
 
7
case "$host_os" in
 
8
    *linux*)
 
9
        save_LDFLAGS="$LDFLAGS"
 
10
        LDFLAGS="$LDFLAGS -pthread -Wl,--no-as-needed -lm -Wl,--as-needed -lrt"
 
11
        ;;
 
12
esac
 
13
 
 
14
        AC_LIB_FIND([check],[check.h],
 
15
                        AC_LANG_PROGRAM([#include <check.h>],[srunner_create(0)]),
 
16
                        [CHECK_CPPFLAGS="$INCCHECK"; CHECK_LIBS="$LTLIBCHECK $LDFLAGS"],
 
17
                        [])
 
18
 
 
19
case "$host_os" in
 
20
    *linux*)
 
21
        LDFLAGS="$save_LDFLAGS"
 
22
        ;;
 
23
esac
 
24
 
 
25
fi
 
26
AC_SUBST([CHECK_CPPFLAGS])
 
27
AC_SUBST([CHECK_LIBS])
 
28
AM_CONDITIONAL([HAVE_LIBCHECK],test "X$HAVE_LIBCHECK" = "Xyes")
 
29
 
 
30
if test "x$CHECK_LIBS" = "x" -a "$enable_check_ut" = "yes"; then
 
31
    AC_MSG_ERROR([
 
32
 
 
33
ERROR!  Check was configured, but not found.  Get it from http://check.sf.net/
 
34
])
 
35
fi