Revision f3ec2d46

View differences:

Makefile
18 18
EXE=.exe
19 19
PROG=ffmpeg$(EXE)
20 20
else
21
EXT=
21
ifeq ($(CONFIG_OS2),yes)
22
EXE=.exe
23
PROG=ffmpeg$(EXE)
24
else
25
EXE=
22 26
PROG=ffmpeg ffplay
23 27
ifeq ($(CONFIG_FFSERVER),yes)
24 28
PROG+=ffserver
25 29
endif
26 30
endif
31
endif
27 32

  
28 33
ifeq ($(CONFIG_AUDIO_BEOS),yes)
29 34
EXTRALIBS+=-lmedia -lbe
30 35
endif
31 36

  
32 37
ifeq ($(BUILD_SHARED),yes)
33
DEP_LIBS=libavcodec/libavcodec.so libavformat/libavformat.a
38
DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
34 39
else
35
DEP_LIBS=libavcodec/libavcodec.a libavformat/libavformat.a
40
DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
36 41
ifeq ($(CONFIG_MP3LAME),yes)
37 42
EXTRALIBS+=-lmp3lame
38 43
endif
......
61 66
              -lavformat -lavcodec $(EXTRALIBS)
62 67

  
63 68
ffmpeg$(EXE): ffmpeg_g$(EXE)
64
	cp -p $< $@ ; $(STRIP) $@
69
	cp -p $< $@
70
	$(STRIP) $@
65 71

  
66 72
ffserver$(EXE): ffserver.o $(DEP_LIBS)
67 73
	$(CC) $(LDFLAGS) $(FFSLDFLAGS) \
configure
13 13

  
14 14
TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
15 15
TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
16
TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
16 17
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
17 18
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
18 19

  
......
61 62
win32="no"
62 63
mingw32="no"
63 64
cygwin="no"
65
os2="no"
64 66
lshared="no"
65 67
extralibs="-lm"
66 68
simpleidct="yes"
......
75 77
ffserver="yes"
76 78
LDFLAGS=-Wl,--warn-common
77 79
FFSLDFLAGS=-Wl,-E
80
LIBPREF="lib"
81
LIBSUF=".a"
82
SLIBPREF="lib"
83
SLIBSUF=".so"
78 84

  
79 85
# OS specific
80 86
targetos=`uname -s`
......
169 175
Linux)
170 176
LDFLAGS="$LDFLAGS -rdynamic"
171 177
;;
178
OS/2)
179
TMPE=$TMPE".exe"
180
ar="emxomfar -p32"
181
strip="echo ignore strip"
182
CFLAGS="-Zomf"
183
LDFLAGS="-Zomf -Zstack 16384"
184
SHFLAGS=""
185
FFSLDFLAGS=""
186
LIBPREF=""
187
LIBSUF=".lib"
188
SLIBPREF=""
189
SLIBSUF=".dll"
190
extralibs=""
191
v4l="no"
192
audio_oss="no"
193
network="no"
194
ffserver="no"
195
os2="yes"
196
;;
172 197
*) ;;
173 198
esac
174 199

  
......
190 215

  
191 216
ldl=-ldl
192 217

  
193
if $cc -o $TMPO $TMPC -ldl 2> /dev/null  ; then
218
if $cc -o $TMPE $TMPC -ldl 2> /dev/null  ; then
194 219
vhook=yes
195 220
dlfcn=yes
196 221
dlopen=yes
197 222
fi
198 223

  
199
if $cc -o $TMPO $TMPC 2> /dev/null  ; then
224
if $cc -o $TMPE $TMPC 2> /dev/null  ; then
200 225
vhook=yes
201 226
dlfcn=yes
202 227
dlopen=yes
......
207 232
int main( void ) { return (int) dlopen("foo", 0); }
208 233
EOF
209 234

  
210
if $cc -o $TMPO $TMPC -ldl 2> /dev/null  ; then
235
if $cc -o $TMPE $TMPC -ldl 2> /dev/null  ; then
211 236
vhook=yes
212 237
dlopen=yes
213 238
fi
214 239

  
215
if $cc -o $TMPO $TMPC 2> /dev/null  ; then
240
if $cc -o $TMPE $TMPC 2> /dev/null  ; then
216 241
vhook=yes
217 242
dlopen=yes
218 243
ldl=""
......
226 251
EOF
227 252

  
228 253
imlib2=no
229
if $cc -o $TMPO $TMPC -lImlib2 2> /dev/null  ; then
254
if $cc -o $TMPE $TMPC -lImlib2 2> /dev/null  ; then
230 255
imlib2=yes
231 256
fi
232 257

  
......
318 343
    return 0;
319 344
}
320 345
EOF
321
$cc -o $TMPO $TMPC -faltivec 2> /dev/null || altivec="no"
346
$cc -o $TMPE $TMPC -faltivec 2> /dev/null || altivec="no"
322 347
fi
323 348

  
324 349
# Can only do mmi on mips
......
338 363
    return 0;
