Last active
April 6, 2019 17:23
-
-
Save rw-r-r-0644/2c3bf4c59071e0ffe8ced91e00aff2de to your computer and use it in GitHub Desktop.
WiiU support for meson in dkP pkgbuild-scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ONLY CONTAINS A TEMPORARY SOLUTION BEFORE DEVKITPRO IS UPDATED | |
DO NOT USE THIS PATCH UNLESS YOU ARE WORKING ON THE WIIU MESA PORT | |
- Replace /opt/devkitpro/meson-toolchain.sh with the file provided in this gist | |
- Create /opt/devkitpro/wiiuvars.sh with the file provided in this gist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SCRIPTDIR="${BASH_SOURCE%/*}" | |
make_flag_list() | |
{ | |
while (( "$#" )); do | |
echo -n "'$1'"; | |
if [ $# -gt 1 ]; then | |
echo -n ","; | |
fi | |
shift | |
done | |
} | |
if [ -z "$1" ]; then | |
echo "No platform specified." 1>&2 | |
exit 1 | |
fi | |
case "$1" in | |
"switch") | |
PLAT_SYSTEM="horizon" | |
PLAT_CPU_FAMILY="aarch64" | |
PLAT_CPU="cortex-a57" | |
PLAT_ENDIAN="little" | |
source ${SCRIPTDIR}/switchvars.sh | |
;; | |
"3ds") | |
PLAT_SYSTEM="horizon" | |
PLAT_CPU_FAMILY="arm" | |
PLAT_CPU="arm11mpcore" | |
PLAT_ENDIAN="little" | |
source ${SCRIPTDIR}/3dsvars.sh | |
;; | |
"nds") | |
PLAT_SYSTEM="bare" | |
PLAT_CPU_FAMILY="arm" | |
PLAT_CPU="arm946e-s" | |
PLAT_ENDIAN="little" | |
source ${SCRIPTDIR}/ndsvars.sh | |
;; | |
"ppc") | |
PLAT_SYSTEM="bare" | |
PLAT_CPU_FAMILY="ppc" | |
PLAT_CPU="ppc750" | |
PLAT_ENDIAN="big" | |
source ${SCRIPTDIR}/ppcvars.sh | |
;; | |
"wiiu") | |
PLAT_SYSTEM="cafe" | |
PLAT_CPU_FAMILY="ppc" | |
PLAT_CPU="ppc750" | |
PLAT_ENDIAN="big" | |
source ${SCRIPTDIR}/wiiuvars.sh | |
;; | |
*) | |
echo "Unsupported platform." 1>&2 | |
exit 1 | |
;; | |
esac | |
echo "[binaries]" | |
echo "c = '` which ${TOOL_PREFIX}gcc `'" | |
echo "cpp = '` which ${TOOL_PREFIX}g++ `'" | |
echo "ar = '` which ${TOOL_PREFIX}gcc-ar `'" | |
echo "strip = '` which ${TOOL_PREFIX}strip `'" | |
echo "pkgconfig = '` which ${TOOL_PREFIX}pkg-config `'" | |
echo "" | |
echo "[properties]" | |
echo "c_args = [` make_flag_list $CPPFLAGS $CFLAGS `]" | |
echo "c_link_args = [` make_flag_list $LDFLAGS $LIBS `]" | |
echo "cpp_args = [` make_flag_list $CPPFLAGS $CXXFLAGS `]" | |
echo "cpp_link_args = [` make_flag_list $LDFLAGS $LIBS `]" | |
echo "" | |
echo "[host_machine]" | |
echo "system = '${PLAT_SYSTEM}'" | |
echo "cpu_family = '${PLAT_CPU_FAMILY}'" | |
echo "cpu = '${PLAT_CPU}'" | |
echo "endian = '${PLAT_ENDIAN}'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. "${BASH_SOURCE%/*}"/devkitppc.sh | |
export PORTLIBS_PREFIX=${DEVKITPRO}/portlibs/wiiu | |
export PPC_PORTLIBS_PREFIX=${DEVKITPRO}/portlibs/ppc | |
export PATH=${PORTLIBS_PREFIX}/bin:${PPC_PORTLIBS_PREFIX}/bin:$PATH | |
export ARCH="-mcpu=750 -meabi -mhard-float" | |
export CFLAGS="${ARCH} -O2 -ffunction-sections -fdata-sections" | |
export CXXFLAGS="${CFLAGS}" | |
export CPPFLAGS="-D__WIIU__ -I${PORTLIBS_PREFIX}/include -I${PPC_PORTLIBS_PREFIX}/include -isystem${DEVKITPRO}/wut/include" | |
export LDFLAGS="${ARCH} -L${PORTLIBS_PREFIX}/lib -L${PPC_PORTLIBS_PREFIX}/lib -L${DEVKITPRO}/wut/lib" | |
export LIBS="-lcoreinit -lwutcrt" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment