Discussion:
Mac OS X dynamic libs (-enable-shared)
Iz Mir
2005-02-06 06:52:41 UTC
Permalink
I've managed to get ffmpeg to compile on Mac OS X and make dynamic
libraries (libavcodec.dylib/libavformat.dylib) - it works well. I've
submitted my patches & variant to the darwinport maintainer.

My question is how important is stripping the library? If I strip, some
symbols get stripped out and ffmpeg no longer functions. Is there some
benefit to stripping a dynamic library?

And versioning: ffmpeg is at 0.4.9; libavcodec_build is 4742;
libavformat is 4621. So I make the 2 dynamic libs - what versioning
should they have? libavcodec.0.dylib as per ffmpeg? Not that it matters
much as yet - nothing except my portfile uses ffmpeg dynamic libs.

On a side note, its very odd to see a 92k ffmpeg binary.



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
Roine Gustafsson
2005-02-06 13:15:37 UTC
Permalink
Post by Iz Mir
I've managed to get ffmpeg to compile on Mac OS X and make dynamic
libraries (libavcodec.dylib/libavformat.dylib) - it works well. I've
submitted my patches & variant to the darwinport maintainer.
Nice!
It would be better to submit them upstream here instead of to
darwinports.
Post by Iz Mir
My question is how important is stripping the library? If I strip,
some symbols get stripped out and ffmpeg no longer functions. Is there
some benefit to stripping a dynamic library?
Yes, you'll remove all the symbols that shouldn't be exported,
minimizing namespace clashes.
You cannot strip a dynamic library like you do with an executable.
You need to write an export-file with only the symbols that should be
exported, link with -exported_symbols_list and strip with strip -x.
Post by Iz Mir
And versioning: ffmpeg is at 0.4.9; libavcodec_build is 4742;
libavformat is 4621. So I make the 2 dynamic libs - what versioning
should they have? libavcodec.0.dylib as per ffmpeg? Not that it
matters much as yet - nothing except my portfile uses ffmpeg dynamic
libs.
I think you should name them like the ffmpeg releases i.e.
libavcodec.0.4.9.dylib with links down to libavcodec.dylib.

Note that the version should also be built into the file by the linker
with -dylib_*_version.
Post by Iz Mir
On a side note, its very odd to see a 92k ffmpeg binary.
:)

/Roine



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
Iz Mir
2005-02-06 18:36:18 UTC
Permalink
Post by Roine Gustafsson
I"ve managed to get ffmpeg to compile on Mac OS X and make dynamic
libraries (libavcodec.dylib/libavformat.dylib) - it works well. I"ve
submitted my patches & variant to the darwinport maintainer.
Nice!
It would be better to submit them upstream here instead of to
darwinports.
Certainly. I'm cleaning it up (don't want to be TOO ashamed of heinous
patches), and trying to accommodate the fink people in not hardcoding
"/opt/local" in - its sooooo tempting though

Do I post them to this mailing list, or to the RFE, or where exactly?
I couldn't find any docs pertaining to it.
Post by Roine Gustafsson
My question is how important is stripping the library? If I strip,
some symbols get stripped out and ffmpeg no longer functions. Is
there
some benefit to stripping a dynamic library?
Yes, you"ll remove all the symbols that shouldn"t be exported,
minimizing namespace clashes.
You cannot strip a dynamic library like you do with an executable.
You need to write an export-file with only the symbols that should be
exported, link with -exported_symbols_list and strip with strip -x.
Hmmm.... that is way over my head, so I'll need to work on that. Like I
said, it works fine without stripping, although I will try and figure
it out.
Post by Roine Gustafsson
And versioning: ffmpeg is at 0.4.9; libavcodec_build is 4742;
libavformat is 4621. So I make the 2 dynamic libs - what versioning
should they have? libavcodec.0.dylib as per ffmpeg? Not that it
matters much as yet - nothing except my portfile uses ffmpeg dynamic
libs.
I think you should name them like the ffmpeg releases i.e.
libavcodec.0.4.9.dylib with links down to libavcodec.dylib.
Note that the version should also be built into the file by the linker
with -dylib_*_version.
I think I have that done more or less. You can see from this output of
linked libraries what I thought it should be and symlinked out to the
full 0.4.9 version:

otool -L libavcodec.0.dylib
libavcodec.0.dylib:
/opt/local/lib/libavcodec.0.dylib (compatibility version 0.0.0,
current version 0.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current
version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 71.1.1)
/opt/local/lib/libxvidcore.4.dylib (compatibility version
4.0.0, current version 4.1.0)
/opt/local/lib/libmp3lame.0.dylib (compatibility version 1.0.0,
current version 1.0.0)
/opt/local/lib/libvorbis.0.dylib (compatibility version 4.0.0,
current version 4.0.0)
/opt/local/lib/libvorbisenc.2.dylib (compatibility version
3.0.0, current version 3.0.0)

otool -L /opt/local/bin/ffmpeg
/opt/local/bin/ffmpeg:
/opt/local/lib/libavformat.0.dylib (compatibility version
0.0.0, current version 0.0.0)
/opt/local/lib/libavcodec.0.dylib (compatibility version 0.0.0,
current version 0.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current
version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 71.1.1)
/opt/local/lib/libvorbis.0.dylib (compatibility version 4.0.0,
current version 4.0.0)
/opt/local/lib/libvorbisenc.2.dylib (compatibility version
3.0.0, current version 3.0.0)
/opt/local/lib/libogg.0.dylib (compatibility version 6.0.0,
current version 6.0.0)
/opt/local/lib/libxvidcore.4.dylib (compatibility version
4.0.0, current version 4.1.0)

You can also see here one of my problems: the compatibility/current
versions - I don't know how to set them (or I thought I did, but...)
and I don't even know exactly how they come into play. For example this
seems out of whack, and yet it works:

/opt/local/lib/libpangoxft-1.0.0.dylib (compatibility version 400.0.0,
current version 400.1.0)

I hope to figure it out eventually. And then make mencoder use the
dynamic libraries.
Roine Gustafsson
2005-02-06 21:59:28 UTC
Permalink
Post by Iz Mir
Do I post them to this mailing list, or to the RFE, or where exactly?
I couldn't find any docs pertaining to it.
<http://ffmpeg.sourceforge.net/ffmpeg-doc.html#SEC33>
Post by Iz Mir
Post by Iz Mir
Post by Iz Mir
And versioning: ffmpeg is at 0.4.9; libavcodec_build is 4742;
libavformat is 4621. So I make the 2 dynamic libs - what versioning
should they have? libavcodec.0.dylib as per ffmpeg? Not that it
matters much as yet - nothing except my portfile uses ffmpeg
dynamic
Post by Iz Mir
libs.
I think you should name them like the ffmpeg releases i.e.
libavcodec.0.4.9.dylib with links down to libavcodec.dylib.
Note that the version should also be built into the file by the linker
with -dylib_*_version.
I think I have that done more or less. You can see from this output of
linked libraries what I thought it should be and symlinked out to the
[...]
Post by Iz Mir
You can also see here one of my problems: the compatibility/current
versions - I don't know how to set them (or I thought I did, but...)
and I don't even know exactly how they come into play.
Like I said, with the -dylib_*_version. Something like
LDFLAGS="-Wl,-search_paths_first,-dylib_current_version,$version,-
dylib_compatibility_version,$version"
Or did you try that but it didn't work?

The versions are used if an application wants to load a specific
version of the lib, or check which API it supports. Few apps do, so it
mostly works anyway.

/Roine



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
Iz Mir
2005-02-07 02:06:11 UTC
Permalink
Post by Iz Mir
Post by Iz Mir
Do I post them to this mailing list, or to the RFE, or where
exactly?
Post by Iz Mir
I couldn"t find any docs pertaining to it.
<http://ffmpeg.sourceforge.net/ffmpeg-doc.html#SEC33>
EGAD! what have I gotten into. Its a spiral of unfathomable tests....
that will take some time to figure out too.
Post by Iz Mir
Like I said, with the -dylib_*_version. Something like
LDFLAGS="-Wl,-search_paths_first,-dylib_current_version,$version,-
dylib_compatibility_version,$version"
Or did you try that but it didn"t work?
Yeah, pretty much tried that (not exacty the comma - the $version won't
work because its 0.4.9-pre1, but I've got a REL_MAJ_MIN_VERSION
variable I use for the dylib). Here:

--------------------------------------
--- libavcodec/Makefile Sat Jan 22 12:52:00 2005
+++ libavcodec/Makefile copy Sat Feb 5 12:18:58 2005
@@ -195,7 +195,10 @@

SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
OBJS := $(OBJS) $(ASM_OBJS)
-
+ifeq ($(CONFIG_DARWIN),yes)
+ DYVER_FLAGS= -dylib_compatibility_version=1.0.0
-dylib_current_version=1.0.0
+ DY_FLAGS= $(DYVER_FLAGS) -dylib_install_name=$(REAL_PREFIX)/lib/$@
+endif
LIB= $(LIBPREF)avcodec$(LIBSUF)
ifeq ($(BUILD_SHARED),yes)
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
@@ -222,7 +225,8 @@
$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS)
$(EXTRALIBS) $(AMREXTRALIBS)
-lib /machine:i386 /def:$(@:.dll=.def)
else
- $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
+ $(CC) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(EXTRALIBS)
$(AMREXTRALIBS) $(DY_FLAGS)
+ install_name_tool -id
$(REAL_PREFIX)/lib/$(SLIBPREF)avcodec.0$(SLIBSUF) $@
endif

