From f24c60870531689d95c056037e48cd29ad1d17bb Mon Sep 17 00:00:00 2001 From: David Tardon Date: Mon, 20 Oct 2014 14:21:22 +0200 Subject: allow to build with system opencollada Change-Id: I6101099c57d429987e06bca0652c843f4a94f8cc diff --git a/Makefile.fetch b/Makefile.fetch index e8ccf5b..18b12be 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -184,7 +184,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR) $(call fetch_Optional,NSS,NSS_TARBALL) \ $(call fetch_Optional_pack,NUMBERTEXT_EXTENSION_PACK) \ $(call fetch_Optional,ODFGEN,ODFGEN_TARBALL) \ - $(call fetch_Optional,COLLADA2GLTF,OPENCOLLADA_TARBALL) \ + $(call fetch_Optional,OPENCOLLADA,OPENCOLLADA_TARBALL) \ $(call fetch_Optional,OPENLDAP,OPENLDAP_TARBALL) \ $(call fetch_Optional,OPENSSL,OPENSSL_TARBALL) \ $(call fetch_Optional,ORCUS,ORCUS_TARBALL) \ diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 5277aea..911dab1 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -3371,6 +3371,20 @@ endif # SYSTEN_LIBGLTF ifeq ($(ENABLE_COLLADA),TRUE) +ifeq ($(SYSTEM_OPENCOLLADA),TRUE) + +define gb_LinkTarget__use_opencollada_parser +$(call gb_LinkTarget_set_include,$(1),\ + $$(INCLUDE) \ + $(OPENCOLLADA_CFLAGS) \ +) + +$(call gb_LinkTarget_add_libs,$(1),$(OPENCOLLADA_LIBS)) + +endef + +else # !SYSTEM_OPENCOLLADA + define gb_LinkTarget__use_opencollada_parser $(call gb_LinkTarget_set_include,$(1),\ -I$(call gb_UnpackedTarball_get_dir,opencollada)/COLLADABaseUtils/include \ @@ -3385,6 +3399,8 @@ $(call gb_LinkTarget_use_static_libraries,$(1),\ ) endef +endif # SYSTEM_OPENCOLLADA + define gb_LinkTarget__use_collada2gltf $(call gb_LinkTarget_set_include,$(1),\ -I$(call gb_UnpackedTarball_get_dir,collada2gltf) \ diff --git a/config_host.mk.in b/config_host.mk.in index 0fefbb0..738c80c 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -431,7 +431,8 @@ export OOOP_SAMPLES_PACK=@OOOP_SAMPLES_PACK@ export OOOP_TEMPLATES_PACK=@OOOP_TEMPLATES_PACK@ export OOO_JUNIT_JAR=@OOO_JUNIT_JAR@ export OOO_VENDOR=@OOO_VENDOR@ -export OPENSSL_CFLAGS=$(gb_SPACE)@OPENSSL_CFLAGS@ +export OPENCOLLADA_CFLAGS=$(gb_SPACE)@OPENCOLLADA_CFLAGS@ +export OPENCOLLADA_LIBS=$(gb_SPACE)@OPENCOLLADA_LIBS@ export OPENSSL_LIBS=$(gb_SPACE)@OPENSSL_LIBS@ export ORCUS_CFLAGS=$(gb_SPACE)@ORCUS_CFLAGS@ export ORCUS_LIBS=$(gb_SPACE)@ORCUS_LIBS@ @@ -558,6 +559,7 @@ export SYSTEM_NPAPI_HEADERS=@SYSTEM_NPAPI_HEADERS@ export SYSTEM_NSS=@SYSTEM_NSS@ export SYSTEM_ODBC_HEADERS=@SYSTEM_ODBC_HEADERS@ export SYSTEM_ODFGEN=@SYSTEM_ODFGEN@ +export SYSTEM_OPENCOLLADA=@SYSTEM_OPENCOLLADA@ export SYSTEM_OPENLDAP=@SYSTEM_OPENLDAP@ export SYSTEM_OPENSSL=@SYSTEM_OPENSSL@ export SYSTEM_PAGEMAKER=@SYSTEM_PAGEMAKER@ diff --git a/configure.ac b/configure.ac index 17feb1a..5d2198b 100644 --- a/configure.ac +++ b/configure.ac @@ -1641,6 +1641,11 @@ AC_ARG_WITH(system-ucpp, [Use ucpp already on system.]),, []) +AC_ARG_WITH(system-opencollada, + AS_HELP_STRING([--with-system-opencollada], + [Use openCOLLADA already on system.]),, + [with_system_opencollada=no]) + AC_ARG_WITH(system-openldap, AS_HELP_STRING([--with-system-openldap], [Use the OpenLDAP LDAP SDK already on system.]),, @@ -10342,11 +10347,41 @@ if test "$enable_collada" != "no" -a "$ENABLE_GLTF" = "TRUE"; then AC_MSG_RESULT([yes]) ENABLE_COLLADA=TRUE AC_DEFINE(HAVE_FEATURE_COLLADA,1) + AC_MSG_CHECKING([which OPENCOLLADA to use]) + if test "$with_system_opencollada" = "yes"; then + AC_MSG_RESULT([external]) + SYSTEM_OPENCOLLADA=TRUE + AS_IF([test -n "$OPENCOLLADA_CFLAGS"],[],[AC_MSG_ERROR([export OPENCOLLADA_CFLAGS])]) + AS_IF([test -n "$OPENCOLLADA_LIBS"],[],[AC_MSG_ERROR([export OPENCOLLADA_LIBS])]) + AC_LANG_PUSH([C++]) + save_CXXFLAGS=$CXXFLAGS + save_CPPFLAGS=$CPPFLAGS + CXXFLAGS="$CXXFLAGS $OPENCOLLADA_CFLAGS" + CPPFLAGS="$CPPFLAGS $OPENCOLLADA_CFLAGS" + AC_CHECK_HEADERS( + COLLADABU.h \ + COLLADAFW.h \ + COLLADASaxFWLLoader.h \ + GeneratedSaxParser.h, + [], + [AC_MSG_ERROR([openCOLLADA headers not found. Install openCOLLADA])], + []) + CXXFLAGS=$save_CXXFLAGS + CPPFLAGS=$save_CPPFLAGS + AC_LANG_POP([C++]) + OPENCOLLADA_CFLAGS=$(printf '%s' "$OPENCOLLADA_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g") + else + AC_MSG_RESULT([internal]) + BUILD_TYPE="$BUILD_TYPE OPENCOLLADA" + fi BUILD_TYPE="$BUILD_TYPE COLLADA2GLTF" else AC_MSG_RESULT([no]) fi AC_SUBST(ENABLE_COLLADA) +AC_SUBST([OPENCOLLADA_CFLAGS]) +AC_SUBST([OPENCOLLADA_LIBS]) +AC_SUBST([SYSTEM_OPENCOLLADA]) # pdf import? AC_MSG_CHECKING([whether to build the PDF import feature]) diff --git a/external/Module_external.mk b/external/Module_external.mk index c95ea20..688e335 100644 --- a/external/Module_external.mk +++ b/external/Module_external.mk @@ -75,7 +75,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,NEON,neon) \ $(call gb_Helper_optional,NSS,nss) \ $(call gb_Helper_optional,ODFGEN,libodfgen) \ - $(call gb_Helper_optional,COLLADA2GLTF,opencollada) \ + $(call gb_Helper_optional,OPENCOLLADA,opencollada) \ $(call gb_Helper_optional,OPENLDAP,openldap) \ $(call gb_Helper_optional,OPENSSL,openssl) \ $(call gb_Helper_optional,ORCUS,liborcus) \ -- cgit v0.10.2 From bd4e81bab2726cbab30b58a71c25db9b7d1ddb7e Mon Sep 17 00:00:00 2001 From: David Tardon Date: Mon, 20 Oct 2014 18:38:44 +0200 Subject: put back variable deleted by mistake Change-Id: Ic705fe6bb7c3b9bae4b09d0b487f48056675b4b8 diff --git a/config_host.mk.in b/config_host.mk.in index 738c80c..32b5145 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -433,6 +433,7 @@ export OOO_JUNIT_JAR=@OOO_JUNIT_JAR@ export OOO_VENDOR=@OOO_VENDOR@ export OPENCOLLADA_CFLAGS=$(gb_SPACE)@OPENCOLLADA_CFLAGS@ export OPENCOLLADA_LIBS=$(gb_SPACE)@OPENCOLLADA_LIBS@ +export OPENSSL_CFLAGS=$(gb_SPACE)@OPENSSL_CFLAGS@ export OPENSSL_LIBS=$(gb_SPACE)@OPENSSL_LIBS@ export ORCUS_CFLAGS=$(gb_SPACE)@ORCUS_CFLAGS@ export ORCUS_LIBS=$(gb_SPACE)@ORCUS_LIBS@ -- cgit v0.10.2