diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2020-09-30 17:08:02 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-30 17:08:02 +1000 |
commit | 16be0948bf1913babf1d563218aca522ed74568c (patch) | |
tree | f541c8b1eb0a45230311a7570bd32818fb594682 | |
parent | 2ab4659197ebdcc7b76c04d93f290a41b6f065dd (diff) | |
parent | 57063c5a474bbcc9c460f1dfae64d9e6f3695831 (diff) |
Merge pull request #18456 from fuzzard/apple_configure_rework
[tools/depends] Apple platform configure rework
-rw-r--r-- | docs/README.iOS.md | 5 | ||||
-rw-r--r-- | docs/README.macOS.md | 5 | ||||
-rw-r--r-- | docs/README.tvOS.md | 1 | ||||
-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 | 130 | ||||
-rw-r--r-- | tools/depends/m4/ax_compare_version.m4 | 177 | ||||
-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 | 12 | ||||
-rw-r--r-- | tools/depends/target/python3/darwin_embedded.patch | 132 | ||||
-rw-r--r-- | tools/depends/target/samba-gplv3/Makefile | 5 |
13 files changed, 348 insertions, 146 deletions
diff --git a/docs/README.iOS.md b/docs/README.iOS.md index 85052b655f..29a5598941 100644 --- a/docs/README.iOS.md +++ b/docs/README.iOS.md @@ -81,12 +81,13 @@ git clone https://github.com/xbmc/xbmc kodi Kodi can be built as a 64bit program for iOS. The dependencies are built in `$HOME/kodi/tools/depends` and installed into `/Users/Shared/xbmc-depends`. **TIP:** Look for comments starting with `Or ...` and only execute the command(s) you need. +**NOTE:** `--with-platform` is mandatory for all Apple platforms Configure build: ``` cd $HOME/kodi/tools/depends ./bootstrap -./configure --host=aarch64-apple-darwin +./configure --host=aarch64-apple-darwin --with-platform=ios ``` Build tools and dependencies: @@ -100,7 +101,7 @@ make -j$(getconf _NPROCESSORS_ONLN) **NOTE:** **Advanced developers** may want to specify an iOS SDK version (if multiple versions are installed) in the configure line(s) shown above. The example below would use the iOS SDK 11.0: ``` -./configure --host=aarch64-apple-darwin --with-sdk=11.0 +./configure --host=aarch64-apple-darwin --with-platform=ios --with-sdk=11.0 ``` **[back to top](#table-of-contents)** | **[back to section top](#4-configure-and-build-tools-and-dependencies)** diff --git a/docs/README.macOS.md b/docs/README.macOS.md index a8347384ce..85c38e5ad5 100644 --- a/docs/README.macOS.md +++ b/docs/README.macOS.md @@ -81,12 +81,13 @@ git clone https://github.com/xbmc/xbmc kodi Kodi can be built as either a 32bit or 64bit program. The dependencies are built in `$HOME/kodi/tools/depends` and installed into `/Users/Shared/xbmc-depends`. **TIP:** Look for comments starting with `Or ...` and only execute the command(s) you need. +**NOTE:** `--with-platform` is mandatory for all Apple platforms Configure build: ``` cd $HOME/kodi/tools/depends ./bootstrap -./configure --host=x86_64-apple-darwin +./configure --host=x86_64-apple-darwin --with-platform=macos ``` Build tools and dependencies: @@ -100,7 +101,7 @@ make -j$(getconf _NPROCESSORS_ONLN) **NOTE:** **Advanced developers** may want to specify an SDK version (if multiple versions are installed) in the configure line(s) shown above. The example below would use SDK 10.13: ``` -./configure --host=x86_64-apple-darwin --with-sdk=10.13 +./configure --host=x86_64-apple-darwin --with-platform=macos --with-sdk=10.13 ``` **[back to top](#table-of-contents)** | **[back to section top](#4-configure-and-build-tools-and-dependencies)** diff --git a/docs/README.tvOS.md b/docs/README.tvOS.md index 483b613840..735cf2b443 100644 --- a/docs/README.tvOS.md +++ b/docs/README.tvOS.md @@ -86,6 +86,7 @@ git clone https://github.com/xbmc/xbmc kodi ## 4. Configure and build tools and dependencies Kodi can be built as a 64bit program only for tvOS. The dependencies are built in `$HOME/kodi/tools/depends` and installed into `/Users/Shared/xbmc-depends`. +**NOTE:** `--with-platform` is mandatory for all Apple platforms Configure build: ``` 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..83831b01fb 100644 --- a/tools/depends/configure.ac +++ b/tools/depends/configure.ac @@ -8,6 +8,7 @@ AC_CANONICAL_HOST m4_include([m4/xbmc_arch.m4]) m4_include([m4/ax_cxx_compile_stdcxx.m4]) +m4_include([m4/ax_compare_version.m4]) # check for not same cpu value AC_DEFUN([MC_CHECK_NOT_CPU], @@ -167,10 +168,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 +328,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,84 +337,84 @@ 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 2>&1) + # test if sdk is available to xcodebuild, otherwise error out + valid_sdk=[`echo $use_sdk_path | grep "error:"`] + + if test "x$valid_sdk" != "x"; then + AC_MSG_ERROR("invalid SDK version provided (--with-sdk=$use_sdk) is not available in xcodebuild -showsdks") + fi + 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}" - - # now that we know which sdk, error check sdk_name - case $use_sdk in - 10.13);; - 10.14);; - 10.15);; - *) - 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" + target_minver="10.13" ;; - 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.*);; - 13.*);; - 14.*);; - *) - AC_MSG_ERROR(error in configure of --with-sdk=$use_sdk) - ;; - 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 + + AX_COMPARE_VERSION([$use_sdk], [ge], [$target_minver], , AC_MSG_ERROR("invalid SDK version provided (--with-sdk=$use_sdk) less than minimum supported ($target_minver)")) + + 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 +440,8 @@ case $use_platform in AC_MSG_ERROR([$use_platform is only supported on the darwin_embedded platform]) fi ;; + ios|macos) + ;; auto) ;; *) @@ -634,7 +642,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/ax_compare_version.m4 b/tools/depends/m4/ax_compare_version.m4 new file mode 100644 index 0000000000..ffb4997e8b --- /dev/null +++ b/tools/depends/m4/ax_compare_version.m4 @@ -0,0 +1,177 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_compare_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# This macro compares two version strings. Due to the various number of +# minor-version numbers that can exist, and the fact that string +# comparisons are not compatible with numeric comparisons, this is not +# necessarily trivial to do in a autoconf script. This macro makes doing +# these comparisons easy. +# +# The six basic comparisons are available, as well as checking equality +# limited to a certain number of minor-version levels. +# +# The operator OP determines what type of comparison to do, and can be one +# of: +# +# eq - equal (test A == B) +# ne - not equal (test A != B) +# le - less than or equal (test A <= B) +# ge - greater than or equal (test A >= B) +# lt - less than (test A < B) +# gt - greater than (test A > B) +# +# Additionally, the eq and ne operator can have a number after it to limit +# the test to that number of minor versions. +# +# eq0 - equal up to the length of the shorter version +# ne0 - not equal up to the length of the shorter version +# eqN - equal up to N sub-version levels +# neN - not equal up to N sub-version levels +# +# When the condition is true, shell commands ACTION-IF-TRUE are run, +# otherwise shell commands ACTION-IF-FALSE are run. The environment +# variable 'ax_compare_version' is always set to either 'true' or 'false' +# as well. +# +# Examples: +# +# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) +# +# would both be true. +# +# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) +# +# would both be false. +# +# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) +# +# would be true because it is only comparing two minor versions. +# +# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) +# +# would be true because it is only comparing the lesser number of minor +# versions of the two values. +# +# Note: The characters that separate the version numbers do not matter. An +# empty string is the same as version 0. OP is evaluated by autoconf, not +# configure, so must be a string, not a variable. +# +# The author would like to acknowledge Guido Draheim whose advice about +# the m4_case and m4_ifvaln functions make this macro only include the +# portions necessary to perform the specific comparison specified by the +# OP argument in the final configure script. +# +# LICENSE +# +# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 13 + +dnl ######################################################################### +AC_DEFUN([AX_COMPARE_VERSION], [ + AC_REQUIRE([AC_PROG_AWK]) + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + AS_VAR_PUSHDEF([A],[ax_compare_version_A]) + A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + AS_VAR_PUSHDEF([B],[ax_compare_version_B]) + B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary + dnl # then the first line is used to determine if the condition is true. + dnl # The sed right after the echo is to remove any indented white space. + m4_case(m4_tolower($2), + [lt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [gt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [le],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ], + [ge],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ],[ + dnl Split the operator from the subversion count if present. + m4_bmatch(m4_substr($2,2), + [0],[ + # A count of zero means use the length of the shorter version. + # Determine the number of characters in A and B. + ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` + ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` + + # Set A to no more than B's length and B to no more than A's length. + A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` + B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` + ], + [[0-9]+],[ + # A count greater than zero means use only that many subversions + A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + ], + [.+],[ + AC_WARNING( + [invalid OP numeric parameter: $2]) + ],[]) + + # Pad zeros at end of numbers to make same length. + ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" + B="$B`echo $A | sed 's/./0/g'`" + A="$ax_compare_version_tmp_A" + + # Check for equality or inequality as necessary. + m4_case(m4_tolower(m4_substr($2,0,2)), + [eq],[ + test "x$A" = "x$B" && ax_compare_version=true + ], + [ne],[ + test "x$A" != "x$B" && ax_compare_version=true + ],[ + AC_WARNING([invalid OP parameter: $2]) + ]) + ]) + + AS_VAR_POPDEF([A])dnl + AS_VAR_POPDEF([B])dnl + + dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. + if test "$ax_compare_version" = "true" ; then + m4_ifvaln([$4],[$4],[:])dnl + m4_ifvaln([$5],[else $5])dnl + fi +]) dnl AX_COMPARE_VERSION 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..01260c7ffb 100644 --- a/tools/depends/target/python3/Makefile +++ b/tools/depends/target/python3/Makefile @@ -14,11 +14,21 @@ ifeq ($(findstring apple-darwin, $(HOST)), apple-darwin) LINK_ICONV=-framework CoreFoundation -liconv endif +ifeq ($(OS), darwin_embedded) + EXTRA_CONFIGURE=ac_cv_func_wait3=no ac_cv_func_wait4=no ac_cv_func_waitpid=no \ + ac_cv_func_execv=no ac_cv_func_fexecv=no ac_cv_func_getentropy=no \ + ac_cv_func_setpriority=no ac_cv_func_sendfile=no ac_cv_header_sched_h=no \ + ac_cv_func_posix_spawn=no ac_cv_func_posix_spawnp=no \ + ac_cv_func_forkpty=no ac_cv_lib_util_forkpty=no \ + ac_cv_func_getgroups=no +endif + # configuration settings CONFIGURE=./configure --prefix=$(PREFIX) \ --disable-shared \ --without-ensurepip \ - --disable-framework --with-system-expat --with-system-ffi --without-pymalloc --enable-ipv6 + --disable-framework --with-system-expat --with-system-ffi --without-pymalloc --enable-ipv6 \ + $(EXTRA_CONFIGURE) LIBDYLIB=$(PLATFORM)/libpython3.8.a diff --git a/tools/depends/target/python3/darwin_embedded.patch b/tools/depends/target/python3/darwin_embedded.patch index 8297615b81..65c2ce70f8 100644 --- a/tools/depends/target/python3/darwin_embedded.patch +++ b/tools/depends/target/python3/darwin_embedded.patch @@ -187,7 +187,12 @@ /* Report the posix error to our parent process. */ /* We ignore all write() return values as the total size of our writes is less than PIPEBUF and we cannot do anything about an error anyways. -@@ -690,7 +709,8 @@ +@@ -686,11 +705,12 @@ + preexec_fn_args_tuple = PyTuple_New(0); + if (!preexec_fn_args_tuple) + goto cleanup; +- PyOS_BeforeFork(); ++// PyOS_BeforeFork(); need_after_fork = 1; } @@ -197,6 +202,26 @@ if (pid == 0) { /* Child process */ /* +@@ -704,7 +724,7 @@ + * This call may not be async-signal-safe but neither is calling + * back into Python. The user asked us to use hope as a strategy + * to avoid deadlock... */ +- PyOS_AfterFork_Child(); ++// PyOS_AfterFork_Child(); + } + + child_exec(exec_array, argv, envp, cwd, +@@ -723,8 +743,8 @@ + + Py_XDECREF(cwd_obj2); + +- if (need_after_fork) +- PyOS_AfterFork_Parent(); ++// if (need_after_fork) ++// PyOS_AfterFork_Parent(); + if (envp) + _Py_FreeCharPArray(envp); + if (argv) --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -806,8 +806,10 @@ @@ -214,77 +239,42 @@ wchar_t *path = Py_DecodeLocale(execpath, &len); --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c -@@ -216,6 +216,22 @@ +@@ -196,8 +196,8 @@ + #else + /* Unix functions that the configure script doesn't check for */ + #ifndef __VXWORKS__ +-#define HAVE_EXECV 1 +-#define HAVE_FORK 1 ++//#define HAVE_EXECV 0 ++//#define HAVE_FORK 0 + #if defined(__USLC__) && defined(__SCO_VERSION__) /* SCO UDK Compiler */ + #define HAVE_FORK1 1 + #endif +@@ -210,8 +210,8 @@ + #define HAVE_KILL 1 + #define HAVE_OPENDIR 1 + #define HAVE_PIPE 1 +-#define HAVE_SYSTEM 1 +-#define HAVE_WAIT 1 ++//#define HAVE_SYSTEM 0 ++//#define HAVE_WAIT 0 + #define HAVE_TTYNAME 1 #endif /* _MSC_VER */ #endif /* ! __WATCOMC__ || __QNX__ */ +--- a/Include/intrcheck.h ++++ b/Include/intrcheck.h +@@ -7,13 +7,13 @@ -+# undef HAVE_EXECV -+# undef HAVE_FORK -+# undef HAVE_FORK1 -+# undef HAVE_FORKPTY -+# undef HAVE_GETGROUPS -+# undef HAVE_POSIX_SPAWN -+# undef HAVE_POSIX_SPAWNP -+# undef HAVE_SCHED_H -+# undef HAVE_SENDFILE -+# undef HAVE_SETPRIORITY -+# undef HAVE_SPAWNV -+# undef HAVE_SYSTEM -+# undef HAVE_WAIT -+# undef HAVE_WAIT3 -+# undef HAVE_WAIT4 -+# undef HAVE_WAITPID - - /*[clinic input] - # one of the few times we lie about this name! -@@ -488,6 +504,10 @@ - } + PyAPI_FUNC(int) PyOS_InterruptOccurred(void); + PyAPI_FUNC(void) PyOS_InitInterrupts(void); +-#ifdef HAVE_FORK ++//#ifdef HAVE_FORK + #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000 + PyAPI_FUNC(void) PyOS_BeforeFork(void); + PyAPI_FUNC(void) PyOS_AfterFork_Parent(void); + PyAPI_FUNC(void) PyOS_AfterFork_Child(void); #endif - -+void PyOS_BeforeFork(void){} -+void PyOS_AfterFork_Parent(void){} -+void PyOS_AfterFork_Child(void){} -+ - /* Legacy wrapper */ - void - PyOS_AfterFork(void) -@@ -5239,6 +5259,8 @@ - #endif - _Py_END_SUPPRESS_IPH - -+ Py_RETURN_NONE; -+ - /* If we get here it's definitely an error */ - - free_string_array(argvlist, argc); -@@ -5319,6 +5341,12 @@ - #endif - _Py_END_SUPPRESS_IPH - -+ while (--envc >= 0) -+ PyMem_DEL(envlist[envc]); -+ PyMem_DEL(envlist); -+ // iOS: we return now -+ Py_RETURN_NONE; -+ - /* If we get here it's definitely an error */ - - posix_path_error(path); -@@ -6135,7 +6163,7 @@ - return NULL; - } - PyOS_BeforeFork(); -- pid = fork1(); -+ pid = -1; - if (pid == 0) { - /* child: this clobbers and resets the import lock. */ - PyOS_AfterFork_Child(); -@@ -6173,7 +6201,7 @@ - return NULL; - } - PyOS_BeforeFork(); -- pid = fork(); -+ pid = -1; - if (pid == 0) { - /* child: this clobbers and resets the import lock. */ - PyOS_AfterFork_Child(); +-#endif ++//#endif + /* Deprecated, please use PyOS_AfterFork_Child() instead */ + Py_DEPRECATED(3.7) PyAPI_FUNC(void) PyOS_AfterFork(void); 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 |