rules.mak 1.62 KB
Newer Older
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
1 2 3 4 5 6 7
# live555

LIVEDOTCOM_URL := http://live555.com/liveMedia/public/live555-latest.tar.gz

PKGS += live555

$(TARBALLS)/live555-latest.tar.gz:
8
	$(call download,$(LIVEDOTCOM_URL))
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
9

10
.sum-live555: live555-latest.tar.gz
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
11

12
live555: live555-latest.tar.gz .sum-live555
13
	$(UNPACK)
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
14 15
	patch -p0 < $(SRC)/live555/live-uselocale.patch
	patch -p0 < $(SRC)/live555/live-inet_ntop.patch
16
	patch -p0 < $(SRC)/live555/live-intptr.patch
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
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
ifndef HAVE_WIN32
ifndef HAVE_WINCE
	patch -p0 < $(SRC)/live555/live-getaddrinfo.patch
endif
endif
	mv live $@
	touch $@

LIVE_TARGET = $(error live555 target not defined!)
ifdef HAVE_LINUX
LIVE_TARGET := linux
endif
ifdef HAVE_WIN32
LIVE_TARGET := mingw
endif
ifdef HAVE_WINCE
LIVE_TARGET := mingw
endif
ifdef HAVE_MACOSX
LIVE_TARGET := macosx
endif

.live555: live555
ifdef HAVE_WINCE
	cd $< && sed -e 's/-lws2_32/-lws2/g' -i.orig config.mingw
endif
	cd $< && sed \
		-e 's%-DBSD=1%-DBSD=1\ $(EXTRA_CFLAGS)\ $(EXTRA_LDFLAGS)%' \
		-e 's%cc%$(CC)%' \
		-e 's%c++%$(CXX)\ $(EXTRA_LDFLAGS)%' \
		-i.orig config.macosx
	cd $< && sed -e 's%-D_FILE_OFFSET_BITS=64%-D_FILE_OFFSET_BITS=64\ -fPIC\ -DPIC%' -i.orig config.linux
	cd $< && ./genMakefiles $(LIVE_TARGET)
	cd $< && $(MAKE) $(HOSTVARS)
	mkdir -p -- "$(PREFIX)/lib" "$(PREFIX)/include"
	cp \
		$</groupsock/libgroupsock.a \
		$</liveMedia/libliveMedia.a \
		$</UsageEnvironment/libUsageEnvironment.a \
		$</BasicUsageEnvironment/libBasicUsageEnvironment.a \
		"$(PREFIX)/lib"
	cp \
		$</groupsock/include/*.hh \
		$</groupsock/include/*.h \
		$</liveMedia/include/*.hh \
        	$</UsageEnvironment/include/*.hh \
        	$</BasicUsageEnvironment/include/*.hh \
		"$(PREFIX)/include"
	touch $@