6047a5b544bae693b079de4e545f71fe4b2656f3
[vlc.git] / contrib / src / live555 / rules.mak
1 # live555
2
3 #LIVEDOTCOM_URL := http://live555.com/liveMedia/public/live555-latest.tar.gz
4 LIVE555_FILE := live.2014.05.27.tar.gz
5 LIVEDOTCOM_URL := http://download.videolan.org/pub/contrib/live555/$(LIVE555_FILE)
6
7 ifdef BUILD_NETWORK
8 PKGS += live555
9 endif
10
11 $(TARBALLS)/$(LIVE555_FILE):
12         $(call download,$(LIVEDOTCOM_URL))
13
14 .sum-live555: $(LIVE555_FILE)
15
16 LIVE_TARGET = $(error live555 target not defined!)
17 ifdef HAVE_LINUX
18 LIVE_TARGET := linux
19 endif
20 ifdef HAVE_WIN32
21 LIVE_TARGET := mingw
22 endif
23 ifdef HAVE_DARWIN_OS
24 LIVE_TARGET := macosx
25 else
26 ifdef HAVE_BSD
27 LIVE_TARGET := freebsd
28 endif
29 endif
30
31 LIVE_EXTRA_CFLAGS := $(EXTRA_CFLAGS) -fexceptions
32
33 live555: $(LIVE555_FILE) .sum-live555
34         rm -Rf live
35         $(UNPACK)
36         chmod -R u+w live
37         cd live && sed -e 's%cc%$(CC)%' -e 's%c++%$(CXX)%' -e 's%LIBRARY_LINK =.*ar%LIBRARY_LINK = $(AR)%' -i.orig config.$(LIVE_TARGET)
38         cd live && sed -i.orig -e s/"libtool -s -o"/"ar cr"/g config.macosx*
39         cd live && sed -i.orig \
40                 -e 's%$(CXX)%$(CXX)\ $(EXTRA_LDFLAGS)%' config.macosx
41         cd live && sed -i.orig \
42                 -e 's%^\(COMPILE_OPTS.*\)$$%\1 '"$(LIVE_EXTRA_CFLAGS)%" config.*
43         cd live && sed -e 's%-D_FILE_OFFSET_BITS=64%-D_FILE_OFFSET_BITS=64\ -fPIC\ -DPIC%' -i.orig config.linux
44 ifdef HAVE_ANDROID
45         cd live && sed -e 's%-DPIC%-DPIC -DNO_SSTREAM=1 -DLOCALE_NOT_USED -I$(ANDROID_NDK)/platforms/android-9/arch-$(PLATFORM_SHORT_ARCH)/usr/include%' -i.orig config.linux
46 endif
47         mv live $@
48         touch $@
49
50 .live555: live555
51         cd $< && ./genMakefiles $(LIVE_TARGET)
52         cd $< && $(MAKE) $(HOSTVARS) -C groupsock \
53                         && $(MAKE) $(HOSTVARS) -C liveMedia \
54                         && $(MAKE) $(HOSTVARS) -C UsageEnvironment \
55                         && $(MAKE) $(HOSTVARS) -C BasicUsageEnvironment
56         mkdir -p -- "$(PREFIX)/lib" "$(PREFIX)/include"
57         cp \
58                 $</groupsock/libgroupsock.a \
59                 $</liveMedia/libliveMedia.a \
60                 $</UsageEnvironment/libUsageEnvironment.a \
61                 $</BasicUsageEnvironment/libBasicUsageEnvironment.a \
62                 "$(PREFIX)/lib/"
63         cp \
64                 $</groupsock/include/*.hh \
65                 $</groupsock/include/*.h \
66                 $</liveMedia/include/*.hh \
67                 $</UsageEnvironment/include/*.hh \
68                 $</BasicUsageEnvironment/include/*.hh \
69                 "$(PREFIX)/include/"
70         touch $@