dsputil.o: dsputil.c dsputil.h
@@ -293,10 +297,17 @@
ifeq ($(CONFIG_WIN32),yes)
install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
else
+ifeq ($(CONFIG_DARWIN),yes)
+ install -d $(prefix)/lib
+ install -m 755 $(SLIB) $(prefix)/lib/libavcodec.dylib
+ ln -sf libavcodec.dylib
$(prefix)/lib/libavcodec.$(RELEASE_VERSION).dylib
+ ln -sf libavcodec.dylib
$(prefix)/lib/libavcodec.$(REL_MAJ_MIN_VERSION).dylib
+else
install -d $(prefix)/lib
install $(INSTALLSTRIP) -m 755 $(SLIB)
$(prefix)/lib/libavcodec-$(VERSION).so
ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
ldconfig || true
+endif
endif
ifeq ($(CONFIG_PP),yes)
$(MAKE) -C libpostproc $@


----------------
Actually, I think that whole DYVER/DY_FLAG part is not functional.

It becomes chicken & the egg with the the install prefix needed during
the build phase which has to be embedded in the library as its is built
and linked (the install_name_tool part) - I think. It's in the "all:
$(LIB) $(SLIB)" phase. The "-id
$(REAL_PREFIX)/lib/$(SLIBPREF)avcodec.0$(SLIBSUF)" path is what gets
linked in (the otool output above).

I'll give the comma thing a try, then see how it gets done with other
makefiles.

Thanks for your assistance. I appreciate your insight and patience.
Roine Gustafsson
2005-02-07 09:43:23 UTC
Permalink
On Monday, Feb 7, 2005, at 03:06 Europe/Stockholm, Iz Mir wrote:
[...]
Post by Iz Mir
+ifeq ($(CONFIG_DARWIN),yes)
+ install -d $(prefix)/lib
+ install -m 755 $(SLIB) $(prefix)/lib/libavcodec.dylib
+ ln -sf libavcodec.dylib
$(prefix)/lib/libavcodec.$(RELEASE_VERSION).dylib
+ ln -sf libavcodec.dylib
$(prefix)/lib/libavcodec.$(REL_MAJ_MIN_VERSION).dylib
+else
install -d $(prefix)/lib
install $(INSTALLSTRIP) -m 755 $(SLIB)
$(prefix)/lib/libavcodec-$(VERSION).so
ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
ldconfig || true
+endif
Try not to put logic into the Makefile. If at all possible, use the
same Makefile for both .so and .dylib and put the logic into the
configure script.
Post by Iz Mir
Actually, I think that whole DYVER/DY_FLAG part is not functional.
It becomes chicken & the egg with the the install prefix needed during
the build phase which has to be embedded in the library as its is
built and linked (the install_name_tool part) - I think. It's in the
"all: $(LIB) $(SLIB)" phase. The "-id
$(REAL_PREFIX)/lib/$(SLIBPREF)avcodec.0$(SLIBSUF)" path is what gets
linked in (the otool output above).
I'm not 100% sure what you're trying to do here, but I'm almost certain
you're not doing it right.
If you put the -dylib_*_version into the LDFLAGS in the configure
script, it should embed the version correctly without any Makefile
modifications.
AFAIK you don't need to specify the -dylib_install_name, which might
make it simpler.

/Roine



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
Iz Mir
2005-02-18 19:45:50 UTC
Permalink
Dynamic library support for Mac OS X, which AFAIK should work for all
Darwin based OSes.
The only thing this modifies for non-Darwin systems is the version
number of the dynamic libraries, from "libavcodec-0.4.9-pre1.so" to
"libavcodec-0.4.9.so", which I think is correct.
The dynamic library on Darwin isn"t stripped since "install -s"
doesn"t
work. To be fixed.
The dynamically linked build cannot be tested without installing the
libraries first. This should be the same on e.g. Linux. I propose a
change to the test script to add
(DY)LD_LIBRARY_PATH=../libavcodec:../libavformat.
Sorry about disappearing: my monitor had to be shipped back RMA. Makes
it a little hard to compile. Anyway, I started over from scratch &
found out that I was reinventing the wheel:

http://cvs.sourceforge.net/viewcvs.py/fink/dists/10.3/unstable/main/
finkinfo/graphics/ffmpeg.info?rev=1.10&view=markup

I thank you for helping me to simplify things - there are many fewer
changes now. It builds almost perfectly (a few minor linking errors). I
have yet to perform one of those regression tests however (I need to
add that to my portfile). It builds & links properly with the patches
below (and pass --extra-libs="-L${prefix}/lib" with configure),
however, I think it would be wise to export version as a x.y.z number
(at least under Mac OS X) because a version of 4.9.1-pre1 will fail at
the -compat/ -current version (only three significant numbers, and no
text are allowed). Further, I think it is overly specific to build as
libavcodec-0.4.9.dylib and symlink to less specific versions, but it is
done both ways:

otool -L libgnet.2.dylib
libgnet.2.dylib:
/opt/local/lib/libgnet-2.0.0.dylib (compatibility version
1.0.0, current version 1.4.0)
/opt/local/lib/libgthread-2.0.0.dylib (compatibility version
401.0.0, current version 401.0.0)
/opt/local/lib/libglib-2.0.0.dylib (compatibility version
401.0.0, current version 401.0.0)
/opt/local/lib/libintl.3.dylib (compatibility version 8.0.0,
current version 8.0.0)
/usr/lib/libiconv.2.dylib (compatibility version 5.0.0, current
version 5.0.0)
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0,
current version 324.6.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 71.1.1)

This doesn't install the static libraries (libavformat.la, or
libavformat.a), and I just have no reason why... I don't know if they
are (ever) needed.

The stripping is handled fine below, but as you point out the install
-s doesn't work, and this doesn't actually behave according to
configure (-disable-strip behaves just as -enable-strip), so I should
fix that as well. It's really one flag (-single_module) that solved a
LOT of my problems. This flag MAY be 10.3 specific (two-level namespace
stuff only appeared on 10.3 I believe). I know its required by one
library, but possibly not both. I forgot now.

• You will hopefully also note the addition of -logg to the makefile.
Maybe you have a less stringent linker, but on Mac OS X, libavformat
needs -logg to link properly when configured for ogg.
Dynamic library support for Mac OS X, which AFAIK should work for
all
Darwin based OSes.
can someone who has Mac OS X check this please
I'm not quite done massaging the way that dynamic libraries are built
on Mac OS X. Should the static libraries (or whatever libavcodec.a is)
be installed as well? I have yet to even see why vhook is disabled in
darwinports.

I realize I have added to the makefile (the install part is
inevitable). I will make an effort to streamline and move more to the
configure script.


--- configure Mon Feb 7 10:35:46 2005
+++ configure copy Mon Feb 7 20:36:33 2005
@@ -262,6 +262,7 @@
dv1394="no"
ffserver="no"
SHFLAGS="-dynamiclib"
+SLIBSUF=".dylib"
extralibs=""
darwin="yes"
strip="strip -x"
@@ -541,6 +542,8 @@
CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer
-force_cpusubtype_ALL -Wno-sign-compare"
if test "$lshared" = no; then
needmdynamicnopic="yes"
+ else
+ LDFLAGS=`echo $LDFLAGS | sed 's/-d,//g'`
fi
;;
*)

--- libavcodec/Makefile Sat Jan 22 12:52:00 2005
+++ libavcodec/Makefile copy Mon Feb 7 17:40:12 2005
@@ -199,6 +199,10 @@
LIB= $(LIBPREF)avcodec$(LIBSUF)
ifeq ($(BUILD_SHARED),yes)
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
+ifeq ($(CONFIG_DARWIN),yes)
+ SHFLAGS+= -single_module -install_name
$(prefix)/lib/libavcodec-$(VERSION)$(SLIBSUF) \
+ -compatibility_version 1 -current_version 0.4.6
+endif
endif
TESTS= imgresample-test dct-test motion-test fft-test

@@ -242,7 +246,7 @@
dep: depend

