From feec7dd735a92d1d390cc0669f879e2b6d36389e Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Wed, 30 Jul 2008 20:05:21 -0700 Subject: libv4l: silence the creation of pkg-config files Signed-off-by: Brandon Philips --- v4l2-apps/lib/libv4l/libv4l2/Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'v4l2-apps/lib/libv4l/libv4l2/Makefile') diff --git a/v4l2-apps/lib/libv4l/libv4l2/Makefile b/v4l2-apps/lib/libv4l/libv4l2/Makefile index 0e63eae71..8e5ba1f82 100644 --- a/v4l2-apps/lib/libv4l/libv4l2/Makefile +++ b/v4l2-apps/lib/libv4l/libv4l2/Makefile @@ -34,14 +34,14 @@ $(V4L2_LIB): $(V4L2_OBJS) $(V4L2CONVERT): $(V4L2CONVERT_O) $(V4L2_LIB) libv4l2.pc: - echo prefix=$(PREFIX) > libv4l2.pc - echo libdir=$(LIBDIR) >> libv4l2.pc - echo >> libv4l2.pc - echo 'Name: libv4l2' >> libv4l2.pc - echo 'Description: v4l2 device access library' >> libv4l2.pc - echo 'Version: '$(V4L2_LIB_VERSION) >> libv4l2.pc - echo 'Libs: -L$${libdir} -lv4l2' >> libv4l2.pc - echo 'Cflags: -I$${prefix}/include' >> libv4l2.pc + @echo prefix=$(PREFIX) > libv4l2.pc + @echo libdir=$(LIBDIR) >> libv4l2.pc + @echo >> libv4l2.pc + @echo 'Name: libv4l2' >> libv4l2.pc + @echo 'Description: v4l2 device access library' >> libv4l2.pc + @echo 'Version: '$(V4L2_LIB_VERSION) >> libv4l2.pc + @echo 'Libs: -L$${libdir} -lv4l2' >> libv4l2.pc + @echo 'Cflags: -I$${prefix}/include' >> libv4l2.pc install: all mkdir -p $(DESTDIR)$(PREFIX)/include -- cgit v1.2.3 From 1d60339ee5ca9a861de510dc4c57576ec9f2e5be Mon Sep 17 00:00:00 2001 From: "hans@localhost.localdomain" Date: Sun, 3 Aug 2008 13:15:46 +0200 Subject: libv4l: makefile and pkgconfig improvements From: Gregor Jasny Various Makefile and pkgconfig file improvements by Gregor Jasny (Debian) Signed-off-by: Gregor Jasny Signed-off-by: Hans de Goede --- v4l2-apps/lib/libv4l/libv4l2/Makefile | 36 ++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'v4l2-apps/lib/libv4l/libv4l2/Makefile') diff --git a/v4l2-apps/lib/libv4l/libv4l2/Makefile b/v4l2-apps/lib/libv4l/libv4l2/Makefile index 8e5ba1f82..38449b44d 100644 --- a/v4l2-apps/lib/libv4l/libv4l2/Makefile +++ b/v4l2-apps/lib/libv4l/libv4l2/Makefile @@ -1,20 +1,23 @@ -CC = gcc -LD = gcc - -CPPFLAGS = -fPIC -I../include -I../../../../linux/include +CPPFLAGS = -I../include -I../../../../linux/include CFLAGS := -g -O1 CFLAGS += -Wall -W -Wno-unused -Wpointer-arith -Wstrict-prototypes -LDFLAGS = -shared - -V4L2_OBJS = libv4l2.o log.o ../libv4lconvert/libv4lconvert.so -V4L2_LIB = libv4l2.so +V4L2_OBJS = libv4l2.o log.o V4L2CONVERT = v4l2convert.so V4L2CONVERT_O = v4l2convert.o libv4l2.so -TARGETS = $(V4L2_LIB) $(V4L2CONVERT) libv4l2.pc +TARGETS = $(V4L2_LIB) libv4l2.pc INCLUDES = ../include/libv4l2.h +ifeq ($(LINKTYPE),static) +V4L2_LIB = libv4l2.a +else +V4L2_LIB = libv4l2.so +V4L2_OBJS += ../libv4lconvert/libv4lconvert.so +TARGETS += $(V4L2CONVERT) +CPPFLAGS += -fPIC +endif + ifeq ($(LIB_RELEASE),) LIB_RELEASE = 0 endif @@ -40,27 +43,38 @@ libv4l2.pc: @echo 'Name: libv4l2' >> libv4l2.pc @echo 'Description: v4l2 device access library' >> libv4l2.pc @echo 'Version: '$(V4L2_LIB_VERSION) >> libv4l2.pc + @echo 'Requires: libv4lconvert' >> libv4l2.pc @echo 'Libs: -L$${libdir} -lv4l2' >> libv4l2.pc + @echo 'Libs.private: -lpthread' >> libv4l2.pc @echo 'Cflags: -I$${prefix}/include' >> libv4l2.pc install: all mkdir -p $(DESTDIR)$(PREFIX)/include install -p -m 644 $(INCLUDES) $(DESTDIR)$(PREFIX)/include +ifeq ($(LINKTYPE),static) + mkdir -p $(DESTDIR)$(LIBDIR) + install -m 644 $(V4L2_LIB) $(DESTDIR)$(LIBDIR) +else mkdir -p $(DESTDIR)$(LIBDIR)/libv4l install -m 755 $(V4L2_LIB).$(LIB_RELEASE) $(DESTDIR)$(LIBDIR) cd $(DESTDIR)$(LIBDIR) && \ ln -f -s $(V4L2_LIB).$(LIB_RELEASE) $(V4L2_LIB) install -m 755 $(V4L2CONVERT).$(LIB_RELEASE) \ $(DESTDIR)$(LIBDIR)/libv4l/$(V4L2CONVERT) +endif mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig install -m 644 libv4l2.pc $(DESTDIR)$(LIBDIR)/pkgconfig clean:: - rm -f *.so* *.o *.d libv4l2.pc log *~ + rm -f *.a *.so* *.o *.d libv4l2.pc log *~ %.o: %.c $(CC) -c -MMD $(CPPFLAGS) $(CFLAGS) -o $@ $< %.so: - $(CC) $(LDFLAGS) -Wl,-soname,$@.$(LIB_RELEASE) -o $@.$(LIB_RELEASE) $^ + $(CC) -shared $(LDFLAGS) -Wl,-soname,$@.$(LIB_RELEASE) -o $@.$(LIB_RELEASE) $^ ln -f -s $@.$(LIB_RELEASE) $@ + +%.a: + $(AR) cqs $@ $^ + -- cgit v1.2.3 From 3dbcf4e987933e8e41ff496e76223f457a7609e5 Mon Sep 17 00:00:00 2001 From: "hans@localhost.localdomain" Date: Sun, 3 Aug 2008 13:21:19 +0200 Subject: libv4l: link against pthread From: Hans de Goede libv4l: link against pthread Signed-off-by: Hans de Goede --- v4l2-apps/lib/libv4l/libv4l2/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'v4l2-apps/lib/libv4l/libv4l2/Makefile') diff --git a/v4l2-apps/lib/libv4l/libv4l2/Makefile b/v4l2-apps/lib/libv4l/libv4l2/Makefile index 38449b44d..d8ac01c34 100644 --- a/v4l2-apps/lib/libv4l/libv4l2/Makefile +++ b/v4l2-apps/lib/libv4l/libv4l2/Makefile @@ -3,6 +3,8 @@ CPPFLAGS = -I../include -I../../../../linux/include CFLAGS := -g -O1 CFLAGS += -Wall -W -Wno-unused -Wpointer-arith -Wstrict-prototypes +LIBS = -lpthread + V4L2_OBJS = libv4l2.o log.o V4L2CONVERT = v4l2convert.so V4L2CONVERT_O = v4l2convert.o libv4l2.so @@ -72,7 +74,7 @@ clean:: $(CC) -c -MMD $(CPPFLAGS) $(CFLAGS) -o $@ $< %.so: - $(CC) -shared $(LDFLAGS) -Wl,-soname,$@.$(LIB_RELEASE) -o $@.$(LIB_RELEASE) $^ + $(CC) -shared $(LDFLAGS) -Wl,-soname,$@.$(LIB_RELEASE) -o $@.$(LIB_RELEASE) $^ $(LIBS) ln -f -s $@.$(LIB_RELEASE) $@ %.a: -- cgit v1.2.3