|
| 1 | +diff '--color=auto' -uNr panda3d/makepanda/makepandacore.py panda3d.mod/makepanda/makepandacore.py |
| 2 | +--- panda3d/makepanda/makepandacore.py 2024-05-17 15:33:46.876526187 +0530 |
| 3 | ++++ panda3d.mod/makepanda/makepandacore.py 2024-05-17 17:06:05.318793873 +0530 |
| 4 | +@@ -2681,15 +2681,17 @@ |
| 5 | + arch_dir = 'arch-arm64' |
| 6 | + else: |
| 7 | + arch_dir = 'arch-' + arch |
| 8 | +- SDK["SYSROOT"] = os.path.join(ndk_root, 'platforms', 'android-%s' % (api), arch_dir).replace('\\', '/') |
| 9 | +- #IncDirectory("ALWAYS", os.path.join(SDK["SYSROOT"], 'usr', 'include')) |
| 10 | ++ SDK["SYSROOT"] = os.path.join(ndk_root, "toolchains", "llvm", "prebuilt", "linux-x86_64", "sysroot", "usr") |
| 11 | ++ IncDirectory("ALWAYS", os.path.join(SDK["SYSROOT"], 'usr', 'include')) |
| 12 | + |
| 13 | + # Starting with NDK r16, libc++ is the recommended STL to use. |
| 14 | + stdlibc = os.path.join(ndk_root, 'sources', 'cxx-stl', 'llvm-libc++') |
| 15 | + IncDirectory("ALWAYS", os.path.join(stdlibc, 'include').replace('\\', '/')) |
| 16 | +- LibDirectory("ALWAYS", os.path.join(stdlibc, 'libs', abi).replace('\\', '/')) |
| 17 | ++ LibDirectory("ALWAYS", os.path.join(ndk_root, "toolchains", "llvm", "prebuilt", |
| 18 | ++ "linux-x86_64", "sysroot", "usr", "lib", |
| 19 | ++ ANDROID_TRIPLE, str(ANDROID_API)) .replace('\\', '", "')) |
| 20 | + |
| 21 | +- stl_lib = os.path.join(stdlibc, 'libs', abi, 'libc++_shared.so') |
| 22 | ++ stl_lib = os.path.join(ndk_root, SDK["SYSROOT"], "lib", ANDROID_TRIPLE, "libc++_shared.so") |
| 23 | + LibName("ALWAYS", stl_lib.replace('\\', '/')) |
| 24 | + CopyFile(os.path.join(GetOutputDir(), 'lib', 'libc++_shared.so'), stl_lib) |
| 25 | + |
| 26 | +@@ -2699,11 +2701,12 @@ |
| 27 | + IncDirectory("ALWAYS", support.replace('\\', '/')) |
| 28 | + if api < 21: |
| 29 | + LibName("ALWAYS", "-landroid_support") |
| 30 | +- |
| 31 | ++ |
| 32 | ++ target_api = os.environ["ANDROID_TARGET_API"] |
| 33 | + # Determine the location of android.jar. |
| 34 | +- SDK["ANDROID_JAR"] = os.path.join(sdk_root, 'platforms', 'android-%s' % (api), 'android.jar') |
| 35 | ++ SDK["ANDROID_JAR"] = os.path.join(sdk_root, 'platforms', 'android-%s' % (target_api), 'android.jar') |
| 36 | + if not os.path.isfile(SDK["ANDROID_JAR"]): |
| 37 | +- exit("Cannot find %s. Install platform API level %s via the SDK manager or change the targeted API level with --target=android-#" % (SDK["ANDROID_JAR"], api)) |
| 38 | ++ exit("Cannot find %s. Install platform API level %s via the SDK manager or change the targeted API level with --target=android-#" % (SDK["ANDROID_JAR"], target_api)) |
| 39 | + |
| 40 | + # Which build tools versions do we have? Pick the latest. |
| 41 | + versions = [] |
| 42 | +diff '--color=auto' -uNr panda3d/makepanda/makepanda.py panda3d.mod/makepanda/makepanda.py |
| 43 | +--- panda3d/makepanda/makepanda.py 2024-05-17 15:33:46.856521623 +0530 |
| 44 | ++++ panda3d.mod/makepanda/makepanda.py 2024-05-17 16:53:32.974433320 +0530 |
| 45 | +@@ -1197,7 +1197,7 @@ |
| 46 | + # CgGL is covered by the Cg framework, and we don't need X11 components on OSX |
| 47 | + if not PkgSkip("NVIDIACG") and not RUNTIME: |
| 48 | + SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg") |
| 49 | +- if not RUNTIME and GetTarget() != "android": |
| 50 | ++ if not RUNTIME and False: # GetTarget() != "android": |
| 51 | + SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h")) |
| 52 | + |
| 53 | + if GetHost() != "darwin": |
| 54 | +@@ -1580,23 +1580,12 @@ |
| 55 | + if 'NOARCH:' + arch.upper() not in opts: |
| 56 | + cmd += " -arch %s" % arch |
| 57 | + |
| 58 | +- if "SYSROOT" in SDK: |
| 59 | +- if GetTarget() != "android": |
| 60 | +- cmd += ' --sysroot=%s' % (SDK["SYSROOT"]) |
| 61 | +- else: |
| 62 | +- ndk_dir = SDK["ANDROID_NDK"].replace('\\', '/') |
| 63 | +- cmd += ' -isystem %s/sysroot/usr/include' % (ndk_dir) |
| 64 | +- cmd += ' -isystem %s/sysroot/usr/include/%s' % (ndk_dir, SDK["ANDROID_TRIPLE"]) |
| 65 | +- cmd += ' -no-canonical-prefixes' |
| 66 | +- |
| 67 | + # Android-specific flags. |
| 68 | + arch = GetTargetArch() |
| 69 | + |
| 70 | + if GetTarget() == "android": |
| 71 | + # Most of the specific optimization flags here were |
| 72 | + # just copied from the default Android Makefiles. |
| 73 | +- if "ANDROID_API" in SDK: |
| 74 | +- cmd += ' -D__ANDROID_API__=' + str(SDK["ANDROID_API"]) |
| 75 | + if "ANDROID_GCC_TOOLCHAIN" in SDK: |
| 76 | + cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/') |
| 77 | + cmd += ' -ffunction-sections -funwind-tables' |
| 78 | +@@ -2117,33 +2106,17 @@ |
| 79 | + for arch in OSX_ARCHS: |
| 80 | + if 'NOARCH:' + arch.upper() not in opts: |
| 81 | + cmd += " -arch %s" % arch |
| 82 | +- |
| 83 | ++ |
| 84 | + elif GetTarget() == 'android': |
| 85 | + arch = GetTargetArch() |
| 86 | + if "ANDROID_GCC_TOOLCHAIN" in SDK: |
| 87 | + cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/') |
| 88 | + cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now" |
| 89 | +- if arch == 'armv7a': |
| 90 | +- cmd += ' -target armv7-none-linux-androideabi' |
| 91 | +- cmd += " -march=armv7-a -Wl,--fix-cortex-a8" |
| 92 | +- elif arch == 'arm': |
| 93 | +- cmd += ' -target armv5te-none-linux-androideabi' |
| 94 | +- elif arch == 'aarch64': |
| 95 | +- cmd += ' -target aarch64-none-linux-android' |
| 96 | +- elif arch == 'mips': |
| 97 | +- cmd += ' -target mipsel-none-linux-android' |
| 98 | +- cmd += ' -mips32' |
| 99 | +- elif arch == 'mips64': |
| 100 | +- cmd += ' -target mips64el-none-linux-android' |
| 101 | +- elif arch == 'x86': |
| 102 | +- cmd += ' -target i686-none-linux-android' |
| 103 | +- elif arch == 'x86_64': |
| 104 | +- cmd += ' -target x86_64-none-linux-android' |
| 105 | + cmd += ' -lc -lm' |
| 106 | + else: |
| 107 | + cmd += " -pthread" |
| 108 | + |
| 109 | +- if "SYSROOT" in SDK: |
| 110 | ++ if "SYSROOT" in SDK and GetTarget() != 'android': |
| 111 | + cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"]) |
| 112 | + |
| 113 | + if LDFLAGS != "": |
0 commit comments