Revision 57514323

View differences:

Makefile
29 29
endif
30 30
endif
31 31

  
32
OBJS = ffmpeg.o ffserver.o
33
SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
34

  
32 35
all: lib $(PROG)
33 36

  
34 37
lib:
......
52 55
	install -s -m 755 $(PROG) $(prefix)/bin
53 56
	ln -sf ffmpeg $(prefix)/bin/ffplay 
54 57

  
58
dep:	depend
59

  
60
depend:
61
	$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
62

  
55 63
clean: 
56 64
	$(MAKE) -C libavcodec clean
57 65
	$(MAKE) -C libav clean
......
63 71

  
64 72
TAGS:
65 73
	etags *.[ch] libav/*.[ch] libavcodec/*.[ch]
74

  
75
ifneq ($(wildcard .depend),)
76
include .depend
77
endif
configure
5 5
TMPS="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
6 6
TMPH="ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
7 7

  
8
if [ ! -z "$TMPDIR" ]; then
8
if test ! -z "$TMPDIR" ; then
9 9
	TMPC="${TMPDIR}/${TMPC}"
10 10
	TMPCPP="${TMPDIR}/${TMPCPP}"
11 11
	TMPO="${TMPDIR}/${TMPO}"
12 12
	TMPS="${TMPDIR}/${TMPS}"
13 13
	TMPH="${TMPDIR}/${TMPH}"
14
elif [ ! -z "$TEMPDIR" ]; then
14
elif test ! -z "$TEMPDIR" ; then
15 15
	TMPC="${TEMPDIR}/${TMPC}"
16 16
	TMPCPP="${TEMPDIR}/${TMPCPP}"
17 17
	TMPO="${TEMPDIR}/${TMPO}"
......
50 50
gprof="no"
51 51
grab="yes"
52 52
mp3lame="no"
53
a52bin="no"
53 54
win32="no"
54 55
extralibs="-lm"
55 56

  
......
72 73
*) ;;
73 74
esac
74 75

  
75
if [ "$1" = "-h" -o "$1" = "--help" ] ; then
76
if test "$1" = "-h" -o "$1" = "--help" ; then
76 77
cat << EOF
77 78

  
78 79
Usage: configure [options]
......
86 87
echo "  --disable-mmx           disable mmx usage"
87 88
echo "  --enable-gprof          enable profiling with gprof [$gprof]"
88 89
echo "  --disable-grab          disable audio/video grabbing code"
89
echo "  --enable-simple_idct    use simple IDCT routines"
90
echo "  --enable-mp3lame        enable mp3 encoding via libmp3lame"
90
echo "  --enable-simple_idct    use simple IDCT routines [default=no]"
91
echo "  --enable-mp3lame        enable mp3 encoding via libmp3lame [default=no]"
91 92
echo "  --enable-win32          enable win32 cross compile"
93
echo "  --enable-a52bin         open liba52.so.0 at runtime [default=no]"
92 94
echo "  --enable-shared         build shared libraries [default=no]"
93 95
exit 1
94 96
fi
......
108 110
  ;;
109 111
  --disable-grab) grab="no"
110 112
  ;;
113
  --enable-a52bin) a52bin="yes" ; extralibs="-ldl $extralibs"
114
  ;;
111 115
  --enable-mp3lame) mp3lame="yes"
112 116
  ;;
113 117
  --enable-simple_idct) simpleidct="yes"
......
124 128
    CFLAGS="-O2"
125 129
fi
126 130

  
127
if [ "$win32" = "yes" ] ; then
131
if test "$win32" = "yes" ; then
128 132
    cross_prefix="i386-mingw32msvc-"
129 133
    cc="${cross_prefix}gcc"
130 134
    ar="${cross_prefix}ar"
......
163 167
echo "gprof enabled    $gprof"
164 168
echo "grab enabled     $grab"
165 169
echo "mp3lame enabled  $mp3lame"
170
echo "a52 dlopened     $a52bin"
166 171

  
167 172
echo "Creating config.mak and config.h"
168 173

  
......
174 179
echo "CC=$cc" >> config.mak
175 180
echo "AR=$ar" >> config.mak
176 181
echo "OPTFLAGS=$CFLAGS" >> config.mak
177
if [ "$cpu" = "x86" ] ; then
182
if test "$cpu" = "x86" ; then
178 183
  echo "TARGET_ARCH_X86=yes" >> config.mak
179 184
  echo "#define ARCH_X86 1" >> $TMPH
180 185
fi
181
if [ "$cpu" = "armv4l" ]; then
186
if test "$cpu" = "armv4l" ; then
182 187
  echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
183 188
  echo "#define ARCH_ARMV4L 1" >> $TMPH
184 189
fi
185
if [ "$cpu" = "alpha" ]; then
190
if test "$cpu" = "alpha" ; then
186 191
  echo "TARGET_ARCH_ALPHA=yes" >> config.mak
187 192
  echo "#define ARCH_ALPHA 1" >> $TMPH
188 193
fi
189
if [ "$mmx" = "yes" ] ; then
194
if test "$mmx" = "yes" ; then
190 195
  echo "TARGET_MMX=yes" >> config.mak
191 196
  echo "#define HAVE_MMX 1" >> $TMPH
192 197
fi
193
if [ "$gprof" = "yes" ] ; then
198
if test "$gprof" = "yes" ; then
194 199
  echo "TARGET_GPROF=yes" >> config.mak
195 200
  echo "#define HAVE_GPROF 1" >> $TMPH
196 201
fi
197
if [ "$lshared" = "yes" ] ; then
202
if test "$lshared" = "yes" ; then
198 203
  echo "BUILD_SHARED=yes" >> config.mak
199 204
else
200 205
  echo "BUILD_SHARED=no" >> config.mak
......
216 221
echo "#define CONFIG_AC3 1" >> $TMPH
217 222
echo "CONFIG_AC3=yes" >> config.mak
218 223

  
219
if [ "$grab" = "yes" ] ; then
224
if test "$a52bin" = "yes" ; then
225
  echo "#define CONFIG_A52BIN 1" >> $TMPH
226
  echo "CONFIG_A52BIN=yes" >> config.mak
227
else
228
  echo "CONFIG_A52BIN=no" >> config.mak
229
fi
230

  
231
if test "$grab" = "yes" ; then
220 232
  echo "#define CONFIG_GRAB 1" >> $TMPH
221 233
  echo "CONFIG_GRAB=yes" >> config.mak
222 234
fi
223 235

  
224
if [ "$mp3lame" = "yes" ] ; then
236
if test "$mp3lame" = "yes" ; then
225 237
  echo "#define CONFIG_MP3LAME 1" >> $TMPH
226 238
  echo "CONFIG_MP3LAME=yes" >> config.mak
227 239
fi
228 240

  
229
if [ "$win32" = "yes" ] ; then
241
if test "$win32" = "yes" ; then
230 242
  echo "#define CONFIG_WIN32 1" >> $TMPH
231 243
  echo "CONFIG_WIN32=yes" >> config.mak
232 244
fi
233 245

  
234
if [ "$_malloc_h" = "yes" ]; then
246
if test "$_malloc_h" = "yes" ; then
235 247
  echo "#define HAVE_MALLOC_H 1" >> $TMPH
236 248
else
237 249
  echo "#undef  HAVE_MALLOC_H" >> $TMPH
238 250
fi
239 251

  
240
if [ "$_memalign" = "yes" ]; then
252
if test "$_memalign" = "yes" ; then
241 253
  echo "#define HAVE_MEMALIGN 1" >> $TMPH
242 254
else
243 255
  echo "#undef  HAVE_MEMALIGN" >> $TMPH
244 256
fi
245 257

  
246
if [ "$simpleidct" = "yes" ]; then
258
if test "$simpleidct" = "yes" ; then
247 259
  echo "#define SIMPLE_IDCT 1" >> $TMPH
248 260
fi
249 261

  
libavcodec/Makefile
10 10
      ratecontrol.o
11 11
ASM_OBJS=
12 12

  
13
# currently using libac3 for ac3 decoding
13
# currently using liba52 for ac3 decoding
14 14
ifeq ($(CONFIG_AC3),yes)
15
OBJS+= ac3dec.o \
16
       libac3/bit_allocate.o libac3/bitstream.o libac3/downmix.o \
17
       libac3/imdct.o  libac3/parse.o
15
OBJS+= a52dec.o
16
endif
17

  
18
# using builtin liba52 or runtime linked liba52.so.0
19
ifeq ($(CONFIG_A52BIN),no)
20
OBJS+= liba52/bit_allocate.o liba52/bitstream.o liba52/downmix.o \
21
	liba52/imdct.o  liba52/parse.o
18 22
endif
19 23

  
20 24
ifeq ($(CONFIG_MP3LAME),yes)
......
30 34
ifeq ($(TARGET_MMX),yes)
31 35
OBJS += i386/fdct_mmx.o i386/cputest.o \
32 36
	i386/dsputil_mmx.o i386/mpegvideo_mmx.o \
33
        i386/idct_mmx.o i386/motion_est_mmx.o \
37
	i386/idct_mmx.o i386/motion_est_mmx.o \
34 38
	i386/simple_idct_mmx.o
35 39
endif
36 40

  
......
91 95
	   armv4l/*.o armv4l/*~ \
92 96
	   mlib/*.o mlib/*~ \
93 97
	   alpha/*.o alpha/*~ \
94
           libac3/*.o libac3/*~ \
95
           apiexample $(TESTS)
98
	   liba52/*.o liba52/*~ \
99
	   apiexample $(TESTS)
96 100

  
97 101
distclean: clean
98 102
	rm -f Makefile.bak .depend
libavcodec/a52dec.c
19 19
#include "avcodec.h"
20 20
#include "liba52/a52.h"
21 21

  
22
#ifdef LIBAVCODEC_A52BIN
22
#ifdef CONFIG_A52BIN
23 23
#include <dlfcn.h>
24 24
static const char* liba52name = "liba52.so.0";
25 25
#endif
......
62 62

  
63 63
} AC3DecodeState;
64 64

  
65
#ifdef LIBAVCODEC_A52BIN
65
#ifdef CONFIG_A52BIN
66 66
static void* dlsymm(void* handle, const char* symbol)
67 67
{
68 68
    void* f = dlsym(handle, symbol);
......
76 76
{
77 77
    AC3DecodeState *s = avctx->priv_data;
78 78

  
79
#ifdef LIBAVCODEC_A52BIN
79
#ifdef CONFIG_A52BIN
80 80
    s->handle = dlopen(liba52name, RTLD_LAZY);
81 81
    if (!s->handle)
82 82
    {
......
95 95
	dlclose(s->handle);
96 96
        return -1;
97 97
    }
98
    printf("INITIALIZED\n");
99 98
#else
100 99
    /* static linked version */
101 100
    s->handle = 0;
......
233 232
{
234 233
    AC3DecodeState *s = avctx->priv_data;
235 234
    s->a52_free(s->state);
236
#ifdef LIBAVCODEC_A52BIN
235
#ifdef CONFIG_A52BIN
237 236
    dlclose(s->handle);
238 237
#endif
239 238
    return 0;

Also available in: Unified diff