339 364
}
340 365
EOF
341
$cc -o $TMPO $TMPC 2> /dev/null || mmi="no"
366
$cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
342 367
fi
343 368

  
344 369
# Checking for CFLAGS
......
377 402
}
378 403
EOF
379 404

  
380
if $cc -o $TMPO $TMPC 2>/dev/null ; then
381
$TMPO && bigendian="yes"
405
if $cc -o $TMPE $TMPC 2>/dev/null ; then
406
$TMPE && bigendian="yes"
382 407
else
383 408
echo big/little test failed
384 409
fi
......
402 427

  
403 428
_memalign=no
404 429
_malloc_h=no
405
if $cc -o $TMPO $TMPC 2> /dev/null ; then
430
if $cc -o $TMPE $TMPC 2> /dev/null ; then
406 431
_malloc_h=yes
407 432
_memalign=yes
408 433
# check for memalign - atmos
......
414 439
return 0;
415 440
}
416 441
EOF
417
$cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
442
$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
418 443
fi
419 444

  
420 445
cat > $TMPC << EOF
......
424 449
EOF
425 450

  
426 451
strptime=no
427
if $cc -o $TMPO $TMPC 2> /dev/null ; then
452
if $cc -o $TMPE $TMPC 2> /dev/null ; then
428 453
  strptime=yes
429 454
fi
430 455

  
......
439 464
return 0;
440 465
}
441 466
EOF
442
$cc -o $TMPO $TMPC -lz 2> /dev/null || zlib="no"
443
# $TMPO 2> /dev/null > /dev/null || zlib="no"
467
$cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
468
# $TMPE 2> /dev/null > /dev/null || zlib="no"
444 469
# XXX: more tests needed - runtime test
445 470
fi
446 471
if test "$zlib" = "yes"; then
......
455 480
EOF
456 481

  
457 482
have_lrintf="no"
458
if $cc $extralibs -o $TMPO $TMPC 2> /dev/null ; then
483
if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
459 484
  have_lrintf="yes"
460
  $TMPO 2> /dev/null > /dev/null || have_lrintf="no"
485
  $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
461 486
fi
462 487

  
463 488
_restrict=
......
577 602
echo "LDFLAGS=$LDFLAGS" >> config.mak
578 603
echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
579 604
echo "SHFLAGS=$SHFLAGS" >> config.mak
605
echo "LIBPREF=$LIBPREF" >> config.mak
606
echo "LIBSUF=$LIBSUF" >> config.mak
607
echo "SLIBPREF=$SLIBPREF" >> config.mak
608
echo "SLIBSUF=$SLIBSUF" >> config.mak
580 609
if test "$cpu" = "x86" ; then
581 610
  echo "TARGET_ARCH_X86=yes" >> config.mak
582 611
  echo "#define ARCH_X86 1" >> $TMPH
......
728 757
  echo "CONFIG_WIN32=yes" >> config.mak
729 758
fi
730 759

  
760
if test "$os2" = "yes" ; then
761
  echo "#define CONFIG_OS2 1" >> $TMPH
762
  echo "CONFIG_OS2=yes" >> config.mak
763
fi
764

  
731 765
if test "$darwin" = "yes"; then
732 766
  echo "#define CONFIG_DARWIN 1"  >> $TMPH
733 767
  echo "CONFIG_DARWIN=yes" >> config.mak
......
786 820
	echo "config.h is unchanged"
787 821
fi
788 822

  
789
rm -f $TMPO $TMPC $TMPS $TMPH
823
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
ffmpeg.c
28 28
#include <termios.h>
29 29
#include <sys/resource.h>
30 30
#endif
31
#ifdef CONFIG_OS2
32
#include <sys/types.h>
33
#include <sys/select.h>
34
#include <stdlib.h>
35
#endif
31 36
#include <time.h>
32 37
#include <ctype.h>
33 38

  
......
2497 2502
    do_pass = pass;
2498 2503
}
2499 2504

  
2500
#ifndef CONFIG_WIN32
2505
#if defined(CONFIG_WIN32) || defined(CONFIG_OS2)
2501 2506
INT64 getutime(void)
2502 2507
{
2503
    struct rusage rusage;
2504

  
2505
    getrusage(RUSAGE_SELF, &rusage);
2506
    return (rusage.ru_utime.tv_sec * 1000000LL) + rusage.ru_utime.tv_usec;
2508
  return av_gettime();
2507 2509
}
2508 2510
#else
2509 2511
INT64 getutime(void)
2510 2512
{
2511
  return av_gettime();
2513
    struct rusage rusage;
2514

  
2515
    getrusage(RUSAGE_SELF, &rusage);
2516
    return (rusage.ru_utime.tv_sec * 1000000LL) + rusage.ru_utime.tv_usec;
2512 2517
}
2513 2518
#endif
2514 2519

  
libavcodec/Makefile
91 91
SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S)
92 92
OBJS := $(OBJS) $(ASM_OBJS)
93 93

  
94
LIB= libavcodec.a
94
LIB= $(LIBPREF)avcodec$(LIBSUF)
95 95
ifeq ($(BUILD_SHARED),yes)
96
SLIB= libavcodec.so
96
SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
97 97
endif
98 98
TESTS= imgresample-test dct-test motion-test fft-test
99 99

  
......
104 104
$(LIB): $(OBJS)
105 105
	rm -f $@
