Subject: Review for transcode patches
To: None <tech-pkg@netbsd.org>
From: Bernd Ernesti <netbsd@lists.veego.de>
List: tech-pkg
Date: 11/16/2003 23:05:52
--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

I had some problems in the past to use all modules of transcode and finally
found a way to fix the build problems for some of them.

Please take a look at the attched patches and test them. I made them build,
but didn't had the time to find a test case and the package freeze is still
active.

TODO: 
- export_yuv4mpeg and export_mpeg2enc are not build as shared moduldes because
we don't have a shared libmjpegutils from the mjpegtools package.
It should be easy to fix the mjpegtools package is you look at the patch-at and
patch-au patches from this mail and make the approviated patches for it, but I
don't have neither the time nor to test it now.

- filter_test also needs to build as a shared module, but I have no ideas what
  it is used 

This fixed all warnings except for the three modules above, where you see this in your
build log:

*** Warning: This library needs some functionality provided by -lxxxxx.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: libtool could not satisfy all declared inter-library
*** dependencies of module yyyyyyyyyyy.  Therefore, libtool will create
*** a static module, that should work as long as the dlopening
*** application is linked with the -dlopen flag.

patch-au adds a strip_fPIC.sh which comes from the devel/SDL package.

Bernd


--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-at

$NetBSD$

--- bbmpeg/Makefile.am.orig	2003-08-04 22:21:42.000000000 +0200
+++ bbmpeg/Makefile.am	2003-11-16 20:19:10.000000000 +0100
@@ -3,7 +3,7 @@
 AUTOMAKE_OPTIONS = 1.3 foreign
 DEFAULT_INCLUDES = -I$(top_srcdir) -I$(srcdir) -I$(top_builddir) -I. 
 
-noinst_LIBRARIES = libbbmpeg.a
+noinst_LTLIBRARIES = libbbmpeg.la
 
 if HAVE_ASM_NASM
 BB_SRC2 = fdct_mmx.s idct_mmx.s quant_mmx.s motion_mmx.s variance_mmx.s
@@ -20,7 +20,7 @@
 
 CFLAGS = -funroll-loops -ffast-math @CFLAGS@ $(MMX)
 
-libbbmpeg_a_SOURCES = dovideo.c params.c bits.c puthdr.c putpic.c putmpg.c putvlc.c stats.c quantize.c predict.c ratectl.c idct.c motion.c transfrm.c fdctref.c resize.c $(BB_SRC1) $(BB_SRC2) $(BB_SRC3)
+libbbmpeg_la_SOURCES = dovideo.c params.c bits.c puthdr.c putpic.c putmpg.c putvlc.c stats.c quantize.c predict.c ratectl.c idct.c motion.c transfrm.c fdctref.c resize.c $(BB_SRC1) $(BB_SRC2) $(BB_SRC3)
 
 noinst_HEADERS = mtable.h mplex.h mmx.h main.h imgresample.h gmo_read.h encaudio.h consts.h consts1.h common.h bbencode.h 
 
@@ -57,10 +57,8 @@
 
 SUBDIRS = . tcmplex
 
-ASM = @NASM@
-ASMFLAGS = @NASMFLAGS@
-
-%.o: %.s ;	$(ASM) -g $(ASMFLAGS) -o $@ $<
-
+STRIP_FPIC = sh $(top_srcdir)/strip_fPIC.sh
 
+.s.lo:
+	$(LIBTOOL) --tag=CC --mode=compile $(STRIP_FPIC) @NASM@ @NASMFLAGS@ $< -o $*.o
 

--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-au

$NetBSD$

--- strip_fPIC.sh.orig	2003-11-16 20:21:01.000000000 +0100
+++ strip_fPIC.sh	2003-11-16 20:20:51.000000000 +0100
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# libtool assumes that the compiler can handle the -fPIC flag
+# This isn't always true (for example, nasm can't handle it)
+command=""
+while [ $# -gt 0 ]; do
+    case "$1" in
+        -?PIC)
+            # Ignore -fPIC and -DPIC options
+            ;;
+        *)
+            command="$command $1"
+            ;;
+    esac
+    shift
+done
+echo $command
+exec $command

--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-av

--- libioaux/Makefile.am.orig	2003-08-04 22:21:44.000000000 +0200
+++ libioaux/Makefile.am	2003-11-16 22:17:41.000000000 +0100
@@ -3,10 +3,10 @@
 AUTOMAKE_OPTIONS = 1.3 foreign
 DEFAULT_INCLUDES = -I$(top_srcdir) -I$(srcdir) -I$(top_builddir) -I.
 
-noinst_LIBRARIES = libtcioaux.a
+noinst_LTLIBRARIES = libtcioaux.la
 
 CFLAGS=-O3 -funroll-loops -ffast-math -DLINUX -Wall @CFLAGS@
-libtcioaux_a_SOURCES = framecode.c configs.c
+libtcioaux_la_SOURCES = framecode.c configs.c
 
 noinst_HEADERS = configs.h framecode.h
 EXTRA_DIST = configs.h framecode.h framecode.l

--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="PLIST.diff"

Index: PLIST
===================================================================
RCS file: /home/source/NetBSD-cvs/main/pkgsrc/graphics/transcode/PLIST,v
retrieving revision 1.8
diff -u -r1.8 PLIST
--- PLIST	22 Sep 2003 10:45:20 -0000	1.8
+++ PLIST	16 Nov 2003 21:38:50 -0000
@@ -32,8 +32,8 @@
 lib/transcode/export_divx5.so
 lib/transcode/export_divx5raw.la
 lib/transcode/export_divx5raw.so
-lib/transcode/export_ffmpeg.a
 lib/transcode/export_ffmpeg.la
+lib/transcode/export_ffmpeg.so
 lib/transcode/export_im.la
 lib/transcode/export_im.so
 lib/transcode/export_jpg.la
@@ -46,8 +46,8 @@
 lib/transcode/export_mjpeg.so
 lib/transcode/export_mp2enc.la
 lib/transcode/export_mp2enc.so
-lib/transcode/export_mpeg.a
 lib/transcode/export_mpeg.la
+lib/transcode/export_mpeg.so
 lib/transcode/export_mpeg2enc.a
 lib/transcode/export_mpeg2enc.la
 lib/transcode/export_net.la
@@ -69,12 +69,12 @@
 lib/transcode/export_wav.la
 lib/transcode/export_wav.so
 lib/transcode/export_xvid.so
-lib/transcode/export_xvid2.a
 lib/transcode/export_xvid2.la
-lib/transcode/export_xvid3.a
+lib/transcode/export_xvid2.so
 lib/transcode/export_xvid3.la
-lib/transcode/export_xvid4.a
+lib/transcode/export_xvid3.so
 lib/transcode/export_xvid4.la
+lib/transcode/export_xvid4.so
 lib/transcode/export_yuv4mpeg.a
 lib/transcode/export_yuv4mpeg.la
 lib/transcode/filter_29to23.la

--pf9I7BMVVzbSWLtt--