Skip to contentSkip to conversation

Fix linking of shared libraries

PATCH In review Andreas Bombe 2 participants 2 messages Feb 19, 2013 – Mar 25, 2013 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix linking of shared libraries

When using libudev, it is actually libmediactl that uses it and not the media-ctl executable. libv4l2subdev uses functions from libmediactl and therefore needs to be linked against it.

---

In light of their relative simplicity as well as cross dependency, does it make sense to keep libmediactl and libv4l2subdev as separate libraries?

 src/Makefile.am |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/Makefile.am +3 -3
index 2583464..f754763 100644
@@ -1,12 +1,12 @@
 lib_LTLIBRARIES = libmediactl.la libv4l2subdev.la
 libmediactl_la_SOURCES = mediactl.c
+libmediactl_la_CFLAGS = $(LIBUDEV_CFLAGS)
+libmediactl_la_LDFLAGS = $(LIBUDEV_LIBS)
 libv4l2subdev_la_SOURCES = v4l2subdev.c
+libv4l2subdev_la_LIBADD = libmediactl.la
 mediactl_includedir=$(includedir)/mediactl
 mediactl_include_HEADERS = mediactl.h v4l2subdev.h
 
 bin_PROGRAMS = media-ctl
-media_ctl_CFLAGS = $(LIBUDEV_CFLAGS)
-media_ctl_LDFLAGS = $(LIBUDEV_LIBS)
 media_ctl_SOURCES = main.c options.c options.h tools.h
 media_ctl_LDADD = libmediactl.la libv4l2subdev.la
-
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw

Hi Andreas,

Thanks for the patch, and sorry for the late reply.

Quoted 5 lines · On Tuesday 19 February 2013 22:03:53 Andreas Bombe wrote:

When using libudev, it is actually libmediactl that uses it and not the media-ctl executable. libv4l2subdev uses functions from libmediactl and therefore needs to be linked against it.

and pushed to the repository.

Quoted 5 lines

---

In light of their relative simplicity as well as cross dependency, does it make sense to keep libmediactl and libv4l2subdev as separate libraries?

I think it does, as libmediactl is supposed to be media-agnostic. I'm working on a media device enumeration library that will likely result in all those libraries being rearchitectured, I'll keep the question in mind.

Quoted 23 lines
 src/Makefile.am |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/Makefile.am +3 -3
index 2583464..f754763 100644
@@ -1,12 +1,12 @@
 lib_LTLIBRARIES = libmediactl.la libv4l2subdev.la
 libmediactl_la_SOURCES = mediactl.c
+libmediactl_la_CFLAGS = $(LIBUDEV_CFLAGS)
+libmediactl_la_LDFLAGS = $(LIBUDEV_LIBS)
 libv4l2subdev_la_SOURCES = v4l2subdev.c
+libv4l2subdev_la_LIBADD = libmediactl.la
 mediactl_includedir=$(includedir)/mediactl
 mediactl_include_HEADERS = mediactl.h v4l2subdev.h
 
 bin_PROGRAMS = media-ctl
-media_ctl_CFLAGS = $(LIBUDEV_CFLAGS)
-media_ctl_LDFLAGS = $(LIBUDEV_LIBS)
 media_ctl_SOURCES = main.c options.c options.h tools.h
 media_ctl_LDADD = libmediactl.la libv4l2subdev.la
-
Signature · 3 lines
Regards,

Laurent Pinchart