live555: enable Solaris target
[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 ifdef HAVE_SOLARIS
31 ifeq ($(ARCH),x86_64)
32 LIVE_TARGET := solaris-64bit
33 else
34 LIVE_TARGET := solaris-32bit
35 endif
36 endif
37
38 LIVE_EXTRA_CFLAGS := $(EXTRA_CFLAGS) -fexceptions
39
40 live555: $(LIVE555_FILE) .sum-live555
41         rm -Rf live
42         $(UNPACK)
43         chmod -R u+w live
44         cd live && sed -e 's%cc%$(CC)%' -e 's%c++%$(CXX)%' -e 's%LIBRARY_LINK =.*ar%LIBRARY_LINK = $(AR)%' -i.orig config.$(LIVE_TARGET)
45         cd live && sed -i.orig -e s/"libtool -s -o"/"ar cr"/g config.macosx*
46         cd live && sed -i.orig \
47                 -e 's%$(CXX)%$(CXX)\ $(EXTRA_LDFLAGS)%' config.macosx
48         cd live && sed -i.orig \
49                 -e 's%^\(COMPILE_OPTS.*\)$$%\1 '"$(LIVE_EXTRA_CFLAGS)%" config.*
50         cd live && sed -e 's%-D_FILE_OFFSET_BITS=64%-D_FILE_OFFSET_BITS=64\ -fPIC\ -DPIC%' -i.orig config.linux
51         cd live && sed -e 's%-DSOLARIS%-DSOLARIS -DXLOCALE_NOT_USED%' -i.orig config.solaris-*bit
52 ifdef HAVE_ANDROID
53         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
54 endif
55         mv live $@
56         touch $@
57
58 .live555: live555
59         cd $< && ./genMakefiles $(LIVE_TARGET)
60         cd $< && $(MAKE) $(HOSTVARS) -C groupsock \
61                         && $(MAKE) $(HOSTVARS) -C liveMedia \
62                         && $(MAKE) $(HOSTVARS) -C UsageEnvironment \
63                         && $(MAKE) $(HOSTVARS) -C BasicUsageEnvironment
64         mkdir -p -- "$(PREFIX)/lib" "$(PREFIX)/include"
65         cp \
66                 $</groupsock/libgroupsock.a \
67                 $</liveMedia/libliveMedia.a \
68                 $</UsageEnvironment/libUsageEnvironment.a \
69                 $</BasicUsageEnvironment/libBasicUsageEnvironment.a \
70                 "$(PREFIX)/lib/"
71         cp \
72                 $</groupsock/include/*.hh \
73                 $</groupsock/include/*.h \
74                 $</liveMedia/include/*.hh \
75                 $</UsageEnvironment/include/*.hh \
76                 $</BasicUsageEnvironment/include/*.hh \
77                 "$(PREFIX)/include/"
78         touch $@