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

Måns Rullgård mru
Tue Jul 11 01:11:12 CEST 2006


wzrlpy at arsystel.com writes:

> Hi,
>
> Another attempt, adapted to SVN-5704, most things are being moved to
> configure/config.mak, hopefully in a less intrusive way:
>
> http://usuarios.arsystel.com/wzrlpy/ffmpeg/ffmpeg.cygwin.vhook.4.patch
> The patch is also attached.
>
> The loop input patch remains the same (awaiting comments):
> http://usuarios.arsystel.com/wzrlpy/ffmpeg/ffmpeg.cygwin.loop_input.2.patch
>
> Regards,
> V?ctor Paesa
>
> diff -Naur ffmpeg-old/common.mak ffmpeg/common.mak
> --- ffmpeg-old/common.mak	2006-07-10 09:42:00.000000000 +0200
> +++ ffmpeg/common.mak	2006-07-11 00:08:04.218750000 +0200
> @@ -65,11 +65,11 @@
>  	install $(INSTALLSTRIP) -m 755 $(SLIBNAME) "$(prefix)"
>  else
>  	install $(INSTALLSTRIP) -m 755 $(SLIBNAME) \
> -		$(libdir)/$(SLIBNAME_WITH_VERSION)
> +		$(shlibdir)/$(SLIBNAME_WITH_VERSION)
>  	ln -sf $(SLIBNAME_WITH_VERSION) \
> -		$(libdir)/$(SLIBNAME_WITH_MAJOR)
> +		$(shlibdir)/$(SLIBNAME_WITH_MAJOR)
>  	ln -sf $(SLIBNAME_WITH_VERSION) \
> -		$(libdir)/$(SLIBNAME)
> +		$(shlibdir)/$(SLIBNAME)
>  endif

OK

>  install-lib-static: $(LIB)
> diff -Naur ffmpeg-old/configure ffmpeg/configure
> --- ffmpeg-old/configure	2006-07-10 09:41:59.000000000 +0200
> +++ ffmpeg/configure	2006-07-11 00:17:18.984375000 +0200
> @@ -319,6 +319,7 @@
>  logfile="config.err"
>  prefix="/usr/local"
>  libdir=""
> +shlibdir=""
>  incdir=""
>  mandir=""
>  bindir=""

OK

> @@ -582,10 +583,14 @@
>  v4l2="no"
>  audio_oss="yes"
>  dv1394="no"
> -vhook="no"

Somewhat unrelated.

>  extralibs=""
>  cygwin="yes"
>  EXESUF=".exe"
> +SLIBPREF="cyg"

Why?  I'm not saying it's wrong, I just don't know.

> +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.

> @@ -1462,6 +1467,12 @@
>      libdir="${prefix}/lib"
>  fi
>  
> +if test "$TARGET_OS" = "CYGWIN" ; then
> +    shlibdir="${bindir}"
> +else
> +    shlibdir="${libdir}"
> +fi

This should be done along with other platform specific setup.

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

OK

> @@ -1930,6 +1942,15 @@
>    echo "#endif" >> $TMPH
>  fi
>  
> +if test "$TARGET_OS" = "CYGWIN" ; then
> +  echo 'ifeq ($(MAKEFILE_NAME),MAKEFILE_VHOOK)' >> config.mak
> +  echo '    EXTRALIBS := -L../libavformat -lavformat$(BUILDSUF) \' >> config.mak
> +  echo '                 -L../libavcodec  -lavcodec$(BUILDSUF)  \' >> config.mak
> +  echo '                 -L../libavutil   -lavutil$(BUILDSUF) $(EXTRALIBS) ' >> config.mak
> +  echo '    SHFLAGS=-shared -Wl,--export-all-symbols,--enable-auto-import' >> config.mak
> +  echo 'endif' >> config.mak
> +fi

Rejected.  This belongs in vhook/Makefile, except the SHFLAGS part,
which should be combined with the other cygwin SHFLAGS somehow.

> diff -Naur ffmpeg-old/vhook/Makefile ffmpeg/vhook/Makefile
> --- ffmpeg-old/vhook/Makefile	2006-07-06 21:25:35.000000000 +0200
> +++ ffmpeg/vhook/Makefile	2006-07-11 00:22:06.921875000 +0200
> @@ -1,3 +1,5 @@
> +MAKEFILE_NAME = MAKEFILE_VHOOK
> +

See above.

>  include ../config.mak
>  
>  VPATH=$(SRC_PATH)/vhook
> @@ -14,13 +16,13 @@
>  
>  ifeq ($(HAVE_IMLIB2),yes)
>      HOOKS += imlib2$(SLIBSUF)
> -    LDFLAGS += -lImlib2
> +    EXTRALIBS += -lImlib2
>  endif
>  
>  ifeq ($(HAVE_FREETYPE2),yes)
>      HOOKS += drawtext$(SLIBSUF)
>      CFLAGS += `freetype-config --cflags`
> -    LDFLAGS += `freetype-config --libs`
> +    EXTRALIBS += `freetype-config --libs`
>  endif

Unrelated, but OK.

>  all: $(HOOKS)
> @@ -31,16 +33,16 @@
>  	$(CC) -MM $(CFLAGS) $^ 1>.depend
>  
>  install: $(HOOKS)
> -	install -d "$(libdir)/vhook"
> -	install -m 755 $(HOOKS) "$(libdir)/vhook"
> +	install -d "$(shlibdir)/vhook"
> +	install -m 755 $(HOOKS) "$(shlibdir)/vhook"

OK

>  ALLHOOKS=$(HOOKS) imlib2$(SLIBSUF) drawtext$(SLIBSUF)
>  uninstall:
> -	rm -f $(addprefix $(libdir)/vhook/,$(ALLHOOKS))
> -	-rmdir "$(libdir)/vhook/"
> +	rm -f $(addprefix $(shlibdir)/vhook/,$(ALLHOOKS))
> +	-rmdir "$(shlibdir)/vhook/"

OK

>  %$(SLIBSUF): %.o
> -	$(CC) $(LDFLAGS) -g -o $@ $(SHFLAGS) $<
> +	$(CC) $(LDFLAGS) -g -o $@ $(SHFLAGS) $< $(EXTRALIBS)

OK

I think this can be made to work.

-- 
M?ns Rullg?rd
mru at inprovide.com




More information about the ffmpeg-devel mailing list