add configure without-thirdparty, without-libzmpeg, without-commercial
[goodguy/history.git] / cinelerra-5.1 / thirdparty / Makefile
index 7268028bdbf72a26e53cb269244af0543ca9af29..5865b7523aa752145d5146d739a7101f51136c69 100644 (file)
@@ -28,6 +28,8 @@ include $(TOPDIR)/global_config
 -include $(TOPDIR)/cin_config
 BLD := $(THIRDPARTY)/build
 
+ifneq ($(WANT_CIN_3RDPARTY),no)
+
 # package build flags, if needed
 # need frame pointer for debugs and helps with profiling
 # NOTE: the trailing blank is MANDITORY or the builds fail
@@ -105,16 +107,13 @@ esound.cfg_vars+= AUDIOFILE_LIBS="$(call ld_path,audiofile,libaudiofile/.libs)"
 esound.cfg_params= --enable-shared=no --with-pic
 esound.mak_vars+= CFLAGS="" 
 esound.ldflags=" -lm -lstdc++"
-faac.cfg_params= --enable-shared=no --without-mp4v2
-faad2.cfg_params= --enable-shared=no
 #fdk.cfg_vars= ./autogen.sh ; CFLAGS+=" -Wno-narrowing" CXXFLAGS+=" -Wno-narrowing"
 fdk.cfg_params= --enable-shared=no
 fdk.mak_params= ; for f in $(call bld_path,fdk,/lib*/include); do ln -s . $$$$f/fdk-aac; done
 fftw.cfg_params= --disable-fortran --enable-shared=no
 ffmpeg.cfg_params= \
        --enable-pthreads --enable-gpl \
-       --disable-ffserver --disable-ffplay \
-       --disable-vaapi \
+       --disable-ffplay --disable-vaapi \
        $(call if_pkg,fdk,--enable-libfdk-aac) \
        $(call if_pkg,twolame,--enable-libtwolame) \
        $(call if_pkg,openjpeg,--enable-libopenjpeg) \
@@ -130,6 +129,7 @@ ffmpeg.cfg_params= \
                $(call inc_path,lame,include) \
                $(call inc_path,openjpeg,src/lib/openjp2) \
                $(call inc_path,libogg,include) \
+               $(call inc_path,opus,include) \
                $(call inc_path,libvorbis,include) \
                $(call inc_path,libtheora,include) \
                $(call inc_path,libvpx) \
@@ -146,6 +146,7 @@ ffmpeg.cfg_params= \
                $(call ld_path,twolame,libtwolame/.libs) \
                $(call ld_path,lame,libmp3lame/.libs) \
                $(call ld_path,openjpeg,bin) \
+               $(call ld_path,opus,.libs) \
                $(call ld_path,libogg,lib/.libs) \
                $(call ld_path,libvorbis,lib/.libs) \
                $(call ld_path,libtheora,lib/.libs) \
@@ -201,7 +202,6 @@ libtheora.cfg_params?= --disable-examples --disable-spec --enable-shared=no
 libuuid.cfg_params?=--enable-shared=no
 libvorbis.cfg_params?= --disable-oggtest --enable-shared=no
 openjpeg.cfg_params?= -DBUILD_SHARED_LIBS:BOOL=OFF
-openjpeg.cfg_params?= -DBUILD_SHARED_LIBS:BOOL=OFF
 openjpeg.cfg_vars?=$(call cmake_config,.)
 openjpeg.mak_params?= ; cd $(call bld_path,openjpeg,src/lib/openjp2); ln -sf . openjpeg-2.1
 opencv.cfg_vars?=$(call cmake_config,.)
@@ -215,6 +215,46 @@ x265.cfg_vars?=$(call cmake_config,source)
 x265.cfg_params?= -DENABLE_SHARED=no
 libvpx.cfg_params?= --enable-pic
 
