Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1e32fe436a
Fetching contributors…

Cannot retrieve contributors at this time

file 218 lines (183 sloc) 6.515 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
ARCH=@ARCH@
SYSROOT=@SYSROOT@

LD=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld
CC=@CC@
CXX=@CXX@

SHELL=/bin/bash
ifeq ($(findstring osx,$(ARCH)),osx)
ifeq ($(findstring arm,$(ARCH)),arm)
LDFLAGS=-arch armv7 -iphoneos_version_min 4.1 -bundle -undefined dynamic_lookup -read_only_relocs suppress
else
LDFLAGS=-bundle -undefined dynamic_lookup -read_only_relocs suppress
endif
else
LDFLAGS=-shared -fPIC -rdynamic
endif

SYSDIR=../../../../system/players/dvdplayer
WRAPPER=../../DllLoader/exports/wrapper.o
WRAPPER_MACH_ALIAS=../../DllLoader/exports/wrapper_mach_alias
DIRS=
ifneq (@USE_EXTERNAL_FFMPEG@,1)
  DIRS+=ffmpeg
endif
ifeq (@USE_INTERNAL_LIBA52@,1)
  DIRS+=liba52
endif
ifeq (@USE_INTERNAL_LIBDTS@,1)
  DIRS+=libdts
endif

LIBS=
ifneq (@USE_EXTERNAL_FFMPEG@,1)
  LIBS+=avutil-50-$(ARCH).so \
avcodec-52-$(ARCH).so \
avformat-52-$(ARCH).so \
postproc-51-$(ARCH).so \
swscale-0.6.1-$(ARCH).so
endif
ifeq (@USE_INTERNAL_LIBA52@,1)
  LIBS+=liba52-$(ARCH).so \
libao-$(ARCH).so
endif
ifeq (@USE_INTERNAL_LIBDTS@,1)
  LIBS+=libdts-$(ARCH).so
endif

ifneq (,$(findstring powerpc,$(ARCH)))
  ARCH_DIR=ppc
else
ifeq ($(findstring arm,$(ARCH)),arm)
  ARCH_DIR=arm
else
  ARCH_DIR=x86
endif
endif

.PHONY: $(DIRS) codecs

codecs: $(addprefix $(SYSDIR)/, $(LIBS));


ifeq ($(findstring osx,$(ARCH)), osx)
# Add -lbundle1.o for powerpc-osx
ifeq ($(ARCH), powerpc-osx)
BUNDLE1_O = -lbundle1.o
endif

