]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Added FFmpeg omkize script
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Mon, 25 May 2009 10:18:04 +0000 (12:18 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Mon, 25 May 2009 10:18:04 +0000 (12:18 +0200)
ffmpeg-omkize.sh [new file with mode: 0755]

diff --git a/ffmpeg-omkize.sh b/ffmpeg-omkize.sh
new file mode 100755 (executable)
index 0000000..eb9d60c
--- /dev/null
@@ -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