[PATCH][Ffmpeg-devel] Compilation Issue
Alexander Strasser
eclipse7
Sat Sep 24 23:21:38 CEST 2005
Hi,
Michel Bardiaux wrote:
> Jan-Willem Mulder wrote:
>
> Please dont top post.
>
> >only problem I have is that --enable-shared does not work as expected
> >anymore when building with mingw.
> >before libavutil was added ffmpeg.exe for example was about 150k,
> >libavformat 400k and libavcodec 2500k. After libavutil was added (and
> >current cvs) ffmpeg.exe results in 3200k, libavutil 35k, libavcodec 2500k,
> >libavformat 3000k. It seems that it is all staticly linked.
> > darkie.
AFAIK there were some problems even before I added libavutil.
> Indeed:
>
> nm -Bo libavformat/avformat.dll | fgrep ' U '
>
> returns empty. Definitely broken.
>
> I was able to work around it by changing some lines in the Makefiles,
> see attached patch. Of course this is *only* for DLLs. How to write
> things exactly so that the shared or static libs are used for the links
> requires more familiarity with the Makefiles than I have. (Someone will
> maybe point out that the autotools would not have made that mistake...)
I tried to work out a solution today. The attached patch is what
I have so far, it may not be the best solution but i think it is
better than before. Please test (on all platforms).
[...]
Alex (beastd)
-------------- next part --------------
Index: libavutil/Makefile
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavutil/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- libavutil/Makefile 6 Aug 2005 10:03:08 -0000 1.2
+++ libavutil/Makefile 24 Sep 2005 20:29:52 -0000
@@ -34,7 +34,7 @@
$(SLIB): $(OBJS)
ifeq ($(CONFIG_WIN32),yes)
- $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
+ $(CC) $(SHFLAGS) -Wl,--enable-runtime-pseudo-reloc,--output-def,$(@:.dll=.def),--out-implib,$(LIB:.a=.dll.a) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
-lib /machine:i386 /def:$(@:.dll=.def)
else
$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
@@ -49,7 +49,7 @@
dep: depend
clean:
- rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so
+ rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so *.def *.dll.a *.exp
distclean: clean
rm -f Makefile.bak .depend
Index: libavcodec/Makefile
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/Makefile,v
retrieving revision 1.201
diff -u -r1.201 Makefile
--- libavcodec/Makefile 10 Sep 2005 23:00:13 -0000 1.201
+++ libavcodec/Makefile 24 Sep 2005 20:29:52 -0000
@@ -404,7 +404,7 @@
$(MAKE) -C libpostproc
endif
ifeq ($(CONFIG_WIN32),yes)
- $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
+ $(CC) $(SHFLAGS) -Wl,--enable-runtime-pseudo-reloc,--output-def,$(@:.dll=.def),--out-implib,$(LIB:.a=.dll.a) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS)
-lib /machine:i386 /def:$(@:.dll=.def)
else
$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(AMREXTRALIBS) $(LDFLAGS)
@@ -427,7 +427,8 @@
dep: depend
clean: $(CLEANAMR)
- rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
+ rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so *.def *.dll.a *.exp \
+ i386/*.o i386/*~ \
armv4l/*.o armv4l/*~ \
mlib/*.o mlib/*~ \
alpha/*.o alpha/*~ \
Index: libavformat/Makefile
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/Makefile,v
retrieving revision 1.99
diff -u -r1.99 Makefile
--- libavformat/Makefile 2 Sep 2005 19:18:59 -0000 1.99
+++ libavformat/Makefile 24 Sep 2005 20:29:52 -0000
@@ -100,7 +100,7 @@
$(SLIB): $(OBJS)
ifeq ($(CONFIG_WIN32),yes)
- $(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
+ $(CC) $(SHFLAGS) -Wl,--enable-runtime-pseudo-reloc,--output-def,$(@:.dll=.def),--out-implib,$(LIB:.a=.dll.a) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
-lib /machine:i386 /def:$(@:.dll=.def)
else
$(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
@@ -143,7 +143,7 @@
g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
distclean clean:
- rm -f *.o *.d .depend *~ *.a *.so $(LIB)
+ rm -f *.o *.d .depend *~ *.a *.so $(LIB) $(SLIB) *.def *.dll.a *.exp
#
# include dependency files if they exist
More information about the ffmpeg-devel
mailing list