$(SYSDIR)/avutil-50-$(ARCH).so: $(WRAPPER) ffmpeg/libavutil/libavutil.dylib
ifeq ($(findstring arm,$(ARCH)),arm)
$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \
$(WRAPPER) ffmpeg/libavutil/*.o
else
$(CC) $(SYSROOT) $(LDFLAGS) -o $@ \
ffmpeg/libavutil/*.o
endif

$(SYSDIR)/avcodec-52-$(ARCH).so: $(WRAPPER) ffmpeg/libavcodec/libavcodec.dylib
ifeq ($(findstring arm,$(ARCH)),arm)
$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \
$(WRAPPER) ffmpeg/libavcodec/*.o \
ffmpeg/libavcodec/$(ARCH_DIR)/*.o
else
$(CC) $(SYSROOT) $(LDFLAGS) -o $@ \
ffmpeg/libavcodec/*.o \
ffmpeg/libavcodec/$(ARCH_DIR)/*.o
endif

$(SYSDIR)/avformat-52-$(ARCH).so: $(WRAPPER) ffmpeg/libavformat/libavformat.dylib
ifeq ($(findstring arm,$(ARCH)),arm)
$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \
$(WRAPPER) ffmpeg/libavformat/*.o
else
$(CC) $(SYSROOT) $(LDFLAGS) -o $@ \
ffmpeg/libavformat/*.o
endif

$(SYSDIR)/swscale-0.6.1-$(ARCH).so: $(WRAPPER) ffmpeg/libswscale/libswscale.dylib
ifeq ($(findstring arm,$(ARCH)),arm)
$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \
$(WRAPPER) ffmpeg/libswscale/*.o
else
$(CC) $(SYSROOT) $(LDFLAGS) -o $@ \
ffmpeg/libswscale/*.o ffmpeg/libswscale/$(ARCH_DIR)/*.o
endif

$(SYSDIR)/postproc-51-$(ARCH).so: $(WRAPPER) ffmpeg/libpostproc/libpostproc.dylib
ifeq ($(findstring arm,$(ARCH)),arm)
$(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \
$(WRAPPER) ffmpeg/libpostproc/*.o
else
$(CC) $(SYSROOT) $(LDFLAGS) -o $@ \
ffmpeg/libpostproc/*.o
endif

ffmpeg/libavutil/libavutil.dylib : ffmpeg;
ffmpeg/libavcodec/libavcodec.dylib : ffmpeg;
ffmpeg/libavformat/libavformat.dylib : ffmpeg;
ffmpeg/libswscale/libswscale.dylib : ffmpeg;
ffmpeg/libpostproc/libpostproc.dylib : ffmpeg;
ffmpeg:
$(MAKE) -C $@

$(SYSDIR)/libdts-$(ARCH).so: $(WRAPPER) libdts/libdts/libdts.a
$(CC) $(SYSROOT) $(LDFLAGS) -Wl,-alias_list,$(WRAPPER_MACH_ALIAS) -o $@ \
$(WRAPPER) libdts/libdts/bitstream.o \
libdts/libdts/downmix.o \
libdts/libdts/parse.o

$(SYSDIR)/liba52-$(ARCH).so: $(WRAPPER) liba52/liba52/liba52.la
$(CC) $(SYSROOT) $(LDFLAGS) -Wl,-alias_list,$(WRAPPER_MACH_ALIAS) -o $@ \
$(WRAPPER) liba52/liba52/.libs/*.o $(BUNDLE1_O)

$(SYSDIR)/libao-$(ARCH).so: $(WRAPPER) liba52/libao/libao.a
$(CC) $(SYSROOT) $(LDFLAGS) -Wl,-alias_list,$(WRAPPER_MACH_ALIAS) -o $@ \
$(WRAPPER) liba52/libao/libao.a $(BUNDLE1_O)

libdts/libdts/libdts.a : libdts;
libdts:
$(MAKE) -C $@

liba52/liba52/liba52.la: liba52
liba52/libao/libao.a: liba52
liba52:
$(MAKE) -C $@

else

$(SYSDIR)/avutil-50-$(ARCH).so: ffmpeg/libavutil/libavutil.so
$(CC) -o $@ $(LDFLAGS) --soname,$@ -Wl,-Bsymbolic \
ffmpeg/libavutil/*.o `cat $(WRAPPER:.o=.def)` $(WRAPPER)

$(SYSDIR)/avcodec-52-$(ARCH).so: $(WRAPPER) ffmpeg/libavcodec/libavcodec.so
$(CC) -o $@ $(LDFLAGS) --soname,$@ -Wl,-Bsymbolic \
ffmpeg/libavcodec/*.o ffmpeg/libavcodec/$(ARCH_DIR)/*.o \
`cat $(WRAPPER:.o=.def)` $(WRAPPER)

$(SYSDIR)/avformat-52-$(ARCH).so: $(WRAPPER) ffmpeg/libavformat/libavformat.so
$(CC) -o $@ $(LDFLAGS) --soname,$@ -Wl,-Bsymbolic \
ffmpeg/libavformat/*.o `cat $(WRAPPER:.o=.def)` $(WRAPPER)

ifneq ($(ARCH), arm)
$(SYSDIR)/swscale-0.6.1-$(ARCH).so: $(WRAPPER) ffmpeg/libswscale/libswscale.so
$(CC) -o $@ $(LDFLAGS) --soname,$@ -Wl,-Bsymbolic \
ffmpeg/libswscale/*.o ffmpeg/libswscale/$(ARCH_DIR)/*.o \
`cat $(WRAPPER:.o=.def)` $(WRAPPER)
else # No ARM version of swscale available yet.
$(SYSDIR)/swscale-0.6.1-$(ARCH).so: $(WRAPPER) ffmpeg/libswscale/libswscale.so
$(CC) -o $@ $(LDFLAGS) --soname,$@ -Wl,-Bsymbolic \
ffmpeg/libswscale/*.o \
`cat $(WRAPPER:.o=.def)` $(WRAPPER)
endif

$(SYSDIR)/postproc-51-$(ARCH).so: $(WRAPPER) ffmpeg/libpostproc/libpostproc.so
$(CC) -o $@ $(LDFLAGS) --soname,$@ -Wl,-Bsymbolic \
ffmpeg/libpostproc/*.o `cat $(WRAPPER:.o=.def)` $(WRAPPER)

ffmpeg/libavutil/libavutil.so : ffmpeg;
ffmpeg/libavcodec/libavcodec.so : ffmpeg;
ffmpeg/libavformat/libavformat.so : ffmpeg;
ffmpeg/libswscale/libswscale.so : ffmpeg;
ffmpeg/libpostproc/libpostproc.so : ffmpeg;
ffmpeg:
$(MAKE) -C $@

$(SYSDIR)/libdts-$(ARCH).so: $(WRAPPER) libdts/libdts/libdts.a
$(CC) -o $@ $(LDFLAGS) --soname,$@ \
libdts/libdts/bitstream.o \
libdts/libdts/downmix.o libdts/libdts/parse.o \
`cat $(WRAPPER:.o=.def)` $(WRAPPER)

$(SYSDIR)/liba52-$(ARCH).so: $(WRAPPER) liba52/liba52/liba52.la
$(CC) -o $@ $(LDFLAGS) --soname,$@ liba52/liba52/.libs/*.o \
-Wl`cat $(WRAPPER:.o=.def)` $(WRAPPER)

$(SYSDIR)/libao-$(ARCH).so: $(WRAPPER) liba52/libao/libao.a
$(CC) -o $@ $(LDFLAGS) --soname,$@ liba52/libao/libao.a \
-Wl`cat $(WRAPPER:.o=.def)` $(WRAPPER)

libdts/libdts/libdts.a : libdts;
libdts:
$(MAKE) -C $@

liba52/liba52/liba52.la: liba52
liba52/libao/libao.a: liba52
liba52:
$(MAKE) -C $@

endif

clean:
rm -f $(addprefix $(SYSDIR)/, $(LIBS))
for d in $(DIRS); do (if test -f "$$d/Makefile"; then ($(MAKE) -C "$$d" clean); fi ); done

distclean:
rm -f $(addprefix $(SYSDIR)/, $(LIBS))
for d in $(DIRS); do (if test -f "$$d/Makefile"; then ($(MAKE) -C "$$d" distclean || $(MAKE) -C "$$d" clean); fi ); done
Something went wrong with that request. Please try again.