summaryrefslogtreecommitdiff
path: root/v4l2-apps
diff options
context:
space:
mode:
authorhans@localhost.localdomain <hans@localhost.localdomain>2008-08-03 13:15:46 +0200
committerhans@localhost.localdomain <hans@localhost.localdomain>2008-08-03 13:15:46 +0200
commit1d60339ee5ca9a861de510dc4c57576ec9f2e5be (patch)
treef0463f183cb09305ae02f348165afd4bd346a209 /v4l2-apps
parentd0280d4d77c5f7dd211cc827284347828e260ab9 (diff)
downloadmediapointer-dvb-s2-1d60339ee5ca9a861de510dc4c57576ec9f2e5be.tar.gz
mediapointer-dvb-s2-1d60339ee5ca9a861de510dc4c57576ec9f2e5be.tar.bz2
libv4l: makefile and pkgconfig improvements
From: Gregor Jasny <jasny@vidsoft.de> Various Makefile and pkgconfig file improvements by Gregor Jasny (Debian) Signed-off-by: Gregor Jasny <jasny@vidsoft.de> Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Diffstat (limited to 'v4l2-apps')
-rw-r--r--v4l2-apps/lib/libv4l/ChangeLog4
-rw-r--r--v4l2-apps/lib/libv4l/libv4l1/Makefile36
-rw-r--r--v4l2-apps/lib/libv4l/libv4l2/Makefile36
-rw-r--r--v4l2-apps/lib/libv4l/libv4lconvert/Makefile25
4 files changed, 70 insertions, 31 deletions
diff --git a/v4l2-apps/lib/libv4l/ChangeLog b/v4l2-apps/lib/libv4l/ChangeLog
index efa501f56..45c9cca63 100644
--- a/v4l2-apps/lib/libv4l/ChangeLog
+++ b/v4l2-apps/lib/libv4l/ChangeLog
@@ -3,8 +3,10 @@ libv4l-0.4.0
* Be more relaxed in our checks for mixing read and mmap access, we were
being more strict in this then certain kernel drivers (bttv) making xawtv
unhappy
-* Add support for conversion to RGB24 (before we only support BGR24) based
+* Add support for conversion to RGB24 (before we only supported BGR24) based
on a patch by Jean-Francois Moine
+* Various Makefile and pkgconfig file improvements by Gregor Jasny (Debian)
+
libv4l-0.3.9
------------
diff --git a/v4l2-apps/lib/libv4l/libv4l1/Makefile b/v4l2-apps/lib/libv4l/libv4l1/Makefile
index 1f82fef10..bedd4391f 100644
--- a/v4l2-apps/lib/libv4l/libv4l1/Makefile
+++ b/v4l2-apps/lib/libv4l/libv4l1/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
-
-V4L1_OBJS = libv4l1.o log.o ../libv4l2/libv4l2.so
-V4L1_LIB = libv4l1.so
+V4L1_OBJS = libv4l1.o log.o
V4L1COMPAT = v4l1compat.so
V4L1COMPAT_O = v4l1compat.o libv4l1.so
-TARGETS = $(V4L1_LIB) $(V4L1COMPAT) libv4l1.pc
+TARGETS = $(V4L1_LIB) libv4l1.pc
INCLUDES = ../include/libv4l1.h
+ifeq ($(LINKTYPE),static)
+V4L1_LIB = libv4l1.a
+else
+V4L1_LIB = libv4l1.so
+V4L1_OBJS += ../libv4l2/libv4l2.so
+TARGETS += $(V4L1COMPAT)
+CPPFLAGS += -fPIC
+endif
+
ifeq ($(LIB_RELEASE),)
LIB_RELEASE = 0
endif
@@ -41,27 +44,38 @@ libv4l1.pc:
@echo 'Name: libv4l1' >> libv4l1.pc
@echo 'Description: v4l1 compatibility library' >> libv4l1.pc
@echo 'Version: '$(V4L2_LIB_VERSION) >> libv4l1.pc
+ @echo 'Requires: libv4l2' >> libv4l1.pc
@echo 'Libs: -L$${libdir} -lv4l1' >> libv4l1.pc
+ @echo 'Libs.private: -lpthread' >> libv4l1.pc
@echo 'Cflags: -I$${prefix}/include' >> libv4l1.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 $(V4L1_LIB) $(DESTDIR)$(LIBDIR)
+else
mkdir -p $(DESTDIR)$(LIBDIR)/libv4l
install -m 755 $(V4L1_LIB).$(LIB_RELEASE) $(DESTDIR)$(LIBDIR)
cd $(DESTDIR)$(LIBDIR) && \
ln -f -s $(V4L1_LIB).$(LIB_RELEASE) $(V4L1_LIB)
install -m 755 $(V4L1COMPAT).$(LIB_RELEASE) \
$(DESTDIR)$(LIBDIR)/libv4l/$(V4L1COMPAT)
+endif
mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
install -m 644 libv4l1.pc $(DESTDIR)$(LIBDIR)/pkgconfig
clean::
- rm -f *.so* *.o *.d libv4l1.pc log *~
+ rm -f *.a *.so* *.o *.d libv4l1.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 $@ $^
+
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 $@ $^
+
diff --git a/v4l2-apps/lib/libv4l/libv4lconvert/Makefile b/v4l2-apps/lib/libv4l/libv4lconvert/Makefile
index 014692ed6..c2a5be942 100644
--- a/v4l2-apps/lib/libv4l/libv4lconvert/Makefile
+++ b/v4l2-apps/lib/libv4l/libv4lconvert/Makefile
@@ -1,14 +1,15 @@
-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
-
+ifeq ($(LINKTYPE),static)
+CONVERT_LIB = libv4lconvert.a
+else
CONVERT_LIB = libv4lconvert.so
+CPPFLAGS += -fPIC
+endif
+
CONVERT_OBJS = libv4lconvert.o tinyjpeg.o sn9c10x.o pac207.o \
jidctflt.o spca561-decompress.o rgbyuv.o spca501.o bayer.o
TARGETS = $(CONVERT_LIB) libv4lconvert.pc
@@ -44,18 +45,26 @@ install: all
mkdir -p $(DESTDIR)$(PREFIX)/include
install -p -m 644 $(INCLUDES) $(DESTDIR)$(PREFIX)/include
mkdir -p $(DESTDIR)$(LIBDIR)
+ifeq ($(LINKTYPE),static)
+ mkdir -p $(DESTDIR)$(LIBDIR)
+ install -m 644 $(CONVERT_LIB) $(DESTDIR)$(LIBDIR)
+else
install -m 755 $(CONVERT_LIB).$(LIB_RELEASE) $(DESTDIR)$(LIBDIR)
cd $(DESTDIR)$(LIBDIR) && \
ln -f -s $(CONVERT_LIB).$(LIB_RELEASE) $(CONVERT_LIB)
+endif
mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
install -m 644 libv4lconvert.pc $(DESTDIR)$(LIBDIR)/pkgconfig
clean::
- rm -f *.so* *.o *.d libv4lconvert.pc log *~
+ rm -f *.a *.so* *.o *.d libv4lconvert.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 $@ $^