diff options
author | fuzzard <fuzzard@kodi.tv> | 2020-09-24 16:05:30 +1000 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2020-09-28 13:44:41 +1000 |
commit | b73ba2dd66c11cffad7e30fca96873db9c2fd4db (patch) | |
tree | 8795577f40530004849b85fa3be973fb0154d0a2 /tools | |
parent | 47be88b5acfa093b145e6467e9621a285a41675a (diff) |
[tools/depends] rework configure for apple platforms
reorder configure for apple platforms
introduce osx arm arch types
Update docs --with-platform mandatory usage for apple platforms
Update buildsteps ios/osx to use new mandatory --with-platform
Update samba to explicitly use -Wno-error=implicit-function-declaration since global use of flag was removed
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/buildsteps/ios/configure-depends | 1 | ||||
-rwxr-xr-x | tools/buildsteps/osx64/configure-depends | 1 | ||||
-rw-r--r-- | tools/depends/Makefile.include.in | 8 | ||||
-rw-r--r-- | tools/depends/configure.ac | 100 | ||||
-rw-r--r-- | tools/depends/m4/xbmc_arch.m4 | 9 | ||||
-rw-r--r-- | tools/depends/native/config.site.native.in | 8 | ||||
-rw-r--r-- | tools/depends/target/python3/Makefile | 6 | ||||
-rw-r--r-- | tools/depends/target/samba-gplv3/Makefile | 5 |
8 files changed, 88 insertions, 50 deletions
diff --git a/tools/buildsteps/ios/configure-depends b/tools/buildsteps/ios/configure-depends index 7f47472032..37e1f77cf4 100755 --- a/tools/buildsteps/ios/configure-depends +++ b/tools/buildsteps/ios/configure-depends @@ -7,6 +7,7 @@ then cd $WORKSPACE/tools/depends;./configure \ --with-tarballs=/Users/Shared/xbmc-depends/tarballs \ --host=aarch64-apple-darwin \ + --with-platform=ios \ --with-sdk=$SDK_VERSION \ --prefix=$XBMC_DEPENDS_ROOT $DEBUG_SWITCH fi diff --git a/tools/buildsteps/osx64/configure-depends b/tools/buildsteps/osx64/configure-depends index 2dd22d4a3e..c44250e05f 100755 --- a/tools/buildsteps/osx64/configure-depends +++ b/tools/buildsteps/osx64/configure-depends @@ -8,5 +8,6 @@ then --with-tarballs=/Users/Shared/xbmc-depends/tarballs \ --host=x86_64-apple-darwin \ --with-sdk=$SDK_VERSION \ + --with-platform=macos \ --prefix=$XBMC_DEPENDS_ROOT $DEBUG_SWITCH fi diff --git a/tools/depends/Makefile.include.in b/tools/depends/Makefile.include.in index dd841c65f8..06daf98e3a 100644 --- a/tools/depends/Makefile.include.in +++ b/tools/depends/Makefile.include.in @@ -92,10 +92,10 @@ STRIP_FOR_BUILD=@STRIP_FOR_BUILD@ READELF_FOR_BUILD=@READELF_FOR_BUILD@ OBJDUMP_FOR_BUILD=@OBJDUMP_FOR_BUILD@ -NATIVE_CFLAGS=@native_platform_min_version@ -I@prefix@/@tool_dir@/include -NATIVE_LDFLAGS=@native_platform_min_version@ -L@prefix@/@tool_dir@/lib -NATIVE_CPPFLAGS=@native_platform_min_version@ -I@prefix@/@tool_dir@/include -NATIVE_CXXFLAGS=@native_platform_min_version@ -I@prefix@/@tool_dir@/include +NATIVE_CFLAGS=@host_includes@ -I@prefix@/@tool_dir@/include +NATIVE_LDFLAGS=@host_includes@ -L@prefix@/@tool_dir@/lib +NATIVE_CPPFLAGS=@host_includes@ -I@prefix@/@tool_dir@/include +NATIVE_CXXFLAGS=@host_includes@ -I@prefix@/@tool_dir@/include ifeq ($(CPU), arm64) diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac index 83389ee165..9bf8a0325d 100644 --- a/tools/depends/configure.ac +++ b/tools/depends/configure.ac @@ -167,10 +167,22 @@ case $build in ;; *darwin*) build_os="osx" - native_platform_min_version=-mmacosx-version-min=`sw_vers | grep ProductVersion | sed -E "s/.*:.*(10\..*)\.?.*/\1/"` + host_includes=-mmacosx-version-min=`sw_vers | grep ProductVersion | awk '{ print $2}'` use_xcodepath=`xcode-select -print-path` use_build_toolchain=$use_xcodepath + use_xcodebuild=$use_xcodepath/usr/bin/xcodebuild + AC_MSG_RESULT(found xcodebuild at $use_xcodebuild) + + # acquire build platform (native) sdk sysroot. + build_platform=macosx + native_sdk_path=[`$use_xcodebuild -version -sdk $build_platform | grep ^Path | awk '{ print $2}'`] + host_includes+=" -isysroot $native_sdk_path" + android_toolchain_name="darwin-x86_64" + + if test "x$prefix" = "xNONE"; then + prefix=/Users/Shared/xbmc-depends + fi ;; *) AC_MSG_ERROR(unsupported native build platform: $build) @@ -315,13 +327,6 @@ case $host in ffmpeg_options_default="--enable-vaapi --enable-vdpau --cpu=$use_cpu" ;; *darwin*) - if test "x$prefix" = "xNONE"; then - prefix=/Users/Shared/xbmc-depends - fi - - use_xcodebuild=$use_xcodepath/usr/bin/xcodebuild - AC_MSG_RESULT(found xcodebuild at $use_xcodebuild) - # darwin builds are always cross cross_compiling="yes" @@ -331,21 +336,42 @@ case $host in platform_ldflags="-Wl,-search_paths_first" platform_cxxflags="-no-cpp-precomp" + case $use_platform in + tvos) + target_platform=appletvos + platform_os="darwin_embedded" + ;; + ios) + target_platform=iphoneos + platform_os="darwin_embedded" + ;; + macos) + target_platform=macosx + platform_os="osx" + ;; + *) + AC_MSG_ERROR(error in configure no platform provided --with-platform) + ;; + esac + + found_sdk_version=[`$use_xcodebuild -showsdks | grep "\-sdk $target_platform" | awk '{ print $2}'`] + use_sdk="${use_sdk:-$found_sdk_version}" + sdk_name=$target_platform$use_sdk + use_sdk_path=[`$use_xcodebuild -version -sdk $sdk_name Path`] + case $host in x86_64-apple-darwin) - MC_CHECK_NOT_CPU([$use_cpu], "arm") + MC_CHECK_NOT_CPU([$use_cpu], "arm*") # setup which cpu to use if test "x$use_cpu" = "xauto"; then use_cpu=x86_64 + meson_cpu=$use_cpu + else + AC_MSG_ERROR(invalid architecture (--with-cpu=$use_cpu)) fi - meson_cpu="x86_64" - - # setup which sdk to use - target_platform=macosx - found_sdk_version=[`$use_xcodebuild -showsdks | grep $target_platform | sort | tail -n 1 | awk '{ print $2}'`] - use_sdk="${use_sdk:-$found_sdk_version}" + target_minver="10.13" # now that we know which sdk, error check sdk_name case $use_sdk in @@ -355,39 +381,31 @@ case $host in *) AC_MSG_ERROR(error in configure of --with-sdk=$use_sdk) esac - sdk_name=$target_platform$use_sdk - platform_min_version="macosx-version-min=10.13" - - use_sdk_path=[`$use_xcodebuild -version -sdk $sdk_name Path`] - platform_os="osx" ;; aarch64-apple-darwin*) MC_CHECK_NOT_CPU([$use_cpu], "*86") - # setup which sdk to use - if test "$use_platform" = "tvos"; then - target_platform=appletvos - else - target_platform=iphoneos - fi - platform_min_version="$target_platform-version-min=11.0" + case $platform_os in + darwin_embedded) + target_minver="11.0" + ;; + osx) + target_minver="11.0" + ;; + *) + AC_MSG_ERROR(invalid platform for architecture ($host)) + ;; + esac # setup which cpu to use if test "x$use_cpu" = "xauto"; then use_cpu=arm64 - fi - - if test "$use_cpu" = "arm64"; then meson_cpu="aarch64" else - meson_cpu="arm" + AC_MSG_ERROR(invalid architecture (--with-cpu=$use_cpu)) fi - found_sdk_version=[`$use_xcodebuild -showsdks | grep "\-sdk $target_platform" | awk '{ print $2}'`] - use_sdk="${use_sdk:-$found_sdk_version}" - sdk_name=$target_platform$use_sdk - case $use_sdk in 11.*);; 12.*);; @@ -398,17 +416,15 @@ case $host in ;; esac - platform_os="darwin_embedded" - platform_cflags+=" -ftree-vectorize -pipe -Wno-trigraphs -fpascal-strings" platform_cflags+=" -Wreturn-type -Wunused-variable -fmessage-length=0 -gdwarf-2" - platform_cflags+=" -Wno-error=implicit-function-declaration" optimize_flags="-O3" - use_sdk_path=[`$use_xcodebuild -version -sdk $sdk_name | grep ^Path | awk '{ print $2}'`] platform_ldflags+=" -L$use_sdk_path/usr/lib" - platform_cxxflags+=" $cpu_flags" ;; esac + + platform_min_version="$target_platform-version-min=$target_minver" + platform_cflags+=" -arch $use_cpu -m$platform_min_version" platform_ldflags+=" -arch $use_cpu -m$platform_min_version -isysroot $use_sdk_path -stdlib=libc++" platform_cxxflags+=" -arch $use_cpu -m$platform_min_version -stdlib=libc++" @@ -434,6 +450,8 @@ case $use_platform in AC_MSG_ERROR([$use_platform is only supported on the darwin_embedded platform]) fi ;; + ios|macos) + ;; auto) ;; *) @@ -634,7 +652,7 @@ AC_SUBST(link_iconv) AC_SUBST(need_libiconv) AC_SUBST(use_gplv3) AC_SUBST(use_ccache) -AC_SUBST(native_platform_min_version) +AC_SUBST(host_includes) AC_SUBST(app_rendersystem) AC_SUBST(ffmpeg_options) diff --git a/tools/depends/m4/xbmc_arch.m4 b/tools/depends/m4/xbmc_arch.m4 index 83e42552c7..05b254d45d 100644 --- a/tools/depends/m4/xbmc_arch.m4 +++ b/tools/depends/m4/xbmc_arch.m4 @@ -14,6 +14,9 @@ case $build in amd64-*-freebsd*) AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_FREEBSD") ;; + arm-apple-darwin*) + AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX") + ;; x86_64-apple-darwin*) AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX") ;; @@ -46,7 +49,11 @@ case $host in AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_FREEBSD") ;; aarch64-apple-darwin*) - AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_EMBEDDED") + if test "$target_platform" = "macosx" ; then + AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX") + else + AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_EMBEDDED") + fi ;; x86_64-apple-darwin*) AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX") diff --git a/tools/depends/native/config.site.native.in b/tools/depends/native/config.site.native.in index d2d57b9ebb..fe0d54759d 100644 --- a/tools/depends/native/config.site.native.in +++ b/tools/depends/native/config.site.native.in @@ -9,10 +9,10 @@ STRIP="${STRIP:-@STRIP_FOR_BUILD@}" READELF="${READELF:-@READELF_FOR_BUILD@}" OBJDUMP="${OBJDUMP:-@OBJDUMP_FOR_BUILD@}" -CFLAGS="@native_platform_min_version@ -I@prefix@/@tool_dir@/include $CFLAGS" -LDFLAGS="@native_platform_min_version@ -L@prefix@/@tool_dir@/lib $LDFLAGS" -CPPFLAGS="@native_platform_min_version@ -I@prefix@/@tool_dir@/include $CPPFLAGS" -CXXFLAGS="@native_platform_min_version@ -I@prefix@/@tool_dir@/include $CXXFLAGS" +CFLAGS="@host_includes@ -I@prefix@/@tool_dir@/include $CFLAGS" +LDFLAGS="@host_includes@ -L@prefix@/@tool_dir@/lib $LDFLAGS" +CPPFLAGS="@host_includes@ -I@prefix@/@tool_dir@/include $CPPFLAGS" +CXXFLAGS="@host_includes@ -I@prefix@/@tool_dir@/include $CXXFLAGS" PKG_CONFIG=@prefix@/@tool_dir@/bin/pkg-config export PKG_CONFIG_LIBDIR=@prefix@/@tool_dir@/lib/pkgconfig diff --git a/tools/depends/target/python3/Makefile b/tools/depends/target/python3/Makefile index d3720b8163..fa32660dec 100644 --- a/tools/depends/target/python3/Makefile +++ b/tools/depends/target/python3/Makefile @@ -14,6 +14,12 @@ ifeq ($(findstring apple-darwin, $(HOST)), apple-darwin) LINK_ICONV=-framework CoreFoundation -liconv endif +ifeq ($(OS), darwin_embedded) + # Darwinembedded platforms do not have a public getentropy function + # getentropy is incorrectly found, so disable explicitly + export ac_cv_func_getentropy=no +endif + # configuration settings CONFIGURE=./configure --prefix=$(PREFIX) \ --disable-shared \ diff --git a/tools/depends/target/samba-gplv3/Makefile b/tools/depends/target/samba-gplv3/Makefile index b051561d82..55bb46b0bd 100644 --- a/tools/depends/target/samba-gplv3/Makefile +++ b/tools/depends/target/samba-gplv3/Makefile @@ -26,6 +26,11 @@ CONFIGURE=./configure --prefix=$(PREFIX) \ LIBDYLIB=$(PLATFORM)/bin/default/source3/libsmb/libsmbclient.a +ifeq ($(OS), darwin_embedded) + # build errors with _yp_get_default_domain NIS failure + CFLAGS+= -Wno-error=implicit-function-declaration +endif + export CC CXX CPP AR RANLIB LD AS NM STRIP TOOLCHAIN export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS export HOST |