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

« back to all changes in this revision

Viewing changes to debian/patches/0003-configure-use-pkg-config-for-check-so-test-is-detect.patch

  • 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
 
From 3bfb03f1f9b8317ff355f0c65cde1e9b3fd5cc43 Mon Sep 17 00:00:00 2001
2
 
From: Scott Kitterman <scott@kitterman.com>
3
 
Date: Mon, 10 Mar 2014 19:46:48 -0400
4
 
Subject: configure: use pkg-config for check so test is detected and tests
5
 
 will run
6
 
 
7
 
---
8
 
 configure.ac           | 19 ++++++-------------
9
 
 unit_tests/Makefile.am |  4 ++--
10
 
 2 files changed, 8 insertions(+), 15 deletions(-)
11
 
 
12
 
diff --git a/configure.ac b/configure.ac
13
 
index c91baeb..41df5d0 100644
14
 
--- a/configure.ac
15
 
+++ b/configure.ac
16
 
@@ -464,22 +464,15 @@ enable_ut_install=no
17
 
 AC_ARG_ENABLE(check,
18
 
 [  --enable-check           Enable 'check' unit tests (default=auto)], enable_check_ut=$enableval, enable_check_ut="auto" )
19
 
 
20
 
-if test "$enable_check_ut" != "no" ; then
21
 
-       AC_LIB_FIND([check],[check.h],
22
 
-                       AC_LANG_PROGRAM([#include <check.h>],[srunner_create(0)]),
23
 
-                       [CHECK_CPPFLAGS="$INCCHECK"; CHECK_LIBS="$LTLIBCHECK"],
24
 
-                       [])
25
 
+if test "$enable_check_ut" = "auto" ; then
26
 
+       PKG_CHECK_EXISTS([check], [enable_check_ut="yes"],
27
 
+                        [enable_check_ut="no"])
28
 
 fi
29
 
-AC_SUBST([CHECK_CPPFLAGS])
30
 
-AC_SUBST([CHECK_LIBS])
31
 
-AM_CONDITIONAL([HAVE_LIBCHECK],test "X$HAVE_LIBCHECK" = "Xyes")
32
 
 
33
 
-if test "x$CHECK_LIBS" = "x" -a "$enable_check_ut" = "yes"; then
34
 
-    AC_MSG_ERROR([
35
 
-
36
 
-ERROR!  Check was configured, but not found.  Get it from http://check.sf.net/
37
 
-])
38
 
+if test "$enable_check_ut" = "yes" ; then
39
 
+       PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
40
 
 fi
41
 
+AM_CONDITIONAL([HAVE_LIBCHECK],test "X$CHECK_LIBS" != "X")
42
 
 
43
 
 AC_ARG_ENABLE(coverage,
44
 
              AC_HELP_STRING([--enable-coverage],
45
 
diff --git a/unit_tests/Makefile.am b/unit_tests/Makefile.am
46
 
index d85d7b6..a4d9d84 100644
47
 
--- a/unit_tests/Makefile.am
48
 
+++ b/unit_tests/Makefile.am
49
 
@@ -33,10 +33,10 @@ check_clamav_SOURCES = check_clamav.c checks.h checks_common.h $(top_builddir)/l
50
 
                       check_jsnorm.c check_str.c check_regex.c\
51
 
                       check_disasm.c check_uniq.c check_matchers.c\
52
 
                       check_htmlnorm.c check_bytecode.c
53
 
-check_clamav_CPPFLAGS = -I$(top_srcdir) @CHECK_CPPFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DOBJDIR=\"$(abs_builddir)\"
54
 
+check_clamav_CPPFLAGS = -I$(top_srcdir) @CHECK_CFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DOBJDIR=\"$(abs_builddir)\"
55
 
 check_clamav_LDADD = $(top_builddir)/libclamav/libclamav.la @THREAD_LIBS@ @CHECK_LIBS@
56
 
 check_clamd_SOURCES = check_clamd.c checks_common.h
57
 
-check_clamd_CPPFLAGS = -I$(top_srcdir) @CHECK_CPPFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DBUILDDIR=\"$(abs_builddir)\"
58
 
+check_clamd_CPPFLAGS = -I$(top_srcdir) @CHECK_CFLAGS@ -DSRCDIR=\"$(abs_srcdir)\" -DBUILDDIR=\"$(abs_builddir)\"
59
 
 check_clamd_LDADD = @CHECK_LIBS@ @CLAMD_LIBS@
60
 
 else
61
 
 check_clamd_SOURCES = check_clamav_skip.c