+DS:=$$$$$$$$
+pkg_cfg=$(call bld_path,$(1),usr/local/lib/pkgconfig):
+LV2_PKGCFG:=$(subst : ,:,$(foreach p,lv2 serd sord sratom lilv suil,$(call pkg_cfg,$(p))))
+
+# lv2
+define waf-setup
+$(1).cfg_vars+=echo 'exec ./waf configure "$(DS)@"' > ./configure; chmod +x \
+ ./configure;  PKG_CONFIG_PATH=$(LV2_PKGCFG) LD_LIBRARY_PATH=$(LV2_LIBPATH) 
+$(1).cfg_params+=\
+ CFLAGS="-I$(call bld_path,lv2) $(foreach f,$(2), $(call inc_path,$(f))) -fPIC "\
+ LDFLAGS="-lm $(foreach f,$(2), $(call ld_path,$(f),usr/local/lib)) "
+$(1).mak_vars=(echo "all:"; echo "     ./waf -v build") > $(call bld_path,$(1),Makefile); 
+$(1).mak_params+=; ( cd $(1)*; ./waf install --destdir=$(call bld_path,$(1)) )
+endef
+
+SYS_LIB:=$(notdir $(lastword $(wildcard /usr/lib /usrlib32 /usr/lib64)))
+SYS_LV2:=$(lastword $(wildcard /usr/$(SYS_LIB)/lv2 /usr/local/$(SYS_LIB)/lv2))
+$(if $(SYS_LV2),,$(eval SYS_LV2:=/usr/$(SYS_LIB)/lv2))
+lv2.cfg_params?= --lv2dir=$(SYS_LV2)
+SYS_LV2_PATH:=/usr/$(SYS_LIB)/lv2: /usr/local/$(SYS_LIB)/lv2:
+DFT_LV2_PATH:= /usr/lib64/lv2: /usr/lib/lv2: /usr/local/lib64/lv2: /usr/local/lib/lv2: 
+LV2_PATH:=$(subst : ,:,$(SYS_LV2_PATH)$(filter-out $(SYS_LV2_PATH),$(DFT_LV2_PATH)))
+lilv.cfg_params?= --static --default-lv2-path=$(LV2_PATH)
+sratom.cfg_params?= --static --no-shared
+serd.cfg_params?= --static --no-shared
+sord.cfg_params?= --static --no-shared
+lilv.cfg_params?= --static --dyn-manifest
+suil.cfg_params?= --static --no-qt
+
+$(eval $(call waf-setup,lv2))
+$(eval $(call waf-setup,serd))
+$(eval $(call waf-setup,sord, serd))
+$(eval $(call waf-setup,sratom, serd sord lv2))
+$(eval $(call waf-setup,lilv, lv2 sratom serd sord))
+$(eval $(call waf-setup,suil, lv2))
+
+# add softlinks for legacy paths
+waf_link=$(1).mak_params+=; (cd $(1)*; ln -s $(1)-0/$(1) usr/local/include/.)
+$(foreach p,sratom serd sord lilv suil,$(eval $(call waf_link,$(p))))
+
 # compile flag vars
 $(foreach tgt,$(TARGETS), \
        $(if $($(tgt).cflags),$(eval $(tgt).cfg_vars+=CFLAGS+=$($(tgt).cflags))))
@@ -240,10 +280,8 @@ $(call rules,$(call std-build,djbfft))
 $(call rules,$(call std-build,audiofile))
 $(call rules,$(call std-build,encore))
 $(call rules,$(call std-build,esound,audiofile))
-$(call rules,$(call std-build,faac))
-$(call rules,$(call std-build,faad2))
 $(call rules,$(call std-build,fdk))
-$(call rules,$(call std-build,ffmpeg, faad2 faac fdk twolame lame openjpeg libtheora x264 x265 libvpx))
+$(call rules,$(call std-build,ffmpeg, fdk twolame lame openjpeg opus libtheora x264 x265 libvpx))
 $(call rules,$(call std-build,fftw))
 $(call rules,$(call std-build,flac,libogg))
 $(call rules,$(call std-build,giflib))
@@ -264,12 +302,19 @@ $(call rules,$(call std-build,mjpegtools, libjpeg))
 $(call rules,$(call std-build,opencv))
 $(call rules,$(call std-build,openexr, ilmbase))
 $(call rules,$(call std-build,openjpeg))
+$(call rules,$(call std-build,opus))
 $(call rules,$(call std-build,speech_tools))
 $(call rules,$(call std-build,tiff))
 $(call rules,$(call std-build,twolame))
 $(call rules,$(call std-build,x264))
 $(call rules,$(call std-build,x265))
 $(call rules,$(call std-build,libvpx))
+$(call rules,$(call std-build,lv2))
+$(call rules,$(call std-build,serd))
+$(call rules,$(call std-build,sord, serd))
+$(call rules,$(call std-build,sratom, serd sord lv2))
+$(call rules,$(call std-build,lilv, lv2 sratom serd sord))
+$(call rules,$(call std-build,suil, lv2))
 
 # specialize festival, multiple tarballs
 festival:
@@ -300,7 +345,13 @@ clean:
 install:
        cp -a $(ver_mjpegtools)/mpeg2enc/mpeg2enc $(BINDIR)/.
        cp -a $(ver_mjpegtools)/mplex/mplex $(BINDIR)/.
+else
+# not WANT_CIN_3RDPARTY
+all:
+clean:
+install:
 
+endif
 val-%:
        @echo $($(subst val-,,$@))