bluez_utils-move-libcheck-under-TEST-conditional.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. From bf5d45f2fbd1b1463512f4eb8d30bffb3478ccc7 Mon Sep 17 00:00:00 2001
  2. From: Marcel Holtmann <marcel@holtmann.org>
  3. Date: Tue, 27 Dec 2011 20:09:56 -0800
  4. Subject: [PATCH] build: Move libcheck under TEST conditional
  5. ---
  6. Makefile.am | 5 ++++-
  7. acinclude.m4 | 8 +++++++-
  8. configure.ac | 3 +--
  9. 3 files changed, 12 insertions(+), 4 deletions(-)
  10. diff --git a/Makefile.am b/Makefile.am
  11. index 9112483..5cf287c 100644
  12. --- a/Makefile.am
  13. +++ b/Makefile.am
  14. @@ -449,6 +449,7 @@ endif
  15. unit_objects =
  16. +if TEST
  17. unit_tests = unit/test-eir
  18. noinst_PROGRAMS += $(unit_tests)
  19. @@ -456,8 +457,10 @@ noinst_PROGRAMS += $(unit_tests)
  20. unit_test_eir_SOURCES = unit/test-eir.c src/eir.c src/glib-helper.c
  21. unit_test_eir_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@ @CHECK_LIBS@
  22. unit_test_eir_CFLAGS = $(AM_CFLAGS) @CHECK_CFLAGS@
  23. -unit_test_eir_SHORTNAME = unit
  24. unit_objects += $(unit_test_eir_OBJECTS)
  25. +else
  26. +unit_tests =
  27. +endif
  28. TESTS = $(unit_tests)
  29. diff --git a/acinclude.m4 b/acinclude.m4
  30. index 2097d77..753b994 100644
  31. --- a/acinclude.m4
  32. +++ b/acinclude.m4
  33. @@ -170,6 +170,12 @@ AC_DEFUN([AC_PATH_READLINE], [
  34. [])
  35. ])
  36. +AC_DEFUN([AC_PATH_CHECK], [
  37. + PKG_CHECK_MODULES(CHECK, check >= 0.9.4, check_found=yes, check_found=no)
  38. + AC_SUBST(CHECK_CFLAGS)
  39. + AC_SUBST(CHECK_LIBS)
  40. +])
  41. +
  42. AC_DEFUN([AC_PATH_OUI], [
  43. AC_ARG_WITH(ouifile,
  44. AS_HELP_STRING([--with-ouifile=PATH],[Path to the oui.txt file @<:@auto@:>@]),
  45. @@ -422,7 +428,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
  46. AM_CONDITIONAL(PAND, test "${pand_enable}" = "yes")
  47. AM_CONDITIONAL(DUND, test "${dund_enable}" = "yes")
  48. AM_CONDITIONAL(CUPS, test "${cups_enable}" = "yes")
  49. - AM_CONDITIONAL(TEST, test "${test_enable}" = "yes")
  50. + AM_CONDITIONAL(TEST, test "${test_enable}" = "yes" && test "${check_found}" = "yes")
  51. AM_CONDITIONAL(TOOLS, test "${tools_enable}" = "yes")
  52. AM_CONDITIONAL(BCCMD, test "${bccmd_enable}" = "yes")
  53. AM_CONDITIONAL(PCMCIA, test "${pcmcia_enable}" = "yes")
  54. diff --git a/configure.ac b/configure.ac
  55. index 3a5dfde..a7670da 100644
  56. --- a/configure.ac
  57. +++ b/configure.ac
  58. @@ -24,8 +24,6 @@ AC_PROG_YACC
  59. AM_PROG_LEX
  60. AM_PROG_MKDIR_P
  61. -PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
  62. -
  63. m4_define([_LT_AC_TAGCONFIG], [])
  64. m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
  65. @@ -50,6 +48,7 @@ AC_PATH_UDEV
  66. AC_PATH_SNDFILE
  67. AC_PATH_OUI
  68. AC_PATH_READLINE
  69. +AC_PATH_CHECK
  70. AC_ARG_BLUEZ
  71. --
  72. 1.7.6.5