diff options
author | wsnipex <wsnipex@a1.net> | 2015-02-17 13:37:31 +0100 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2015-03-01 21:02:31 +0100 |
commit | b39251254de5fe8e4a9f00ebab21931c6fd3f5c6 (patch) | |
tree | ba397a9c9bd0b5da5a3e2bee22b585d6358f4c8d /tools | |
parent | 996b6a37f7381d6928eea7bd7332a05042b38ec2 (diff) |
[depends] add binary addon specific cmake Toolchain and autotools config.site
Diffstat (limited to 'tools')
-rw-r--r-- | tools/depends/configure.in | 3 | ||||
-rw-r--r-- | tools/depends/target/Toolchain_binaddons.cmake.in | 53 | ||||
-rw-r--r-- | tools/depends/target/config-binaddons.site.in | 175 | ||||
-rw-r--r-- | tools/depends/xbmc-addons.include | 6 |
4 files changed, 235 insertions, 2 deletions
diff --git a/tools/depends/configure.in b/tools/depends/configure.in index 8e4607300d..4a0553630f 100644 --- a/tools/depends/configure.in +++ b/tools/depends/configure.in @@ -2,7 +2,8 @@ AC_PREREQ(2.59) AC_INIT([xbmc-depends], [2.00], [http://trac.xbmc.org]) :${CFLAGS=""} AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_FILES([target/config.site native/config.site.native Makefile.include target/Toolchain.cmake]) +AC_CONFIG_FILES([target/config.site native/config.site.native Makefile.include target/Toolchain.cmake + target/config-binaddons.site target/Toolchain_binaddons.cmake]) AC_CANONICAL_HOST m4_include([../../m4/xbmc_arch.m4]) m4_include([../../m4/ax_cxx_compile_stdcxx_11.m4]) diff --git a/tools/depends/target/Toolchain_binaddons.cmake.in b/tools/depends/target/Toolchain_binaddons.cmake.in new file mode 100644 index 0000000000..cdc2fe4f6c --- /dev/null +++ b/tools/depends/target/Toolchain_binaddons.cmake.in @@ -0,0 +1,53 @@ +set(CMAKE_SYSTEM_VERSION 1) +set(OS "@platform_os@") +set(CPU "@use_cpu@") +set(PLATFORM "@use_platform@") +if("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android") + set(CMAKE_SYSTEM_NAME Linux) +endif() + +set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@) + +# set special CORE_SYSTEM_NAME +if("${OS}" STREQUAL "android") + set(CORE_SYSTEM_NAME android) + list(APPEND CMAKE_FIND_ROOT_PATH @use_toolchain@/sysroot/usr) +elseif("${OS}" STREQUAL "ios") + set(CORE_SYSTEM_NAME ios) +elseif("${PLATFORM}" STREQUAL "raspberry-pi") + set(CORE_SYSTEM_NAME rbpi) + list(APPEND CMAKE_FIND_ROOT_PATH @use_firmware@/opt/vc) + set(CMAKE_LIBRARY_PATH @CMAKE_FIND_ROOT_PATH@/lib:@use_firmware@/opt/vc/lib) + set(CMAKE_INCLUDE_PATH @CMAKE_FIND_ROOT_PATH@/include:@use_firmware@/opt/vc/include) +endif() + + +if("${OS}" STREQUAL "ios" OR "${OS}" STREQUAL "osx") + set(CMAKE_OSX_SYSROOT @use_sdk_path@) + list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT} ${CMAKE_OSX_SYSROOT}/usr) + set(CMAKE_LIBRARY_PATH @CMAKE_FIND_ROOT_PATH@/lib:@use_sdk_path@/lib) + set(CMAKE_INCLUDE_PATH @CMAKE_FIND_ROOT_PATH@/include:@use_sdk_path@/include) +endif() + +# specify the cross compiler +set(CMAKE_C_COMPILER @CC@) +set(CMAKE_CXX_COMPILER @CXX@) +set(CMAKE_AR @AR@ CACHE FILEPATH "Archiver") +set(CMAKE_LINKER @LD@ CACHE FILEPATH "Linker") +set(CMAKE_C_FLAGS "@platform_cflags@ @platform_includes@") +set(CMAKE_CXX_FLAGS "@platform_cxxflags@ @platform_includes@") +set(CMAKE_CPP_FLAGS "@platform_cflags@ @platform_includes@") +set(ENV{CFLAGS} ${CMAKE_C_FLAGS}) +set(ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS}) +set(ENV{CPPFLAGS} ${CMAKE_CPP_FLAGS}) +SET(ENV{LDFLAGS} "@platform_ldflags@") + +# search for programs in the build host directories +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +# for libraries and headers in the target directories +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +if(NOT OS STREQUAL "linux") + set(ADDONS_PREFER_STATIC_LIBS ON) +endif() diff --git a/tools/depends/target/config-binaddons.site.in b/tools/depends/target/config-binaddons.site.in new file mode 100644 index 0000000000..4248501146 --- /dev/null +++ b/tools/depends/target/config-binaddons.site.in @@ -0,0 +1,175 @@ +if test "@cross_compiling@" = "yes"; then +cross_compiling=yes +host=@use_host@ +host_alias=@use_host@ +fi + +LD="@LD@" +CC="@CC@" +CXX="@CXX@" +CPP="@CPP@" +AR="@AR@" +AS="@AS@" +NM="@NM@" +STRIP="@STRIP@" +RANLIB="@RANLIB@" +OBJDUMP="@OBJDUMP@" + +if test "@platform_os@" = "ios" ; then + export AS="@prefix@/@tool_dir@/bin/gas-preprocessor.pl @CC@ -arch @use_cpu@" + export CCAS="--tag CC @prefix@/@tool_dir@/bin/gas-preprocessor.pl @CC@ -arch @use_cpu@" +fi + +CFLAGS="@platform_cflags@ @platform_includes@ $CFLAGS" +LDFLAGS="@platform_ldflags@ $LDFLAGS" +CXXFLAGS="@platform_cxxflags@ @platform_includes@ $CXXFLAGS" +CPPFLAGS="@platform_cflags@ @platform_includes@ $CPPFLAGS" + +export PKG_CONFIG=@prefix@/@tool_dir@/bin/pkg-config +export YASM=@prefix@/@tool_dir@/bin/yasm +export NASM=@prefix@/@tool_dir@/bin/yasm + +PATH=@prefix@/@tool_dir@/bin:@use_toolchain@/usr/bin:@use_toolchain@/bin:$PATH +LD_LIBRARY_PATH=@prefix@/@tool_dir@/lib:$LD_LIBRARY_PATH + +NATIVE_ROOT=@prefix@/@tool_dir@ + +#afps-ng and libomxil-bellagio +ac_cv_func_malloc_0_nonnull=yes + +#curl +ac_cv_file__dev_urandom=yes +ac_cv_lib_ssl_SSL_connect=yes + +#gettext and libiconv +gl_cv_header_working_stdint_h=yes + +#libcec +ac_cv_search_dlopen=-ldl + +#libgcrypt +if test "${PACKAGE_NAME}" = "libgcrypt"; then + ac_cv_path_GPG_ERROR_CONFIG=@prefix@/@deps_dir@/bin/gpg-error-config + ac_cv_sys_symbol_underscore=no + CFLAGS="$CFLAGS -std=gnu99" +fi + +#python +ac_cv_func_gethostbyname_r=no +ac_cv_header_sys_un_h=yes + +#rsxs/projectm +jm_cv_func_gettimeofday_clobber=no +mac_cv_pkg_ldflags=-lz +if test "@platform_os@" = "osx"; then + ac_cv_func_strnlen_working=no + ac_cv_header_stdbool_h=yes +fi + +#gnutls +gl_cv_func_gettimeofday_clobber=no + + +#samba +SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes +samba_cv_CC_NEGATIVE_ENUM_VALUES=yes +libreplace_cv_HAVE_C99_VSNPRINTF=yes +samba_cv_HAVE_C99_VSNPRINTF=yes +ac_cv_header_standards_h=no + +ac_cv_file__proc_sys_kernel_core_pattern=no +samba_cv_SYSCONF_SC_NPROCESSORS_ONLN=no +libreplace_cv_HAVE_GETADDRINFO=no + +if test "${PACKAGE_NAME}" = "Samba" -a "@platform_os@" = "ios"; then + # disable python support + export PYTHON_VER=0.0 + # ios/osx-10.6 issue with collision of _MD5 exported from a system lib + export LDFLAGS="${LDFLAGS} -Wl,-unexported_symbol,_MD5* -lc" +fi + +if test "${PACKAGE_NAME}" = "Samba" -a "@platform_os@" = "osx"; then + # disable python support + export PYTHON_VER=0.0 + # ios/osx-10.6 issue with collision of _MD5 exported from a system lib + export LDFLAGS="${LDFLAGS} -Wl,-unexported_symbol,_MD5* -lc" + # uses OPT instead of CFLAGS + export OPT="${CFLAGS}" + # various configure overrides + ac_cv_header_libunwind_h=no + ac_cv_header_execinfo_h=no + # fixes crash on 10.6 if xbmc is built using 10.7 SDK with 10.6 min + ac_cv_func_vdprintf=no +fi + +if test "@platform_os@" = "android"; then + #samba + SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes + libreplace_cv_READDIR_GETDIRENTRIES=no + libreplace_cv_READDIR_GETDENTS=no + samba_cv_REPLACE_READDIR=no + samba_cv_HAVE_WRFILE_KEYTAB=yes + samba_cv_HAVE_GETTIMEOFDAY_TZ=yes + samba_cv_USE_SETREUID=yes + samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes + samba_cv_HAVE_IFACE_IFCONF=yes + samba_cv_HAVE_MMAP=yes + samba_cv_HAVE_FCNTL_LOCK=yes + samba_cv_HAVE_SECURE_MKSTEMP=yes + samba_cv_CC_NEGATIVE_ENUM_VALUES=yes + samba_cv_fpie=no + samba_cv_have_longlong=yes + samba_cv_HAVE_OFF64_T=yes + samba_cv_HAVE_UT_UT_TYPE=no + ac_cv_func_srand=yes + ac_cv_func_rand=yes + + #python: android doesn't have libutil + PYTHON_LDFLAGS="-L@prefix@/@deps_dir@/lib -lpython${PYTHON_VERSION} -lc -ldl -lm -lexpat -lffi -lintl -lssl -lcrypto" + +fi + +if test "@platform_os@" = "ios"; then + # tweaks for libffi (ios must use llvm-gcc-4.2) + if test "${PACKAGE_NAME}" = "libffi" ; then + case "@use_xcode@" in + 3.*.* | 4.* | 4.*.*) + export CC="@use_toolchain@/usr/bin/llvm-gcc-4.2" + export CPP="@use_toolchain@/usr/bin/llvm-gcc-4.2 -E" + ;; + *) + export CC="@use_toolchain@/usr/bin/clang" + export CPP="@use_toolchain@/usr/bin/clang -E" + ;; + esac + unset AS + unset CCAS + fi + + # tweaks for flac + if test "${ac_unique_file}" = "src/flac/main.c" ; then + # compiler barfs if we use -O3/O2 for flac + export CFLAGS=`echo ${CFLAGS} | sed 's/-O3/-Os/'` + export CPPFLAGS=`echo ${CPPFLAGS} | sed 's/-O3/-Os/'` + fi + + # tweaks for libmpeg2 + if test "${PACKAGE_NAME}" = "libmpeg2" ; then + export LDFLAGS="${LDFLAGS} -Wl,-read_only_relocs,suppress" + fi +fi + +#Fix for older, broken android toolchains +if test "${PACKAGE_NAME}" = "FreeType" -a "@platform_os@" = "android"; then + CFLAGS="$CFLAGS -std=gnu99" +fi + +# These libs do not correctly export their symbols. Force them in case +# -fvisibility=hidden is set. +if test "${ac_unique_file}" = "src/flac/main.c" || \ + test "${ac_unique_file}" = "src/framing.c" || \ + test "${ac_unique_file}" = "src/libdvdcss.c" || \ + test "${PACKAGE_NAME}" = "libmpeg2" || \ + test "${PACKAGE_NAME}" = "libssh2" ; then + CFLAGS="$CFLAGS -fvisibility=default" +fi diff --git a/tools/depends/xbmc-addons.include b/tools/depends/xbmc-addons.include index af0589be32..adb440a19d 100644 --- a/tools/depends/xbmc-addons.include +++ b/tools/depends/xbmc-addons.include @@ -62,7 +62,7 @@ $(TOOLCHAIN_FILE): $(abs_top_srcdir)/target/Toolchain_binaddons.cmake sed "s|@CMAKE_FIND_ROOT_PATH@|$(ADDON_DEPS_DIR)|g" $(abs_top_srcdir)/target/Toolchain_binaddons.cmake > $@ linux-system-libs: - mkdir -p $(ADDON_DEPS_DIR)/lib/pkgconfig + mkdir -p $(ADDON_DEPS_DIR)/lib/pkgconfig $(ADDON_DEPS_DIR)/include [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/x11.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/x11.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/x11.pc [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xproto.pc ] || ln -s /usr/share/pkgconfig/xproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/xproto.pc [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc ] || ln -s /usr/share/pkgconfig/kbproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc @@ -77,4 +77,8 @@ linux-system-libs: [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/sm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xmu.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xmu.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/xmu.pc [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/libdrm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/gl.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc + [ -f $(ADDON_DEPS_DIR)/lib/libGL.so ] || \ + (ln -s /usr/lib/$(HOST)/mesa $(ADDON_DEPS_DIR)/lib/mesa && ln -s $(ADDON_DEPS_DIR)/lib/mesa/libGL.so $(ADDON_DEPS_DIR)/lib/libGL.so) + [ -f $(ADDON_DEPS_DIR)/include/GL ] || ln -s /usr/include/GL $(ADDON_DEPS_DIR)/include/GL |