106 106
	$(AR) rc $@ $(OBJS)
107
ifneq ($(CONFIG_OS2),yes)
107 108
	$(RANLIB) $@
109
endif
108 110

  
109 111
$(SLIB): $(OBJS)
110 112
	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS)
libavcodec/common.h
89 89

  
90 90
#    define snprintf _snprintf
91 91

  
92
#else /* CONFIG_WIN32 */
92
/* CONFIG_WIN32 end */
93
#elif defined (CONFIG_OS2)
94
/* OS/2 EMX */
95

  
96
#include <inttypes.h>
97

  
98
typedef unsigned char UINT8;
99
typedef unsigned short UINT16;
100
typedef unsigned int UINT32;
101
typedef unsigned long long UINT64;
102
typedef signed char INT8;
103
typedef signed short INT16;
104
typedef signed int INT32;
105
typedef signed long long INT64;
106

  
107
#ifdef HAVE_AV_CONFIG_H
108

  
109
#ifndef INT64_C
110
#define INT64_C(c)     (c ## LL)
111
#define UINT64_C(c)    (c ## ULL)
112
#endif
113

  
114
#ifdef USE_FASTMEMCPY
115
#include "fastmemcpy.h"
116
#endif
117

  
118
#include <float.h>
119

  
120
#endif /* HAVE_AV_CONFIG_H */
121

  
122
/* CONFIG_OS2 end */
123
#else
93 124

  
94 125
/* unix */
95 126

  
......
119 150
#        endif
120 151
#    endif /* HAVE_AV_CONFIG_H */
121 152

  
122
#endif /* !CONFIG_WIN32 */
153
#endif /* !CONFIG_WIN32 && !CONFIG_OS2 */
123 154

  
124 155
#ifdef HAVE_AV_CONFIG_H
125 156

  
libavformat/Makefile
48 48
OBJS+= ogg.o
49 49
endif
50 50

  
51
LIB= libavformat.a
51
LIB= $(LIBPREF)avformat$(LIBSUF)
52 52

  
53 53
all: $(LIB)
54 54

  
55 55
$(LIB): $(OBJS)
56 56
	rm -f $@
57 57
	$(AR) rc $@ $(OBJS)
58
ifneq ($(CONFIG_OS2),yes)
58 59
	$(RANLIB) $@
60
endif
59 61

  
60 62
installlib: all
61 63
	install -m 644 $(LIB) $(prefix)/lib
......
73 75
	g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $< 
74 76

  
75 77
clean: 
76
	rm -f *.o *~ *.a 
78
	rm -f *.o *~ *.a $(LIB)
libavformat/file.c
42 42
    } else {
43 43
        access = O_RDONLY;
44 44
    }
45
#ifdef CONFIG_WIN32
45
#if defined(CONFIG_WIN32) || defined(CONFIG_OS2)
46 46
    access |= O_BINARY;
47 47
#endif
48 48
    fd = open(filename, access, 0666);
libavformat/img.c
26 26
#ifdef __BEOS__
27 27
#  ifndef usleep
28 28
#    include <OS.h>
29
#    define usleep(t)    snooze((bigtime_t)(t))
29
#    define usleep(t)  snooze((bigtime_t)(t))
30 30
#  endif
31 31
#endif
32
#if defined(CONFIG_OS2)
33
#  include <stdlib.h>
34
#  define usleep(t)    _sleep2((t) / 1000)
35
#endif
32 36

  
33 37
typedef struct {
34 38
    int width;
libavformat/utils.c
18 18
 */
19 19
#include "avformat.h"
20 20
#include <ctype.h>
21
#ifndef CONFIG_WIN32
22
#include <unistd.h>
23
#include <fcntl.h>
24
#include <sys/time.h>
25
#else
21
#ifdef CONFIG_WIN32
26 22
#define strcasecmp _stricmp
27 23
#include <sys/types.h>
28 24
#include <sys/timeb.h>
25
#elif defined(CONFIG_OS2)
26
#include <string.h>
27
#define strcasecmp stricmp
28
#include <sys/time.h>
29
#else
30
#include <unistd.h>
31
#include <fcntl.h>
32
#include <sys/time.h>
29 33
#endif
30 34
#include <time.h>
31 35

  
......
362 366
    }
363 367
        
364 368
    /* XXX: suppress this hack for redirectors */
365
#ifndef __MINGW32__
369
#ifdef CONFIG_NETWORK
366 370
    if (fmt == &redir_demux) {
367 371
        err = redir_open(ic_ptr, &ic->pb);
368 372
        url_fclose(&ic->pb);

Also available in: Unified diff