clean: $(CLEANAMR)
- rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
+ rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *$(SLIBSUF) i386/*.o i386/*~ \
armv4l/*.o armv4l/*~ \
mlib/*.o mlib/*~ \
alpha/*.o alpha/*~ \
@@ -293,10 +297,17 @@
ifeq ($(CONFIG_WIN32),yes)
install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
else
+ifeq ($(CONFIG_DARWIN),yes)
+ install -d $(prefix)/lib
+ $(STRIP) $(SLIB)
+ install -m 755 $(SLIB) $(prefix)/lib/libavcodec-$(VERSION)$(SLIBSUF)
+ ln -sf libavcodec-$(VERSION)$(SLIBSUF)
$(prefix)/lib/libavcodec$(SLIBSUF)
+else
install -d $(prefix)/lib
install $(INSTALLSTRIP) -m 755 $(SLIB)
$(prefix)/lib/libavcodec-$(VERSION).so
ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
ldconfig || true
+endif
endif
ifeq ($(CONFIG_PP),yes)
$(MAKE) -C libpostproc $@

--- libavformat/Makefile Tue Jan 11 03:16:04 2005
+++ libavformat/Makefile copy Mon Feb 7 20:31:34 2005
@@ -74,6 +74,7 @@

ifeq ($(CONFIG_VORBIS),yes)
OBJS+= ogg.o
+EXTRALIBS+=-logg
endif

ifeq ($(TARGET_ARCH_SPARC64),yes)
@@ -83,6 +84,10 @@
LIB= $(LIBPREF)avformat$(LIBSUF)
ifeq ($(BUILD_SHARED),yes)
SLIB= $(SLIBPREF)avformat$(SLIBSUF)
+ifeq ($(CONFIG_DARWIN),yes)
+ SHFLAGS+= -single_module -install_name
$(prefix)/lib/libavformat-$(VERSION)$(SLIBSUF) \
+ -compatibility_version 1 -current_version 0.4.6
+endif
endif

EXTRALIBS+=-lavcodec -L../libavcodec
@@ -115,11 +120,18 @@
ifeq ($(CONFIG_WIN32),yes)
install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
else
+ifeq ($(CONFIG_DARWIN),yes)
+ install -d $(prefix)/lib
+ $(STRIP) $(SLIB)
+ install -m 755 $(SLIB) $(prefix)/lib/libavformat-$(VERSION)$(SLIBSUF)
+ ln -sf libavformat-$(VERSION)$(SLIBSUF)
$(prefix)/lib/libavformat$(SLIBSUF)
+else
install -d $(prefix)/lib
install $(INSTALLSTRIP) -m 755 $(SLIB)
$(prefix)/lib/libavformat-$(VERSION).so
ln -sf libavformat-$(VERSION).so $(prefix)/lib/libavformat.so
ldconfig || true
endif
+endif
else
install:
endif
@@ -142,7 +154,7 @@
g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<

distclean clean:
- rm -f *.o *.d .depend *~ *.a *.so $(LIB)
+ rm -f *.o *.d .depend *~ *.a *$(SLIBSUF) $(LIB)

#
# include dependency files if they exist
Roine Gustafsson
2005-02-18 23:16:13 UTC
Permalink
Post by Iz Mir
I thank you for helping me to simplify things - there are many fewer
changes now. It builds almost perfectly (a few minor linking errors).
Are you applying the patch to the current CVS and getting errors?
Can you post the linking errors?
Post by Iz Mir
I have yet to perform one of those regression tests however (I need
to add that to my portfile). It builds & links properly with the
patches below (and pass --extra-libs="-L${prefix}/lib" with
configure), however, I think it would be wise to export version as a
x.y.z number (at least under Mac OS X) because a version of 4.9.1-pre1
will fail at the -compat/ -current version (only three significant
numbers, and no text are allowed).
Yes, the patch does that. Doesn't it work for you?
Post by Iz Mir
Further, I think it is overly specific to build as
libavcodec-0.4.9.dylib and symlink to less specific versions, but it
[...]

It's done that way so the developer linking the application can decide
if it wants to link to a specific library version or not. This is
similar but not the same use as the built-in versions.
Post by Iz Mir
This doesn't install the static libraries (libavformat.la, or
libavformat.a), and I just have no reason why... I don't know if they
are (ever) needed.
Most people would use the static libraries. This is the only way to
prevent "dll hell", or incompatible dynamic libraries. If you provide a
package you really should provide a static library version too.
Post by Iz Mir
The stripping is handled fine below, but as you point out the install
-s doesn't work, and this doesn't actually behave according to
configure (-disable-strip behaves just as -enable-strip), so I should
fix that as well. It's really one flag (-single_module) that solved a
LOT of my problems.
Hmm, never used. What problems did it solve?
Post by Iz Mir
This flag MAY be 10.3 specific (two-level namespace stuff only
appeared on 10.3 I believe). I know its required by one library, but
possibly not both. I forgot now.
Two-level namespace was in 10.0, but ld crashed when it was used. It
worked from 10.1 and up.

10.0 support is not interesting as nobody uses it anymore. 10.2 support
is IMO required unless impossible, since alot of people haven't
bothered to upgrade to 10.3.
Post by Iz Mir
I'm not quite done massaging the way that dynamic libraries are built
on Mac OS X. Should the static libraries (or whatever libavcodec.a is)
be installed as well? I have yet to even see why vhook is disabled in
darwinports.
yes, it should.
Post by Iz Mir
I realize I have added to the makefile (the install part is
inevitable). I will make an effort to streamline and move more to the
configure script.
--- configure Mon Feb 7 10:35:46 2005
+++ configure copy Mon Feb 7 20:36:33 2005
@@ -262,6 +262,7 @@
dv1394="no"
ffserver="no"
SHFLAGS="-dynamiclib"
+SLIBSUF=".dylib"
extralibs=""
darwin="yes"
strip="strip -x"
@@ -541,6 +542,8 @@
CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer
-force_cpusubtype_ALL -Wno-sign-compare"
if test "$lshared" = no; then
needmdynamicnopic="yes"
+ else
+ LDFLAGS=`echo $LDFLAGS | sed 's/-d,//g'`
??
Why not just remove the "-d" yourself?
Post by Iz Mir
fi
;;
*)
--- libavcodec/Makefile Sat Jan 22 12:52:00 2005
+++ libavcodec/Makefile copy Mon Feb 7 17:40:12 2005
@@ -199,6 +199,10 @@
LIB= $(LIBPREF)avcodec$(LIBSUF)
ifeq ($(BUILD_SHARED),yes)
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
+ifeq ($(CONFIG_DARWIN),yes)
+ SHFLAGS+= -single_module -install_name
$(prefix)/lib/libavcodec-$(VERSION)$(SLIBSUF) \
+ -compatibility_version 1 -current_version 0.4.6
Are you working on 0.4.6??? Sir, please put down your compiler and step
away from the source.

And giving a higher compatibility version than current version means
it's incompatible with itself. Why are you hard-coding the versions?

Unless you are in some obscene hurry to get dynamic libraries
backported to older releases, it's better to help this go into the
current ffmpeg CVS. Then your port file will be reduced to supplying
some options to ./configure.

/Roine



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Iz Mir
2005-02-19 22:06:32 UTC
Permalink
Post by Roine Gustafsson
Are you applying the patch to the current CVS and getting errors?
Can you post the linking errors?
Ah, problem solved with the latest cvs.
Post by Roine Gustafsson
Post by Iz Mir
I have yet to perform one of those regression tests however (I need
to add that to my portfile). It builds & links properly with the
patches below (and pass --extra-libs="-L${prefix}/lib" with
configure), however, I think it would be wise to export version as a
x.y.z number (at least under Mac OS X) because a version of
4.9.1-pre1 will fail at the -compat/ -current version (only three
significant numbers, and no text are allowed).
Yes, the patch does that. Doesn't it work for you?
I can't find any patch, and I just signed up for the email mailing
list. If you could resend it, I could check.
Post by Roine Gustafsson
Post by Iz Mir
The stripping is handled fine below, but as you point out the install
-s doesn't work, and this doesn't actually behave according to
configure (-disable-strip behaves just as -enable-strip), so I should
fix that as well. It's really one flag (-single_module) that solved a
LOT of my problems.
Hmm, never used. What problems did it solve?
rm -f libavcodec.a
ar rc libavcodec.a bitstream.o utils.o mem.o allcodecs.o mpegvideo.o
jrevdct.o jfdctfst.o jfdctint.o mpegaudio.o ac3enc.o mjpeg.o resample.o
resample2.o dsputil.o motion_est.o imgconvert.o imgresample.o mpeg12.o
mpegaudiodec.o pcm.o simple_idct.o ratecontrol.o adpcm.o eval.o dv.o
error_resilience.o fft.o mdct.o mace.o huffyuv.o cyuv.o opts.o raw.o
h264.o golomb.o vp3.o asv1.o 4xm.o cabac.o ffv1.o ra144.o ra288.o
vcr1.o cljr.o roqvideo.o dpcm.o interplayvideo.o xan.o rpza.o cinepak.o
msrle.o msvideo1.o vqavideo.o idcinvideo.o adx.o rational.o faandct.o
8bps.o smc.o parser.o flicvideo.o truemotion1.o vmdav.o lcl.o qtrle.o
g726.o flac.o vp3dsp.o integer.o snow.o tscc.o sonic.o ulti.o
h264idct.o qdrw.o xl.o rangecoder.o png.o pnm.o qpeg.o vc9.o h263.o
h261.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o
mp3lameaudio.o ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o
ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o
ppc/dsputil_h264_altivec.o
ranlib libavcodec.a
cc -dynamiclib -install_name /opt/local/lib/libavcodec-0.4.9-pre1.dylib
-compatibility_version 1 -current_version 0.4.9 -o libavcodec.dylib
bitstream.o utils.o mem.o allcodecs.o mpegvideo.o jrevdct.o jfdctfst.o
jfdctint.o mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o
dsputil.o motion_est.o imgconvert.o imgresample.o mpeg12.o
mpegaudiodec.o pcm.o simple_idct.o ratecontrol.o adpcm.o eval.o dv.o
error_resilience.o fft.o mdct.o mace.o huffyuv.o cyuv.o opts.o raw.o
h264.o golomb.o vp3.o asv1.o 4xm.o cabac.o ffv1.o ra144.o ra288.o
vcr1.o cljr.o roqvideo.o dpcm.o interplayvideo.o xan.o rpza.o cinepak.o
msrle.o msvideo1.o vqavideo.o idcinvideo.o adx.o rational.o faandct.o
8bps.o smc.o parser.o flicvideo.o truemotion1.o vmdav.o lcl.o qtrle.o
g726.o flac.o vp3dsp.o integer.o snow.o tscc.o sonic.o ulti.o
h264idct.o qdrw.o xl.o rangecoder.o png.o pnm.o qpeg.o vc9.o h263.o
h261.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o
mp3lameaudio.o ppc/dsputil_ppc.o ppc/mpegvideo_ppc.o
ppc/dsputil_altivec.o ppc/mpegvideo_altivec.o ppc/idct_altivec.o
ppc/fft_altivec.o ppc/gmc_altivec.o ppc/fdct_altivec.o
ppc/dsputil_h264_altivec.o -L/opt/local/lib -lz -lmp3lame
-Wl,-search_paths_first -L/opt/local/lib
ld: common symbols not allowed with MH_DYLIB output format
msmpeg4.o definition of common _ff_msmp4_dc_chroma_vlc (size 32)
msmpeg4.o definition of common _ff_msmp4_dc_luma_vlc (size 32)
msmpeg4.o definition of common _ff_msmp4_mb_i_vlc (size 16)
/usr/bin/libtool: internal link edit command failed
make[1]: *** [libavcodec.dylib] Error 1
make: *** [lib] Error 2

and subsequent attempts at working around that.
Post by Roine Gustafsson
Post by Iz Mir
This flag MAY be 10.3 specific (two-level namespace stuff only
appeared on 10.3 I believe). I know its required by one library, but
possibly not both. I forgot now.
Two-level namespace was in 10.0, but ld crashed when it was used. It
worked from 10.1 and up.
10.0 support is not interesting as nobody uses it anymore. 10.2
support is IMO required unless impossible, since alot of people
haven't bothered to upgrade to 10.3.
okay scratch the -single_module flag. Instead, -fno-common does the
same thing in this case.
Post by Roine Gustafsson
Post by Iz Mir
I'm not quite done massaging the way that dynamic libraries are built
on Mac OS X. Should the static libraries (or whatever libavcodec.a
is) be installed as well? I have yet to even see why vhook is
disabled in darwinports.
yes, it should.
vhook builds, but it builds null.so - and that can't be right, but it
doesn't work with .dylib rule either. I'm just gonna shelve vhook.
Doubt it would get much use on Mac OS X.

As for static libraries, I couldn't get them to strip properly. install
-s -m 755 libavcodec.a
/Users/me/darwinports/localports/multimedia/ffmpeg/work/destroot/opt/
local/lib/libavcodec-0.4.9-pre1.a
strip: symbols referenced by relocation entries that can't be stripped
in:
/Users/me/darwinports/localports/multimedia/ffmpeg/work/destroot/opt/
local/lib/libavcodec-0.4.9-pre1.a(bitstream.o)
dyld_stub_binding_helper
_av_free
_av_log
_av_realloc
_av_realloc_static

(errors for every output.o file in the library)

or strip -x /Users/me/Desktop/libavcodec.a
strip: symbols referenced by indirect symbol table entries that can't
be stripped in: /Users/me/Desktop/libavcodec.a(mpegvideo.o)
_sse_mb
_dct_quantize_refine
_encode_picture

ya know, I don't NEED it stripped.
Post by Roine Gustafsson
Post by Iz Mir
+ LDFLAGS=`echo $LDFLAGS | sed 's/-d,//g'`
??
Why not just remove the "-d" yourself?
Well someone put it in for some reason for a static build of ffmpeg.
And seeing how you were with 0.4.6 (a simple keystroke error), imagine
what it would be like if I deleted something! Besides, it might be
require for a static ffmpeg build - I haven't tested it, just dynamic
libraries. And the -d conflicts with dynamic libraries, but doesn't for
a static ffmpeg - so I just left it there.
Post by Roine Gustafsson
Post by Iz Mir
+ -compatibility_version 1 -current_version 0.4.6
Are you working on 0.4.6??? Sir, please put down your compiler and
step away from the source.
And giving a higher compatibility version than current version means
it's incompatible with itself. Why are you hard-coding the versions?
Unless you are in some obscene hurry to get dynamic libraries
backported to older releases, it's better to help this go into the
current ffmpeg CVS. Then your port file will be reduced to supplying
some options to ./configure.
wow, so I missed by 1 key. It should be a 9.

These are the only stand outs in the "make test" suite:

../ffmpeg_g -y -bitexact -dct_algo 1 -idct_algo 2 -y -i
./data/a-wmv2.avi -f rawvideo ./data/out.yuv
ffmpeg version 0.4.9-pre1, build 4743, Copyright (c) 2000-2004 Fabrice
Bellard
configuration: --prefix=/opt/local --mandir=/opt/local/share/man
--extra-libs=-L/opt/local/lib --enable-mp3lame --enable-xvid
--enable-gpl --enable-shared
built on Feb 19 2005 11:58:16, gcc: 3.3 20030304 (Apple Computer,
Inc. build 1671)
[wmv2 @ 0x88b5d008]I7:0/
[wmv2 @ 0x88b5d008]I7:0/
[wmv2 @ 0x88b5d008]I7:0/
[wmv2 @ 0x88b5d008]I7:0/
------------
../ffmpeg_g -y -bitexact -dct_algo 1 -idct_algo 2 -y -i
./data/a-error-mpeg4-adv.avi -f rawvideo ./data/out.yuv
ffmpeg version 0.4.9-pre1, build 4743, Copyright (c) 2000-2004 Fabrice
Bellard
configuration: --prefix=/opt/local --mandir=/opt/local/share/man
---extra-libs=-L/opt/local/lib --enable-mp3lame --enable-xvid
--enable-gpl --enable-shared
built on Feb 19 2005 11:58:16, gcc: 3.3 20030304 (Apple Computer,
Inc. build 1671)
[mpeg4 @ 0x88b5d008]concealing 39 DC, 39 AC, 39 MV errors
[mpeg4 @ 0x88b5d008]concealing 115 DC, 115 AC, 115 MV errors
[mpeg4 @ 0x88b5d008]concealing 39 DC, 39 AC, 39 MV errors
[mpeg4 @ 0x88b5d008]concealing 115 DC, 115 AC, 115 MV errors
[mpeg4 @ 0x88b5d008]concealing 98 DC, 98 AC, 98 MV errors
[mpeg4 @ 0x88b5d008]concealing 100 DC, 100 AC, 100 MV errors
[mpeg4 @ 0x88b5d008]concealing 68 DC, 68 AC, 68 MV errors
[mpeg4 @ 0x88b5d008]concealing 87 DC, 87 AC, 87 MV errors
[mpeg4 @ 0x88b5d008]concealing 86 DC, 86 AC, 86 MV errors
[mpeg4 @ 0x88b5d008]concealing 104 DC, 104 AC, 104 MV errors
[mpeg4 @ 0x88b5d008]concealing 36 DC, 36 AC, 36 MV errors
[mpeg4 @ 0x88b5d008]concealing 95 DC, 95 AC, 95 MV errors
[mpeg4 @ 0x88b5d008]concealing 88 DC, 88 AC, 88 MV errors
[mpeg4 @ 0x88b5d008]concealing 77 DC, 77 AC, 77 MV errors
------------
Regression test succeeded.
------------
So please resend your patch.




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Roine Gustafsson
2005-02-19 23:00:09 UTC
Permalink
Post by Iz Mir
Post by Roine Gustafsson
Post by Iz Mir
I'm not quite done massaging the way that dynamic libraries are
built on Mac OS X. Should the static libraries (or whatever
libavcodec.a is) be installed as well? I have yet to even see why
vhook is disabled in darwinports.
yes, it should.
vhook builds, but it builds null.so - and that can't be right, but it
doesn't work with .dylib rule either. I'm just gonna shelve vhook.
Doubt it would get much use on Mac OS X.
vhook is AFAIK depreciated. Noone will miss it.
Post by Iz Mir
As for static libraries, I couldn't get them to strip properly.
install -s -m 755 libavcodec.a
/Users/me/darwinports/localports/multimedia/ffmpeg/work/destroot/opt/
local/lib/libavcodec-0.4.9-pre1.a
strip: symbols referenced by relocation entries that can't be stripped
/Users/me/darwinports/localports/multimedia/ffmpeg/work/destroot/opt/
local/lib/libavcodec-0.4.9-pre1.a(bitstream.o)
dyld_stub_binding_helper
_av_free
_av_log
_av_realloc
_av_realloc_static
(errors for every output.o file in the library)
or strip -x /Users/me/Desktop/libavcodec.a
strip: symbols referenced by indirect symbol table entries that can't
be stripped in: /Users/me/Desktop/libavcodec.a(mpegvideo.o)
_sse_mb
_dct_quantize_refine
_encode_picture
ya know, I don't NEED it stripped.
Use -x for .dylibs, and no stripping for .a. Static libraries should be
stripped when the executable is built.
Post by Iz Mir
Post by Roine Gustafsson
Post by Iz Mir
+ LDFLAGS=`echo $LDFLAGS | sed 's/-d,//g'`
??
Why not just remove the "-d" yourself?
Well someone put it in for some reason for a static build of ffmpeg.
And seeing how you were with 0.4.6 (a simple keystroke error), imagine
what it would be like if I deleted something! Besides, it might be
require for a static ffmpeg build - I haven't tested it, just dynamic
libraries. And the -d conflicts with dynamic libraries, but doesn't
for a static ffmpeg - so I just left it there.
No, the -d was a fix that didn't work. It should be removed.

ffmpeg is supported by peer review, so expect to answer for any change
you want to make. This process leads to fewer keystroke bugs :)
But a nice pair of asbestos underwear comes in handy around here
sometimes.
Post by Iz Mir
Post by Roine Gustafsson
Post by Iz Mir
+ -compatibility_version 1 -current_version 0.4.6
Are you working on 0.4.6??? Sir, please put down your compiler and
step away from the source.
And giving a higher compatibility version than current version means
it's incompatible with itself. Why are you hard-coding the versions?
Unless you are in some obscene hurry to get dynamic libraries
backported to older releases, it's better to help this go into the
current ffmpeg CVS. Then your port file will be reduced to supplying
some options to ./configure.
wow, so I missed by 1 key. It should be a 9.
Good :)

I think there is no reasonable value for compatibility_version, so you
should probably not set it. The source changes breaks binary
compatibility less frequently these days, so maybe setting it to 0.4.9
for the future would be a good idea.
[...]
Post by Iz Mir
------------
Regression test succeeded.
------------
Means everything is A-OK. The output you posted is normal.
Post by Iz Mir
So please resend your patch.
Apparently GMane stores the attachments. Nice.
<http://article.gmane.org/gmane.comp.video.ffmpeg.devel/19357>


/Roine



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Iz Mir
2005-02-20 02:54:20 UTC
Permalink
Post by Roine Gustafsson
Post by Iz Mir
or strip -x /Users/me/Desktop/libavcodec.a
strip: symbols referenced by indirect symbol table entries that can't
be stripped in: /Users/me/Desktop/libavcodec.a(mpegvideo.o)
_sse_mb
_dct_quantize_refine
_encode_picture
ya know, I don't NEED it stripped.
Use -x for .dylibs, and no stripping for .a. Static libraries should
be stripped when the executable is built.
What? No stripping, but when you strip...? Plain strip doesn't do it
either.
Post by Roine Gustafsson
Post by Iz Mir
Post by Roine Gustafsson
Post by Iz Mir
+ LDFLAGS=`echo $LDFLAGS | sed 's/-d,//g'`
??
Why not just remove the "-d" yourself?
Well someone put it in for some reason for a static build of ffmpeg.
And seeing how you were with 0.4.6 (a simple keystroke error),
imagine what it would be like if I deleted something! Besides, it
might be require for a static ffmpeg build - I haven't tested it,
just dynamic libraries. And the -d conflicts with dynamic libraries,
but doesn't for a static ffmpeg - so I just left it there.
No, the -d was a fix that didn't work. It should be removed.
ffmpeg is supported by peer review, so expect to answer for any change
you want to make. This process leads to fewer keystroke bugs :)
But a nice pair of asbestos underwear comes in handy around here
sometimes.
Apparently so. I was thinking "What a total crotch" Ooops, one of those
keystroke errors again - I meant "NOT a total..." Great, looking
forward to more barbs.
Post by Roine Gustafsson
Post by Iz Mir
Post by Roine Gustafsson
Post by Iz Mir
+ -compatibility_version 1 -current_version 0.4.6
Are you working on 0.4.6??? Sir, please put down your compiler and
step away from the source.
And giving a higher compatibility version than current version means
it's incompatible with itself. Why are you hard-coding the versions?
Unless you are in some obscene hurry to get dynamic libraries
backported to older releases, it's better to help this go into the
current ffmpeg CVS. Then your port file will be reduced to supplying
some options to ./configure.
wow, so I missed by 1 key. It should be a 9.
Good :)
I think there is no reasonable value for compatibility_version, so you
should probably not set it. The source changes breaks binary
compatibility less frequently these days, so maybe setting it to 0.4.9
for the future would be a good idea.
Compat 1, current 0.4.9 still works as well as anything else - it just
looks odd. As long as it doesn't complain, do whatcha like.
Post by Roine Gustafsson
[...]
Post by Iz Mir
------------
Regression test succeeded.
------------
Means everything is A-OK. The output you posted is normal.
Expellent!
Post by Roine Gustafsson
Post by Iz Mir
So please resend your patch.
Apparently GMane stores the attachments. Nice.
<http://article.gmane.org/gmane.comp.video.ffmpeg.devel/19357>
Bubulah, are you meshugener? Using your patches with ogg enabled:

rm -f libavformat.a
ar rc libavformat.a utils.o cutils.o os_support.o allformats.o mpeg.o
mpegts.o mpegtsenc.o ffm.o crc.o img.o img2.o raw.o rm.o avienc.o
avidec.o wav.o swf.o au.o gif.o mov.o mpjpeg.o dv.o yuv4mpeg.o 4xm.o
flvenc.o flvdec.o movenc.o psxstr.o idroq.o ipmovie.o nut.o wc3movie.o
mp3.o westwood.o segafilm.o idcin.o flic.o sierravmd.o matroska.o sol.o
electronicarts.o nsvdec.o asf.o asf-enc.o pnm.o yuv.o png.o jpeg.o
gifdec.o sgi.o avio.o aviobuf.o file.o framehook.o udp.o tcp.o http.o
rtsp.o rtp.o rtpproto.o ogg.o
ranlib libavformat.a
cc -dynamiclib -o libavformat.dylib utils.o cutils.o os_support.o
allformats.o mpeg.o mpegts.o mpegtsenc.o ffm.o crc.o img.o img2.o raw.o
rm.o avienc.o avidec.o wav.o swf.o au.o gif.o mov.o mpjpeg.o dv.o
yuv4mpeg.o 4xm.o flvenc.o flvdec.o movenc.o psxstr.o idroq.o ipmovie.o
nut.o wc3movie.o mp3.o westwood.o segafilm.o idcin.o flic.o sierravmd.o
matroska.o sol.o electronicarts.o nsvdec.o asf.o asf-enc.o pnm.o yuv.o
png.o jpeg.o gifdec.o sgi.o avio.o aviobuf.o file.o framehook.o udp.o
tcp.o http.o rtsp.o rtp.o rtpproto.o ogg.o -L/opt/local/lib -lz
-lavcodec -L../libavcodec -lmp3lame -Wl,-search_paths_first
-Wl,-current_version,0.4.9,-install_name,/usr/local/lib/
libavformat.dylib
ld: warning prebinding disabled because of undefined symbols
ld: Undefined symbols:
_ogg_page_serialno
_ogg_stream_clear
_ogg_stream_flush
_ogg_stream_init
_ogg_stream_packetin
_ogg_stream_packetout
_ogg_stream_pagein
_ogg_stream_pageout
_ogg_sync_buffer
_ogg_sync_clear
_ogg_sync_init
_ogg_sync_pageout
_ogg_sync_wrote
/usr/bin/libtool: internal link edit command failed

There is no -logg in your patch.
----------------------
• I think prefix is being used too early, and set too late for the
library path. From the config.mak:

prefix=/opt/local
SLDFLAGS=-Wl,-current_version,$(VERSION_NUMERIC),-install_name,/usr/
local/lib/$(SLIB)

\$(prefix) then? I didn't even know a variable could be passed through
like that.
-----------------------
->• The static libraries (libavformat.a & libavcodec.a) aren't
installed, just built and forgotten. (one last thing to do)
• When I had a 1 day old library installed already, and using these new
patches I saw tons of "using something from path/*.dylib not from
path/*.dylib" errors. All anyone had to do is remove the libxx.dylib,
but I just hadn't come across this with the previous patches.
• I am coping & dealing with the embedded compat vers (they are the
same for the libraries):

otool -L ffmpeg
/opt/local/bin/ffmpeg:
/opt/local/lib/libavformat.dylib (compatibility version 0.0.0,
current version 0.4.9)
/opt/local/lib/libavcodec.dylib (compatibility version 0.0.0,
current version 0.4.9)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current
version 1.0.0)
/opt/local/lib/libvorbis.0.dylib (compatibility version 4.0.0,
current version 4.0.0)
/opt/local/lib/libvorbisenc.2.dylib (compatibility version
3.0.0, current version 3.0.0)
/opt/local/lib/libogg.0.dylib (compatibility version 6.0.0,
current version 6.0.0)
/opt/local/lib/libxvidcore.4.dylib (compatibility version
4.0.0, current version 4.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 71.1.1)
----------------------
And the libraries aren't stripped.

+ifeq ($(CONFIG_DARWIN),yes)
+ifdef STRIP
+ $(STRIP) $(SLIB)
+endif
+endif

or something like a DARWIN_DYLIB_STRIP to config.mak.

• "make test" has the same results (wmv2 & mpeg4 have some problems).
And libquicktime picks up libavcodec - it just brings a tear to my eye.
It's a thing of booty.
--------------------------------------------------------------
Your patches are great. Thanks for seeing it through. So here are the
patches as they stand now:

--- configure Mon Feb 7 10:35:46 2005
+++ configure copy Sat Feb 19 12:42:18 2005
@@ -167,6 +167,8 @@
optimize="yes"
debug="yes"
dostrip="yes"
+installstrip="-s"
+haveldconfig="yes"
extralibs="-lm"
simpleidct="yes"
bigendian="no"
@@ -262,11 +264,16 @@
dv1394="no"
ffserver="no"
SHFLAGS="-dynamiclib"
+CFLAGS="$CFLAGS -fno-common"
extralibs=""
darwin="yes"
strip="strip -x"
-LDFLAGS="-Wl,-d,-search_paths_first"
+haveldconfig="no"
+installstrip="" #
+LDFLAGS="-Wl,-search_paths_first"
+SLDFLAGS="-Wl,-current_version,\$(VERSION_NUMERIC),-
install_name,\$(prefix)/lib/\$(SLIB)"
FFSLDFLAGS=-Wl,-bind_at_load
+SLIBSUF=".dylib"
;;
MINGW32*)
# Note: the rest of the mingw32 config is done afterwards as mingw32
@@ -1100,7 +1107,8 @@
echo "RANLIB=$ranlib" >> config.mak
if test "$dostrip" = "yes" ; then
echo "STRIP=$strip" >> config.mak
-echo "INSTALLSTRIP=-s" >> config.mak
+echo "HAVE_LDCONFIG=$haveldconfig" >> config.mak
+echo "INSTALLSTRIP=$installstrip" >> config.mak
else
echo "STRIP=echo ignoring strip" >> config.mak
echo "INSTALLSTRIP=" >> config.mak
@@ -1116,6 +1124,7 @@
echo "OPTFLAGS=$CFLAGS" >> config.mak
echo "SHCFLAGS=$SHCFLAGS">>config.mak
echo "LDFLAGS=$LDFLAGS" >> config.mak
+echo "SLDFLAGS=$SLDFLAGS" >> config.mak
echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
echo "SHFLAGS=$SHFLAGS" >> config.mak
echo "LIBPREF=$LIBPREF" >> config.mak
@@ -1247,6 +1256,11 @@
version=`grep '#define FFMPEG_VERSION '
"$source_path/libavcodec/avcodec.h" |
cut -d '"' -f 2`
echo "VERSION=$version" >>config.mak
+
+# Version guaranteed to be in x.y.z format
+version_numeric=`echo $version| sed
's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1.\2.\3/'`
+echo "VERSION_NUMERIC=$version_numeric" >>config.mak
+
# if you do not want to use encoders, disable that.
echo "#define CONFIG_ENCODERS 1" >> $TMPH
echo "CONFIG_ENCODERS=yes" >> config.mak
-----------
--- libavcodec/Makefile Sat Jan 22 12:52:00 2005
+++ libavcodec/Makefile copy Sat Feb 19 19:53:30 2005
@@ -222,7 +222,7 @@
$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS)
$(EXTRALIBS) $(AMREXTRALIBS)
-lib /machine:i386 /def:$(@:.dll=.def)
else
- $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
+ $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
$(LDFLAGS) $(SLDFLAGS)
endif

dsputil.o: dsputil.c dsputil.h
@@ -242,7 +242,7 @@
dep: depend

clean: $(CLEANAMR)
- rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
+ rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so *.dylib i386/*.o i386/*~
\
armv4l/*.o armv4l/*~ \
mlib/*.o mlib/*~ \
alpha/*.o alpha/*~ \
@@ -294,9 +294,16 @@
install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
else
install -d $(prefix)/lib
- install $(INSTALLSTRIP) -m 755 $(SLIB)
$(prefix)/lib/libavcodec-$(VERSION).so
- ln -sf libavcodec-$(VERSION).so $(prefix)/lib/libavcodec.so
+ifeq ($(CONFIG_DARWIN),yes)
+ifdef STRIP
+ $(STRIP) $(SLIB)
+endif
+endif
+ install $(INSTALLSTRIP) -m 755 $(SLIB)
$(prefix)/lib/libavcodec-$(VERSION_NUMERIC)$(SLIBSUF)
+ ln -sf libavcodec-$(VERSION_NUMERIC)$(SLIBSUF)
$(prefix)/lib/libavcodec$(SLIBSUF)
+ifeq ($(LDCONFIG),yes)
ldconfig || true
+endif
endif
ifeq ($(CONFIG_PP),yes)
$(MAKE) -C libpostproc $@
--- libavformat/Makefile Tue Jan 11 03:16:04 2005
+++libavformat/Makefile copy Sat Feb 19 19:54:38 2005
@@ -74,6 +74,7 @@

ifeq ($(CONFIG_VORBIS),yes)
OBJS+= ogg.o
+EXTRALIBS+=-logg
endif

ifeq ($(TARGET_ARCH_SPARC64),yes)
@@ -104,7 +105,7 @@
$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS)
$(PPOBJS) $(EXTRALIBS) $(VPATH)/../libavcodec/avcodec.dll
-lib /machine:i386 /def:$(@:.dll=.def)
else
- $(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS)
+ $(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS) $(LDFLAGS)
$(SLDFLAGS)
endif

depend: $(SRCS)
@@ -116,10 +117,17 @@
install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
else
install -d $(prefix)/lib
- install $(INSTALLSTRIP) -m 755 $(SLIB)
$(prefix)/lib/libavformat-$(VERSION).so
- ln -sf libavformat-$(VERSION).so $(prefix)/lib/libavformat.so
+ifeq ($(CONFIG_DARWIN),yes)
+ifdef STRIP
+ $(STRIP) $(SLIB)
+endif
+endif
+ install $(INSTALLSTRIP) -m 755 $(SLIB)
$(prefix)/lib/libavformat-$(VERSION_NUMERIC)$(SLIBSUF)
+ ln -sf libavformat-$(VERSION_NUMERIC)$(SLIBSUF)
$(prefix)/lib/libavformat$(SLIBSUF)
+ifeq ($(HAVE_LDCONFIG),yes)
ldconfig || true
endif
+endif
else
install:
endif
@@ -142,7 +150,7 @@
g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<

distclean clean:
- rm -f *.o *.d .depend *~ *.a *.so $(LIB)
+ rm -f *.o *.d .depend *~ *.a *.so *.dylib $(SLIB) $(LIB)

#
# include dependency files if they exist



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
Roine Gustafsson
2005-02-20 14:56:26 UTC
Permalink
Post by Iz Mir
Post by Roine Gustafsson
Post by Iz Mir
or strip -x /Users/me/Desktop/libavcodec.a
strip: symbols referenced by indirect symbol table entries that
can't be stripped in: /Users/me/Desktop/libavcodec.a(mpegvideo.o)
_sse_mb
_dct_quantize_refine
_encode_picture
ya know, I don't NEED it stripped.
Use -x for .dylibs, and no stripping for .a. Static libraries should
be stripped when the executable is built.
What? No stripping, but when you strip...? Plain strip doesn't do it
either.
Static libraries (.a): no stripping on the libav*.a. Stripping should
be done on the executable later.
Dynamic libraries (.dylib): strip with -x on the libav*.dylib.
Post by Iz Mir
Post by Roine Gustafsson
I think there is no reasonable value for compatibility_version, so
you should probably not set it. The source changes breaks binary
compatibility less frequently these days, so maybe setting it to
0.4.9 for the future would be a good idea.
Compat 1, current 0.4.9 still works as well as anything else - it just
looks odd. As long as it doesn't complain, do whatcha like.
Hmm, compatibility_version > current_version shouldn't work. It's has
no meaning anyway. comparibility_version should be set to the lowest
version that this library is backwards compatible with. For ffmpeg, I'm
hoping future releases will be binary compatible with 0.4.9.
Post by Iz Mir
Post by Roine Gustafsson
Post by Iz Mir
So please resend your patch.
Apparently GMane stores the attachments. Nice.
<http://article.gmane.org/gmane.comp.video.ffmpeg.devel/19357>
rm -f libavformat.a
ar rc libavformat.a utils.o cutils.o os_support.o allformats.o mpeg.o
mpegts.o mpegtsenc.o ffm.o crc.o img.o img2.o raw.o rm.o avienc.o
avidec.o wav.o swf.o au.o gif.o mov.o mpjpeg.o dv.o yuv4mpeg.o 4xm.o
flvenc.o flvdec.o movenc.o psxstr.o idroq.o ipmovie.o nut.o wc3movie.o
mp3.o westwood.o segafilm.o idcin.o flic.o sierravmd.o matroska.o
sol.o electronicarts.o nsvdec.o asf.o asf-enc.o pnm.o yuv.o png.o
jpeg.o gifdec.o sgi.o avio.o aviobuf.o file.o framehook.o udp.o
tcp.o http.o rtsp.o rtp.o rtpproto.o ogg.o
ranlib libavformat.a
cc -dynamiclib -o libavformat.dylib utils.o cutils.o os_support.o
allformats.o mpeg.o mpegts.o mpegtsenc.o ffm.o crc.o img.o img2.o
raw.o rm.o avienc.o avidec.o wav.o swf.o au.o gif.o mov.o mpjpeg.o
dv.o yuv4mpeg.o 4xm.o flvenc.o flvdec.o movenc.o psxstr.o idroq.o
ipmovie.o nut.o wc3movie.o mp3.o westwood.o segafilm.o idcin.o flic.o
sierravmd.o matroska.o sol.o electronicarts.o nsvdec.o asf.o asf-enc.o
pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o avio.o aviobuf.o file.o
framehook.o udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o ogg.o
-L/opt/local/lib -lz -lavcodec -L../libavcodec -lmp3lame
-Wl,-search_paths_first
-Wl,-current_version,0.4.9,-install_name,/usr/local/lib/
libavformat.dylib
ld: warning prebinding disabled because of undefined symbols
_ogg_page_serialno
_ogg_stream_clear
_ogg_stream_flush
_ogg_stream_init
_ogg_stream_packetin
_ogg_stream_packetout
_ogg_stream_pagein
_ogg_stream_pageout
_ogg_sync_buffer
_ogg_sync_clear
_ogg_sync_init
_ogg_sync_pageout
/usr/bin/libtool: internal link edit command failed
There is no -logg in your patch.
No, my patch was about dynamic libraries on Mac OS X, not fixing ogg.
Post by Iz Mir
• I think prefix is being used too early, and set too late for the
prefix=/opt/local
SLDFLAGS=-Wl,-current_version,$(VERSION_NUMERIC),-install_name,/usr/
local/lib/$(SLIB)
\$(prefix) then? I didn't even know a variable could be passed through
like that.
Good spotting. Yes, set too early and \$(prefix) works instead.
Post by Iz Mir
->• The static libraries (libavformat.a & libavcodec.a) aren't
installed, just built and forgotten. (one last thing to do)
For some reason they are not installed with "make install" but "make
installlib" should install the static ones.
Post by Iz Mir
• When I had a 1 day old library installed already, and using these
new patches I saw tons of "using something from path/*.dylib not from
path/*.dylib" errors. All anyone had to do is remove the libxx.dylib,
but I just hadn't come across this with the previous patches.
Can you copy down the text? When in the build process does that happen?
I can see from the ogg example above that -L/opt/local/lib is *before*
-L./libavcodec, which means it may find the old library first.
This should not be a problem providing you install the new libraries
before using the executable.
Post by Iz Mir
And the libraries aren't stripped.
+ifeq ($(CONFIG_DARWIN),yes)
+ifdef STRIP
+ $(STRIP) $(SLIB)
+endif
+endif
or something like a DARWIN_DYLIB_STRIP to config.mak.
STRIP is always defined so the if is unneccesary. And I really don't
like the CONFIG_DARWIN in Makefile, which shouldn't be needed anyway.
IMO, the $(STRIP) $(SLIB) should be there, but I don't know for what
reason it isn't. Maybe for debug purposes? Maybe we need a
libavcodec_debug.dylib?

Anyway, here's my suggestion

+ifndef INSTALLSTRIP
+ $(STRIP) $(SLIB)
+endif

Which will strip the library whenever it is not stripped with install.
And if no strip is wanted, $STRIP is just "echo no stripping done".
Post by Iz Mir
• "make test" has the same results (wmv2 & mpeg4 have some problems).
No, it's supposed to look that way.
Post by Iz Mir
And libquicktime picks up libavcodec - it just brings a tear to my
eye. It's a thing of booty.
A muxer library depends on a codec library? Meshegas.
Post by Iz Mir
Your patches are great. Thanks for seeing it through. So here are the
I agree with everything but the stripping part, and the -logg part
should be saved for a later ogg patch.

/Roine



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
Iz Mir
2005-02-22 06:12:15 UTC
Permalink
Post by Roine Gustafsson
->• The static libraries (libavformat.a & libavcodec.a) aren"t
installed, just built and forgotten. (one last thing to do)
For some reason they are not installed with "make install" but "make
installlib" should install the static ones.
• When I had a 1 day old library installed already, and using these
new patches I saw tons of "using something from path/*.dylib not
from
path/*.dylib" errors. All anyone had to do is remove the
libxx.dylib,
but I just hadn"t come across this with the previous patches.
Can you copy down the text? When in the build process does that
happen?
I can see from the ogg example above that -L/opt/local/lib is *before*
-L./libavcodec, which means it may find the old library first.
This should not be a problem providing you install the new libraries
before using the executable.
"-L/opt/local/lib" is there because '--extra-libs="-L${prefix}/lib"' is
passed to configure, so maybe you are right about that - it does NEED
to be there, just not first. It doesn't happen every time though - its
odd. But here is one time it did happen:

------------------------
cc -O3 -g -Wall -Wno-switch -I/opt/local/include -fno-common
-no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL
-Wno-sign-compare -faltivec -I.
-I'/Users/me/darwinports/localports/multimedia/ffmpeg/work/ffmpeg
-0.4.9-pre5'
-I'/Users/me/darwinports/localports/multimedia/ffmpeg/work/ffmpeg
-0.4.9-pre5'/libavcodec
-I'/Users/me/darwinports/localports/multimedia/ffmpeg/work/ffmpeg
-0.4.9-pre5'/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_GNU_SOURCE -c -o ffmpeg.o ffmpeg.c
ffmpeg.c: In function `opt_target':
ffmpeg.c:3743: warning: duplicate `const'
cc -Wl,-search_paths_first -g -o ffmpeg_g ffmpeg.o cmdutils.o
-L./libavformat -lavformat -L./libavcodec -lavcodec -L/opt/local/lib
-lz -lvorbis -lvorbisenc -logg -lxvidcore
ld: warning prebinding disabled because dependent library:
/Users/me/darwinports/localports/multimedia/ffmpeg/work/destroot/opt/
local/lib/libavformat.dylib is not prebound
ld: warning multiple definitions of symbol _ff_h263_chroma_qscale_table
/opt/local/lib/libavcodec.dylib(h263.o) definition of
_ff_h263_chroma_qscale_table
[...150 or more like this..]
ld: warning multiple definitions of symbol _mpa_huffbits_11
/opt/local/lib/libavcodec.dylib(mpegaudiodec.o) definition of
_mpa_huffbits_11
./libavcodec/libavcodec.dylib(mpegaudiodec.o) definition of
_mpa_huffbits_11
ld: warning suggest use of -bind_at_load, as lazy binding may result in
errors or different symbols being used
symbol _av_first_parser used from dynamic library
/opt/local/lib/libavcodec.dylib(parser.o) not from earlier dynamic
library
/Users/me/darwinports/localports/multimedia/ffmpeg/work/destroot/opt/
local/lib/libavcodec.dylib(parser.o)
[...150 or more like this..]
cp -p ffplay_g ffplay
strip -x ffplay
cc -O3 -g -Wall -Wno-switch -I/opt/local/include -fno-common
-no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL
-Wno-sign-compare -faltivec -I.
-I'/Users/me/darwinports/localports/multimedia/ffmpeg/work/ffmpeg
-0.4.9-pre5'
-I'/Users/me/darwinports/localports/multimedia/ffmpeg/work/ffmpeg
-0.4.9-pre5'/libavcodec
-I'/Users/me/darwinports/localports/multimedia/ffmpeg/work/ffmpeg
-0.4.9-pre5'/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_GNU_SOURCE -c -o output_example.o output_example.c
output_example.c: In function `write_audio_frame':
output_example.c:143: warning: unused variable `out_size'
cc -Wl,-search_paths_first -g -o output_example output_example.o
-L./libavformat -lavformat -L./libavcodec -lavcodec -L/opt/local/lib
-lz -lvorbis -lvorbisenc -logg -lxvidcore
ld: warning prebinding disabled because dependent library:
/Users/me/darwinports/localports/multimedia/ffmpeg/work/destroot/opt/
local/lib/libavformat.dylib is not prebound
ld: warning multiple definitions of symbol _ff_h263_chroma_qscale_table
/opt/local/lib/libavcodec.dylib(h263.o) definition of
_ff_h263_chroma_qscale_table
./libavcodec/libavcodec.dylib(h263.o) definition of
_ff_h263_chroma_qscale_table
[.....and again we go through it all for ffplay & output_example.....]
------------------------------------
but it doesn't happen very often - like I said, odd.
Post by Roine Gustafsson
Anyway, here"s my suggestion
+ifndef INSTALLSTRIP
+ $(STRIP) $(SLIB)
+endif
Which will strip the library whenever it is not stripped with install.
And if no strip is wanted, $STRIP is just "echo no stripping done".
the substitute patch above works fine.
Post by Roine Gustafsson
And libquicktime picks up libavcodec - it just brings a tear to my
eye. It"s a thing of booty.
A muxer library depends on a codec library? Meshegas.
Hey, it's not like I've ever seen -lavcodec before on my Mac. You're
just too jaded. You and your little-endian platform. Oy!
Post by Roine Gustafsson
Your patches are great. Thanks for seeing it through. So here are
the
I agree with everything but the stripping part, and the -logg part
should be saved for a later ogg patch.
Sure, an ogg and a a52 patch too - because --enable-a52 doesn't build
cleanly either (at least with -enable=shared).

Anyway, I also compiled the static ffmpeg binary. It too passes
regression tests like everything else.
Roine Gustafsson
2005-02-22 09:43:24 UTC
Permalink
Post by Iz Mir
Post by Iz Mir
Post by Iz Mir
• When I had a 1 day old library installed already, and using these
new patches I saw tons of "using something from path/*.dylib not
from
Post by Iz Mir
path/*.dylib" errors. All anyone had to do is remove the
libxx.dylib,
Post by Iz Mir
but I just hadn"t come across this with the previous patches.
Can you copy down the text? When in the build process does that
happen?
I can see from the ogg example above that -L/opt/local/lib is *before*
-L./libavcodec, which means it may find the old library first.
This should not be a problem providing you install the new libraries
before using the executable.
"-L/opt/local/lib" is there because '--extra-libs="-L${prefix}/lib"'
is passed to configure, so maybe you are right about that - it does
NEED to be there, just not first. It doesn't happen every time though
------------------------
cc -O3 -g -Wall -Wno-switch -I/opt/local/include -fno-common
-no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL
-Wno-sign-compare -faltivec -I.
-I'/Users/me/darwinports/localports/multimedia/ffmpeg/work/ffmpeg
-0.4.9-pre5'
-I'/Users/me/darwinports/localports/multimedia/ffmpeg/work/ffmpeg
-0.4.9-pre5'/libavcodec
-I'/Users/me/darwinports/localports/multimedia/ffmpeg/work/ffmpeg
-0.4.9-pre5'/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_GNU_SOURCE -c -o ffmpeg.o ffmpeg.c
ffmpeg.c:3743: warning: duplicate `const'
cc -Wl,-search_paths_first -g -o ffmpeg_g ffmpeg.o cmdutils.o
-L./libavformat -lavformat -L./libavcodec -lavcodec -L/opt/local/lib
-lz -lvorbis -lvorbisenc -logg -lxvidcore
/Users/me/darwinports/localports/multimedia/ffmpeg/work/destroot/opt/
local/lib/libavformat.dylib is not prebound
Hmm, we should give it a pre-binding address too...
Post by Iz Mir
ld: warning multiple definitions of symbol _ff_h263_chroma_qscale_table
/opt/local/lib/libavcodec.dylib(h263.o) definition of
_ff_h263_chroma_qscale_table
[...150 or more like this..]
ld: warning multiple definitions of symbol _mpa_huffbits_11
/opt/local/lib/libavcodec.dylib(mpegaudiodec.o) definition of
_mpa_huffbits_11
./libavcodec/libavcodec.dylib(mpegaudiodec.o) definition of
_mpa_huffbits_11
I think this is due to the fact that libavformat already links to
libavcodec, so when libavcodec is linked alot of dupe symbols will show
up.
Can you try switching the link order, eg

-L./libavcodec -lavcodec -L./libavformat -lavformat

and see if it fixes it?

I used to see alot of these too, but haven't for a while. I don't like
"random" things...
Post by Iz Mir
ld: warning suggest use of -bind_at_load, as lazy binding may result
in errors or different symbols being used
maybe -bind_at_load is the answer...

[...]
Post by Iz Mir
------------------------------------
but it doesn't happen very often - like I said, odd.
Post by Iz Mir
Post by Iz Mir
And libquicktime picks up libavcodec - it just brings a tear to my
eye. It"s a thing of booty.
A muxer library depends on a codec library? Meshegas.
Hey, it's not like I've ever seen -lavcodec before on my Mac. You're
just too jaded. You and your little-endian platform. Oy!
Um, I have a Mac too?
Post by Iz Mir
Post by Iz Mir
Post by Iz Mir
Your patches are great. Thanks for seeing it through. So here are
the
I agree with everything but the stripping part, and the -logg part
should be saved for a later ogg patch.
Sure, an ogg and a a52 patch too - because --enable-a52 doesn't build
cleanly either (at least with -enable=shared).
Doesn't this work on x86? Anybody using shared libs? Hellooo?
Post by Iz Mir
Anyway, I also compiled the static ffmpeg binary. It too passes
regression tests like everything else.
And "make installlib" works too?

/Roine



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
Iz Mir
2005-02-24 03:14:29 UTC
Permalink
Post by Roine Gustafsson
Post by Iz Mir
/Users/me/darwinports/localports/multimedia/ffmpeg/work/destroot/opt/
local/lib/libavformat.dylib is not prebound
Hmm, we should give it a pre-binding address too...
If you can figure out how to do it without touching the makefile. This
doesn't work:
ranlib libavformat.a
cc -dynamiclib -o libavformat.dylib utils.o [therest] ogg.o
-L/opt/local/lib -lz -logg -lavcodec -L../libavcodec -lmp3lame
-Wl,-search_paths_first
-Wl,-prebind,-current_version,0.4.9,-install_name,/Users/me/
darwinports/localports/multimedia/ffmpeg/work/destroot/opt/local/lib/
libavformat.dylib

otool -hv libavformat.dylib
Mach header
magic cputype cpusubtype filetype ncmds sizeofcmds flags
MH_MAGIC PPC ALL DYLIB 12 1636 NOUNDEFS
DYLDLINK TWOLEVEL

Prebinding isn't all that important. So ffmpeg launches a little slower.
Post by Roine Gustafsson
Can you try switching the link order, eg
-L./libavcodec -lavcodec -L./libavformat -lavformat
and see if it fixes it?
It hasn't happened in 3 compiles.
Post by Roine Gustafsson
I used to see alot of these too, but haven't for a while. I don't like
"random" things...
Post by Iz Mir
ld: warning suggest use of -bind_at_load, as lazy binding may result
in errors or different symbols being used
maybe -bind_at_load is the answer...
this warning doesn't happen on a proper compile.
Post by Roine Gustafsson
And "make installlib" works too?
My portfile has this (and yes, it does work, static libs are in
destroot):
# Enable shared library libavcodec & libavformat
variant shared {
configure.args-append --enable-shared
destroot.target install installlib
}

but there would need to be some sort of note somewhere saying to do
that, unless they read this quagmire of a thread.



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Roine Gustafsson
2005-02-24 14:41:06 UTC
Permalink
Post by Iz Mir
Post by Roine Gustafsson
Post by Iz Mir
/Users/me/darwinports/localports/multimedia/ffmpeg/work/destroot/
opt/local/lib/libavformat.dylib is not prebound
Hmm, we should give it a pre-binding address too...
If you can figure out how to do it without touching the makefile. This
ranlib libavformat.a
cc -dynamiclib -o libavformat.dylib utils.o [therest] ogg.o
-L/opt/local/lib -lz -logg -lavcodec -L../libavcodec -lmp3lame
-Wl,-search_paths_first
-Wl,-prebind,-current_version,0.4.9,-install_name,/Users/me/
darwinports/localports/multimedia/ffmpeg/work/destroot/opt/local/lib/
libavformat.dylib
otool -hv libavformat.dylib
Mach header
magic cputype cpusubtype filetype ncmds sizeofcmds flags
MH_MAGIC PPC ALL DYLIB 12 1636 NOUNDEFS
DYLDLINK TWOLEVEL
AFAIK the way to do it is to supply a prebinding address. More info
here:
<http://developer.apple.com/documentation/MacOSX/Conceptual/
BPFrameworks/Concepts/FrameworkBinding.html>
<http://developer.apple.com/documentation/Performance/Conceptual/
LaunchTime/Tasks/Prebinding.html>

Never tried it myself tho.
Post by Iz Mir
Prebinding isn't all that important. So ffmpeg launches a little slower.
Yup. AFAIR there's a background thread that should fix prebinding on
non-prebound executables after three launches.
Post by Iz Mir
Post by Roine Gustafsson
Can you try switching the link order, eg
-L./libavcodec -lavcodec -L./libavformat -lavformat
and see if it fixes it?
It hasn't happened in 3 compiles.
You mean you tried it and it seems to work?
Post by Iz Mir
Post by Roine Gustafsson
I used to see alot of these too, but haven't for a while. I don't
like "random" things...
Post by Iz Mir
ld: warning suggest use of -bind_at_load, as lazy binding may result
in errors or different symbols being used
maybe -bind_at_load is the answer...
this warning doesn't happen on a proper compile.
What is "proper" compile? After e.g. "make distclean && make"?
Post by Iz Mir
Post by Roine Gustafsson
And "make installlib" works too?
My portfile has this (and yes, it does work, static libs are in
# Enable shared library libavcodec & libavformat
variant shared {
configure.args-append --enable-shared
destroot.target install installlib
}
but there would need to be some sort of note somewhere saying to do
that, unless they read this quagmire of a thread.
"variant shared" would not need "installlib" which installs the static
library, no?
I assume you have something like "variant static" too?

With all your newfangled knowledge in ffmpeg, can you to make an
updated port for Fink too? The current is 0.4.8 AFAIR.

/Roine



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

Loading...