source: scripts/scripts/untested/blfs-scripts/blfs-ffmpeg.sh @ 7f65c0e

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 7f65c0e was 7f65c0e, checked in by Jim Gifford <clfs@…>, 18 years ago

r625@server (orig r623): jim | 2005-10-31 12:43:24 -0800
Final Move

  • Property mode set to 100755
File size: 3.6 KB
Line 
1#!/bin/bash
2
3### ffmpeg ###
4
5cd ${SRC}
6LOG=ffmpeg-blfs.log
7
8SELF=`basename ${0}`
9set_buildenv
10set_libdirname
11setup_multiarch
12if [ ! "${libdirname}" = "lib" ]; then
13   extra_conf="--libdir=/usr/${libdirname}"
14fi
15
16unpack_tarball FFMpeg-${FFMPEG_VER}
17cd ${PKGDIR}
18
19# Set this if you want to build a shared postproc library
20use_shared_pp="Y"
21
22#-------------------------------------------------------------------------------
23# Configure doesn't actually check if anything exists, we do it
24# manually here...
25
26# Do we have faad2? If so, do we also have faac?
27if [ -f /usr/include/faad.h -a -f /usr/${libdirname}/libfaad.a ]; then
28   extra_conf="${extra_conf} --enable-faad"
29   echo " - enabling faad2 support"
30   if [ -f /usr/bin/faad ]; then
31      extra_conf="${extra_conf} --enable-faadbin"
32      echo " - enabling faad2bin support"
33   fi
34   if [ -f /usr/include/faac.h -a -f /usr/${libdirname}/libfaac.a ]; then
35      extra_conf="${extra_conf} --enable-faac"
36      echo " - enabling faac support"
37   fi
38fi
39
40# Do we have xvid?
41if [ -f /usr/include/xvid.h -a -f /usr/${libdirname}/libxvidcore.a ]; then
42   extra_conf="${extra_conf} --enable-xvid"
43   echo " - enabling xvid support"
44fi
45
46# Do we have lame?
47if [ -f /usr/include/lame/lame.h -a -f /usr/${libdirname}/libmp3lame.a ]; then
48   extra_conf="${extra_conf} --enable-mp3lame"
49   echo " - enabling mp3lame support"
50fi
51
52# Do we have ogg? If so, check if we have vorbis and theora
53if [ -f /usr/include/ogg/ogg.h -a -f /usr/${libdirname}/libogg.a ]; then
54   extra_conf="${extra_conf} --enable-libogg"
55   echo " - enabling libogg support"
56
57   # Do we have vorbis?
58   if [ -f /usr/include/vorbis/codec.h -a -f /usr/${libdirname}/libvorbis.a ]
59   then
60      extra_conf="${extra_conf} --enable-vorbis"
61      echo " - enabling vorbis support"
62   fi
63   # Do we have theora?
64   if [ -f /usr/include/theora/theora.h -a -f /usr/${libdirname}/libtheora.a ]
65   then
66      extra_conf="${extra_conf} --enable-theora"
67      echo " - enabling theora support"
68   fi
69fi
70
71# Do we have libgsm?
72if [ -f /usr/include/gsm.h -a -f /usr/${libdirname}/libgsm.a ]; then
73   extra_conf="${extra_conf} --enable-libgsm"
74   echo " - enabling libgsm support"
75fi
76#-------------------------------------------------------------------------------
77
78# Fix configure to generate pkgconfig files which set libdir properly
79sed -i -e 's@^\(libdir=\)\\\${exec_prefix}/lib@\1${libdir}@g' \
80   configure
81
82# Fix issues with liba52
83sed -i -e "s/static uint64/const uint64/" \
84    libavcodec/liba52/resample_mmx.c
85
86# Stop the vhook build bitching and moaning because it cant find the created
87# libavcodec, libavformat and (if shared pp lib built) libpostproc
88vhook_add_libs="-L../libavcodec -lavcodec -L../libavformat -lavformat"
89
90if [ "${use_shared_pp}" = "Y" ]; then
91   extra_conf="${extra_conf} --enable-shared-pp"
92   vhook_add_libs="${vhook_add_libs} -L../libavcodec/libpostproc -lpostproc"
93fi
94
95sed -i -e "s@\$<@\$< ${vhook_add_libs}@g" \
96   vhook/Makefile
97
98# Hoorah, configure checks for -m32 in CFLAGS and configures amd64 build as
99# a standard X86 build :-) So we define ARCH_CFLAGS in CFLAGS as well as
100# with CC (still need it there for shared lib creation)
101max_log_init ffmpeg ${FFMPEG_VER} "blfs (shared)" ${CONFLOGS} ${LOG}
102CFLAGS="${ARCH_CFLAGS} -pipe ${TGT_CFLAGS}" \
103./configure --prefix=/usr ${extra_conf} \
104 --cc="${CC-gcc} ${ARCH_CFLAGS}" \
105 --mandir=/usr/share/man \
106 --enable-gpl \
107 --enable-a52 \
108 --enable-pp \
109 --enable-shared \
110 --enable-pthreads \
111   >> ${LOGFILE} 2>&1 &&
112echo " o Configure OK" &&
113
114min_log_init ${BUILDLOGS} &&
115make \
116   >> ${LOGFILE} 2>&1 &&
117echo " o Build OK" &&
118
119min_log_init ${INSTLOGS} &&
120make install \
121   >> ${LOGFILE} 2>&1 &&
122echo " o ALL OK" || barf
123
Note: See TracBrowser for help on using the repository browser.