Statistics
| Branch: | Tag: | Revision:

streamers-build / THIRDPARTY-LIBS / Makefile @ b54320b3

History | View | Annotate | Download (7.25 KB)

1 de3093ce Csaba Kiraly
UNAME := $(shell uname)
2
3 6be9fce9 Csaba Kiraly
THIRDPARTYLIBS = $(shell pwd)
4
#NAPA-LIBS = NAPA-BASELIBS/monl/libmon.a NAPA-BASELIBS/ml/libml.a
5
#GRAPES-LIBS = GRAPES/src/libgrapes.a
6
#LIBS = $(GRAPES-LIBS) $(NAPA-LIBS)
7
8 3f254acb Csaba Kiraly
NOGIT := $(shell [ -d ../.git ] || echo 1)
9 45bf7a3a Luca
#GITREPOCHECK = .git/HEAD
10
GITREPOCHECK = .git
11 3f254acb Csaba Kiraly
12 f009bf28 Csaba Kiraly
#configure FFMPEG
13
CONFIG_FFMPEG += --disable-sse #required because of an error in recent ffmpeg version in case of -bf > 0
14 80a25ec3 Csaba Kiraly
CONFIG_FFMPEG += --disable-vaapi #there seems to be no static version of vaapi, so it creates problems in distributed binaries
15 f947e1b7 Csaba Kiraly
CONFIG_FFMPEG += --enable-gpl
16 8acc41bc Csaba Kiraly
CONFIG_FFMPEG += --disable-doc #for less build dependecies and faster build
17 207561b5 Rune K. Svendsen
ifneq (,$(findstring mingw32,$(HOSTARCH)))
18 68bd0f9b Csaba Kiraly
CONFIG_FFMPEG += --arch=i586 --enable-cross-compile --cross-prefix=$(CROSSPREFIX) --target-os=mingw32 --enable-memalign-hack --disable-pthreads
19 f947e1b7 Csaba Kiraly
else
20 de3093ce Csaba Kiraly
ifeq ($(UNAME), Darwin)
21
CONFIG_FFMPEG += --disable-avfilter # current libav fails to build on OSX Lion
22 0550c4a4 Csaba Kiraly
CONFIG_FFMPEG += --disable-vda # seems to create some linking problems in ffmpeg 0.10.2
23 c355b499 Csaba Kiraly
CONFIG_LIBVORBIS += --build=x86_64 # OSX 10.7.2 needs this
24 de3093ce Csaba Kiraly
endif
25 45bf7a3a Luca
ifneq (,$(findstring i386-linux,$(HOSTARCH)))
26
CONFIG_FFMPEG +=  --extra-cflags=" $(CFLAGS) "
27
endif
28 de3093ce Csaba Kiraly
29 f947e1b7 Csaba Kiraly
CONFIG_FFMPEG += --enable-pthreads
30 f009bf28 Csaba Kiraly
CONFIG_FFMPEG += --enable-libvorbis
31
CONFIG_FFMPEG_CFLAGS += -I$(THIRDPARTYLIBS)/libvorbis-install/include
32
CONFIG_FFMPEG_LDFLAGS += -L$(THIRDPARTYLIBS)/libvorbis-install/lib
33 15b6069c Csaba Kiraly
CONFIG_FFMPEG_LDLIBS += -lvorbis
34
CONFIG_FFMPEG_LDLIBS += -lvorbisenc
35 f009bf28 Csaba Kiraly
CONFIG_FFMPEG_CFLAGS += -I$(THIRDPARTYLIBS)/libogg-install/include
36
CONFIG_FFMPEG_LDFLAGS += -L$(THIRDPARTYLIBS)/libogg-install/lib
37 15b6069c Csaba Kiraly
CONFIG_FFMPEG_LDLIBS += -logg
38 f947e1b7 Csaba Kiraly
endif
39 ec46ee6f Csaba Kiraly
CONFIG_FFMPEG += --enable-libx264
40
CONFIG_FFMPEG_CFLAGS += -I$(THIRDPARTYLIBS)/x264-install/include
41
CONFIG_FFMPEG_LDFLAGS += -L$(THIRDPARTYLIBS)/x264-install/lib
42
CONFIG_FFMPEG_LDLIBS += -lx264
43 bc99d9d4 Csaba Kiraly
CONFIG_FFMPEG += --enable-libmp3lame
44
CONFIG_FFMPEG_CFLAGS += -I$(THIRDPARTYLIBS)/mp3lame-install/include
45
CONFIG_FFMPEG_LDFLAGS += -L$(THIRDPARTYLIBS)/mp3lame-install/lib
46
CONFIG_FFMPEG_LDLIBS += -lmp3lame
47 ec46ee6f Csaba Kiraly
48 f009bf28 Csaba Kiraly
CONFIG_FFMPEG += --extra-cflags='$(CONFIG_FFMPEG_CFLAGS)'
49
CONFIG_FFMPEG += --extra-ldflags='$(CONFIG_FFMPEG_LDFLAGS)'
50
51 207561b5 Rune K. Svendsen
ifneq (,$(findstring mingw32,$(HOSTARCH)))
52 8a41196a Csaba Kiraly
FLAGS_GRAPES += ARCH=win32
53 fb6cc7b9 ArpadBakay
ALTO_OPTION = ALTO=0
54 ec46ee6f Csaba Kiraly
CONFIG_X264 += --host=$(HOSTARCH)
55 bc99d9d4 Csaba Kiraly
CONFIG_MP3LAME += --host=$(HOSTARCH)
56 8a41196a Csaba Kiraly
endif
57
58 1723b629 Csaba Kiraly
WGET_OR_CURL = $(shell which wget || echo "curl -O -L")
59
60 9084a254 Csaba Kiraly
.PHONY: GRAPES-build NAPA-build all
61 6be9fce9 Csaba Kiraly
62
all: GRAPES-build NAPA-build
63
64 3f254acb Csaba Kiraly
ifndef NOGIT
65 2ece989d Csaba Kiraly
x264/$(GITREPOCHECK) ffmpeg/$(GITREPOCHECK) GRAPES/$(GITREPOCHECK) NAPA-BASELIBS/$(GITREPOCHECK):
66
	cd .. && git submodule init $(THIRDPARTYLIBS)/$(@:/$(GITREPOCHECK)=)
