hi all, with the help of Pierre Dumuid, i wrote the following patches to make cinelerra compatible, by now, with i586 and powerpc. (other archs may come easily, as sparc, alpha, powerpc64 and mips).
there are four patches: - avcmakefile-fix.diff: fix the Makefile.am of quicktime/ffmpeg/libavcodec/ to include conditional for powerpc processor. TODO - put altivec conditional - configure-fix.diff: fix configure.in - added a call to quicktime/ffmpeg/configure to generate architecture coerent quicktime/ffmpeg/avconfig.h (exatly the same of the old static avconfig.h w/ arch things!). TODO - just a warning: do not use --enable-altivec yet! - ffconfigure-fix.diff: fix quicktime/ffmpeg/configure - small fixes and now it generates avconfig.h directly - ppcmakefileam-fix.diff: added a Makefile.am file in quicktime/ffmpeg/libavcodec/ppc. TODO - put altivec files to compile when altivec is enabled here it generated correct code for both i386 and ppc. altivec is to come. bye, rafael diniz -- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Eng. da Computação @ Unicamp Radio Muda, radiolivre.org, Centro de Mídia Independente Chave PGP: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x2FF86098 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Index: configure.in =================================================================== --- configure.in (revision 946) +++ configure.in (working copy) @@ -288,11 +288,33 @@ [ enable_altivec=$enableval ], [ enable_altivec=no ]) +############# QUICKTIME (this generates avconfig.h) +# arguments defined that seem to match the avconfig.h as of 2006-10-26 when it was static.. + +ff_conf_args=" " + +# Where altivec is not present +if test "x$enable_altivec" = "xno"; then + ff_conf_args="$ff_conf_args --disable-altivec" +fi + +srcdir_c=$(readlink -f $srcdir) +mkdir -p quicktime/ffmpeg/ > /dev/null 2>&1 +cd quicktime/ffmpeg/ +echo --- QUICKTIME CONFIGURATION SECTION -------------- +echo $ff_conf_args +./configure $ff_conf_args +echo -------------------------------------------------- +cd ../../ +############# END QUICKTIME configure (this generates avconfig.h) + + enable_mmx=no enable_3dnow=no enable_powerpc=no enable_altivec=no + case "$target_cpu" in i586 | i686) enable_mmx=yes @@ -397,7 +419,6 @@ ############## END of .png TO .o CONVERSION - AC_OUTPUT(Makefile cinelerra-cvs-current.spec po/Makefile.in \ m4/Makefile \ libmpeg3/Makefile libmpeg3/video/Makefile libmpeg3/audio/Makefile \ @@ -406,6 +427,7 @@ quicktime/ffmpeg/Makefile \ quicktime/ffmpeg/libavcodec/Makefile \ quicktime/ffmpeg/libavcodec/i386/Makefile \ + quicktime/ffmpeg/libavcodec/ppc/Makefile \ mpeg2enc/Makefile toolame-02l/Makefile \ guicast/Makefile cinelerra/Makefile \ cinelerra/data/Makefile \
Index: quicktime/ffmpeg/libavcodec/Makefile.am =================================================================== --- quicktime/ffmpeg/libavcodec/Makefile.am (revision 946) +++ quicktime/ffmpeg/libavcodec/Makefile.am (working copy) @@ -8,6 +8,11 @@ endif endif +if TARGET_ARCH_POWERPC +MM_DIR = ppc +MM_LIB = ppc/libavcodecppc.la +endif + SUBDIRS = $(MM_DIR) noinst_LTLIBRARIES = libavcodec.la
Index: quicktime/ffmpeg/configure
===================================================================
--- quicktime/ffmpeg/configure (revision 946)
+++ quicktime/ffmpeg/configure (working copy)
@@ -3,6 +3,9 @@
# ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
#
+# This configure script has been hacked for cinelerra's own purposes!
+# search for the 'cinelerra' strings to observe these hacks.
+
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
cat << EOF
@@ -1217,7 +1220,8 @@
echo "License: GPL"
fi
-echo "Creating config.mak and config.h"
+# CINELERRA - make avconfig.h directly!
+echo "creating avconfig.mak and avconfig.h"
date >> config.log
echo " $0 $FFMPEG_CONFIGURATION" >> config.log
@@ -1621,12 +1625,13 @@
FILES="Makefile libavformat/Makefile libavcodec/Makefile \
libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile \
doc/Makefile doc/texi2pod.pl"
- for dir in $DIRS ; do
- mkdir -p $dir
- done
- for f in $FILES ; do
- ln -sf "$source_path/$f" $f
- done
+# CINELERRA - commented to avoid creating directories...
+# for dir in $DIRS ; do
+# mkdir -p $dir
+# done
+# for f in $FILES ; do
+# ln -sf "$source_path/$f" $f
+# done
echo "SRC_PATH=$source_path" >> config.mak
else
echo "SRC_PATH='$source_path'" >> config.mak
@@ -1677,11 +1682,11 @@
echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
done
-diff $TMPH config.h >/dev/null 2>&1
+diff $TMPH avconfig.h >/dev/null 2>&1
if test $? -ne 0 ; then
- mv -f $TMPH config.h
+ mv -f $TMPH avconfig.h
else
- echo "config.h is unchanged"
+ echo "avconfig.h is unchanged"
fi
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
@@ -1690,13 +1695,18 @@
# build pkg-config files libavcodec.pc, libavformat.pc and libpostproc.pc
lavc_build=`grep '#define LIBAVCODEC_BUILD' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9]//g'`
-lavf_build=`grep '#define LIBAVFORMAT_BUILD' "$source_path/libavformat/avformat.h" | sed 's/[^0-9]//g'`
+# CINELERRA: libavformat directory not actually in the Cinelerra repo
+#lavf_build=`grep '#define LIBAVFORMAT_BUILD' "$source_path/libavformat/avformat.h" | sed 's/[^0-9]//g'`
requires=
test "$libogg" = "yes" && requires="$requires ogg >= 1.1"
test "$vorbis" = "yes" && requires="$requires vorbis"
test "$theora" = "yes" && requires="$requires theora"
+# CINELERRA:
+# BEGIN COMMENTING OUT THE .pc FILES
+if test 1 -eq 0 ; then
+
# libavcodec.pc
cat <<EOF >libavcodec.pc
prefix=$prefix
@@ -1790,3 +1800,6 @@
Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
Cflags: -I\${includedir}
EOF
+
+fi
+# END COMMENTING OUT THE .pc FILES
--- quicktime/ffmpeg/libavcodec/ppc/Makefile.am.not 1970-01-01 00:00:00.000000000 +0000 +++ quicktime/ffmpeg/libavcodec/ppc/Makefile.am 2006-10-25 23:38:10.000000000 +0000 @@ -0,0 +1,15 @@ +noinst_LTLIBRARIES = libavcodecppc.la + +# special options needed due to scarcity of registers +AM_CFLAGS = \ + $(LARGEFILE_CFLAGS) \ + $(CPU_CFLAGS) \ + -O3 -prefer-non-pic \ + -D_GNU_SOURCE -DHAVE_AV_CONFIG_H -I$(srcdir)/../.. + +libavcodecppc_la_SOURCES = \ + dsputil_ppc.c mpegvideo_ppc.c + +EXTRA_DIST = dsputil_ppc.c \ + mpegvideo_ppc.c +
pgpPkbX8oLHTK.pgp
Description: PGP signature
