Revision daf8e955

View differences:

Makefile
10 10
LDFLAGS+=-p
11 11
endif
12 12

  
13
PROG= ffmpeg ffserver
13
ifeq ($(CONFIG_WIN32),yes)
14
EXE=.exe
15
PROG=ffmpeg$(EXE)
16
else
17
EXT=
18
PROG=ffmpeg ffserver
19
endif
14 20

  
15 21
all: lib $(PROG)
16 22

  
......
18 24
	$(MAKE) -C libavcodec all
19 25
	$(MAKE) -C libav all
20 26

  
21
ffmpeg: ffmpeg.o libav/libav.a libavcodec/libavcodec.a
22
	gcc $(LDFLAGS) -o $@ $^ -lm
27
ffmpeg$(EXE): ffmpeg.o libav/libav.a libavcodec/libavcodec.a
28
	$(CC) $(LDFLAGS) -o $@ $^ -lm
23 29

  
24
ffserver: ffserver.o libav/libav.a libavcodec/libavcodec.a
25
	gcc $(LDFLAGS) -o $@ $^ -lm
30
ffserver$(EXE): ffserver.o libav/libav.a libavcodec/libavcodec.a
31
	$(CC) $(LDFLAGS) -o $@ $^ -lm
26 32

  
27 33
%.o: %.c
28
	gcc $(CFLAGS) -c -o $@ $< 
34
	$(CC) $(CFLAGS) -c -o $@ $< 
29 35

  
30 36
install: all
31 37
	install -s -m 755 $(PROG) $(prefix)/bin
configure
21 21
gprof="no"
22 22
mp3lib="yes"
23 23
grab="yes"
24
win32="no"
24 25

  
25 26
if [ "$1" = "-h" -o "$1" = "--help" ] ; then
26 27
cat << EOF
......
37 38
echo "  --enable-gprof          enable profiling with gprof [$gprof]"
38 39
echo "  --disable-mp3lib        disable mp3 lib compiling"
39 40
echo "  --disable-grab          disable audio/video grabbing code"
41
echo "  --enable-win32          enable win32 cross compile"
40 42
exit 1
41 43
fi
42 44

  
......
56 58
  ;;
57 59
  --disable-grab) grab="no"
58 60
  ;;
61
  --enable-win32) win32="yes"
62
  ;;
59 63
  esac
60 64
done
61 65

  
66
# Checking for CFLAGS
67
if test -z "$CFLAGS"; then
68
    CFLAGS="-O2"
69
fi
70

  
71
if [ "$win32" = "yes" ] ; then
72
    cross_prefix="i386-mingw32msvc-"
73
    cc="${cross_prefix}gcc"
74
    ar="${cross_prefix}ar"
75
    grab="no"
76
fi
77

  
62 78
echo "Install prefix   $prefix"
63 79
echo "C compiler       $cc"
64 80
echo "CPU              $cpu"
......
71 87
echo "# Automatically generated by configure - do not modify" > config.mak
72 88
echo "/* Automatically generated by configure - do not modify */" > config.h
73 89

  
74
# Checking for CFLAGS
75
if test -z "$CFLAGS"; then
76
 CFLAGS="-O2"
77
fi
78

  
79 90
echo "prefix=$prefix" >> config.mak
80 91
echo "MAKE=make" >> config.mak
81 92
echo "CC=$cc" >> config.mak
......
120 131
  echo "#define CONFIG_GRAB 1" >> config.h
121 132
  echo "CONFIG_GRAB=yes" >> config.mak
122 133
fi
134

  
135
if [ "$win32" = "yes" ] ; then
136
  echo "#define CONFIG_WIN32 1" >> config.h
137
  echo "CONFIG_WIN32=yes" >> config.mak
138
fi
ffmpeg.c
16 16
 * along with this program; if not, write to the Free Software
17 17
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 18
 */
19
#include <stdlib.h>
20
#include <stdio.h>
21
#include <string.h>
22
#include <errno.h>
19
#define HAVE_AV_CONFIG_H
20
#include "avformat.h"
21

  
23 22
#ifndef CONFIG_WIN32
24
#include "config.h"
25 23
#include <unistd.h>
26 24
#include <fcntl.h>
27 25
#include <sys/ioctl.h>
......
33 31
#include <ctype.h>
34 32
#endif
35 33

  
36
#include "avformat.h"
37 34

  
38 35
#define MAXINT64 INT64_C(0x7fffffffffffffff)
39 36

  

Also available in: Unified diff