0007-configure.ac-add-disable-libv4l-option.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. From 702722a43ee6472993fabdd810272d3599064866 Mon Sep 17 00:00:00 2001
  2. From: Hugues Fruchet <hugues.fruchet@st.com>
  3. Date: Wed, 17 May 2017 10:03:11 +0200
  4. Subject: [PATCH] configure.ac: add --disable-libv4l option
  5. Add an option to disable libv4l libraries and plugins compilation.
  6. If system is not supporting dynamic shared libraries, this option
  7. is automatically set.
  8. dlopen() is no more a mandatory dependency (warning is kept).
  9. lib/ and contrib/ folders are no more built with this option set
  10. because of libv4l dependency.
  11. utils/ folder is still built with this options set but without
  12. rds-ctl because of its libv4l dependency.
  13. v4l2-compliance and v4l2-ctl are also built but without any links
  14. on libv4l and libv4lconvert libraries.
  15. Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
  16. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
  17. ---
  18. Makefile.am | 11 +++++++++--
  19. configure.ac | 12 +++++++++++-
  20. utils/Makefile.am | 6 +++++-
  21. utils/v4l2-compliance/Makefile.am | 4 ++++
  22. utils/v4l2-ctl/Makefile.am | 4 ++++
  23. 5 files changed, 33 insertions(+), 4 deletions(-)
  24. diff --git a/Makefile.am b/Makefile.am
  25. index e603472..07c3ef8 100644
  26. --- a/Makefile.am
  27. +++ b/Makefile.am
  28. @@ -1,10 +1,17 @@
  29. AUTOMAKE_OPTIONS = foreign
  30. ACLOCAL_AMFLAGS = -I m4
  31. -SUBDIRS = v4l-utils-po libdvbv5-po lib
  32. +SUBDIRS = v4l-utils-po libdvbv5-po
  33. +
  34. +if WITH_LIBV4L
  35. +SUBDIRS += lib
  36. +endif
  37. if WITH_V4LUTILS
  38. -SUBDIRS += utils contrib
  39. +SUBDIRS += utils
  40. +if WITH_LIBV4L
  41. +SUBDIRS += contrib
  42. +endif
  43. endif
  44. EXTRA_DIST = android-config.h bootstrap.sh doxygen_libdvbv5.cfg include COPYING.libv4l \
  45. diff --git a/configure.ac b/configure.ac
  46. index 8e536cc..b9fc59a 100644
  47. --- a/configure.ac
  48. +++ b/configure.ac
  49. @@ -285,7 +285,7 @@ dl_saved_libs=$LIBS
  50. AC_SEARCH_LIBS([dlopen],
  51. [dl],
  52. [test "$ac_cv_search_dlopen" = "none required" || DLOPEN_LIBS=$ac_cv_search_dlopen],
  53. - [AC_MSG_ERROR([unable to find the dlopen() function])])
  54. + [AC_MSG_WARN([unable to find the dlopen() function])])
  55. AC_SUBST([DLOPEN_LIBS])
  56. LIBS=$dl_saved_libs
  57. @@ -371,6 +371,14 @@ AC_ARG_ENABLE(libdvbv5,
  58. esac]
  59. )
  60. +AC_ARG_ENABLE(libv4l,
  61. + AS_HELP_STRING([--disable-libv4l], [disable libv4l compilation]),
  62. + [case "${enableval}" in
  63. + yes | no ) ;;
  64. + *) AC_MSG_ERROR(bad value ${enableval} for --disable-libv4l) ;;
  65. + esac]
  66. +)
  67. +
  68. AC_ARG_ENABLE(dyn-libv4l,
  69. AS_HELP_STRING([--disable-dyn-libv4l], [disable dynamic libv4l support]),
  70. [case "${enableval}" in
  71. @@ -428,6 +436,7 @@ AM_CONDITIONAL([WITH_LIBDVBV5], [test x$enable_libdvbv5 != xno -a x$have_li
  72. AM_CONDITIONAL([WITH_DVBV5_REMOTE], [test x$enable_libdvbv5 != xno -a x$have_libudev = xyes -a x$have_pthread = xyes])
  73. AM_CONDITIONAL([WITH_DYN_LIBV4L], [test x$enable_dyn_libv4l != xno])
  74. +AM_CONDITIONAL([WITH_LIBV4L], [test x$enable_libv4l != xno -a x$enable_shared != xno])
  75. AM_CONDITIONAL([WITH_V4LUTILS], [test x$enable_v4l_utils != xno -a x$linux_os = xyes])
  76. AM_CONDITIONAL([WITH_QV4L2], [test x${qt_pkgconfig} = xtrue -a x$enable_qv4l2 != xno])
  77. AM_CONDITIONAL([WITH_V4L_PLUGINS], [test x$enable_dyn_libv4l != xno -a x$enable_shared != xno])
  78. @@ -455,6 +464,7 @@ AM_COND_IF([WITH_LIBDVBV5], [USE_LIBDVBV5="yes"], [USE_LIBDVBV5="no"])
  79. AM_COND_IF([WITH_DVBV5_REMOTE], [USE_DVBV5_REMOTE="yes"
  80. AC_DEFINE([HAVE_DVBV5_REMOTE], [1], [Usage of DVBv5 remote enabled])],
  81. [USE_DVBV5_REMOTE="no"])
  82. +AM_COND_IF([WITH_LIBV4L], [USE_LIBV4L="yes"], [USE_LIBV4L="no"])
  83. AM_COND_IF([WITH_DYN_LIBV4L], [USE_DYN_LIBV4L="yes"], [USE_DYN_LIBV4L="no"])
  84. AM_COND_IF([WITH_V4LUTILS], [USE_V4LUTILS="yes"], [USE_V4LUTILS="no"])
  85. AM_COND_IF([WITH_QV4L2], [USE_QV4L2="yes"], [USE_QV4L2="no"])
  86. diff --git a/utils/Makefile.am b/utils/Makefile.am
  87. index d7708cc..ce710c2 100644
  88. --- a/utils/Makefile.am
  89. +++ b/utils/Makefile.am
  90. @@ -13,8 +13,12 @@ SUBDIRS = \
  91. v4l2-sysfs-path \
  92. cec-ctl \
  93. cec-compliance \
  94. - cec-follower \
  95. + cec-follower
  96. +
  97. +if WITH_LIBV4L
  98. +SUBDIRS += \
  99. rds-ctl
  100. +endif
  101. if WITH_LIBDVBV5
  102. SUBDIRS += \
  103. diff --git a/utils/v4l2-compliance/Makefile.am b/utils/v4l2-compliance/Makefile.am
  104. index c2b5919..0240a50 100644
  105. --- a/utils/v4l2-compliance/Makefile.am
  106. +++ b/utils/v4l2-compliance/Makefile.am
  107. @@ -7,12 +7,16 @@ v4l2_compliance_SOURCES = v4l2-compliance.cpp v4l2-test-debug.cpp v4l2-test-inpu
  108. v4l2-test-codecs.cpp v4l2-test-colors.cpp v4l2-compliance.h
  109. v4l2_compliance_CPPFLAGS = -I../common
  110. +if WITH_LIBV4L
  111. if WITH_V4L2_COMPLIANCE_LIBV4L
  112. v4l2_compliance_LDADD = ../../lib/libv4l2/libv4l2.la ../../lib/libv4lconvert/libv4lconvert.la -lrt -lpthread
  113. else
  114. v4l2_compliance_LDADD = -lrt -lpthread
  115. DEFS += -DNO_LIBV4L2
  116. endif
  117. +else
  118. +DEFS += -DNO_LIBV4L2
  119. +endif
  120. EXTRA_DIST = Android.mk fixme.txt v4l2-compliance.1
  121. diff --git a/utils/v4l2-ctl/Makefile.am b/utils/v4l2-ctl/Makefile.am
  122. index 955647d..4475aed 100644
  123. --- a/utils/v4l2-ctl/Makefile.am
  124. +++ b/utils/v4l2-ctl/Makefile.am
  125. @@ -9,10 +9,14 @@ v4l2_ctl_SOURCES = v4l2-ctl.cpp v4l2-ctl.h v4l2-ctl-common.cpp v4l2-ctl-tuner.cp
  126. v4l2-tpg-colors.c v4l2-tpg-core.c v4l-stream.c
  127. v4l2_ctl_CPPFLAGS = -I../common
  128. +if WITH_LIBV4L
  129. if WITH_V4L2_CTL_LIBV4L
  130. v4l2_ctl_LDADD = ../../lib/libv4l2/libv4l2.la ../../lib/libv4lconvert/libv4lconvert.la -lrt -lpthread
  131. else
  132. DEFS += -DNO_LIBV4L2
  133. endif
  134. +else
  135. +DEFS += -DNO_LIBV4L2
  136. +endif
  137. EXTRA_DIST = Android.mk v4l2-ctl.1
  138. --
  139. 1.9.1