67
	cd .. && git submodule update $(THIRDPARTYLIBS)/$(@:/$(GITREPOCHECK)=)
68 eee31b4f Csaba Kiraly
69 2ece989d Csaba Kiraly
x264/config.mak: x264/$(GITREPOCHECK)
70 3f254acb Csaba Kiraly
71 2ece989d Csaba Kiraly
ffmpeg/config.mak: ffmpeg/$(GITREPOCHECK)
72 3f254acb Csaba Kiraly
73 2ece989d Csaba Kiraly
GRAPES-build: GRAPES/$(GITREPOCHECK)
74 3f254acb Csaba Kiraly
75 2ece989d Csaba Kiraly
NAPA-build: NAPA-BASELIBS/$(GITREPOCHECK)
76 3f254acb Csaba Kiraly
endif
77
78 f1abd72b Luca
ifneq (,$(findstring mingw32,$(HOSTARCH)))
79
x264/config.mak:
80
	cd x264 && ./configure --disable-lavf --prefix=$(THIRDPARTYLIBS)/x264-install/ --libdir=$(THIRDPARTYLIBS)/x264-install/lib $(CONFIG_X264) --enable-win32thread || { echo "Error configuring x264" && exit 1; }
81
else
82 3f254acb Csaba Kiraly
x264/config.mak:
83 45bf7a3a Luca
	cd x264 && ./configure --disable-lavf --prefix=$(THIRDPARTYLIBS)/x264-install/ --libdir=$(THIRDPARTYLIBS)/x264-install/lib $(CONFIG_X264) --host=$(HOSTARCH) || { echo "Error configuring x264" && exit 1; }
