[Ffmpeg-devel] [PATCH] Cygwin vhook, always static avformat

Diego Biurrun diego
Thu Jul 13 23:25:37 CEST 2006


On Thu, Jul 13, 2006 at 08:55:49PM +0200, wzrlpy at arsystel.com wrote:
> 
> Here is attached the next attempt of patch:
> 
> >>> +SLIBSUF=".dll"
> >>> +SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
> >>> +SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
> >>> +SHFLAGS='-shared
> >>> -Wl,--out-implib=lib$(NAME).dll.a,--export-all-symbols,--enable-auto-import'
> >>
> >> OK, assuming the odd-looking (in my Unix eyes) SHFLAGS is correct.
> > Yes, it is correct, in the sense that the build succeeds. But I'am afraid
> > it
> > is yet incomplete, I forgot the --no-whole-archive option, so that
> > symbols in dependency libraries are not exported multiple times.
> Finally I removed the "--export-all-symbols,--enable-auto-import", they
> are set by default under Cygwin.

We seem to be getting somewhere after all...

First off, please split your patch in two parts: one for the vhook issue
and one for the shared lib support under Cygwin.

> --- ffmpeg-old/configure	2006-07-12 17:55:48.000000000 +0200
> +++ ffmpeg/configure	2006-07-13 20:08:25.093750000 +0200
> @@ -328,6 +328,7 @@
>  logfile="config.err"
>  prefix="/usr/local"
>  libdir=""
> +shlibdir='$(libdir)'

Why not simply $libdir?

> @@ -1573,6 +1579,7 @@
>  echo "libdir=\$(DESTDIR)$libdir" >> config.mak
>  echo "incdir=\$(DESTDIR)$incdir" >> config.mak
>  echo "bindir=\$(DESTDIR)$bindir" >> config.mak
> +echo "shlibdir=$shlibdir" >> config.mak
>  echo "mandir=\$(DESTDIR)$mandir" >> config.mak

And at this point it becomes confusing.  It's correct because you used a
Makefile variable, but it's just ugly to have one line differ from the
others here...

> --- ffmpeg-old/vhook/Makefile	2006-07-12 17:55:48.000000000 +0200
> +++ ffmpeg/vhook/Makefile	2006-07-13 18:07:12.968750000 +0200
> @@ -5,6 +5,13 @@
>  CFLAGS=-fPIC $(SHCFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavformat \
>         -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavutil -DHAVE_AV_CONFIG_H
>  
> +ifeq ($(TARGET_OS),CYGWIN)
> +    EXTRALIBS := -Wl,--no-whole-archive \
> +                 -L../libavformat -lavformat$(BUILDSUF) \
> +                 -L../libavcodec  -lavcodec$(BUILDSUF)  \
> +                 -L../libavutil   -lavutil$(BUILDSUF) $(EXTRALIBS)
> +endif
> +
>  #FIXME: This needs to be in configure/config.mak
>  ifeq ($(CONFIG_DARWIN),yes)
>  	SHFLAGS = -dynamiclib -Wl,-single_module -flat_namespace \

This is hackish, then again, we already have this other FIXME for Darwin
there.  The vhook build needs to be overhauled, but this is not
necessarily for you to solve..

> @@ -14,13 +21,13 @@
>  
>  ifeq ($(HAVE_IMLIB2),yes)
>      HOOKS += imlib2$(SLIBSUF)
> -    LDFLAGS += -lImlib2
> +    EXTRALIBS += -lImlib2
>  endif

Remind me why this is necessary...

Diego




More information about the ffmpeg-devel mailing list