From f856ee8df0b7eb95a77190ba186be5322c523dfc Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Mon, 25 May 2009 12:18:04 +0200 Subject: [PATCH] Added FFmpeg omkize script --- ffmpeg-omkize.sh | 78 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100755 ffmpeg-omkize.sh diff --git a/ffmpeg-omkize.sh b/ffmpeg-omkize.sh new file mode 100755 index 000000000..eb9d60c88 --- /dev/null +++ b/ffmpeg-omkize.sh @@ -0,0 +1,78 @@ +SUBDIRS_LIB="libavcodec libavdevice libavfilter libavformat libavutil libpostproc" +SUBDIRS_MORE="libswscale" + +function create_omk () { + f=$1 + fomk=$2 + + rm -f $fomk + cat >$fomk <<"EOF" +include $(srcdir)/../config.mak-omk + +EOF + cat $f/Makefile | \ + grep -v '^include' | \ + sed -e 's/\.o\>/.c/g' \ + -e 's/\(YASM.*\)\.c/\1.asm/g' \ + -e 's/x86\/h264_idct_sse2.c/x86\/h264_idct_sse2.asm/g' \ + >>$fomk + + if [ "$f" == "libavcodec" ] ; then + cat >>$fomk <<"EOF" + +OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes) $(MMX-OBJS-y) + +SUBDIRS=x86 + +EOF + touch $f/x86/Makefile.omk + git add $f/x86/Makefile.omk + fi + cat >>$fomk <<"EOF" +lib_LIBRARIES:=$(NAME) +$(NAME)_SOURCES:=$(OBJS) $(OBJS-y) $(OBJS-yes) +renamed_include_HEADERS:=$(foreach h,$(HEADERS),$(h)->lib$(NAME)/$(h) ) +INCLUDES += -I $(srcdir)/.. +EOF + git add $fomk + + return +} + +if [ ! -e Makefile.omk ] ; then + + echo "SUBDIRS=$SUBDIRS_LIB $SUBDIRS_MORE" >Makefile.omk + + git add Makefile.omk + + for f in $SUBDIRS_LIB ; do + rm -f $f/Makefile.omk + cp $f/Makefile $f/Makefile.omk + git add $f/Makefile.omk + done + + git commit -m "Added copies of makefiles for OMK build." + +fi + +if [ ! -e libswscale/Makefile.omk ] ; then + + for f in $SUBDIRS_MORE ; do + mkdir -p $f-omk + rm -f $f-omk/Makefile.omk + cp $f/Makefile $f-omk/Makefile.omk + ( cd $f ; ln -sf ../$f-omk/Makefile.omk Makefile.omk ) + git add $f-omk/Makefile.omk + done + + git commit -m "Added copy of libswscale/Makefile for omkization." + +fi + +for f in $SUBDIRS_LIB ; do + create_omk $f $f/Makefile.omk +done + +for f in $SUBDIRS_MORE ; do + create_omk $f $f-omk/Makefile.omk +done -- 2.39.2