84 f1abd72b Luca
endif
85 6be9fce9 Csaba Kiraly
86 9084a254 Csaba Kiraly
x264-install: x264/config.mak
87 6be9fce9 Csaba Kiraly
	$(MAKE) -C x264 || { echo "Error compiling x264" && exit 1; }
88 15cd13c3 Csaba Kiraly
	$(MAKE) -C x264 install-lib-static  || { echo "Error installing x264" && exit 1; }
89 9084a254 Csaba Kiraly
	touch x264-install
90 6be9fce9 Csaba Kiraly
91 756707c7 Csaba Kiraly
libogg:
92 1723b629 Csaba Kiraly
	$(WGET_OR_CURL) http://downloads.xiph.org/releases/ogg/libogg-1.2.2.tar.gz && tar xzf libogg-1.2.2.tar.gz && mv libogg-1.2.2 libogg && rm libogg-1.2.2.tar.gz
93 756707c7 Csaba Kiraly
94
libogg-install: libogg
95 9c0dce6e Giovanni [dacav] Simoni
	cd libogg && ./configure --disable-oggtest --disable-shared --prefix=$(THIRDPARTYLIBS)/libogg-install/ --libdir=$(THIRDPARTYLIBS)/libogg-install/lib && make && make install
96 756707c7 Csaba Kiraly
97
libvorbis:
98 1723b629 Csaba Kiraly
	$(WGET_OR_CURL) http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.gz && tar xzf libvorbis-1.3.2.tar.gz && mv libvorbis-1.3.2 libvorbis && rm libvorbis-1.3.2.tar.gz
99 756707c7 Csaba Kiraly
100
libvorbis-install: libvorbis libogg-install
101 9c0dce6e Giovanni [dacav] Simoni
	cd libvorbis && ./configure --disable-oggtest --disable-shared --prefix=$(THIRDPARTYLIBS)/libvorbis-install/ --libdir=$(THIRDPARTYLIBS)/libvorbis-install/lib --with-ogg=$(THIRDPARTYLIBS)/libogg-install/ $(CONFIG_LIBVORBIS) && make && make install
102 756707c7 Csaba Kiraly
103 ab2147bc Csaba Kiraly
mp3lame: VERSION_LAME_DIR = 3.99
104
mp3lame: VERSION_LAME = 3.99.5
105 756707c7 Csaba Kiraly
mp3lame:
106 56b651d6 Csaba Kiraly
	$(WGET_OR_CURL) http://sourceforge.net/projects/lame/files/lame/$(VERSION_LAME_DIR)/lame-$(VERSION_LAME).tar.gz && tar xzf lame-$(VERSION_LAME).tar.gz && rm -f lame-$(VERSION_LAME).tar.gz && mv lame-$(VERSION_LAME) mp3lame;
107 756707c7 Csaba Kiraly
108
mp3lame-install: mp3lame
109 bc99d9d4 Csaba Kiraly
	cd mp3lame && ./configure --disable-gtktest --disable-frontend --disable-shared --prefix=$(THIRDPARTYLIBS)/mp3lame-install/ --libdir=$(THIRDPARTYLIBS)/mp3lame-install/lib $(CONFIG_MP3LAME) && make && make install
110 756707c7 Csaba Kiraly
111 207561b5 Rune K. Svendsen
ifeq (,$(findstring mingw32,$(HOSTARCH)))
112 bc99d9d4 Csaba Kiraly
ffmpeg/config.mak: libvorbis-install libogg-install
113 f947e1b7 Csaba Kiraly
endif
114 ec46ee6f Csaba Kiraly
ffmpeg/config.mak: x264-install
115 bc99d9d4 Csaba Kiraly
ffmpeg/config.mak: mp3lame-install
116 3f254acb Csaba Kiraly
ffmpeg/config.mak:
117 9c0dce6e Giovanni [dacav] Simoni
	cd ffmpeg && ./configure --prefix=$(THIRDPARTYLIBS)/ffmpeg-install --libdir=$(THIRDPARTYLIBS)/ffmpeg-install/lib $(CONFIG_FFMPEG) || { echo "Error configuring ffmpeg" && exit 1; }
118
	#in case x264 is not reqired (do we need the encoding?): ./configure --enable-gpl --enable-pthreads --prefix=$BASEDIR/ffmpeg-install --libdir=$BASEDIR/ffmpeg-install/lib
119 15b6069c Csaba Kiraly
	echo $(CONFIG_FFMPEG_CFLAGS) >ffmpeg.cflags
120
	echo $(CONFIG_FFMPEG_LDFLAGS) >ffmpeg.ldflags
121
	echo $(CONFIG_FFMPEG_LDLIBS) >ffmpeg.ldlibs
122 6be9fce9 Csaba Kiraly
123 9084a254 Csaba Kiraly
ffmpeg-install: ffmpeg/config.mak
124 6be9fce9 Csaba Kiraly
	$(MAKE) -C ffmpeg || { echo "Error compiling ffmpeg" && exit 1; }
125
	$(MAKE) -C ffmpeg install || { echo "Error installing ffmpeg" && exit 1; }
126 9084a254 Csaba Kiraly
	touch ffmpeg-install
127 6be9fce9 Csaba Kiraly
128 b54320b3 Luca Baldesi
pjproject-src:
129
	$(WGET_OR_CURL) http://www.pjsip.org/release/2.1/pjproject-2.1.tar.bz2
130
	tar -C pjproject-src xjf pjproject-2.1.tar.bz2
131
132
pjproject: pjproject-src
133
	cd pjproject-src
134
	./configure --disable-sound --disable-oss --disable-video --disable-small-filter --disable-large-filter --disable-speex-aec --disable-g711-codec --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-speex-codec --disable-ilbc-codec --disable-sdl --disable-ffmpeg --disable-v4l2 --disable-ssl --disable-opencore-amr --disable-silk --prefix=$(THIRDPARTYLIBS)/pjproject"
135
	make dep
136
	make
137
	make install
138
139
GRAPES-build: ffmpeg-install pjproject
140
	$(FLAGS_GRAPES) FFDIR=$(THIRDPARTYLIBS)/ffmpeg $(MAKE) PJDIR=$(THIRDPARTYLIBS)/pjproject -C GRAPES || { echo "Error compiling GRAPES" && exit 1; }
141 6be9fce9 Csaba Kiraly
142 3f254acb Csaba Kiraly
NAPA-build:
143 fb6cc7b9 ArpadBakay
	cd NAPA-BASELIBS && $(ALTO_OPTION) ./build_all.sh -q
144 6be9fce9 Csaba Kiraly
145
clean:
146 773fe817 Csaba Kiraly
	$(MAKE) -C GRAPES clean
147 df0cb19f GiuseppeTropea
	$(MAKE) -C NAPA-BASELIBS clean
148 319c97ef Csaba Kiraly
149 b54320b3 Luca Baldesi
distclean: clean
150 319c97ef Csaba Kiraly
	[ ! -d GRAPES ] || $(MAKE) -C GRAPES clean
151
	[ ! -d NAPA-BASELIBS ] || $(MAKE) -C NAPA-BASELIBS clean
152
	rm -rf libx264-install
153
	[ ! -d x264 ] || $(MAKE) -C x264 distclean || true
154
	rm -rf ffmpeg-install
155 15b6069c Csaba Kiraly
	rm -rf ffmpeg.{ldflags,cflags,ldlibs}
156 319c97ef Csaba Kiraly
	[ ! -d ffmpeg ] || $(MAKE) -C ffmpeg distclean || true
157
	rm -rf mp3lame-install
158
	[ ! -d mp3lame ] || $(MAKE) -C mp3lame distclean || true
159
	rm -rf libvorbis-install
160
	[ ! -d libvorbis ] || $(MAKE) -C libvorbis distclean || true
161
	rm -rf libogg-install
162
	[ ! -d libogg ] || $(MAKE) -C libogg distclean || true
163 b54320b3 Luca Baldesi
	rm -rf pjproject 
164
	[ ! -d pjproject-src ] || $(MAKE) -C pjproject-src distclean || true